summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Soller <jackpot51@gmail.com>2022-10-17 10:36:10 -0600
committerJeremy Soller <jackpot51@gmail.com>2022-10-18 08:28:09 -0600
commitc09d65f7fb01e60e4d5d46f073437c4be658e558 (patch)
tree7d73efefcabf713de8978869daeb55e160b585d6
parent88b2ed287f27a453d623e91517d7973a586a203f (diff)
downloadrust-libc-c09d65f7fb01e60e4d5d46f073437c4be658e558.tar.gz
redox: Add ENOTSUP, FIONREAD, MSG_DONTWAIT, and madvise
-rw-r--r--libc-test/semver/redox.txt4
-rw-r--r--src/unix/redox/mod.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
index adff39fa0b..475e96bdd9 100644
--- a/libc-test/semver/redox.txt
+++ b/libc-test/semver/redox.txt
@@ -58,6 +58,7 @@ ENOSTR
ENOTBLK
ENOTNAM
ENOTRECOVERABLE
+ENOTSUP
ENOTUNIQ
EOWNERDEAD
EPOLLERR
@@ -93,11 +94,13 @@ EUCLEAN
EUNATCH
EUSERS
EXFULL
+FIONREAD
IMAXBEL
IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP
IUCLC
IUTF8
+MSG_DONTWAIT
NI_DGRAM
NI_MAXSERV
NI_NAMEREQD
@@ -187,6 +190,7 @@ getservbyport
getservent
killpg
lockf
+madvise
memalign
nice
open_memstream
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index bc46d4942a..02beda4312 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -375,6 +375,7 @@ pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */
pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */
/* Operation not supported on transport endpoint */
pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */
/* Address family not supported by protocol */
pub const EAFNOSUPPORT: ::c_int = 97;
@@ -615,6 +616,7 @@ pub const EXIT_FAILURE: ::c_int = 1;
// sys/ioctl.h
// FIXME: relibc {
+pub const FIONREAD: ::c_ulong = 0x541B;
pub const FIONBIO: ::c_ulong = 0x5421;
pub const FIOCLEX: ::c_ulong = 0x5451;
// }
@@ -661,6 +663,7 @@ pub const MSG_EOR: ::c_int = 128;
pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
pub const MSG_TRUNC: ::c_int = 32;
+pub const MSG_DONTWAIT: ::c_int = 64;
pub const MSG_WAITALL: ::c_int = 256;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -1028,6 +1031,7 @@ extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
// sys/mman.h
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;