@@ -30,16 +30,35 @@ pub type c_char = i8;
30
30
pub type c_long = i64 ;
31
31
pub type c_ulong = u64 ;
32
32
33
- pub type wchar_t = i16 ;
33
+ pub type wchar_t = i32 ;
34
+ pub type wint_t = u32 ;
35
+ pub type wctype_t = i64 ;
34
36
37
+ pub type regoff_t = size_t ;
35
38
pub type off_t = c_long ;
36
- pub type mode_t = u16 ;
37
- pub type time_t = i64 ;
38
- pub type pid_t = usize ;
39
- pub type gid_t = usize ;
40
- pub type uid_t = usize ;
41
-
42
- pub type suseconds_t = i64 ;
39
+ pub type mode_t = c_int ;
40
+ pub type time_t = c_long ;
41
+ pub type pid_t = c_int ;
42
+ pub type id_t = c_uint ;
43
+ pub type gid_t = c_int ;
44
+ pub type uid_t = c_int ;
45
+ pub type dev_t = c_long ;
46
+ pub type ino_t = c_ulong ;
47
+ pub type nlink_t = c_ulong ;
48
+ pub type blksize_t = c_long ;
49
+ pub type blkcnt_t = c_ulong ;
50
+
51
+ pub type fsblkcnt_t = c_ulong ;
52
+ pub type fsfilcnt_t = c_ulong ;
53
+
54
+ pub type useconds_t = c_uint ;
55
+ pub type suseconds_t = c_int ;
56
+
57
+ pub type clock_t = c_long ;
58
+ pub type clockid_t = c_int ;
59
+ pub type timer_t = * mut c_void ;
60
+
61
+ pub type nfds_t = c_ulong ;
43
62
44
63
s ! {
45
64
pub struct fd_set {
52
71
pub revents: :: c_short,
53
72
}
54
73
74
+ pub struct stat {
75
+ pub st_dev: :: dev_t,
76
+ pub st_ino: :: ino_t,
77
+ pub st_nlink: :: nlink_t,
78
+ pub st_mode: :: mode_t,
79
+ pub st_uid: :: uid_t,
80
+ pub st_gid: :: gid_t,
81
+ pub st_rdev: :: dev_t,
82
+ pub st_size: :: off_t,
83
+ pub st_blksize: :: blksize_t,
84
+ pub st_blocks: :: blkcnt_t,
85
+
86
+ pub st_atime: :: timespec,
87
+ pub st_mtime: :: timespec,
88
+ pub st_ctime: :: timespec,
89
+
90
+ _pad: [ c_char; 24 ] ,
91
+ }
92
+
55
93
pub struct timeval {
56
94
pub tv_sec: time_t,
57
95
pub tv_usec: suseconds_t,
@@ -128,6 +166,8 @@ pub const F_SETFD: ::c_int = 2;
128
166
pub const F_GETFL : :: c_int = 3 ;
129
167
pub const F_SETFL : :: c_int = 4 ;
130
168
169
+ pub const FD_CLOEXEC : :: c_int = 0x0100_0000 ;
170
+
131
171
pub const O_RDONLY : :: c_int = 0x0001_0000 ;
132
172
pub const O_WRONLY : :: c_int = 0x0002_0000 ;
133
173
pub const O_RDWR : :: c_int = 0x0003_0000 ;
@@ -303,6 +343,7 @@ extern {
303
343
pub fn close ( fd : :: c_int ) -> :: c_int ;
304
344
pub fn fchown ( fd : :: c_int , uid : :: uid_t , gid : :: gid_t ) -> :: c_int ;
305
345
pub fn fcntl ( fd : :: c_int , cmd : :: c_int , ...) -> :: c_int ;
346
+ pub fn fstat ( fd : :: c_int , buf : * mut stat ) -> :: c_int ;
306
347
pub fn fsync ( fd : :: c_int ) -> :: c_int ;
307
348
pub fn gethostname ( name : * mut :: c_char , len : :: size_t ) -> :: c_int ;
308
349
pub fn getpid ( ) -> pid_t ;
@@ -317,6 +358,7 @@ extern {
317
358
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int )
318
359
-> :: c_int ;
319
360
pub fn munmap ( addr : * mut :: c_void , len : :: size_t ) -> :: c_int ;
361
+ pub fn poll ( fds : * mut pollfd , nfds : nfds_t , timeout : :: c_int ) -> :: c_int ;
320
362
pub fn read ( fd : :: c_int , buf : * mut :: c_void , count : :: size_t ) -> :: ssize_t ;
321
363
pub fn setenv ( name : * const c_char , val : * const c_char , overwrite : :: c_int )
322
364
-> :: c_int ;
0 commit comments