Expand description
Execute system call directly without std
or libc
.
§Usage
Add this to Cargo.toml
:
[dependencies]
nc = "0.9"
§Examples
Get file stat:
let mut statbuf = nc::stat_t::default();
let filepath = "/etc/passwd";
#[cfg(target_os = "linux")]
let ret = {
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "riscv64"
)))]
unsafe {
nc::stat(filepath, &mut statbuf)
}
#[cfg(any(
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "riscv64"
))]
unsafe {
nc::fstatat(nc::AT_FDCWD, filepath, &mut statbuf, 0)
}
};
#[cfg(any(target_os = "android", target_os = "freebsd"))]
let ret = unsafe { nc::fstatat(nc::AT_FDCWD, filepath, &mut statbuf, 0) };
match ret {
Ok(_) => println!("s: {:?}", statbuf),
Err(errno) => eprintln!("Failed to get file status, got errno: {}", errno),
}
Fork process:
let pid = unsafe { nc::fork() };
match pid {
Err(errno) => eprintln!("Failed to call fork(), err: {}", nc::strerror(errno)),
Ok(0) => {
// Child process
println!("[child] pid: {}", unsafe { nc::getpid() });
let args = ["ls", "-l", "-a"];
let env = ["DISPLAY=wayland"];
let ret = unsafe { nc::execve("/bin/ls", &args, &env) };
assert!(ret.is_ok());
}
Ok(child_pid) => {
// Parent process
println!("[main] child pid is: {child_pid}");
}
}
Kill init process:
let ret = unsafe { nc::kill(1, nc::SIGTERM) };
assert_eq!(ret, Err(nc::EPERM));
Or handle signals:
fn handle_alarm(signum: i32) {
assert_eq!(signum, nc::SIGALRM);
}
fn main() {
let sa = nc::new_sigaction(handle_alarm);
let ret = unsafe { nc::rt_sigaction(nc::SIGALRM, Some(&sa), None) };
assert!(ret.is_ok());
let remaining = unsafe { nc::alarm(1) };
let mask = nc::sigset_t::default();
let ret = unsafe { nc::rt_sigsuspend(&mask) };
assert!(ret.is_err());
assert_eq!(ret, Err(nc::EINTR));
assert_eq!(remaining, Ok(0));
}
Or get system info:
pub fn cstr_to_str(input: &[u8]) -> &str {
let nul_index = input.iter().position(|&b| b == 0).unwrap_or(input.len());
std::str::from_utf8(&input[0..nul_index]).unwrap()
}
fn main() {
let mut uts = nc::utsname_t::default();
let ret = unsafe { nc::uname(&mut uts) };
assert!(ret.is_ok());
let mut result = Vec::new();
result.push(cstr_to_str(&uts.sysname));
result.push(cstr_to_str(&uts.nodename));
result.push(cstr_to_str(&uts.release));
result.push(cstr_to_str(&uts.version));
result.push(cstr_to_str(&uts.machine));
let domain_name = cstr_to_str(&uts.domainname);
if domain_name != "(none)" {
result.push(domain_name);
}
let result = result.join(" ");
println!("{}", result);
}
§Supported Operating Systems and Architectures
- linux
- aarch64
- arm
- loongarch64
- mips
- mips64
- mips64el
- mipsel
- powerpc64
- powerpc64le
- riscv64
- s390x
- x86
- x86-64
- android
- aarch64
- freebsd
- x86-64
- netbsd
- x86-64
- mac os
- x86-64
§Related projects
Re-exports§
Modules§
Constants§
- E2BIG
- Argument list too long
- EACCES
- Permission denied
- EADDRINUSE
- Address already in use
- EADDRNOTAVAIL
- Cannot assign requested address
- EADV
- Advertise error
- EAFNOSUPPORT
- Address family not supported by protocol
- EAGAIN
- Try again
- EALREADY
- Operation already in progress
- EBADE
- Invalid exchange
- EBADF
- Bad file number
- EBADFD
- File descriptor in bad state
- EBADMSG
- Not a data message
- EBADR
- Invalid request descriptor
- EBADRQC
- Invalid request code
- EBADSLT
- Invalid slot
- EBFONT
- Bad font file format
- EBUSY
- Device or resource busy
- ECANCELED
- Operation Canceled
- ECHILD
- No child processes
- ECHRNG
- Channel number out of range
- ECOMM
- Communication error on send
- ECONNABORTED
- Software caused connection abort
- ECONNREFUSED
- Connection refused
- ECONNRESET
- Connection reset by peer
- EDEADLK
- Resource deadlock would occur
- EDEADLOCK
- EDESTADDRREQ
- Destination address required
- EDOM
- Math argument out of domain of func
- EDOTDOT
- RFS specific error
- EDQUOT
- Quota exceeded
- EEXIST
- File exists
- EFAULT
- Bad address
- EFBIG
- File too large
- EHOSTDOWN
- Host is down
- EHOSTUNREACH
- No route to host
- EHWPOISON
- Memory page has hardware error
- EIDRM
- Identifier removed
- EILSEQ
- Illegal byte sequence
- EINPROGRESS
- Operation now in progress
- EINTR
- Interrupted system call
- EINVAL
- Invalid argument
- EIO
- I/O error
- EISCONN
- Transport endpoint is already connected
- EISDIR
- Is a directory
- EISNAM
- Is a named type file
- EKEYEXPIRED
- Key has expired
- EKEYREJECTED
- Key was rejected by service
- EKEYREVOKED
- Key has been revoked
- EL2HLT
- Level 2 halted
- EL2NSYNC
- Level 2 not synchronized
- EL3HLT
- Level 3 halted
- EL3RST
- Level 3 reset
- ELIBACC
- Can not access a needed shared library
- ELIBBAD
- Accessing a corrupted shared library
- ELIBEXEC
- Cannot exec a shared library directly
- ELIBMAX
- Attempting to link in too many shared libraries
- ELIBSCN
- .lib section in a.out corrupted
- ELNRNG
- Link number out of range
- ELOOP
- Too many symbolic links encountered
- EMEDIUMTYPE
- Wrong medium type
- EMFILE
- Too many open files
- EMLINK
- Too many links
- EMSGSIZE
- Message too long
- EMULTIHOP
- Multihop attempted
- ENAMETOOLONG
- File name too long
- ENAVAIL
- No XENIX semaphores available
- ENETDOWN
- Network is down
- ENETRESET
- Network dropped connection because of reset
- ENETUNREACH
- Network is unreachable
- ENFILE
- File table overflow
- ENOANO
- No anode
- ENOBUFS
- No buffer space available
- ENOCSI
- No CSI structure available
- ENODATA
- No data available
- ENODEV
- No such device
- ENOENT
- No such file or directory
- ENOEXEC
- Exec format error
- ENOKEY
- Required key not available
- ENOLCK
- No record locks available
- ENOLINK
- Link has been severed
- ENOMEDIUM
- No medium found
- ENOMEM
- Out of memory
- ENOMSG
- No message of desired type
- ENONET
- Machine is not on the network
- ENOPKG
- Package not installed
- ENOPROTOOPT
- Protocol not available
- ENOSPC
- No space left on device
- ENOSR
- Out of streams resources
- ENOSTR
- Device not a stream
- ENOSYS
- Invalid system call number
- ENOTBLK
- Block device required
- ENOTCONN
- Transport endpoint is not connected
- ENOTDIR
- Not a directory
- ENOTEMPTY
- Directory not empty
- ENOTNAM
- Not a XENIX named type file
- ENOTRECOVERABLE
- State not recoverable
- ENOTSOCK
- Socket operation on non-socket
- ENOTTY
- Not a typewriter
- ENOTUNIQ
- Name not unique on network
- ENXIO
- No such device or address
- EOPNOTSUPP
- Operation not supported on transport endpoint
- EOVERFLOW
- Value too large for defined data type
- EOWNERDEAD
- Owner died
- EPERM
- Operation not permitted
- EPFNOSUPPORT
- Protocol family not supported
- EPIPE
- Broken pipe
- EPROTO
- Protocol error
- EPROTONOSUPPORT
- Protocol not supported
- EPROTOTYPE
- Protocol wrong type for socket
- ERANGE
- Math result not representable
- EREMCHG
- Remote address changed
- EREMOTE
- Object is remote
- EREMOTEIO
- Remote I/O error
- ERESTART
- Interrupted system call should be restarted
- ERFKILL
- Operation not possible due to RF-kill
- EROFS
- Read-only file system
- ESHUTDOWN
- Cannot send after transport endpoint shutdown
- ESOCKTNOSUPPORT
- Socket type not supported
- ESPIPE
- Illegal seek
- ESRCH
- No such process
- ESRMNT
- Srmount error
- ESTALE
- Stale file handle
- ESTRPIPE
- Streams pipe error
- ETIME
- Timer expired
- ETIMEDOUT
- Connection timed out
- ETOOMANYREFS
- Too many references: cannot splice
- ETXTBSY
- Text file busy
- EUCLEAN
- Structure needs cleaning
- EUNATCH
- Protocol driver not attached
- EUSERS
- Too many users
- EWOULDBLOCK
- EXDEV
- Cross-device link
- EXFULL
- Exchange full
- SYS_
ACCEPT - SYS_
ACCEP T4 - SYS_
ACCESS - SYS_
ACCT - SYS_
ADD_ KEY - SYS_
ADJTIMEX - SYS_
AFS_ SYSCALL - SYS_
ALARM - SYS_
ARCH_ PRCTL - SYS_
BIND - SYS_BPF
- SYS_BRK
- SYS_
CACHESTAT - SYS_
CAPGET - SYS_
CAPSET - SYS_
CHDIR - SYS_
CHMOD - SYS_
CHOWN - SYS_
CHROOT - SYS_
CLOCK_ ADJTIME - SYS_
CLOCK_ GETRES - SYS_
CLOCK_ GETTIME - SYS_
CLOCK_ NANOSLEEP - SYS_
CLOCK_ SETTIME - SYS_
CLONE - SYS_
CLON E3 - SYS_
CLOSE - SYS_
CLOSE_ RANGE - SYS_
CONNECT - SYS_
COPY_ FILE_ RANGE - SYS_
CREAT - SYS_
CREATE_ MODULE - SYS_
DELETE_ MODULE - SYS_DUP
- SYS_
DUP2 - SYS_
DUP3 - SYS_
EPOLL_ CREATE - SYS_
EPOLL_ CREAT E1 - SYS_
EPOLL_ CTL - SYS_
EPOLL_ CTL_ OLD - SYS_
EPOLL_ PWAIT - SYS_
EPOLL_ PWAI T2 - SYS_
EPOLL_ WAIT - SYS_
EPOLL_ WAIT_ OLD - SYS_
EVENTFD - SYS_
EVENTF D2 - SYS_
EXECVE - SYS_
EXECVEAT - SYS_
EXIT - SYS_
EXIT_ GROUP - SYS_
FACCESSAT - SYS_
FACCESSA T2 - SYS_
FADVIS E64 - SYS_
FALLOCATE - SYS_
FANOTIFY_ INIT - SYS_
FANOTIFY_ MARK - SYS_
FCHDIR - SYS_
FCHMOD - SYS_
FCHMODAT - SYS_
FCHMODA T2 - SYS_
FCHOWN - SYS_
FCHOWNAT - SYS_
FCNTL - SYS_
FDATASYNC - SYS_
FGETXATTR - SYS_
FINIT_ MODULE - SYS_
FLISTXATTR - SYS_
FLOCK - SYS_
FORK - SYS_
FREMOVEXATTR - SYS_
FSCONFIG - SYS_
FSETXATTR - SYS_
FSMOUNT - SYS_
FSOPEN - SYS_
FSPICK - SYS_
FSTAT - SYS_
FSTATFS - SYS_
FSYNC - SYS_
FTRUNCATE - SYS_
FUTEX - SYS_
FUTEX_ REQUEUE - SYS_
FUTEX_ WAIT - SYS_
FUTEX_ WAITV - SYS_
FUTEX_ WAKE - SYS_
FUTIMESAT - SYS_
GETCPU - SYS_
GETCWD - SYS_
GETDENTS - SYS_
GETDENT S64 - SYS_
GETEGID - SYS_
GETEUID - SYS_
GETGID - SYS_
GETGROUPS - SYS_
GETITIMER - SYS_
GETPEERNAME - SYS_
GETPGID - SYS_
GETPGRP - SYS_
GETPID - SYS_
GETPMSG - SYS_
GETPPID - SYS_
GETPRIORITY - SYS_
GETRANDOM - SYS_
GETRESGID - SYS_
GETRESUID - SYS_
GETRLIMIT - SYS_
GETRUSAGE - SYS_
GETSID - SYS_
GETSOCKNAME - SYS_
GETSOCKOPT - SYS_
GETTID - SYS_
GETTIMEOFDAY - SYS_
GETUID - SYS_
GETXATTR - SYS_
GET_ KERNEL_ SYMS - SYS_
GET_ MEMPOLICY - SYS_
GET_ ROBUST_ LIST - SYS_
GET_ THREAD_ AREA - SYS_
INIT_ MODULE - SYS_
INOTIFY_ ADD_ WATCH - SYS_
INOTIFY_ INIT - SYS_
INOTIFY_ INIT1 - SYS_
INOTIFY_ RM_ WATCH - SYS_
IOCTL - SYS_
IOPERM - SYS_
IOPL - SYS_
IOPRIO_ GET - SYS_
IOPRIO_ SET - SYS_
IO_ CANCEL - SYS_
IO_ DESTROY - SYS_
IO_ GETEVENTS - SYS_
IO_ PGETEVENTS - SYS_
IO_ SETUP - SYS_
IO_ SUBMIT - SYS_
IO_ URING_ ENTER - SYS_
IO_ URING_ REGISTER - SYS_
IO_ URING_ SETUP - SYS_
KCMP - SYS_
KEXEC_ FILE_ LOAD - SYS_
KEXEC_ LOAD - SYS_
KEYCTL - SYS_
KILL - SYS_
LANDLOCK_ ADD_ RULE - SYS_
LANDLOCK_ CREATE_ RULESET - SYS_
LANDLOCK_ RESTRICT_ SELF - SYS_
LCHOWN - SYS_
LGETXATTR - SYS_
LINK - SYS_
LINKAT - SYS_
LISTEN - SYS_
LISTMOUNT - SYS_
LISTXATTR - SYS_
LLISTXATTR - SYS_
LOOKUP_ DCOOKIE - SYS_
LREMOVEXATTR - SYS_
LSEEK - SYS_
LSETXATTR - SYS_
LSM_ GET_ SELF_ ATTR - SYS_
LSM_ LIST_ MODULES - SYS_
LSM_ SET_ SELF_ ATTR - SYS_
LSTAT - SYS_
MADVISE - SYS_
MAP_ SHADOW_ STACK - SYS_
MBIND - SYS_
MEMBARRIER - SYS_
MEMFD_ CREATE - SYS_
MEMFD_ SECRET - SYS_
MIGRATE_ PAGES - SYS_
MINCORE - SYS_
MKDIR - SYS_
MKDIRAT - SYS_
MKNOD - SYS_
MKNODAT - SYS_
MLOCK - SYS_
MLOC K2 - SYS_
MLOCKALL - SYS_
MMAP - SYS_
MODIFY_ LDT - SYS_
MOUNT - SYS_
MOUNT_ SETATTR - SYS_
MOVE_ MOUNT - SYS_
MOVE_ PAGES - SYS_
MPROTECT - SYS_
MQ_ GETSETATTR - SYS_
MQ_ NOTIFY - SYS_
MQ_ OPEN - SYS_
MQ_ TIMEDRECEIVE - SYS_
MQ_ TIMEDSEND - SYS_
MQ_ UNLINK - SYS_
MREMAP - SYS_
MSEAL - SYS_
MSGCTL - SYS_
MSGGET - SYS_
MSGRCV - SYS_
MSGSND - SYS_
MSYNC - SYS_
MUNLOCK - SYS_
MUNLOCKALL - SYS_
MUNMAP - SYS_
NAME_ TO_ HANDLE_ AT - SYS_
NANOSLEEP - SYS_
NEWFSTATAT - SYS_
NFSSERVCTL - SYS_
OPEN - SYS_
OPENAT - SYS_
OPENA T2 - SYS_
OPEN_ BY_ HANDLE_ AT - SYS_
OPEN_ TREE - SYS_
PAUSE - SYS_
PERF_ EVENT_ OPEN - SYS_
PERSONALITY - SYS_
PIDFD_ GETFD - SYS_
PIDFD_ OPEN - SYS_
PIDFD_ SEND_ SIGNAL - SYS_
PIPE - SYS_
PIPE2 - SYS_
PIVOT_ ROOT - SYS_
PKEY_ ALLOC - SYS_
PKEY_ FREE - SYS_
PKEY_ MPROTECT - SYS_
POLL - SYS_
PPOLL - SYS_
PRCTL - SYS_
PREA D64 - SYS_
PREADV - SYS_
PREAD V2 - SYS_
PRLIMI T64 - SYS_
PROCESS_ MADVISE - SYS_
PROCESS_ MRELEASE - SYS_
PROCESS_ VM_ READV - SYS_
PROCESS_ VM_ WRITEV - SYS_
PSELEC T6 - SYS_
PTRACE - SYS_
PUTPMSG - SYS_
PWRIT E64 - SYS_
PWRITEV - SYS_
PWRITE V2 - SYS_
QUERY_ MODULE - SYS_
QUOTACTL - SYS_
QUOTACTL_ FD - SYS_
READ - SYS_
READAHEAD - SYS_
READLINK - SYS_
READLINKAT - SYS_
READV - SYS_
REBOOT - SYS_
RECVFROM - SYS_
RECVMMSG - SYS_
RECVMSG - SYS_
REMAP_ FILE_ PAGES - SYS_
REMOVEXATTR - SYS_
RENAME - SYS_
RENAMEAT - SYS_
RENAMEA T2 - SYS_
REQUEST_ KEY - SYS_
RESTART_ SYSCALL - SYS_
RMDIR - SYS_
RSEQ - SYS_
RT_ SIGACTION - SYS_
RT_ SIGPENDING - SYS_
RT_ SIGPROCMASK - SYS_
RT_ SIGQUEUEINFO - SYS_
RT_ SIGRETURN - SYS_
RT_ SIGSUSPEND - SYS_
RT_ SIGTIMEDWAIT - SYS_
RT_ TGSIGQUEUEINFO - SYS_
SCHED_ GETAFFINITY - SYS_
SCHED_ GETATTR - SYS_
SCHED_ GETPARAM - SYS_
SCHED_ GETSCHEDULER - SYS_
SCHED_ GET_ PRIORITY_ MAX - SYS_
SCHED_ GET_ PRIORITY_ MIN - SYS_
SCHED_ RR_ GET_ INTERVAL - SYS_
SCHED_ SETAFFINITY - SYS_
SCHED_ SETATTR - SYS_
SCHED_ SETPARAM - SYS_
SCHED_ SETSCHEDULER - SYS_
SCHED_ YIELD - SYS_
SECCOMP - SYS_
SECURITY - SYS_
SELECT - SYS_
SEMCTL - SYS_
SEMGET - SYS_
SEMOP - SYS_
SEMTIMEDOP - SYS_
SENDFILE - SYS_
SENDMMSG - SYS_
SENDMSG - SYS_
SENDTO - SYS_
SETDOMAINNAME - SYS_
SETFSGID - SYS_
SETFSUID - SYS_
SETGID - SYS_
SETGROUPS - SYS_
SETHOSTNAME - SYS_
SETITIMER - SYS_
SETNS - SYS_
SETPGID - SYS_
SETPRIORITY - SYS_
SETREGID - SYS_
SETRESGID - SYS_
SETRESUID - SYS_
SETREUID - SYS_
SETRLIMIT - SYS_
SETSID - SYS_
SETSOCKOPT - SYS_
SETTIMEOFDAY - SYS_
SETUID - SYS_
SETXATTR - SYS_
SET_ MEMPOLICY - SYS_
SET_ MEMPOLICY_ HOME_ NODE - SYS_
SET_ ROBUST_ LIST - SYS_
SET_ THREAD_ AREA - SYS_
SET_ TID_ ADDRESS - SYS_
SHMAT - SYS_
SHMCTL - SYS_
SHMDT - SYS_
SHMGET - SYS_
SHUTDOWN - SYS_
SIGALTSTACK - SYS_
SIGNALFD - SYS_
SIGNALF D4 - SYS_
SOCKET - SYS_
SOCKETPAIR - SYS_
SPLICE - SYS_
STAT - SYS_
STATFS - SYS_
STATMOUNT - SYS_
STATX - SYS_
SWAPOFF - SYS_
SWAPON - SYS_
SYMLINK - SYS_
SYMLINKAT - SYS_
SYNC - SYS_
SYNCFS - SYS_
SYNC_ FILE_ RANGE - SYS_
SYSFS - SYS_
SYSINFO - SYS_
SYSLOG - SYS_TEE
- SYS_
TGKILL - SYS_
TIME - SYS_
TIMERFD_ CREATE - SYS_
TIMERFD_ GETTIME - SYS_
TIMERFD_ SETTIME - SYS_
TIMER_ CREATE - SYS_
TIMER_ DELETE - SYS_
TIMER_ GETOVERRUN - SYS_
TIMER_ GETTIME - SYS_
TIMER_ SETTIME - SYS_
TIMES - SYS_
TKILL - SYS_
TRUNCATE - SYS_
TUXCALL - SYS_
UMASK - SYS_
UMOUN T2 - SYS_
UNAME - SYS_
UNLINK - SYS_
UNLINKAT - SYS_
UNSHARE - SYS_
URETPROBE - SYS_
USELIB - SYS_
USERFAULTFD - SYS_
USTAT - SYS_
UTIME - SYS_
UTIMENSAT - SYS_
UTIMES - SYS_
VFORK - SYS_
VHANGUP - SYS_
VMSPLICE - SYS_
VSERVER - SYS_
WAIT4 - SYS_
WAITID - SYS_
WRITE - SYS_
WRITEV - SYS__
SYSCTL
Functions§
- _sysctl⚠
- Read/write system parameters.
- accept⚠
- Accept a connection on a socket.
- accept4⚠
- Accept a connection on a socket.
- access⚠
- Check user’s permission for a file.
- acct⚠
- Switch process accounting.
- add_key⚠
- Add a key to the kernel’s key management facility.
- adjtimex⚠
- Tune kernel clock. Returns clock state on success.
- alarm⚠
- Set an alarm clock for delivery of a signal.
- arch_
prctl ⚠ - Set architecture-specific thread state.
- bind⚠
- Bind a name to a socket.
- bpf⚠
- Perform a command on an extended BPF map or program
- brk⚠
- Change data segment size.
- cachestat⚠
cachestat()
returns the page cache statistics of a file in the bytes range specified byoff
andlen
.- capget⚠
- Get capabilities of thread.
- capset⚠
- Set capabilities of thread.
- chdir⚠
- Change working directory.
- chmod⚠
- Change permissions of a file.
- chown⚠
- Change ownership of a file.
- chroot⚠
- Change the root directory.
- clock_
adjtime ⚠ - Tune kernel clock.
- clock_
getres ⚠ - Get resolution(precision) of the specific clock.
- clock_
gettime ⚠ - Get time of specific clock.
- clock_
nanosleep ⚠ - High resolution sleep with a specific clock.
- clock_
settime ⚠ - Set time of specific clock.
- clone⚠
- Create a child process.
- clone3⚠
- New api to create child process.
- close⚠
- Close a file descriptor.
- close_
range ⚠ - Close all file descriptors in a given range
- connect⚠
- Initialize a connection on a socket.
- copy_
file_ ⚠range - Copy a range of data from one file to another.
- creat⚠
- Create a file.
- delete_
module ⚠ - Unlock a kernel module.
- dup⚠
- Create a copy of the file descriptor
oldfd
, using the lowest available file descriptor. - dup2⚠
- Create a copy of the file descriptor
oldfd
, using the speficified file descriptornewfd
. - dup3⚠
- Save as
dup2()
, but can set the close-on-exec flag onnewfd
. - epoll_
create ⚠ - Open an epoll file descriptor.
- epoll_
create1 ⚠ - Open an epoll file descriptor.
- epoll_
ctl ⚠ - Control interface for an epoll file descriptor.
- epoll_
pwait ⚠ - Wait for an I/O event on an epoll file descriptor.
- epoll_
pwait2 ⚠ - Wait for an I/O event on an epoll file descriptor.
- epoll_
wait ⚠ - Wait for an I/O event on an epoll file descriptor.
- eventfd⚠
- Create a file descriptor for event notification.
- eventfd2⚠
- Create a file descriptor for event notification.
- execve⚠
- Execute a new program.
- execveat⚠
- Execute a new program relative to a directory file descriptor.
- exit⚠
- Terminate current process.
- exit_
group ⚠ - Exit all threads in a process’s thread group.
- faccessat⚠
- Check user’s permission for a file.
- faccessat2⚠
- Check user’s permission for a file.
- fadvise64⚠
- Predeclare an access pattern for file data.
- fallocate⚠
- Manipulate file space.
- fanotify_
init ⚠ - Create and initialize fanotify group.
- fanotify_
mark ⚠ - Add, remove, or modify an fanotify mark on a filesystem object
- fchdir⚠
- Change working directory.
- fchmod⚠
- Change permissions of a file.
- fchmodat⚠
- Change permissions of a file.
- fchmodat2⚠
- Change permissions of a file.
- fchown⚠
- Change ownership of a file.
- fchownat⚠
- Change ownership of a file.
- fcntl⚠
- manipulate file descriptor.
- fdatasync⚠
- Flush all modified in-core data (exclude metadata) refered by
fd
to disk. - fgetxattr⚠
- Get extended attribute value.
- finit_
module ⚠ - Load a kernel module.
- flistxattr⚠
- List extended attribute names.
- flock⚠
- Apply or remove an advisory lock on an open file.
- fork⚠
- Create a child process.
- fremovexattr⚠
- Remove an extended attribute.
- fsconfig⚠
- Set parameters and trigger actions on a context.
- fsetxattr⚠
- Set extended attribute value.
- fsmount⚠
- Create a kernel mount representation for a new, prepared superblock.
- fsopen⚠
- Open a filesystem by name so that it can be configured for mounting.
- fspick⚠
- Pick a superblock into a context for reconfiguration.
- fstat⚠
- Get file status about a file descriptor.
- fstatfs⚠
- Get filesystem statistics.
- fsync⚠
- Flush all modified in-core data refered by
fd
to disk. - ftruncate⚠
- Truncate an opened file to a specified length.
- futex⚠
- Fast user-space locking.
- futex_
requeue ⚠ - Requeue a waiter from one futex to another.
- futex_
wait ⚠ - Wait on a futex.
- futex_
waitv ⚠ - Wait on a list of futexes.
- futex_
wake ⚠ - Wake a number of futexes.
- futimesat⚠
- Change timestamp of a file relative to a directory file discriptor.
- get_
mempolicy ⚠ - Retrieve NUMA memory policy for a thread
- get_
robust_ ⚠list - Get the robust-futex list head of a task.
- get_
thread_ ⚠area - Get thread-local storage information.
- getcpu⚠
- Determine CPU and NUMA node on which the calling thread is running.
- getcwd⚠
- Get current working directory.
- getdents⚠
- Get directory entries.
- getdents64⚠
- Get directory entries.
- getegid⚠
- Get the effective group ID of the calling process.
- geteuid⚠
- Get the effective user ID of the calling process.
- getgid⚠
- Get the real group ID of the calling process.
- getgroups⚠
- Get list of supplementary group Ids.
- getitimer⚠
- Get value of an interval timer.
- getpeername⚠
- Get name of connected peer socket.
- getpgid⚠
- Returns the PGID(process group ID) of the process specified by
pid
. - getpgrp⚠
- Get the process group ID of the calling process.
- getpid⚠
- Get the process ID (PID) of the calling process.
- getppid⚠
- Get the process ID of the parent of the calling process.
- getpriority⚠
- Get program scheduling priority.
- getrandom⚠
- Obtain a series of random bytes.
- getresgid⚠
- Get real, effect and saved group ID.
- getresuid⚠
- Get real, effect and saved user ID.
- getrlimit⚠
- Get resource limit.
- getrusage⚠
- Get resource usage.
- getsid⚠
- Get session Id.
- getsockname⚠
- Get current address to which the socket
sockfd
is bound. - getsockopt⚠
- Get options on sockets
- gettid⚠
- Get the caller’s thread ID (TID).
- gettimeofday⚠
- Get time.
- getuid⚠
- Get the real user ID of the calling process.
- getxattr⚠
- Get extended attribute value.
- init_
module ⚠ - Load a kernel module.
- inotify_
add_ ⚠watch - Add a watch to an initialized inotify instance.
- inotify_
init ⚠ - Initialize an inotify instance.
- inotify_
init1 ⚠ - Initialize an inotify instance.
- inotify_
rm_ ⚠watch - Remove an existing watch from an inotify instance.
- io_
cancel ⚠ - Attempts to cancel an iocb previously passed to
io_submit
. - io_
destroy ⚠ - Destroy the
aio_context
specified. - io_
getevents ⚠ - Attempts to read at least
min_nr
events and up to nr events from the completion queue for theaio_context
specified byctx_id
. - io_
pgetevents ⚠ - Read asynchronous I/O events from the completion queue
- io_
setup ⚠ - Create an asynchronous I/O context.
- io_
submit ⚠ - Queue the nr iocbs pointed to by
iocb
for processing. - io_
uring_ ⚠enter - Initiate and/or complete asynchronous I/O
- io_
uring_ ⚠register - Register files or user buffers for asynchronous I/O
- io_
uring_ ⚠setup - Setup a context for performing asynchronous I/O.
- ioctl⚠
- Control device.
- ioperm⚠
- Set port input/output permissions.
- iopl⚠
- Change I/O privilege level.
- ioprio_
get ⚠ - Get I/O scheduling class and priority.
- ioprio_
set ⚠ - Set I/O scheduling class and priority.
- kcmp⚠
- Compare two processes to determine if they share a kernel resource.
- kexec_
file_ ⚠load - Load a new kernel for later execution.
- kexec_
load ⚠ - Load a new kernel for later execution.
- keyctl⚠
- Manipulate the kernel’s key management facility.
- kill⚠
- Send signal to a process.
- lchown⚠
- Change ownership of a file. Does not deference symbolic link.
- lgetxattr⚠
- Get extended attribute value.
- link⚠
- Make a new name for a file.
- linkat⚠
- Make a new name for a file.
- listen⚠
- Listen for connections on a socket.
- listmount⚠
- listxattr⚠
- List extended attribute names.
- llistxattr⚠
- List extended attribute names.
- lookup_
dcookie ⚠ - Return a directory entry’s path.
- lremovexattr⚠
- Remove an extended attribute.
- lseek⚠
- Reposition file offset.
- lsetxattr⚠
- Set extended attribute value.
- lstat⚠
- Get file status about a file, without following symbolic.
- madvise⚠
- Give advice about use of memory.
- map_
shadow_ ⚠stack - mbind⚠
- Set memory policy for a memory range.
- membarrier⚠
- Issue memory barriers on a set of threads.
- memfd_
create ⚠ - Create an anonymous file.
- memfd_
secret ⚠ - create an anonymous RAM-based file to access secret memory regions.
- migrate_
pages ⚠ - Move all pages in a process to another set of nodes
- mincore⚠
mincore()
returns the memory residency status of the pages in the current process’s address space specified by[addr, addr + len)
.- mkdir⚠
- Create a directory.
- mkdirat⚠
- Create a directory.
- mknod⚠
- Create a special or ordinary file.
- mknodat⚠
- Create a special or ordinary file.
- mlock⚠
- Lock memory.
- mlock2⚠
- Lock memory.
- mlockall⚠
- Lock memory.
- mmap⚠
- Map files or devices into memory.
- mount⚠
- Mount filesystem.
- move_
mount ⚠ - Move a mount from one place to another.
- move_
pages ⚠ - Move individual pages of a process to another node
- mprotect⚠
- Set protection on a region of memory.
- mq_
getsetattr ⚠ - Get/set message queue attributes
- mq_
notify ⚠ - Register for notification when a message is available
- mq_open⚠
- Open a POSIX message queue.
- mq_
timedreceive ⚠ - Receive a message from a message queue
- mq_
timedsend ⚠ - Send message to a message queue.
- mq_
unlink ⚠ - Remove a message queue.
- mremap⚠
- Remap a virtual memory address
- mseal⚠
- Seals the VM’s metadata from selected syscalls.
- msgctl⚠
- System V message control operations.
- msgget⚠
- Get a System V message queue identifier.
- msgrcv⚠
- Receive messages from a System V message queue.
- msgsnd⚠
- Append the message to a System V message queue.
- msync⚠
- Synchronize a file with memory map.
- munlock⚠
- Unlock memory.
- munlockall⚠
- Unlock memory.
- munmap⚠
- Unmap files or devices from memory.
- name_
to_ ⚠handle_ at - Obtain handle for a filename
- nanosleep⚠
- High resolution sleep.
- new_
sigaction - newfstatat⚠
- Get file status.
- open⚠
- Open and possibly create a file.
- open_
by_ ⚠handle_ at - Obtain handle for an open file
- open_
tree ⚠ - openat⚠
- Open and possibly create a file within a directory.
- openat2⚠
- Open and possibly create a file (extended)
- pause⚠
- Pause the calling process to sleep until a signal is delivered.
- perf_
event_ ⚠open - Set up performance monitoring.
- personality⚠
- Set the process execution domain.
- pidfd_
getfd ⚠ - Obtain a duplicate of another process’s file descriptor.
- pidfd_
open ⚠ - Obtain a file descriptor that refers to a process.
- pidfd_
send_ ⚠signal - Signal a process through a pidfd.
- pipe⚠
- Create a pipe.
- pipe2⚠
- Create a pipe.
- pivot_
root ⚠ - Change the root filesystem.
- pkey_
alloc ⚠ - Create a new protection key.
- pkey_
free ⚠ - Free a protection key.
- pkey_
mprotect ⚠ - Set protection on a region of memory.
- poll⚠
- Wait for some event on file descriptors.
- ppoll⚠
- Wait for some event on a file descriptor.
- prctl⚠
- Operations on a process.
- pread64⚠
- Read from a file descriptor without changing file offset.
- preadv⚠
- Read from a file descriptor without changing file offset.
- preadv2⚠
- Read from a file descriptor without changing file offset.
- prlimit64⚠
- Get/set the resource limits of an arbitary process.
- process_
vm_ ⚠readv - Transfer data between process address spaces
- process_
vm_ ⚠writev - Transfer data between process address spaces
- pselect6⚠
- Sychronous I/O multiplexing.
- ptrace⚠
- Process trace.
- pwrite64⚠
- Write to a file descriptor without changing file offset.
- pwritev⚠
- Write to a file descriptor without changing file offset.
- pwritev2⚠
- Write to a file descriptor without changing file offset.
- quotactl⚠
- Manipulate disk quotes.
- quotactl_
fd ⚠ - Manipulate disk quotes.
- read⚠
- Read from a file descriptor.
- readahead⚠
- Initialize file head into page cache.
- readlink⚠
- Read value of a symbolic link.
- readlinkat⚠
- Read value of a symbolic link.
- readv⚠
- Read from a file descriptor into multiple buffers.
- reboot⚠
- Reboot or enable/disable Ctrl-Alt-Del.
- recvfrom⚠
- Receive a message from a socket.
- recvmmsg⚠
- Receives multile messages on a socket
- recvmsg⚠
- Receive a msg from a socket.
- remap_
file_ ⚠pages - Create a nonlinear file mapping.
- removexattr⚠
- Remove an extended attribute.
- rename⚠
- Change name or location of a file.
- renameat⚠
- Change name or location of a file.
- renameat2⚠
- Change name or location of a file.
- request_
key ⚠ - Request a key from kernel’s key management facility.
- restart_
syscall ⚠ - Restart a system call after interruption by a stop signal.
- rmdir⚠
- Delete a directory.
- rseq⚠
- Setup restartable sequences for caller thread.
- rt_
sigaction ⚠ - Examine and change a signal action.
- rt_
sigpending ⚠ - Examine pending signals.
- rt_
sigprocmask ⚠ - Change the list of currently blocked signals.
- rt_
sigqueueinfo ⚠ - Queue a signal and data.
- rt_
sigreturn ⚠ - Return from signal handler and cleanup stack frame.
- rt_
sigsuspend ⚠ - Wait for a signal.
- rt_
sigtimedwait ⚠ - Synchronously wait for queued signals.
- rt_
tgsigqueueinfo ⚠ - Queue a signal and data.
- sched_
get_ ⚠priority_ max - Get static priority max value.
- sched_
get_ ⚠priority_ min - Get static priority min value.
- sched_
getaffinity ⚠ - Get a thread’s CPU affinity mask.
- sched_
getattr ⚠ - Get scheduling policy and attributes
- sched_
getparam ⚠ - Get scheduling paramters.
- sched_
getscheduler ⚠ - Get scheduling parameter.
- sched_
rr_ ⚠get_ interval - Get the
SCHED_RR
interval for the named process. - sched_
setaffinity ⚠ - Set a thread’s CPU affinity mask.
- sched_
setattr ⚠ - Set the RT priority of a thread.
- sched_
setparam ⚠ - Set scheduling paramters.
- sched_
setscheduler ⚠ - Set scheduling parameter.
- sched_
yield ⚠ - Yield the processor.
- seccomp⚠
- Operate on Secure Computing state of the process.
- select⚠
- Sychronous I/O multiplexing.
- semctl⚠
- System V semaphore control operations
- semget⚠
- Get a System V semphore set identifier.
- semop⚠
- System V semphore operations.
- semtimedop⚠
- System V semaphore operations
- sendfile⚠
- Transfer data between two file descriptors.
- sendmmsg⚠
- Send multiple messages on a socket
- sendmsg⚠
- Send a message on a socket.
- sendto⚠
- Send a message on a socket.
- set_
mempolicy ⚠ - Set default NUMA memory policy for a thread and its children
- set_
mempolicy_ ⚠home_ node - set_
robust_ ⚠list - Set the robust-futex list head of a task.
- set_
thread_ ⚠area - Set thread-local storage information.
- set_
tid_ ⚠address - Set pointer to thread ID.
- setdomainname⚠
- Set NIS domain name.
- setfsgid⚠
- Set group identify used for filesystem checkes.
- setfsuid⚠
- Set user identify used for filesystem checkes.
- setgid⚠
- Set the group ID of the calling process to
gid
. - setgroups⚠
- Set list of supplementary group Ids.
- sethostname⚠
- Set hostname.
- setitimer⚠
- Set value of an interval timer.
- setns⚠
- Reassociate thread with a namespace.
- setpgid⚠
- Set the process group ID (PGID) of the process specified by
pid
topgid
. - setpriority⚠
- Set program scheduling priority.
- setregid⚠
- Set real and effective group IDs of the calling process.
- setresgid⚠
- Set real, effective and saved group Ids of the calling process.
- setresuid⚠
- Set real, effective and saved user Ids of the calling process.
- setreuid⚠
- Set real and effective user IDs of the calling process.
- setrlimit⚠
- Set resource limit.
- setsid⚠
- Create a new session if the calling process is not a process group leader.
- setsockopt⚠
- Set options on sockets.
- settimeofday⚠
- Set system time and timezone.
- setuid⚠
- Set user ID of the calling process to
uid
. - setxattr⚠
- Set extended attribute value.
- shmat⚠
- Attach the System V shared memory segment.
- shmctl⚠
- System V shared memory control.
- shmdt⚠
- Detach the System V shared memory segment.
- shmget⚠
- Allocates a System V shared memory segment.
- shutdown⚠
- Shutdown part of a full-duplex connection.
- sigaltstack⚠
- Get/set signal stack context.
- signalfd⚠
- Create a file descriptor to accept signals.
- signalfd4⚠
- Create a file descriptor to accept signals.
- socket⚠
- Create an endpoint for communication.
- socketpair⚠
- Create a pair of connected socket.
- splice⚠
- Splice data to/from pipe.
- stat⚠
- Get file status about a file.
- statfs⚠
- Get filesystem statistics.
- statmount⚠
- statx⚠
- Get file status about a file (extended).
- strerror
- Get errno description.
- swapoff⚠
- Stop swapping to file/device.
- swapon⚠
- Start swapping to file/device.
- symlink⚠
- Make a new name for a file.
- symlinkat⚠
- Make a new name for a file.
- sync⚠
- Commit filesystem caches to disk.
- sync_
file_ ⚠range - Sync a file segment to disk
- syncfs⚠
- Commit filesystem cache related to
fd
to disk. - sysfs⚠
- Get filesystem type information.
- sysinfo⚠
- Return system information.
- syslog⚠
- Read and/or clear kernel message ring buffer.
- tee⚠
- Duplicate pipe content.
- tgkill⚠
- Send a signal to a thread.
- time⚠
- Get time in seconds.
- timer_
create ⚠ - Create a per-process timer
- timer_
delete ⚠ - Delete a per-process timer
- timer_
getoverrun ⚠ - Get overrun count for a per-process timer.
- timer_
gettime ⚠ - Fetch state of per-process timer>
- timer_
settime ⚠ - Arm/disarm state of per-process timer.
- timerfd_
create ⚠ - Create a timer that notifies via a file descriptor.
- timerfd_
gettime ⚠ - Get current timer via a file descriptor.
- timerfd_
settime ⚠ - Set current timer via a file descriptor.
- times⚠
- Get process times.
- tkill⚠
- Send a signal to a thread (obsolete).
- truncate⚠
- Truncate a file to a specified length.
- umask⚠
- Set file mode creation mask.
- umount2⚠
- Unmount filesystem.
- uname⚠
- Get name and information about current kernel.
- unlink⚠
- Delete a name and possibly the file it refers to.
- unlinkat⚠
- Delete a name and possibly the file it refers to.
- unshare⚠
- Disassociate parts of the process execution context
- uselib⚠
- Load shared library.
- userfaultfd⚠
- Create a file descriptor to handle page faults in user space.
- ustat⚠
- Get filesystem statistics
- utime⚠
- Change file last access and modification time.
- utimensat⚠
- Change time timestamps with nanosecond precision.
- utimes⚠
- Change file last access and modification time.
- vfork⚠
- Create a child process and wait until it is terminated.
- vhangup⚠
- Virtually hang up the current terminal.
- vmsplice⚠
- Splice user page into a pipe.
- wait4⚠
- Wait for process to change state.
- waitid⚠
- Wait for process to change state.
- write⚠
- Write to a file descriptor.
- writev⚠
- Write to a file descriptor from multiple buffers.