@@ -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+ pub f_spare: [ c_long; 7 ] ,
258+ }
259+
244260 //b_struct__Timespec.h
245261 pub struct _Timespec {
246262 pub tv_sec: crate :: time_t,
@@ -1385,6 +1401,9 @@ pub const O_ACCMODE: c_int = 3;
13851401pub const O_CLOEXEC : c_int = 0x100000 ; // fcntlcom
13861402pub const O_EXCL : c_int = 0x0800 ;
13871403pub const O_CREAT : c_int = 0x0200 ;
1404+ pub const O_SYNC : c_int = 0x2000 ;
1405+ pub const O_ASYNC : c_int = 0x0040 ;
1406+ pub const O_DSYNC : c_int = 0x10000 ;
13881407pub const O_TRUNC : c_int = 0x0400 ;
13891408pub const O_APPEND : c_int = 0x0008 ;
13901409pub const O_RDWR : c_int = 0x0002 ;
@@ -1571,6 +1590,15 @@ extern "C" {
15711590 flags : c_int ,
15721591 ) -> c_int ;
15731592
1593+ pub fn mkdirat ( dirfd : c_int , pathname : * const c_char , mode : mode_t ) -> c_int ;
1594+
1595+ pub fn readlinkat (
1596+ dirfd : c_int ,
1597+ pathname : * const c_char ,
1598+ buf : * mut c_char ,
1599+ bufsiz : size_t ,
1600+ ) -> ssize_t ;
1601+
15741602 pub fn unlinkat ( dirfd : c_int , pathname : * const c_char , flags : c_int ) -> c_int ;
15751603
15761604 // netdb.h
@@ -1617,6 +1645,7 @@ extern "C" {
16171645 pub fn pause ( ) -> c_int ;
16181646 pub fn seteuid ( uid : uid_t ) -> c_int ;
16191647 pub fn setegid ( gid : gid_t ) -> c_int ;
1648+ pub fn statfs ( path : * const c_char , buf : * mut statfs ) -> c_int ;
16201649 pub fn sleep ( secs : c_uint ) -> c_uint ;
16211650 pub fn ttyname ( fd : c_int ) -> * mut c_char ;
16221651 pub fn wait ( status : * mut c_int ) -> pid_t ;
@@ -1829,6 +1858,9 @@ extern "C" {
18291858 // stat.h
18301859 pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
18311860
1861+ // sys/statfs.h
1862+ pub fn fstatfs ( fd : c_int , buf : * mut statfs ) -> c_int ;
1863+
18321864 // stat.h
18331865 pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
18341866
@@ -1845,10 +1877,19 @@ extern "C" {
18451877 // dirent.h
18461878 pub fn readdir ( pDir : * mut crate :: DIR ) -> * mut crate :: dirent ;
18471879
1880+ // dirent.h
1881+ pub fn fdopendir ( fd : c_int ) -> * mut crate :: DIR ;
1882+
1883+ // dirent.h
1884+ pub fn dirfd ( dirp : * mut crate :: DIR ) -> c_int ;
1885+
18481886 // fcntl.h or
18491887 // ioLib.h
18501888 pub fn open ( path : * const c_char , oflag : c_int , ...) -> c_int ;
18511889
1890+ // fcntl.h
1891+ pub fn openat ( dirfd : c_int , pathname : * const c_char , flags : c_int , ...) -> c_int ;
1892+
18521893 // poll.h
18531894 pub fn poll ( fds : * mut pollfd , nfds : nfds_t , timeout : c_int ) -> c_int ;
18541895
@@ -2186,6 +2227,9 @@ extern "C" {
21862227 // unistd.h
21872228 pub fn fsync ( fd : c_int ) -> c_int ;
21882229
2230+ // unistd.h
2231+ pub fn fdatasync ( fd : c_int ) -> c_int ;
2232+
21892233 // dirent.h
21902234 pub fn closedir ( ptr : * mut crate :: DIR ) -> c_int ;
21912235
0 commit comments