X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4bd07ac2140668789aa3ee8ec4dde4a3e0a3bba5..c6bf4f310a33a9262d455ea4d3f0630b1255e3fe:/libsyscall/wrappers/select-base.c diff --git a/libsyscall/wrappers/select-base.c b/libsyscall/wrappers/select-base.c index f688d6f36..1a6502241 100644 --- a/libsyscall/wrappers/select-base.c +++ b/libsyscall/wrappers/select-base.c @@ -2,14 +2,14 @@ * Copyright (c) 2005, 2007 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -17,7 +17,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_LICENSE_HEADER_END@ */ @@ -39,17 +39,17 @@ #if defined(VARIANT_CANCELABLE) || defined(VARIANT_PRE1050) #if !defined(VARIANT_DARWIN_EXTSN) extern int __select(int, fd_set * __restrict, fd_set * __restrict, - fd_set * __restrict, struct timeval * __restrict); + fd_set * __restrict, struct timeval * __restrict); #endif int __pselect(int, fd_set * __restrict, fd_set * __restrict, - fd_set * __restrict, const struct timespec * __restrict, const sigset_t * __restrict); + fd_set * __restrict, const struct timespec * __restrict, const sigset_t * __restrict); #else /* !VARIANT_CANCELABLE && !VARIANT_PRE1050 */ #if !defined(VARIANT_DARWIN_EXTSN) int __select_nocancel(int, fd_set * __restrict, fd_set * __restrict, - fd_set * __restrict, struct timeval * __restrict); + fd_set * __restrict, struct timeval * __restrict); #endif int __pselect_nocancel(int, fd_set * __restrict, fd_set * __restrict, - fd_set * __restrict, const struct timespec * __restrict, const sigset_t * __restrict); + fd_set * __restrict, const struct timespec * __restrict, const sigset_t * __restrict); #endif /* VARIANT_CANCELABLE || VARIANT_PRE1050 */ #if !defined(VARIANT_DARWIN_EXTSN) @@ -60,13 +60,13 @@ int __pselect_nocancel(int, fd_set * __restrict, fd_set * __restrict, */ int select(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, - fd_set * __restrict exceptfds, struct timeval * __restrict + fd_set * __restrict exceptfds, struct timeval * __restrict #if defined(VARIANT_LEGACY) || defined(VARIANT_PRE1050) - intimeout + intimeout #else /* !VARIANT_LEGACY && !VARIANT_PRE1050 */ - timeout + timeout #endif /* VARIANT_LEGACY || VARIANT_PRE1050 */ - ) + ) { #if defined(VARIANT_LEGACY) || defined(VARIANT_PRE1050) struct timeval tb, *timeout; @@ -104,8 +104,8 @@ select(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, extern int __pthread_sigmask(int, const sigset_t *, sigset_t *); static int _pselect_emulated(int count, fd_set * __restrict rfds, fd_set * __restrict wfds, - fd_set * __restrict efds, const struct timespec * __restrict timo, - const sigset_t * __restrict mask) + fd_set * __restrict efds, const struct timespec * __restrict timo, + const sigset_t * __restrict mask) { sigset_t omask; struct timeval tvtimo, *tvp; @@ -121,8 +121,9 @@ _pselect_emulated(int count, fd_set * __restrict rfds, fd_set * __restrict wfds, if (mask != 0) { rv = __pthread_sigmask(SIG_SETMASK, mask, &omask); - if (rv != 0) + if (rv != 0) { return rv; + } } rv = select(count, rfds, wfds, efds, tvp); @@ -142,13 +143,13 @@ _pselect_emulated(int count, fd_set * __restrict rfds, fd_set * __restrict wfds, */ int pselect(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, - fd_set * __restrict exceptfds, const struct timespec * __restrict + fd_set * __restrict exceptfds, const struct timespec * __restrict #if defined(VARIANT_LEGACY) || defined(VARIANT_PRE1050) - intimeout, + intimeout, #else /* !VARIANT_LEGACY && !VARIANT_PRE1050 */ - timeout, + timeout, #endif /* VARIANT_LEGACY || VARIANT_PRE1050 */ - const sigset_t * __restrict sigmask) + const sigset_t * __restrict sigmask) { int ret; #if defined(VARIANT_LEGACY) || defined(VARIANT_PRE1050)