Deleted Added
full compact
thr_syscalls.c (278751) thr_syscalls.c (280818)
1/*
2 * Copyright (c) 2014 The FreeBSD Foundation.
3 * Copyright (C) 2005 David Xu <davidxu@freebsd.org>.
4 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
5 * Copyright (C) 2000 Jason Evans <jasone@freebsd.org>.
6 * All rights reserved.
7 *
8 * Portions of this software were developed by Konstantin Belousov

--- 50 unchanged lines hidden (view full) ---

59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 */
65
66#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2014 The FreeBSD Foundation.
3 * Copyright (C) 2005 David Xu <davidxu@freebsd.org>.
4 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
5 * Copyright (C) 2000 Jason Evans <jasone@freebsd.org>.
6 * All rights reserved.
7 *
8 * Portions of this software were developed by Konstantin Belousov

--- 50 unchanged lines hidden (view full) ---

59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 */
65
66#include <sys/cdefs.h>
67__FBSDID("$FreeBSD: head/lib/libthr/thread/thr_syscalls.c 278751 2015-02-14 11:47:40Z kib $");
67__FBSDID("$FreeBSD: head/lib/libthr/thread/thr_syscalls.c 280818 2015-03-29 19:14:41Z kib $");
68
69#include "namespace.h"
70#include <sys/types.h>
71#include <sys/mman.h>
72#include <sys/param.h>
73#include <sys/select.h>
74#include <sys/signalvar.h>
75#include <sys/socket.h>

--- 260 unchanged lines hidden (view full) ---

336 curthread = _get_curthread();
337 _thr_cancel_enter(curthread);
338 ret = __sys_pselect(count, rfds, wfds, efds, timo, mask);
339 _thr_cancel_leave(curthread, ret == -1);
340
341 return (ret);
342}
343
68
69#include "namespace.h"
70#include <sys/types.h>
71#include <sys/mman.h>
72#include <sys/param.h>
73#include <sys/select.h>
74#include <sys/signalvar.h>
75#include <sys/socket.h>

--- 260 unchanged lines hidden (view full) ---

336 curthread = _get_curthread();
337 _thr_cancel_enter(curthread);
338 ret = __sys_pselect(count, rfds, wfds, efds, timo, mask);
339 _thr_cancel_leave(curthread, ret == -1);
340
341 return (ret);
342}
343
344static int
345__thr_kevent(int kq, const struct kevent *changelist, int nchanges,
346 struct kevent *eventlist, int nevents, const struct timespec *timeout)
347{
348 struct pthread *curthread;
349 int ret;
350
351 if (nevents == 0) {
352 /*
353 * No blocking, do not make the call cancellable.
354 */
355 return (__sys_kevent(kq, changelist, nchanges, eventlist,
356 nevents, timeout));
357 }
358 curthread = _get_curthread();
359 _thr_cancel_enter(curthread);
360 ret = __sys_kevent(kq, changelist, nchanges, eventlist, nevents,
361 timeout);
362 _thr_cancel_leave(curthread, ret == -1 && nchanges == 0);
363
364 return (ret);
365}
366
344/*
345 * Cancellation behavior:
346 * Thread may be canceled at start, but if the system call got some data,
347 * the thread is not canceled.
348 */
349static ssize_t
350__thr_read(int fd, void *buf, size_t nbytes)
351{

--- 242 unchanged lines hidden (view full) ---

594 SLOT(swapcontext);
595 SLOT(system);
596 SLOT(tcdrain);
597 SLOT(wait4);
598 SLOT(write);
599 SLOT(writev);
600 SLOT(spinlock);
601 SLOT(spinunlock);
367/*
368 * Cancellation behavior:
369 * Thread may be canceled at start, but if the system call got some data,
370 * the thread is not canceled.
371 */
372static ssize_t
373__thr_read(int fd, void *buf, size_t nbytes)
374{

--- 242 unchanged lines hidden (view full) ---

617 SLOT(swapcontext);
618 SLOT(system);
619 SLOT(tcdrain);
620 SLOT(wait4);
621 SLOT(write);
622 SLOT(writev);
623 SLOT(spinlock);
624 SLOT(spinunlock);
625 SLOT(kevent);
602#undef SLOT
603 *(__libc_interposing_slot(
604 INTERPOS__pthread_mutex_init_calloc_cb)) =
605 (interpos_func_t)_pthread_mutex_init_calloc_cb;
606}
626#undef SLOT
627 *(__libc_interposing_slot(
628 INTERPOS__pthread_mutex_init_calloc_cb)) =
629 (interpos_func_t)_pthread_mutex_init_calloc_cb;
630}