4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright (c) 1982, 1986, 1989, 1993
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * The Regents of the University of California. All rights reserved.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * (c) UNIX System Laboratories, Inc.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * All or some portions of this file are derived from material licensed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * to the University of California by American Telephone and Telegraph
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Co. or Unix System Laboratories, Inc. and are reproduced herein with
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * the permission of UNIX System Laboratories, Inc.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Portions copyright (c) 1999, 2000
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Intel Corporation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * All rights reserved.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Redistribution and use in source and binary forms, with or without
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * modification, are permitted provided that the following conditions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * 1. Redistributions of source code must retain the above copyright
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * notice, this list of conditions and the following disclaimer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * 2. Redistributions in binary form must reproduce the above copyright
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * notice, this list of conditions and the following disclaimer in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * documentation and/or other materials provided with the distribution.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * 3. All advertising materials mentioning features or use of this software
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * must display the following acknowledgement:
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * This product includes software developed by the University of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * California, Berkeley, Intel Corporation, and its contributors.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * 4. Neither the name of University, Intel Corporation, or their respective
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * contributors may be used to endorse or promote products derived from
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * this software without specific prior written permission.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * $Id: select.c,v 1.1.1.1 2003/11/19 01:50:30 kyu3 Exp $
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** Sleep for the specified number of Microseconds.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Implements the usleep(3) function.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Microseconds Number of microseconds to sleep.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval 0 Always returns zero.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return (0);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncunsigned int
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return (usleep( (useconds_t)(Seconds * 1000000) ));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /* Note: backend also returns POLLHUP/POLLERR if appropriate. */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync static int16_t flag[3] = { POLLRDNORM, POLLWRNORM, POLLRDBAND };
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync while (( 0 != (j = ffs(bits))) && ((fd = i + --j) < nfd)) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ( 0 != FdCount ) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return (0);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Allocate just enough bits for the non-null fd_sets. Use the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * preallocated auto buffer if possible.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Assign pointers into the bit buffers and fetch the input bits.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Put the output buffers together so that they can be bzeroed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * together.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync } while (0)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Poll for I/O events
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Scan for pending I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Adjust timeout is needed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Give it a rest
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /* select is not restarted after signals... */