use super::abi::*;
use crate::{
unit_result_from_value,
AsRawFd,
};
#[inline]
pub fn close(fd: &impl AsRawFd) -> crate::Result<()> {
// SAFETY: There is no pointer being passed, the worst that can happen is that the kernel
// returns an error if the `fd` is invalid.
let ret = unsafe { syscall_1(3, fd.as_raw_fd() as usize) as u32 };
unit_result_from_value(ret)
}