Module base::sys::linux

source ·
Expand description

Small system utility modules for usage by other modules.

Re-exports

Modules

Structs

  • A system error In Unix systems, retrieved from errno (man 3 errno), set by a libc function that returned an error. On Windows, retrieved from GetLastError, set by a Windows function that returned an error
  • Used to poll multiple objects that have file descriptors.
  • Iterator returning the offset range of data in the file.
  • Generic netlink header struct, can be used by netlink consumer
  • A set of memfd seals.
  • Wraps an anonymous shared memory mapping in the current process. Provides RAII semantics including munmap when no longer needed.
  • Tracks Fixed Memory Maps within an anonymous memory-mapped fixed-sized arena in the current process.
  • Iterator over struct NlAttr as received from a netlink socket.
  • Safe wrapper for NETLINK_GENERIC netlink sockets.
  • A single netlink message, including its header and data.
  • Iterator over struct nlmsghdr as received from a netlink socket.
  • Netlink attribute struct, can be used by netlink consumer
  • A safe wrapper around a Linux signalfd (man 2 signalfd).
  • Used to attempt to clean up a named pipe after it is no longer used.
  • Used to attempt to clean up a named pipe after it is no longer used.

Enums

Constants

Traits

Functions

  • Generates ioctl request number.
  • Discards the given range of a block file.
  • Drops all capabilities (permitted, inheritable, and effective) from the current process.
  • Return a timespec filed with the specified Duration duration.
  • Enable experimental core scheduling for the current thread.
  • Returns the last errno as a Result that is always an error.
  • Safe wrapper for fallocate().
  • Find the offset range of the next data in the file.
  • Safe wrapper for flock(2) with the operation op and optionally nonblocking. The lock will be dropped automatically when file is dropped.
  • Safe wrapper for fstat().
  • Obtain file system type of the file system that the file is served from.
  • Safe wrapper for getegid(2).
  • Safe wrapper for geteuid(2).
  • This bypasses libc’s caching getpid(2) wrapper which can be invalid if a raw clone was used elsewhere.
  • Safe wrapper for the geppid Linux systemcall.
  • Safe wrapper for the gettid Linux systemcall.
  • Checks whether a file is a block device fie or not.
  • Kill all processes in the current process group.
  • Returns the capacity (measure of performance) of a given logical core.
  • Returns a list of supported frequencies in kHz for a given logical core.
  • Returns the maximum frequency (in kHz) of a given logical core.
  • Get the max number of open files allowed by the environment.
  • Return the maximum Duration that can be used with libc::timespec.
  • Moves the requested PID/TID to a particular cgroup
  • Test-only function used to create a pipe that is full. The pipe is created, has its size set to the minimum and then has that much data written to it. Use new_pipe_full to test handling of blocking write calls in unit tests.
  • Open the file with the given path, or if it is of the form /proc/self/fd/N then just use the file descriptor.
  • Queries the property of a specified CPU sysfs node.
  • Spawns a pipe pair where the first pipe is the read end and the second pipe is the write end.
  • Utility function that returns true if the given FD is readable without blocking.
  • Read raw bytes from stdin.
  • Reaps a child process that has terminated.
  • If the given path is of the form /proc/self/fd/N for some N, returns Ok(Some(N)). Otherwise returns Ok(None).
  • Set the CPU affinity of the current thread to a given set of CPUs.
  • Sets the pipe signified with fd to size.
  • Enables real time thread priorities in the current thread up to limit.
  • Sets the current thread to be scheduled using the round robin real time class with priority.
  • Verifies that |raw_descriptor| is actually owned by this process and duplicates it to ensure that we have a unique handle to it.
  • Verifies that |raw_fd| is actually owned by this process and duplicates it to ensure that we have a unique handle to it.
  • A safe wrapper around waitpid.

Type Definitions