autocommit 2022-03-11 19:24:53 CET
This commit is contained in:
parent
b1890894b2
commit
0ae73ab9c4
9 changed files with 277 additions and 66 deletions
8
src/utils/nonblock.rs
Normal file
8
src/utils/nonblock.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use uapi::{c};
|
||||
use crate::utils::oserror::OsError;
|
||||
|
||||
pub fn set_nonblock(fd: c::c_int) -> Result<(), OsError> {
|
||||
let fl = uapi::fcntl_getfl(fd)?;
|
||||
uapi::fcntl_setfl(fd, fl | c::SOCK_NONBLOCK)?;
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue