@@ -180,6 +180,11 @@ pub const SEEK_END: c_int = 2;
180
180
pub const _IOFBF: c_int = 0 ;
181
181
pub const _IONBF: c_int = 2 ;
182
182
pub const _IOLBF: c_int = 1 ;
183
+ pub const F_GETFD : c_int = 1 ;
184
+ pub const F_SETFD : c_int = 2 ;
185
+ pub const F_GETFL : c_int = 3 ;
186
+ pub const F_SETFL : c_int = 4 ;
187
+ pub const FD_CLOEXEC : c_int = 1 ;
183
188
pub const FD_SETSIZE : size_t = 1024 ;
184
189
pub const O_APPEND : c_int = 0x0001 ;
185
190
pub const O_DSYNC : c_int = 0x0002 ;
@@ -209,6 +214,22 @@ pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
209
214
pub const AT_REMOVEDIR : c_int = 0x4 ;
210
215
pub const UTIME_OMIT : c_long = 0xfffffffe ;
211
216
pub const UTIME_NOW : c_long = 0xffffffff ;
217
+ pub const S_IFIFO : mode_t = 49152 ;
218
+ pub const S_IFCHR : mode_t = 8192 ;
219
+ pub const S_IFBLK : mode_t = 24576 ;
220
+ pub const S_IFDIR : mode_t = 16384 ;
221
+ pub const S_IFREG : mode_t = 32768 ;
222
+ pub const S_IFLNK : mode_t = 40960 ;
223
+ pub const S_IFSOCK : mode_t = 49152 ;
224
+ pub const S_IFMT : mode_t = 57344 ;
225
+ pub const DT_UNKNOWN : u8 = 0 ;
226
+ pub const DT_BLK : u8 = 1 ;
227
+ pub const DT_CHR : u8 = 2 ;
228
+ pub const DT_DIR : u8 = 3 ;
229
+ pub const DT_REG : u8 = 4 ;
230
+ pub const DT_LNK : u8 = 7 ;
231
+ pub const FIONREAD : c_int = 1 ;
232
+ pub const FIONBIO : c_int = 2 ;
212
233
213
234
pub const E2BIG : c_int = 1 ;
214
235
pub const EACCES : c_int = 2 ;
@@ -378,6 +399,7 @@ extern "C" {
378
399
) -> size_t ;
379
400
pub fn gmtime ( a : * const time_t ) -> * mut tm ;
380
401
pub fn gmtime_r ( a : * const time_t , b : * mut tm ) -> * mut tm ;
402
+ pub fn localtime ( a : * const time_t ) -> * mut tm ;
381
403
pub fn localtime_r ( a : * const time_t , b : * mut tm ) -> * mut tm ;
382
404
pub fn asctime_r ( a : * const tm , b : * mut c_char ) -> * mut c_char ;
383
405
pub fn ctime_r ( a : * const time_t , b : * mut c_char ) -> * mut c_char ;
@@ -403,6 +425,7 @@ extern "C" {
403
425
pub fn isspace ( c : c_int ) -> c_int ;
404
426
pub fn isupper ( c : c_int ) -> c_int ;
405
427
pub fn isxdigit ( c : c_int ) -> c_int ;
428
+ pub fn isblank ( c : c_int ) -> c_int ;
406
429
pub fn tolower ( c : c_int ) -> c_int ;
407
430
pub fn toupper ( c : c_int ) -> c_int ;
408
431
pub fn setvbuf (
@@ -448,6 +471,7 @@ extern "C" {
448
471
pub fn strspn ( cs : * const c_char , ct : * const c_char ) -> size_t ;
449
472
pub fn strcspn ( cs : * const c_char , ct : * const c_char ) -> size_t ;
450
473
pub fn strdup ( cs : * const c_char ) -> * mut c_char ;
474
+ pub fn strndup ( cs : * const c_char , n : size_t ) -> * mut c_char ;
451
475
pub fn strpbrk ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
452
476
pub fn strstr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
453
477
pub fn strcasecmp ( s1 : * const c_char , s2 : * const c_char ) -> c_int ;
@@ -577,7 +601,6 @@ extern "C" {
577
601
pub fn link ( src : * const c_char , dst : * const c_char ) -> :: c_int ;
578
602
pub fn lseek ( fd : :: c_int , offset : off_t , whence : :: c_int ) -> off_t ;
579
603
pub fn pathconf ( path : * const c_char , name : :: c_int ) -> c_long ;
580
- pub fn pause ( ) -> :: c_int ;
581
604
pub fn rmdir ( path : * const c_char ) -> :: c_int ;
582
605
pub fn sleep ( secs : :: c_uint ) -> :: c_uint ;
583
606
pub fn unlink ( c : * const c_char ) -> :: c_int ;
@@ -645,6 +668,8 @@ extern "C" {
645
668
646
669
pub fn sysconf ( name : :: c_int ) -> :: c_long ;
647
670
671
+ pub fn ioctl ( fd : :: c_int , request : :: c_int , ...) -> :: c_int ;
672
+
648
673
pub fn fseeko (
649
674
stream : * mut :: FILE ,
650
675
offset : :: off_t ,
0 commit comments