Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: fusl/include/sys/select.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #ifndef _SYS_SELECT_H 1 #ifndef _SYS_SELECT_H
2 #define _SYS_SELECT_H 2 #define _SYS_SELECT_H
3 #ifdef __cplusplus 3 #ifdef __cplusplus
4 extern "C" { 4 extern "C" {
5 #endif 5 #endif
6 6
7 #include <features.h> 7 #include <features.h>
8 8
9 #define __NEED_size_t 9 #define __NEED_size_t
10 #define __NEED_time_t 10 #define __NEED_time_t
11 #define __NEED_suseconds_t 11 #define __NEED_suseconds_t
12 #define __NEED_struct_timeval 12 #define __NEED_struct_timeval
13 #define __NEED_struct_timespec 13 #define __NEED_struct_timespec
14 #define __NEED_sigset_t 14 #define __NEED_sigset_t
15 15
16 #include <bits/alltypes.h> 16 #include <bits/alltypes.h>
17 17
18 #define FD_SETSIZE 1024 18 #define FD_SETSIZE 1024
19 19
20 typedef unsigned long fd_mask; 20 typedef unsigned long fd_mask;
21 21
22 typedef struct 22 typedef struct {
23 { 23 unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
24 » unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
25 } fd_set; 24 } fd_set;
26 25
27 #define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeo f (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0) 26 #define FD_ZERO(s) \
28 #define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*siz eof(long))))) 27 do { \
29 #define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*si zeof(long))))) 28 int __i; \
30 #define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*si zeof(long))))) 29 unsigned long* __b = (s)->fds_bits; \
30 for (__i = sizeof(fd_set) / sizeof(long); __i; __i--) \
31 *__b++ = 0; \
32 } while (0)
33 #define FD_SET(d, s) \
34 ((s)->fds_bits[(d) / (8 * sizeof(long))] |= \
35 (1UL << ((d) % (8 * sizeof(long)))))
36 #define FD_CLR(d, s) \
37 ((s)->fds_bits[(d) / (8 * sizeof(long))] &= \
38 ~(1UL << ((d) % (8 * sizeof(long)))))
39 #define FD_ISSET(d, s) \
40 !!((s)->fds_bits[(d) / (8 * sizeof(long))] & \
41 (1UL << ((d) % (8 * sizeof(long)))))
31 42
32 int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, str uct timeval *__restrict); 43 int select(int,
33 int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co nst struct timespec *__restrict, const sigset_t *__restrict); 44 fd_set* __restrict,
45 fd_set* __restrict,
46 fd_set* __restrict,
47 struct timeval* __restrict);
48 int pselect(int,
49 fd_set* __restrict,
50 fd_set* __restrict,
51 fd_set* __restrict,
52 const struct timespec* __restrict,
53 const sigset_t* __restrict);
34 54
35 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 55 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
36 #define NFDBITS (8*(int)sizeof(long)) 56 #define NFDBITS (8 * (int)sizeof(long))
37 #endif 57 #endif
38 58
39 #ifdef __cplusplus 59 #ifdef __cplusplus
40 } 60 }
41 #endif 61 #endif
42 #endif 62 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698