rusl 0.5.0

Rust linux interface layer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use sc::syscall;

use crate::platform::Fd;

/// Attempts to close the provided `Fd`.
/// See the [linux docs for details.](https://man7.org/linux/man-pages/man2/close.2.html)
/// # Errors
/// See above
#[inline]
pub fn close(fd: Fd) -> crate::Result<()> {
    let res = unsafe { syscall!(CLOSE, fd.0) };
    bail_on_below_zero!(res, "Failed `CLOSE` syscall");
    Ok(())
}