Linux-specific
или за что вас будут ненавидеть пользователи *BSD и Solaris, когда будут портировать ваш код
- API:
- Дополнительные возможности
Управление памятью
mbind \- set memory policy for a memory range mremap \- remap a virtual memory address remap_file_pages \- create a nonlinear file mapping
Управление процессами
clone, __clone2 \- create a child process prlimit \- get/set resource limits ioprio_get, ioprio_set \- get/set I/O scheduling class and priority personality \- set the process execution domain prctl \- operations on a process sched_setaffinity, sched_getaffinity \- \ sched_setscheduler, sched_getscheduler \-
Неймспейсы
setns \- reassociate thread with a namespace
Треды
exit_group \- exit all threads in a process get_thread_area \- get a thread-local storage (TLS) area gettid \- get thread identification set_thread_area \- set a thread local storage (TLS) area set_tid_address \- set pointer to thread ID tkill, tgkill \- send a signal to a thread
epoll
epoll_create, epoll_create1 \- open an epoll file descriptor epoll_ctl \- control interface for an epoll descriptor epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor
aio
extended attributes
getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value listxattr, llistxattr, flistxattr \- list extended attribute names removexattr, lremovexattr, fremovexattr \- remove an extended attribute setxattr, lsetxattr, fsetxattr \- set an extended attribute value
numa
get_mempolicy \- retrieve NUMA memory policy for a process getcpu \- determine CPU and NUMA node on which the calling thread is running migrate_pages \- move all pages in a process to another set of nodes move_pages \- move individual pages of a process to another node set_mempolicy \- set default NUMA memory policy for a process and its children
dnotify/inotify
fcntl \- manipulate file descriptor (F_GETOWN_EX, F_SETOWN_EX, F_SETPIPE_SZ, F_GETPIPE_SZ, F_GETSIG, F_SETSIG, F_NOTIFY, F_GETLEASE, F_SETLEASE) inotify_add_watch \- add a watch to an initialized inotify instance inotify_init, inotify_init1 \- initialize an inotify instance inotify_rm_watch \- remove an existing watch from an inotify instance
capabilities
capget, capset \- set/get capabilities of thread(s)
futex
futex \- fast user-space locking
Костыли
adjtimex \- tune kernel clock bdflush \- start, flush, or tune buffer-dirty-flush daemon idle - make process 0 idle (legacy) ioperm \- set port input/output permissions (obscure) iopl \- change I/O privilege level (obscure) ipc \- System V IPC system calls kexec_load \- load a new kernel for later execution lookup_dcookie \- return a directory entry's path (obscure) mount \- mount file system nfsservctl \- syscall interface to kernel nfs daemon pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information handling readahead \- perform file readahead into page cache readdir \- read directory entry (legacy) reboot \- reboot or enable/disable Ctrl-Alt-Del sendfile \- transfer data between file descriptors setup \- setup devices and file systems, mount root file system (obscure) swapon, swapoff \- start/stop swapping to file/device sync, syncfs \- commit buffer cache to disk sync_file_range \- sync a file segment with disk sysctl \- read/write system parameters sysinfo \- returns information on overall system statistics umount, umount2 \- unmount file system
Управление модулями
create_module \- create a loadable module entry delete_module \- unload a kernel module get_kernel_syms \- retrieve exported kernel and module symbols init_module \- load a kernel module query_module \- query the kernel for various bits pertaining to modules
Security
pivot_root \- change the root file system setfsgid \- set group identity used for file system checks setfsuid \- set user identity used for file system checks unshare \- disassociate parts of the process execution context
Расширение POSIX
dup3 \- duplicate a file descriptor eventfd \- create a file descriptor for event notification fallocate \- manipulate file space (есть posix_fallocate) fcntl \- manipulate file descriptor (F_GETOWN_EX, F_SETOWN_EX, F_SETPIPE_SZ, F_GETPIPE_SZ, F_GETSIG, F_SETSIG, F_NOTIFY, F_GETLEASE, F_SETLEASE) getrusage \- get resource usage (потребление потока) _llseek \- reposition read/write file offset (legac5) madvise \- give advice about use of memory (posix_madvise) mmap2 \- map files or devices into memory msgctl \- message control operations (IPC_INFO, MSG_INFO, MSG_STAT) pipe2 \- create pipe ppoll \- wait for some event on a file descriptor rt_sigqueueinfo, rt_tgsigqueueinfo \- queue a signal and data pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- semctl \- semaphore control operations (IPC_INFO, SEM_INFO, SEM_STAT) recvmmsg sendmmsg signalfd \- create a file descriptor for accepting signals shmctl \- shared memory control (IPC_INFO, SHN_INFO, SHM_STAT, SHM_LOCK/SHM_UNLOCK) splice \- splice data to/from a pipe statfs, fstatfs \- get file system statistics tee \- duplicating pipe content timer_create \- create a POSIX per-process timer timerfd_create, timerfd_settime, timerfd_gettime \- uselib \- load shared library vhangup \- virtually hangup the current tty vmsplice \- splice user pages into a pipe
aio
io_cancel \- cancel an outstanding asynchronous I/O operation io_destroy \- destroy an asynchronous I/O context io_getevents \- read asynchronous I/O events from the completion queue io_setup \- create an asynchronous I/O context io_submit \- submit asynchronous I/O blocks for processing
personality
personality \- set the process execution domain
Platform-specific особенности
alloc_hugepages (obscure, x86-64 only) arch_prctl - set architecture-specific thread state (obscure, x86-64 only) cacheflush \- flush contents of instruction and/or data cache (obscure, MIPS only) modify_ldt \- get or set ldt (obscure, x86 only) spu_create \- create a new spu context (obscure, ppc only) spu_run \- execute an SPU context (obscure, ppc only) subpage_prot \- define a subpage protection for an address range (ppc only) vm86 (obscure, x86 only)
- Дополнительные возможности
- procfs, sysfs, configfs
- selinux
- pam
- limits, cgroups
- bash
- GNU extensions
- glibc
- ld: переменные окружения
- feature test macros
procfs
- Специфичен для ряда UNIX-like систем, следует идее "всё есть файл"
- Для linux специфично активное использование procfs не только для получения информации о процессах
- Это не в последнюю очередь связано с простотой добавления подобной поддержки в ядерные модули и универсальное удобство (как следствие, востребованность) файлового интерфейса
accept \- accept a connection on a socket add_key \- add a key to the kernel's key management facility alloc_hugepages, free_hugepages \- allocate or free huge pages arch_prctl \- set architecture-specific thread state bind \- bind a name to a socket connect \- initiate a connection on a socket futimesat \- change timestamps of a file relative to a \ getcontext, setcontext \- get or set the user context getpeername \- get name of connected peer socket getpriority, setpriority \- get/set program scheduling priority getsockname \- get socket name getsockopt, setsockopt \- get and set options on sockets intro \- introduction to system calls ioctl \- control device killpg \- send signal to a process group link \- make a new name for a file listen \- listen for connections on a socket lseek \- reposition read/write file offset nanosleep \- high-resolution sleep outb, outw, outl, outsb, outsw, outsl, posix_fadvise \- predeclare an access pattern for file data ptrace \- process trace quotactl \- manipulate disk quotas readlink \- read value of a symbolic link request_key \- request a key from the kernel's key management facility setpgid, getpgid, setpgrp, getpgrp \- set/get process group setreuid, setregid \- set real and/or effective user or group ID shmget \- allocates a shared memory segment shutdown \- shut down part of a full-duplex connection sigreturn \- return from signal handler and cleanup stack frame sigwaitinfo, sigtimedwait \- synchronously wait for queued signals socketcall \- socket system calls socketpair \- create a pair of connected sockets stat, fstat, lstat \- get file status syscall \- indirect system call syscalls \- Linux system calls truncate, ftruncate \- truncate a file to a specified length utime, utimes \- change file last access and modification times utimensat, futimens \- change file timestamps with nanosecond precision wait3, wait4 \- wait for process to change state, BSD style