22
22
pub sl_cur: size_t,
23
23
}
24
24
25
+ // sys/event.h
26
+ pub struct kevent {
27
+ pub ident: crate :: uintptr_t,
28
+ pub filter: c_short,
29
+ pub flags: c_ushort,
30
+ pub fflags: c_uint,
31
+ pub data: i64 ,
32
+ pub udata: * mut c_void,
33
+ pub ext: [ u64 ; 4 ] ,
34
+ }
35
+
25
36
// sys/link_elf.h
26
37
pub struct dl_phdr_info {
27
38
pub dlpi_addr: crate :: Elf_Addr ,
31
42
}
32
43
}
33
44
45
+ // sys/event.h
46
+ pub const EVFILT_READ : i16 = -1 ;
47
+ pub const EVFILT_WRITE : i16 = -2 ;
48
+ pub const EVFILT_PROC : i16 = -5 ;
49
+ pub const EV_ADD : u16 = 0x0001 ;
50
+ pub const EV_DELETE : u16 = 0x0002 ;
51
+ pub const EV_ONESHOT : u16 = 0x0010 ;
52
+ pub const EV_CLEAR : u16 = 0x0020 ;
53
+ pub const EV_EOF : u16 = 0x8000 ;
54
+ pub const EV_ERROR : u16 = 0x4000 ;
55
+ pub const NOTE_EXIT : u32 = 0x80000000 ;
56
+
57
+ // sys/ioccom.h
58
+ pub const IOC_VOID : c_ulong = 0x20000000 ;
59
+ pub const IOC_OUT : c_ulong = 0x40000000 ;
60
+ pub const IOC_IN : c_ulong = 0x80000000 ;
61
+ pub const IOC_INOUT : c_ulong = IOC_IN | IOC_OUT ;
62
+ pub const IOC_DIRMASK : c_ulong = 0xe0000000 ;
63
+
34
64
#[ link( name = "bsd" ) ]
35
65
extern "C" {
36
66
// stdlib.h
@@ -40,6 +70,13 @@ extern "C" {
40
70
pub fn arc4random ( ) -> u32 ;
41
71
pub fn arc4random_uniform ( upper_bound : u32 ) -> u32 ;
42
72
pub fn arc4random_buf ( buf : * mut c_void , n : size_t ) ;
73
+ pub fn mkstemps ( template : * mut c_char , suffixlen : c_int ) -> c_int ;
74
+ pub fn strtonum (
75
+ nptr : * const c_char ,
76
+ minval : c_longlong ,
77
+ maxval : c_longlong ,
78
+ errstr : * mut * const c_char ,
79
+ ) -> c_longlong ;
43
80
44
81
// pty.h
45
82
pub fn openpty (
@@ -68,6 +105,17 @@ extern "C" {
68
105
pub fn sl_free ( sl : * mut StringList , i : c_int ) ;
69
106
pub fn sl_find ( sl : * mut StringList , n : * mut c_char ) -> * mut c_char ;
70
107
108
+ // sys/event.h
109
+ pub fn kqueue ( ) -> c_int ;
110
+ pub fn kevent (
111
+ kq : c_int ,
112
+ changelist : * const kevent ,
113
+ nchanges : c_int ,
114
+ eventlist : * mut kevent ,
115
+ nevents : c_int ,
116
+ timeout : * const crate :: timespec ,
117
+ ) -> c_int ;
118
+
71
119
// sys/link_elf.h
72
120
pub fn dl_iterate_phdr (
73
121
callback : Option <
@@ -78,4 +126,26 @@ extern "C" {
78
126
79
127
// sys/time.h
80
128
pub fn lutimes ( file : * const c_char , times : * const crate :: timeval ) -> c_int ;
129
+
130
+ // sys/uov.h
131
+ pub fn preadv (
132
+ fd : c_int ,
133
+ iov : * const crate :: iovec ,
134
+ iovcnt : c_int ,
135
+ offset : crate :: off_t ,
136
+ ) -> ssize_t ;
137
+ pub fn pwritev (
138
+ fd : c_int ,
139
+ iov : * const crate :: iovec ,
140
+ iovcnt : c_int ,
141
+ offset : crate :: off_t ,
142
+ ) -> ssize_t ;
143
+
144
+ // sys/wait.h
145
+ pub fn wait4 (
146
+ pid : crate :: pid_t ,
147
+ status : * mut c_int ,
148
+ options : c_int ,
149
+ rusage : * mut crate :: rusage ,
150
+ ) -> crate :: pid_t ;
81
151
}
0 commit comments