thr_syscalls.c (127486) | thr_syscalls.c (129484) |
---|---|
1/* 2 * Copyright (c) 2000 Jason Evans <jasone@freebsd.org>. 3 * Copyright (c) 2002 Daniel M. Eischen <deischen@freebsd.org> 4 * Copyright (c) 2003 Jeff Roberson <jeff@freebsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * | 1/* 2 * Copyright (c) 2000 Jason Evans <jasone@freebsd.org>. 3 * Copyright (c) 2002 Daniel M. Eischen <deischen@freebsd.org> 4 * Copyright (c) 2003 Jeff Roberson <jeff@freebsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * |
31 * $FreeBSD: head/lib/libthr/thread/thr_syscalls.c 127486 2004-03-27 15:05:28Z mtm $ | 31 * $FreeBSD: head/lib/libthr/thread/thr_syscalls.c 129484 2004-05-20 12:06:16Z mtm $ |
32 */ 33 34/* 35 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 36 * All rights reserved. 37 * 38 * Redistribution and use in source and binary forms, with or without 39 * modification, are permitted provided that the following conditions --- 285 unchanged lines hidden (view full) --- 325 326 _thread_enter_cancellation_point(); 327 ret = __sys_select(numfds, readfds, writefds, exceptfds, timeout); 328 _thread_leave_cancellation_point(); 329 330 return ret; 331} 332 | 32 */ 33 34/* 35 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 36 * All rights reserved. 37 * 38 * Redistribution and use in source and binary forms, with or without 39 * modification, are permitted provided that the following conditions --- 285 unchanged lines hidden (view full) --- 325 326 _thread_enter_cancellation_point(); 327 ret = __sys_select(numfds, readfds, writefds, exceptfds, timeout); 328 _thread_leave_cancellation_point(); 329 330 return ret; 331} 332 |
333__weak_reference(_sigaction, sigaction); 334 335int 336_sigaction(int sig, const struct sigaction *act, struct sigaction *oact) 337{ 338 struct sigaction *tmpact; 339 struct sigaction oldact, wrapperact; 340 int error; 341 342 /* Detect invalid signals. */ 343 if (sig < 1 || sig > NSIG) { 344 errno = EINVAL; 345 return (-1); 346 } 347 348 /* 349 * If act is not NULL the library's signal wrapper is passed into the 350 * kernel only if the action is not SIG_DFL or SIG_IGN. 351 * On the other hand if act is NULL the caller only wants 352 * the old value so there is no need to call into the kernel. 353 */ 354 error = 0; 355 tmpact = NULL; 356 proc_sigact_copyout(sig, &oldact); 357 if (act != NULL) { 358 proc_sigact_copyin(sig, act); 359 tmpact = proc_sigact_sigaction(sig); 360 if (tmpact->sa_handler != SIG_DFL && 361 tmpact->sa_handler != SIG_IGN) { 362 bcopy((const void *)tmpact, (void *)&wrapperact, 363 sizeof(struct sigaction)); 364 wrapperact.sa_flags |= SA_SIGINFO; 365 wrapperact.sa_sigaction = &_thread_sig_wrapper; 366 tmpact = &wrapperact; 367 } 368 error = __sys_sigaction(sig, tmpact, NULL); 369 } 370 if (error == 0) { 371 372 /* If successful, return the old sigaction to the user */ 373 if (oact != NULL ) 374 bcopy((const void *)&oldact, (void *)oact, 375 sizeof(struct sigaction)); 376 } else { 377 378 /* 379 * The only time error is non-zero is if the syscall failed, 380 * which means the sigaction in the process global list 381 * was altered before the syscall. Return it to it's old value. 382 */ 383 proc_sigact_copyin(sig, &oldact); 384 } 385 return (error); 386} 387 | |
388__weak_reference(_sleep, sleep); 389 390unsigned int 391_sleep(unsigned int seconds) 392{ 393 unsigned int ret; 394 395 _thread_enter_cancellation_point(); --- 104 unchanged lines hidden --- | 333__weak_reference(_sleep, sleep); 334 335unsigned int 336_sleep(unsigned int seconds) 337{ 338 unsigned int ret; 339 340 _thread_enter_cancellation_point(); --- 104 unchanged lines hidden --- |