@@ -241,6 +241,22 @@ s! {
241241 st_reserved4: Padding <c_int>,
242242 }
243243
244+ pub struct fsid_t {
245+ val: [ c_long; 2 ] ,
246+ }
247+
248+ pub struct statfs {
249+ pub f_type: c_long,
250+ pub f_bsize: c_long,
251+ pub f_blocks: c_long,
252+ pub f_bfree: c_long,
253+ pub f_bavail: c_long,
254+ pub f_files: c_long,
255+ pub f_ffree: c_long,
256+ pub f_fsid: crate :: fsid_t,
257+ f_spare: Padding <[ c_long; 7 ] >,
258+ }
259+
244260 //b_struct__Timespec.h
245261 pub struct _Timespec {
246262 pub tv_sec: crate :: time_t,
@@ -1374,6 +1390,9 @@ pub const O_ACCMODE: c_int = 3;
13741390pub const O_CLOEXEC : c_int = 0x100000 ; // fcntlcom
13751391pub const O_EXCL : c_int = 0x0800 ;
13761392pub const O_CREAT : c_int = 0x0200 ;
1393+ pub const O_SYNC : c_int = 0x2000 ;
1394+ pub const O_ASYNC : c_int = 0x0040 ;
1395+ pub const O_DSYNC : c_int = 0x10000 ;
13771396pub const O_TRUNC : c_int = 0x0400 ;
13781397pub const O_APPEND : c_int = 0x0008 ;
13791398pub const O_RDWR : c_int = 0x0002 ;
@@ -1560,6 +1579,15 @@ extern "C" {
15601579 flags : c_int ,
15611580 ) -> c_int ;
15621581
1582+ pub fn mkdirat ( dirfd : c_int , pathname : * const c_char , mode : mode_t ) -> c_int ;
1583+
1584+ pub fn readlinkat (
1585+ dirfd : c_int ,
1586+ pathname : * const c_char ,
1587+ buf : * mut c_char ,
1588+ bufsiz : size_t ,
1589+ ) -> ssize_t ;
1590+
15631591 pub fn unlinkat ( dirfd : c_int , pathname : * const c_char , flags : c_int ) -> c_int ;
15641592
15651593 // netdb.h
@@ -1606,6 +1634,7 @@ extern "C" {
16061634 pub fn pause ( ) -> c_int ;
16071635 pub fn seteuid ( uid : uid_t ) -> c_int ;
16081636 pub fn setegid ( gid : gid_t ) -> c_int ;
1637+ pub fn statfs ( path : * const c_char , buf : * mut statfs ) -> c_int ;
16091638 pub fn sleep ( secs : c_uint ) -> c_uint ;
16101639 pub fn ttyname ( fd : c_int ) -> * mut c_char ;
16111640 pub fn wait ( status : * mut c_int ) -> pid_t ;
@@ -1818,6 +1847,9 @@ extern "C" {
18181847 // stat.h
18191848 pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
18201849
1850+ // sys/statfs.h
1851+ pub fn fstatfs ( fd : c_int , buf : * mut statfs ) -> c_int ;
1852+
18211853 // stat.h
18221854 pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
18231855
@@ -1834,10 +1866,19 @@ extern "C" {
18341866 // dirent.h
18351867 pub fn readdir ( pDir : * mut crate :: DIR ) -> * mut crate :: dirent ;
18361868
1869+ // dirent.h
1870+ pub fn fdopendir ( fd : c_int ) -> * mut crate :: DIR ;
1871+
1872+ // dirent.h
1873+ pub fn dirfd ( dirp : * mut crate :: DIR ) -> c_int ;
1874+
18371875 // fcntl.h or
18381876 // ioLib.h
18391877 pub fn open ( path : * const c_char , oflag : c_int , ...) -> c_int ;
18401878
1879+ // fcntl.h
1880+ pub fn openat ( dirfd : c_int , pathname : * const c_char , flags : c_int , ...) -> c_int ;
1881+
18411882 // poll.h
18421883 pub fn poll ( fds : * mut pollfd , nfds : nfds_t , timeout : c_int ) -> c_int ;
18431884
@@ -2175,6 +2216,9 @@ extern "C" {
21752216 // unistd.h
21762217 pub fn fsync ( fd : c_int ) -> c_int ;
21772218
2219+ // unistd.h
2220+ pub fn fdatasync ( fd : c_int ) -> c_int ;
2221+
21782222 // dirent.h
21792223 pub fn closedir ( ptr : * mut crate :: DIR ) -> c_int ;
21802224
0 commit comments