MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / fcntl

Function fcntl

block/src/fcntl.rs:46–54  ·  view source on GitHub ↗

Wrapper for [`libc::fcntl`] that properly sets the function arguments.

(fd: RawFd, arg: FcntlArg)

Source from the content-addressed store, hash-verified

44
45/// Wrapper for [`libc::fcntl`] that properly sets the function arguments.
46fn fcntl(fd: RawFd, arg: FcntlArg) -> libc::c_int {
47 // SAFETY: We use a valid FD.
48 unsafe {
49 match arg {
50 FcntlArg::F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock),
51 FcntlArg::F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock),
52 }
53 }
54}
55
56/// Describes the type of lock you want to set.
57#[derive(Clone, Copy, Debug)]

Callers 15

expand_fdtableFunction · 0.85
test_windows_guestFunction · 0.85
from_tap_fdMethod · 0.85
newMethod · 0.85
spawnMethod · 0.85
newMethod · 0.85
probeMethod · 0.85
try_acquire_lockFunction · 0.85
get_lock_stateFunction · 0.85

Calls

no outgoing calls