select.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _SYS_SELECT_H
#define _SYS_SELECT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/feature_tests.h>
#ifndef _KERNEL
#include <sys/time_impl.h>
#endif
#endif /* _KERNEL */
#ifdef __cplusplus
extern "C" {
#endif
/*
* in <sys/ucontext.h> as a result of XPG4v2 requirements. XPG6
* now allows the visibility of signal.h in this header, however
* an order of inclusion problem occurs as a result of inclusion
* the sigset_t type instead. This type is required for the XPG6
* introduced pselect() function also declared in this header.
*/
#ifndef _SIGSET_T
#define _SIGSET_T
typedef struct { /* signal set type */
unsigned int __sigbits[4];
} sigset_t;
#if defined(_SYSCALL32)
/* Kernel view of the ILP32 user sigset_t structure */
typedef struct {
} sigset32_t;
#endif /* _SYSCALL32 */
#endif /* _SIGSET_T */
#endif /* #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
/*
* Select uses bit masks of file descriptors in longs.
* These macros manipulate such bit fields.
* FD_SETSIZE may be defined by the user, but the default here
* should be >= NOFILE (param.h).
*/
#ifndef FD_SETSIZE
#ifdef _LP64
#define FD_SETSIZE 65536
#else
#define FD_SETSIZE 1024
#endif /* _LP64 */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#endif
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define select select_large_fdset
#define pselect pselect_large_fdset
#endif
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* FD_SETSIZE */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
typedef long fd_mask;
#endif
typedef long fds_mask;
/*
* The value of _NBBY needs to be consistant with the value
*/
#define _NBBY 8
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#ifndef NBBY /* number of bits per byte */
#endif
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#endif
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
typedef struct fd_set {
#else
typedef struct __fd_set {
#endif
} fd_set;
#ifdef _KERNEL
#else
#endif /* _KERNEL */
#ifndef _KERNEL
#ifdef __STDC__
const sigset_t *_RESTRICT_KYWD);
#endif
#else
extern int select();
extern int pselect();
#endif
#endif /* __STDC__ */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SELECT_H */