]> gcc.gnu.org Git - gcc.git/blob - libphobos/libdruntime/core/sys/linux/sys/eventfd.d
Add D front-end, libphobos library, and D2 testsuite.
[gcc.git] / libphobos / libdruntime / core / sys / linux / sys / eventfd.d
1 /**
2 * D header file for GNU/Linux.
3 *
4 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
5 * Authors: Nemanja Boric
6 */
7 module core.sys.linux.sys.eventfd;
8
9 version (linux):
10 extern (C):
11 @nogc:
12 @system:
13 nothrow:
14
15 import core.stdc.stdint: uint64_t;
16
17 /// Type for the event counter
18 alias uint64_t eventfd_t;
19
20 /* Return file descriptor for generic event channel. Set initial
21 value to count. */
22 int eventfd (uint count, int flags);
23
24 /* Read event counter and possibly wait for events. */
25 int eventfd_read (int fd, eventfd_t* value);
26
27 /* Increment event counter. */
28 int eventfd_write (int fd, eventfd_t value);
29
30 version (X86)
31 {
32 enum EFD_SEMAPHORE = 1;
33 enum EFD_CLOEXEC = 0x80000; // octal!2000000
34 enum EFD_NONBLOCK = 0x800; // octal!4000
35 }
36 else version (X86_64)
37 {
38 enum EFD_SEMAPHORE = 1;
39 enum EFD_CLOEXEC = 0x80000; // octal!2000000
40 enum EFD_NONBLOCK = 0x800; // octal!4000
41 }
42 else version (MIPS32)
43 {
44 enum EFD_SEMAPHORE = 1;
45 enum EFD_CLOEXEC = 0x80000; // octal!2000000
46 enum EFD_NONBLOCK = 0x80; // octal!200
47 }
48 else version (MIPS64)
49 {
50 enum EFD_SEMAPHORE = 1;
51 enum EFD_CLOEXEC = 0x80000; // octal!2000000
52 enum EFD_NONBLOCK = 0x80; // octal!200
53 }
54 else version (PPC)
55 {
56 enum EFD_SEMAPHORE = 1;
57 enum EFD_CLOEXEC = 0x80000; // octal!2000000
58 enum EFD_NONBLOCK = 0x800; // octal!4000
59 }
60 else version (PPC64)
61 {
62 enum EFD_SEMAPHORE = 1;
63 enum EFD_CLOEXEC = 0x80000; // octal!2000000
64 enum EFD_NONBLOCK = 0x800; // octal!4000
65 }
66 else version (ARM)
67 {
68 enum EFD_SEMAPHORE = 1;
69 enum EFD_CLOEXEC = 0x80000; // octal!2000000
70 enum EFD_NONBLOCK = 0x800; // octal!4000
71 }
72 else version (AArch64)
73 {
74 enum EFD_SEMAPHORE = 1;
75 enum EFD_CLOEXEC = 0x80000; // octal!2000000
76 enum EFD_NONBLOCK = 0x800; // octal!4000
77 }
78 else version (SPARC64)
79 {
80 enum EFD_SEMAPHORE = 1;
81 enum EFD_CLOEXEC = 0x80000; // octal!2000000
82 enum EFD_NONBLOCK = 0x800; // octal!4000
83 }
84 else version (SystemZ)
85 {
86 enum EFD_SEMAPHORE = 1;
87 enum EFD_CLOEXEC = 0x80000; // octal!2000000
88 enum EFD_NONBLOCK = 0x800; // octal!4000
89 }
90 else
91 static assert(0, "unimplemented");
This page took 0.0391 seconds and 5 git commands to generate.