Use unsafe blocks in sys/epoll.h implementation
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
//! sys/epoll.h implementation for Redox, following http://man7.org/linux/man-pages/man7/epoll.7.html
|
||||
|
||||
// TODO: set this for entire crate when possible
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
use core::ptr;
|
||||
|
||||
use crate::{
|
||||
@@ -80,7 +83,7 @@ pub unsafe extern "C" fn epoll_ctl(
|
||||
event: *mut epoll_event,
|
||||
) -> c_int {
|
||||
trace_expr!(
|
||||
Sys::epoll_ctl(epfd, op, fd, event)
|
||||
unsafe { Sys::epoll_ctl(epfd, op, fd, event) }
|
||||
.map(|()| 0)
|
||||
.or_minus_one_errno(),
|
||||
"epoll_ctl({}, {}, {}, {:p})",
|
||||
@@ -98,7 +101,7 @@ pub unsafe extern "C" fn epoll_wait(
|
||||
maxevents: c_int,
|
||||
timeout: c_int,
|
||||
) -> c_int {
|
||||
epoll_pwait(epfd, events, maxevents, timeout, ptr::null())
|
||||
unsafe { epoll_pwait(epfd, events, maxevents, timeout, ptr::null()) }
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
@@ -110,7 +113,7 @@ pub unsafe extern "C" fn epoll_pwait(
|
||||
sigmask: *const sigset_t,
|
||||
) -> c_int {
|
||||
trace_expr!(
|
||||
Sys::epoll_pwait(epfd, events, maxevents, timeout, sigmask)
|
||||
unsafe { Sys::epoll_pwait(epfd, events, maxevents, timeout, sigmask) }
|
||||
.map(|e| e as c_int)
|
||||
.or_minus_one_errno(),
|
||||
"epoll_pwait({}, {:p}, {}, {}, {:p})",
|
||||
|
||||
Reference in New Issue
Block a user