Merge branch 'socket_poll_constants' into 'master'

adding SOCK_RDM and a couple of POLL* constants.

Closes #164

See merge request redox-os/relibc!354
This commit is contained in:
Jeremy Soller
2023-03-26 09:06:29 +00:00
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -6,7 +6,7 @@ use crate::{
fs::File,
header::sys_epoll::{
epoll_create1, epoll_ctl, epoll_data, epoll_event, epoll_wait, EPOLLERR, EPOLLHUP, EPOLLIN,
EPOLLNVAL, EPOLLOUT, EPOLLPRI, EPOLL_CLOEXEC, EPOLL_CTL_ADD,
EPOLLNVAL, EPOLLOUT, EPOLLPRI, EPOLLRDBAND, EPOLLRDNORM, EPOLLWRBAND, EPOLLWRNORM, EPOLL_CLOEXEC, EPOLL_CTL_ADD,
},
platform::types::*,
};
@@ -17,6 +17,10 @@ pub const POLLOUT: c_short = 0x004;
pub const POLLERR: c_short = 0x008;
pub const POLLHUP: c_short = 0x010;
pub const POLLNVAL: c_short = 0x020;
pub const POLLRDNORM: c_short = 0x040;
pub const POLLRDBAND: c_short = 0x080;
pub const POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub type nfds_t = c_ulong;
@@ -35,6 +39,10 @@ pub fn poll_epoll(fds: &mut [pollfd], timeout: c_int) -> c_int {
(POLLERR, EPOLLERR),
(POLLHUP, EPOLLHUP),
(POLLNVAL, EPOLLNVAL),
(POLLRDNORM, EPOLLRDNORM),
(POLLWRNORM, EPOLLWRNORM),
(POLLRDBAND, EPOLLRDBAND),
(POLLWRBAND, EPOLLWRBAND),
];
let ep = {
+1
View File
@@ -6,6 +6,7 @@ pub const SOCK_NONBLOCK: c_int = 0o4_000;
pub const SOCK_CLOEXEC: c_int = 0o2_000_000;
// Other constants
pub const SOCK_RDM: c_int = 4;
pub const SOCK_SEQPACKET: c_int = 5;
pub const SOL_SOCKET: c_int = 1;