Skip to content

Commit bd2cec2

Browse files
committed
Adding structs and defines for vxworks
1 parent 8f74b4b commit bd2cec2

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

libc-test/semver/vxworks.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,15 @@ ONLCR
241241
OPOST
242242
O_ACCMODE
243243
O_APPEND
244+
O_ASYNC
244245
O_CLOEXEC
245246
O_CREAT
247+
O_DSYNC
246248
O_EXCL
247249
O_NONBLOCK
248250
O_RDONLY
249251
O_RDWR
252+
O_SYNC
250253
O_TRUNC
251254
O_WRONLY
252255
PARENB
@@ -468,6 +471,7 @@ connect
468471
creat
469472
dev_t
470473
dirent
474+
dirfd
471475
dladdr
472476
dlclose
473477
dlerror
@@ -482,7 +486,9 @@ fchown
482486
fchownat
483487
fclose
484488
fcntl
489+
fdatasync
485490
fdopen
491+
fdopendir
486492
feof
487493
ferror
488494
fflush
@@ -506,6 +512,7 @@ fscanf
506512
fseek
507513
fseeko
508514
fsetpos
515+
fsid_t
509516
fstat
510517
fsync
511518
ftell
@@ -586,6 +593,7 @@ memcpy
586593
memmove
587594
memset
588595
mkdir
596+
mkdirat
589597
mkdtemp
590598
mkfifo
591599
mkstemp
@@ -604,6 +612,7 @@ nfds_t
604612
nlink_t
605613
off_t
606614
open
615+
openat
607616
opendir
608617
openlog
609618
pathconf
@@ -676,6 +685,7 @@ raise
676685
read
677686
readdir
678687
readlink
688+
readlinkat
679689
readv
680690
realloc
681691
realpath
@@ -736,6 +746,7 @@ sprintf
736746
sscanf
737747
ssize_t
738748
stat
749+
statfs
739750
strcat
740751
strchr
741752
strcmp

src/vxworks/mod.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
13851401
pub const O_CLOEXEC: c_int = 0x100000; // fcntlcom
13861402
pub const O_EXCL: c_int = 0x0800;
13871403
pub 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;
13881407
pub const O_TRUNC: c_int = 0x0400;
13891408
pub const O_APPEND: c_int = 0x0008;
13901409
pub 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

Comments
 (0)