1use crate::*;
2
3#[man("fcntl(2) with cmd = `F_ADD_SEALS`")]
4pub fn fcntl_add_seals(fd: c::c_int, seals: c::c_int) -> Result<()> {
5 let res = unsafe { c::fcntl(fd, c::F_ADD_SEALS, seals) };
6 map_err!(res).map(drop)
7}
8
9#[man("fcntl(2) with cmd = `F_GET_SEALS`")]
10pub fn fcntl_get_seals(fd: c::c_int) -> Result<c::c_int> {
11 let res = unsafe { c::fcntl(fd, c::F_GET_SEALS) };
12 map_err!(res)
13}
14
15#[man("fcntl(2) with cmd = `F_OFD_SETLK`")]
16pub fn fcntl_ofd_setlk(fd: c::c_int, lock: &c::flock) -> Result<()> {
17 let res = unsafe { c::fcntl(fd, c::F_OFD_SETLK, lock) };
18 map_err!(res).map(drop)
19}
20
21#[man("fcntl(2) with cmd = `F_OFD_SETLKW`")]
22pub fn fcntl_ofd_setlkw(fd: c::c_int, lock: &c::flock) -> Result<()> {
23 let res = unsafe { c::fcntl(fd, c::F_OFD_SETLKW, lock) };
24 map_err!(res).map(drop)
25}
26
27#[man("fcntl(2) with cmd = `F_OFD_GETLK`")]
28pub fn fcntl_ofd_getlk(fd: c::c_int, lock: &mut c::flock) -> Result<()> {
29 let res = unsafe { c::fcntl(fd, c::F_OFD_GETLK, lock) };
30 map_err!(res).map(drop)
31}