]> git.lizzy.rs Git - plan9front.git/blob - sys/include/ape/select.h
remove keyboard stuff from other ports, make openssl and python compile on arm
[plan9front.git] / sys / include / ape / select.h
1 #ifndef __SELECT_H
2 #define __SELECT_H
3 #ifndef _BSD_EXTENSION
4     This header file is an extension to ANSI/POSIX
5 #endif
6 #pragma lib "/$M/lib/ape/libap.a"
7
8 #ifndef _FD_SET_T
9 #define _FD_SET_T
10 /* BSD select, and adjunct types and macros */
11
12 /* assume 96 fds is sufficient for fdset size */
13
14 typedef struct fd_set {
15         long fds_bits[3];
16 } fd_set;
17
18 #define FD_SET(n,p)     ((p)->fds_bits[(n)>>5] |= (1 << ((n) &0x1f)))
19 #define FD_CLR(n,p)     ((p)->fds_bits[(n)>>5] &= ~(1 << ((n) &0x1f)))
20 #define FD_ISSET(n,p)   ((p)->fds_bits[(n)>>5] & (1 << ((n) &0x1f)))
21 #define FD_ZERO(p)      ((p)->fds_bits[0] =0, (p)->fds_bits[1] =0, (p)->fds_bits[2] =0)
22 #endif
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 extern int select(int, fd_set*, fd_set*, fd_set*, struct timeval *);
29
30 #ifdef __cplusplus
31 }
32 #endif
33
34 #endif