Skip to content

Commit 826ff38

Browse files
redox: More resource.h, fcntl.h constants
1 parent 586ccc1 commit 826ff38

File tree

2 files changed

+46
-9
lines changed

2 files changed

+46
-9
lines changed

libc-test/semver/redox.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,32 @@ OLCUC
131131
O_ASYNC
132132
O_EXLOCK
133133
O_FSYNC
134+
O_NDELAY
134135
O_NOCTTY
135136
O_PATH
136137
O_SHLOCK
137138
O_SYMLINK
138139
PTHREAD_STACK_MIN
140+
RLIMIT_AS
141+
RLIMIT_CORE
142+
RLIMIT_CPU
143+
RLIMIT_DATA
144+
RLIMIT_FSIZE
145+
RLIMIT_LOCKS
146+
RLIMIT_MEMLOCK
147+
RLIMIT_MSGQUEUE
148+
RLIMIT_NICE
149+
RLIMIT_NLIMITS
150+
RLIMIT_NOFILE
151+
RLIMIT_NPROC
152+
RLIMIT_RSS
153+
RLIMIT_RTPRIO
154+
RLIMIT_SIGPENDING
155+
RLIMIT_STACK
139156
RLIM_INFINITY
140157
RLIM_SAVED_CUR
141158
RLIM_SAVED_MAX
159+
RUSAGE_BOTH
142160
RUSAGE_CHILDREN
143161
RUSAGE_SELF
144162
RUSAGE_THREAD
@@ -247,6 +265,7 @@ pipe2
247265
pthread_condattr_setclock
248266
qsort
249267
reallocarray
268+
rlim_t
250269
setgrent
251270
setpwent
252271
setrlimit

src/unix/redox/mod.rs

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ pub const O_WRONLY: c_int = 0x0002_0000;
517517
pub const O_RDWR: c_int = 0x0003_0000;
518518
pub const O_ACCMODE: c_int = 0x0003_0000;
519519
pub const O_NONBLOCK: c_int = 0x0004_0000;
520+
pub const O_NDELAY: c_int = O_NONBLOCK;
520521
pub const O_APPEND: c_int = 0x0008_0000;
521522
pub const O_SHLOCK: c_int = 0x0010_0000;
522523
pub const O_EXLOCK: c_int = 0x0020_0000;
@@ -627,15 +628,6 @@ pub const PTHREAD_RWLOCK_INITIALIZER: crate::pthread_rwlock_t = crate::pthread_r
627628
};
628629
pub const PTHREAD_STACK_MIN: size_t = 4096;
629630

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-
639631
// signal.h
640632
pub const SIG_BLOCK: c_int = 0;
641633
pub const SIG_UNBLOCK: c_int = 1;
@@ -774,6 +766,32 @@ pub const MS_ASYNC: c_int = 0x0001;
774766
pub const MS_INVALIDATE: c_int = 0x0002;
775767
pub const MS_SYNC: c_int = 0x0004;
776768

769+
// sys/resource.h
770+
pub const RLIM_INFINITY: rlim_t = !0;
771+
pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
772+
pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
773+
pub const RLIMIT_CPU: c_int = 0;
774+
pub const RLIMIT_FSIZE: c_int = 1;
775+
pub const RLIMIT_DATA: c_int = 2;
776+
pub const RLIMIT_STACK: c_int = 3;
777+
pub const RLIMIT_CORE: c_int = 4;
778+
pub const RLIMIT_RSS: c_int = 5;
779+
pub const RLIMIT_NPROC: c_int = 6;
780+
pub const RLIMIT_NOFILE: c_int = 7;
781+
pub const RLIMIT_MEMLOCK: c_int = 8;
782+
pub const RLIMIT_AS: c_int = 9;
783+
pub const RLIMIT_LOCKS: c_int = 10;
784+
pub const RLIMIT_SIGPENDING: c_int = 11;
785+
pub const RLIMIT_MSGQUEUE: c_int = 12;
786+
pub const RLIMIT_NICE: c_int = 13;
787+
pub const RLIMIT_RTPRIO: c_int = 14;
788+
pub const RLIMIT_NLIMITS: c_int = 15;
789+
790+
pub const RUSAGE_SELF: c_int = 0;
791+
pub const RUSAGE_CHILDREN: c_int = -1;
792+
pub const RUSAGE_BOTH: c_int = -2;
793+
pub const RUSAGE_THREAD: c_int = 1;
794+
777795
// sys/select.h
778796
pub const FD_SETSIZE: c_int = 1024;
779797

0 commit comments

Comments
 (0)