all: split reusable components into workspace crates
This commit is contained in:
parent
2a079ed800
commit
657e7ce2f7
225 changed files with 7422 additions and 17602 deletions
|
|
@ -1,16 +0,0 @@
|
|||
use {
|
||||
crate::utils::oserror::{OsError, OsErrorExt},
|
||||
uapi::c,
|
||||
};
|
||||
|
||||
pub fn set_nonblock(fd: c::c_int) -> Result<(), OsError> {
|
||||
let fl = uapi::fcntl_getfl(fd).to_os_error()?;
|
||||
uapi::fcntl_setfl(fd, fl | c::O_NONBLOCK).to_os_error()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_block(fd: c::c_int) -> Result<(), OsError> {
|
||||
let fl = uapi::fcntl_getfl(fd).to_os_error()?;
|
||||
uapi::fcntl_setfl(fd, fl & !c::O_NONBLOCK).to_os_error()?;
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue