Skip to content

Commit

Permalink
redox: Add ENOTSUP, FIONREAD, MSG_DONTWAIT, and madvise
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Oct 18, 2022
1 parent 88b2ed2 commit c09d65f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc-test/semver/redox.txt
Expand Up @@ -58,6 +58,7 @@ ENOSTR
ENOTBLK
ENOTNAM
ENOTRECOVERABLE
ENOTSUP
ENOTUNIQ
EOWNERDEAD
EPOLLERR
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -187,6 +190,7 @@ getservbyport
getservent
killpg
lockf
madvise
memalign
nice
open_memstream
Expand Down
4 changes: 4 additions & 0 deletions src/unix/redox/mod.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
// }
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c09d65f

Please sign in to comment.