浏览代码

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
Jeremy Soller 2 年之前
父节点
当前提交
3f76a08122
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 9 1
      src/header/poll/mod.rs
  2. 1 0
      src/header/sys_socket/constants.rs

+ 9 - 1
src/header/poll/mod.rs

@@ -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 - 0
src/header/sys_socket/constants.rs

@@ -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;