Skip to content
Snippets Groups Projects
Commit f22150e7 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'poll-unsafe-blocks' into 'master'

Use unsafe blocks in poll.h implementation

See merge request !526
parents 0a29bfae 2e48a31a
No related branches found
No related tags found
1 merge request!526Use unsafe blocks in poll.h implementation
Pipeline #16525 passed
//! poll implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.h.html //! poll implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.h.html
// TODO: set this for entire crate when possible
#![deny(unsafe_op_in_unsafe_fn)]
use core::{mem, slice}; use core::{mem, slice};
use crate::{ use crate::{
...@@ -113,7 +116,10 @@ pub fn poll_epoll(fds: &mut [pollfd], timeout: c_int) -> c_int { ...@@ -113,7 +116,10 @@ pub fn poll_epoll(fds: &mut [pollfd], timeout: c_int) -> c_int {
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int { pub unsafe extern "C" fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int {
trace_expr!( trace_expr!(
poll_epoll(slice::from_raw_parts_mut(fds, nfds as usize), timeout), poll_epoll(
unsafe { slice::from_raw_parts_mut(fds, nfds as usize) },
timeout
),
"poll({:p}, {}, {})", "poll({:p}, {}, {})",
fds, fds,
nfds, nfds,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment