~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to include/sys/select.h

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _SYS_SELECT_H
 
2
#define _SYS_SELECT_H
 
3
#ifdef __cplusplus
 
4
extern "C" {
 
5
#endif
 
6
 
 
7
#include <features.h>
 
8
 
 
9
#define __NEED_size_t
 
10
#define __NEED_time_t
 
11
#define __NEED_suseconds_t
 
12
#define __NEED_struct_timeval
 
13
#define __NEED_struct_timespec
 
14
#define __NEED_sigset_t
 
15
 
 
16
#include <bits/alltypes.h>
 
17
 
 
18
#define FD_SETSIZE 1024
 
19
 
 
20
typedef unsigned long fd_mask;
 
21
 
 
22
typedef struct
 
23
{
 
24
        unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
 
25
} fd_set;
 
26
 
 
27
#define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0)
 
28
#define FD_SET(d, s)   ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))
 
29
#define FD_CLR(d, s)   ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))
 
30
#define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
 
31
 
 
32
int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
 
33
int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict, const sigset_t *__restrict);
 
34
 
 
35
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 
36
#define NFDBITS (8*(int)sizeof(long))
 
37
#endif
 
38
 
 
39
#ifdef __cplusplus
 
40
}
 
41
#endif
 
42
#endif