Mercurial > projects > ldc
comparison tango/tango/stdc/posix/poll.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /** | |
2 * D header file for POSIX. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition | |
8 */ | |
9 module tango.stdc.posix.poll; | |
10 | |
11 private import tango.stdc.posix.config; | |
12 | |
13 extern (C): | |
14 | |
15 // | |
16 // XOpen (XSI) | |
17 // | |
18 /* | |
19 struct pollfd | |
20 { | |
21 int fd; | |
22 short events; | |
23 short revents; | |
24 } | |
25 | |
26 nfds_t | |
27 | |
28 POLLIN | |
29 POLLRDNORM | |
30 POLLRDBAND | |
31 POLLPRI | |
32 POLLOUT | |
33 POLLWRNORM | |
34 POLLWRBAND | |
35 POLLERR | |
36 POLLHUP | |
37 POLLNVAL | |
38 | |
39 int poll(pollfd[], nfds_t, int); | |
40 */ | |
41 | |
42 version( linux ) | |
43 { | |
44 struct pollfd | |
45 { | |
46 int fd; | |
47 short events; | |
48 short revents; | |
49 } | |
50 | |
51 alias c_ulong nfds_t; | |
52 | |
53 const POLLIN = 0x001; | |
54 const POLLRDNORM = 0x040; | |
55 const POLLRDBAND = 0x080; | |
56 const POLLPRI = 0x002; | |
57 const POLLOUT = 0x004; | |
58 const POLLWRNORM = 0x100; | |
59 const POLLWRBAND = 0x200; | |
60 const POLLERR = 0x008; | |
61 const POLLHUP = 0x010; | |
62 const POLLNVAL = 0x020; | |
63 | |
64 int poll(pollfd*, nfds_t, int); | |
65 } | |
66 else version( darwin ) | |
67 { | |
68 struct pollfd | |
69 { | |
70 int fd; | |
71 short events; | |
72 short revents; | |
73 }; | |
74 | |
75 alias uint nfds_t; | |
76 | |
77 enum | |
78 { | |
79 POLLIN = 0x0001, | |
80 POLLPRI = 0x0002, | |
81 POLLOUT = 0x0004, | |
82 POLLRDNORM = 0x0040, | |
83 POLLWRNORM = POLLOUT, | |
84 POLLRDBAND = 0x0080, | |
85 POLLWRBAND = 0x0100, | |
86 POLLEXTEND = 0x0200, | |
87 POLLATTRIB = 0x0400, | |
88 POLLNLINK = 0x0800, | |
89 POLLWRITE = 0x1000, | |
90 POLLERR = 0x0008, | |
91 POLLHUP = 0x0010, | |
92 POLLNVAL = 0x0020, | |
93 | |
94 POLLSTANDARD = (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND| | |
95 POLLWRBAND|POLLERR|POLLHUP|POLLNVAL) | |
96 } | |
97 | |
98 int poll(pollfd*, nfds_t, int); | |
99 } |