Skip to content

Commit d09b1da

Browse files
joshuamegnauth54tgross35
authored andcommitted
redox: dirfd, VDISABLE, and resource consts
1 parent 8c2810a commit d09b1da

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

libc-test/semver/redox.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ B460800
1616
B500000
1717
B576000
1818
B921600
19+
BUFSIZ
1920
DT_UNKNOWN
2021
EADV
2122
EBADE
@@ -130,10 +131,17 @@ OLCUC
130131
O_ASYNC
131132
O_EXLOCK
132133
O_FSYNC
134+
O_NOCTTY
133135
O_PATH
134136
O_SHLOCK
135137
O_SYMLINK
136138
PTHREAD_STACK_MIN
139+
RLIM_INFINITY
140+
RLIM_SAVED_CUR
141+
RLIM_SAVED_MAX
142+
RUSAGE_CHILDREN
143+
RUSAGE_SELF
144+
RUSAGE_THREAD
137145
SA_RESTORER
138146
SCM_RIGHTS
139147
SIGIO
@@ -172,6 +180,9 @@ VWERASE
172180
WEXITED
173181
WNOWAIT
174182
WSTOPPED
183+
_IOFBF
184+
_IOLBF
185+
_IONBF
175186
_PC_2_SYMLINKS
176187
_PC_ALLOC_SIZE_MIN
177188
_PC_ASYNC_IO
@@ -184,6 +195,7 @@ _PC_REC_XFER_ALIGN
184195
_PC_SOCK_MAXBUF
185196
_PC_SYMLINK_MAX
186197
_PC_SYNC_IO
198+
_POSIX_VDISABLE
187199
_SC_LOGIN_NAME_MAX
188200
_SC_RE_DUP_MAX
189201
__WALL
@@ -194,6 +206,7 @@ bsearch
194206
chroot
195207
clearerr
196208
difftime
209+
dirfd
197210
endgrent
198211
endpwent
199212
endservent

src/unix/redox/mod.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ pub const O_SYMLINK: c_int = 0x4000_0000;
532532
// Negative to allow it to be used as int
533533
// FIXME(redox): Fix negative values missing from includes
534534
pub const O_NOFOLLOW: c_int = -0x8000_0000;
535+
pub const O_NOCTTY: c_int = 0x00000200;
535536

536537
// locale.h
537538
pub const LC_ALL: c_int = 0;
@@ -626,6 +627,15 @@ pub const PTHREAD_RWLOCK_INITIALIZER: crate::pthread_rwlock_t = crate::pthread_r
626627
};
627628
pub const PTHREAD_STACK_MIN: size_t = 4096;
628629

630+
// sys/resource.h
631+
pub const RLIM_INFINITY: u64 = !0;
632+
pub const RLIM_SAVED_CUR: u64 = RLIM_INFINITY;
633+
pub const RLIM_SAVED_MAX: u64 = RLIM_INFINITY;
634+
pub const RUSAGE_SELF: c_int = 0;
635+
pub const RUSAGE_CHILDREN: c_int = -1;
636+
pub const RUSAGE_BOTH: c_int = -2;
637+
pub const RUSAGE_THREAD: c_int = 1;
638+
629639
// signal.h
630640
pub const SIG_BLOCK: c_int = 0;
631641
pub const SIG_UNBLOCK: c_int = 1;
@@ -935,6 +945,8 @@ pub const TCSANOW: c_int = 0;
935945
pub const TCSADRAIN: c_int = 1;
936946
pub const TCSAFLUSH: c_int = 2;
937947

948+
pub const _POSIX_VDISABLE: crate::cc_t = 0;
949+
938950
// sys/wait.h
939951
pub const WNOHANG: c_int = 1;
940952
pub const WUNTRACED: c_int = 2;
@@ -984,6 +996,11 @@ pub const R_OK: c_int = 4;
984996
pub const W_OK: c_int = 2;
985997
pub const X_OK: c_int = 1;
986998

999+
// stdio.h
1000+
pub const BUFSIZ: c_uint = 1024;
1001+
pub const _IOFBF: c_int = 0;
1002+
pub const _IOLBF: c_int = 1;
1003+
pub const _IONBF: c_int = 2;
9871004
pub const SEEK_SET: c_int = 0;
9881005
pub const SEEK_CUR: c_int = 1;
9891006
pub const SEEK_END: c_int = 2;
@@ -1096,6 +1113,9 @@ extern "C" {
10961113
pub fn __errno_location() -> *mut c_int;
10971114
pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
10981115

1116+
// dirent.h
1117+
pub fn dirfd(dirp: *mut crate::DIR) -> c_int;
1118+
10991119
// unistd.h
11001120
pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int;
11011121
pub fn getdtablesize() -> c_int;

0 commit comments

Comments
 (0)