Skip to main content

fcntl

Function fcntl 

Source
pub fn fcntl<'a, RF>(
    fd: &'a RF,
    cmd: FcntlCmd,
    arg: FcntlArg,
) -> Result<FcntlArg, FcntlError>
where RF: AsRawFd,
Expand description

Calls fcntl with the given cmd and arg. On success, the structure passed to the arg parameter is returned as returned by the kernel. Note: Where possible convenience wrappers (such as is_file_locked, lock_file, etc.) should be used as they correctly interpret possible return values of the syscall.

Currently supported cmds:

  • FcntlCmd::GetLock
  • FcntlCmd::SetLock

ยงErrors

In case of an error (syscall returned an error, invalid arg provided, cmd not supported, etc.) an appropriate value is returned.