Mercurial > projects > ldc
annotate druntime/import/stdc/posix/sys/select.d @ 760:6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 00:19:18 +0100 |
parents | |
children |
rev | line source |
---|---|
760
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
1 /** |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
2 * D header file for POSIX. |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
3 * |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
4 * Copyright: Public Domain |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
5 * License: Public Domain |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
6 * Authors: Sean Kelly |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
8 */ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
9 module stdc.posix.sys.select; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
10 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
11 private import stdc.posix.config; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
12 public import stdc.time; // for timespec |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
13 public import stdc.posix.sys.time; // for timeval |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
14 public import stdc.posix.sys.types; // for time_t |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
15 public import stdc.posix.signal; // for sigset_t |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
16 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
17 extern (C): |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
18 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
19 // |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
20 // Required |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
21 // |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
22 /* |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
23 NOTE: This module requires timeval from stdc.posix.sys.time, but timeval |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
24 is supposedly an XOpen extension. As a result, this header will not |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
25 compile on platforms that are not XSI-compliant. This must be resolved |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
26 on a per-platform basis. |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
27 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
28 fd_set |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
29 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
30 void FD_CLR(int fd, fd_set* fdset); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
31 int FD_ISSET(int fd, fd_set* fdset); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
32 void FD_SET(int fd, fd_set* fdset); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
33 void FD_ZERO(fd_set* fdset); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
34 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
35 FD_SETSIZE |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
36 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
37 int pselect(int, fd_set*, fd_set*, fd_set*, in timespec*, in sigset_t*); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
38 int select(int, fd_set*, fd_set*, fd_set*, timeval*); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
39 */ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
40 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
41 version( linux ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
42 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
43 private |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
44 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
45 alias c_long __fd_mask; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
46 const __NFDBITS = 8 * __fd_mask.sizeof; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
47 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
48 extern (D) int __FDELT( int d ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
49 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
50 return d / __NFDBITS; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
51 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
52 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
53 extern (D) int __FDMASK( int d ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
54 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
55 return cast(__fd_mask) 1 << ( d % __NFDBITS ); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
56 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
57 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
58 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
59 const FD_SETSIZE = 1024; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
60 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
61 struct fd_set |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
62 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
63 __fd_mask[FD_SETSIZE / __NFDBITS] fds_bits; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
64 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
65 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
66 extern (D) void FD_CLR( int fd, fd_set* fdset ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
67 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
68 fdset.fds_bits[__FDELT( fd )] &= ~__FDMASK( fd ); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
69 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
70 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
71 extern (D) int FD_ISSET( int fd, fd_set* fdset ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
72 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
73 return fdset.fds_bits[__FDELT( fd )] & __FDMASK( fd ); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
74 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
75 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
76 extern (D) void FD_SET( int fd, fd_set* fdset ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
77 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
78 fdset.fds_bits[__FDELT( fd )] |= __FDMASK( fd ); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
79 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
80 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
81 extern (D) void FD_ZERO( fd_set* fdset ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
82 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
83 fdset.fds_bits[0 .. $] = 0; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
84 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
85 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
86 /+ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
87 + GNU ASM Implementation |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
88 + |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
89 # define __FD_ZERO(fdsp) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
90 do { \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
91 int __d0, __d1; \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
92 __asm__ __volatile__ ("cld; rep; stosl" \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
93 : "=c" (__d0), "=D" (__d1) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
94 : "a" (0), "0" (sizeof (fd_set) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
95 / sizeof (__fd_mask)), \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
96 "1" (&__FDS_BITS (fdsp)[0]) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
97 : "memory"); \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
98 } while (0) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
99 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
100 # define __FD_SET(fd, fdsp) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
101 __asm__ __volatile__ ("btsl %1,%0" \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
102 : "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
103 : "r" (((int) (fd)) % __NFDBITS) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
104 : "cc","memory") |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
105 # define __FD_CLR(fd, fdsp) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
106 __asm__ __volatile__ ("btrl %1,%0" \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
107 : "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
108 : "r" (((int) (fd)) % __NFDBITS) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
109 : "cc","memory") |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
110 # define __FD_ISSET(fd, fdsp) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
111 (__extension__ \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
112 ({register char __result; \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
113 __asm__ __volatile__ ("btl %1,%2 ; setcb %b0" \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
114 : "=q" (__result) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
115 : "r" (((int) (fd)) % __NFDBITS), \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
116 "m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
117 : "cc"); \ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
118 __result; })) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
119 +/ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
120 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
121 int pselect(int, fd_set*, fd_set*, fd_set*, in timespec*, in sigset_t*); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
122 int select(int, fd_set*, fd_set*, fd_set*, timeval*); |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
123 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
124 else version( darwin ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
125 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
126 private |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
127 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
128 const uint __DARWIN_NBBY = 8; /* bits in a byte */ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
129 const uint __DARWIN_NFDBITS = (int.sizeof * __DARWIN_NBBY); /* bits per mask */ |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
130 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
131 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
132 const FD_SETSIZE = 1024; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
133 |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
134 struct fd_set |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
135 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
136 int fds_bits[(((FD_SETSIZE) + ((__DARWIN_NFDBITS) - 1)) / (__DARWIN_NFDBITS))]; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
137 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
138 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
139 else version( freebsd ) |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
140 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
141 private |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
142 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
143 const uint FD_SETSIZE = 1024; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
144 const uint _NFDBITS = c_ulong.sizeof * 8; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
145 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
146 struct fd_set |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
147 { |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
148 c_ulong fds_bits[((FD_SETSIZE + (_NFDBITS - 1)) / _NFDBITS)]; |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
149 } |
6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
150 } |