The set of all system calls implemented by the operating system is the application programming interface (API ). Is the interface between applications and systems. Linux system calls include most common system calls and functions derived from system calls. I. Process Control: fork create a new process clone create sub-process execve run Executable File exit stop process _ exit stop the current process immediately getdtablesize the maximum number of files that can be opened by the process getpgid get the specified process group ID setpgid set specified process group flag number getpgrp get current process group ID setpgrp set current process group flag number getpid get process ID getppid get parent process ID getpriority get scheduling priority setpriority set Scheduling priority modify_ldt local description table of the read/write process nanosleep enables the process to sleep at the specified time nice changes the priority of the time-based process pause to suspend the process, wait for the signal personality to set the process running domain prctl to perform specific operations on the process ptrace Process Tracking worker get the maximum static priority sched_get_priority_min get the lower limit sched_getparam get the scheduling parameter sched_getscheduler of the process get the scheduling the sched_rr_get_interval policy gets the time slice length of the real-time process scheduled by the RR algorithm sched_setparam sets the scheduling parameter sched_setsched.pdf of the process to set the scheduling policy and parameter sched_yield of the specified process to take the initiative, create a sub-process for the vfork at the end of the scheduling queue to run new programs, usually use wait to wait for the sub-process to terminate wait3 see Wait waitpid wait for the sub-process to terminate wait4 see waitpid capget get process permission capset process permission getsid get meeting ID setsid set meeting ID no.
Ii. File System Control
1. file read/write operation fcntl file control open file creat create new file close file description word read file write Write File readv read data from file into buffer array writev will buffer Array write Data to the file pread random read to the file pwrite random write to the file lseek move the file pointer _ llseek in the 64-bit address space move the file pointer DUP copy the opened file description word dup2 according to the specified conditional copy file description flock file Add/unlock poll I/o multi-channel conversion truncate truncated file ftruncate see truncate umask set File Permission mask fsync write part of the file in memory back to disk
2. File System Operation access determine file accessibility chdir change current working directory fchdir see chdir chmod change file mode fchmod see chmod chown change file owner or user group fchown see chown lchown see chown chroot change root directory stat get File status information lstat see stat fstat see stat statfs get File System Information fstatfs see statfs readdir read directory item getdents read directory item mkdir create directory mknod create index node rmdir delete directory rename file rename link create link symlink Create Symbolic Link unlink Delete link readlink read symbolic link value mount Mount File System umount unload File System ustat get File System Information utime change file access Modification for more information about time utimes, see utime quotactl to control disk quotas.
Iii. System Control ioctl I/O total control function _ sysctl read/write system parameter Acct enable or disable process accounting getrlimit to get system resource upper limit setrlimit set system resource upper limit getrusage to get system resource usage uselib select the binary function library ioperm to be used to set port I/O permissions iopl change process I/o permission level outb low-level port operation reboot restart Swapon open swap file and device swapoff disable swap file and the device bdflush controls the bdflush daemon sysfs to obtain the file system type sysinfo supported by the core. Obtain the system information. adjtimex adjusts the system clock. alarm sets the process's alarm clock getitimer to get the timer value. setitimer sets the timer value get settimeofday set time and time zone stime set system date and time get system time times get process run time uname get current UNIX system name, version and host information vhangup suspend current terminal nfsservctl to NFS the daemon controls vm86 and enters the simulation 8086 mode. create_module creates a module item that can be loaded. delete_module deletes the module item that can be loaded. init_module initializes the module query_module and queries the module information. * get_kernel_syms obtains the core symbol, it has been replaced by query_module
4. Memory Management BRK changes data segment space allocation sbrk refer to BRK mlock Memory Page locking munlock Memory Page unlocking mlockall call process all memory page locking munlockall call process all memory page unlocking MMAP Virtual Memory Page munmap removes Memory Page ing mremap re virtual memory address msync writes data in the ing memory back to disk mprotect set memory image protection getpagesize get page size sync writes memory buffer data back to hard disk cacheflush write content back to disk
5. Network Management getdomainname get domain name setdomainname set domain name gethostid get host ID sethostid set host ID gethostname get host name sethostname set Host Name
6. Socket control socketcall Socket System Call socket establish socket bind socket to port connect remote host accept response socket connection request send message sendto send UDP message sendmsg refer to send Recv through socket receiving information recvfrom receiving UDP information recvmsg see Recv listen listening socket port select round-robin shutdown for multiple synchronous I/o close connection on socket getsockname get local socket name getpeername get communication peer socket name getsockopt get port set setsockopt set port parameter sendfile data transmission between files or ports socketpair create a pair of connected anonymous socket
7. User Management getuid get user ID setuid Set User ID getgid get group ID setgid set group ID getegid get valid group ID setegid set valid group ID geteuid get valid user ID number seteuid set valid user ID setregid set true and valid group ID setreuid set true and valid user ID getresgid respectively to obtain true, the valid and saved group ID setresgid are set to true, and the valid and saved group ID getresuid are obtained respectively, set valid and saved user ID setresuid to true, valid and saved user ID: setfsgid set the group ID used for file system check setfsuid set the user ID used for file system check getgroups get after population group flag list setgroups set after population group flag list
VIII. inter-process communication IPC inter-process communication control call
1. Signal sigaction setting the processing method for the specified signal sigprocmask execute blocking/unblocking operations on the signal set in the signal set according to the parameters sigpending for the specified blocked signal set the queue sigsuspend pending process to wait for a specific for signal, see signal kill to send a signal to a process or process group * sigblock to add a signal to the blocked signal mask, sigprocmask has replaced * siggetmask to obtain the existing blocking signal mask, and sigprocmask has replaced * sigsetmask with the given signal mask to replace the existing blocking signal mask, sigprocmask has replaced * sigmask to convert the given signal into a mask, and sigprocmask has replaced * sigpause as sigsuspend. sigsuspend has replaced sigvec as a signal processing function compatible with BSD, function similar to sigaction ssetmaskansi C signal processing function, function similar to sigaction
2. Message Queue msgctl message control operation msgget get message queue msgsnd send message msgrcv get message
3. Pipeline Pipe
4. semaphores semctl semaphores control semget to obtain a set of semaphores semop semaphores
5. Shared Memory shmctl control shared memory shmget get shared memory shmat connection shared memory shmdt remove share inside
For details, see UNIX advanced programming and UNIX Network Programming volumes 1 and 2.
The set of all system calls implemented by the operating system is the application programming interface (API ). Is the interface between applications and systems. Linux system calls include most common system calls and functions derived from system calls. I. Process Control: fork create a new process clone create sub-process execve run Executable File exit stop process _ exit stop the current process immediately getdtablesize the maximum number of files that can be opened by the process getpgid get the specified process group ID setpgid set specified process group flag number getpgrp get current process group ID setpgrp set current process group flag number getpid get process ID getppid get parent process ID getpriority get scheduling priority setpriority set Scheduling priority modify_ldt local description table of the read/write process nanosleep enables the process to sleep at the specified time nice changes the priority of the time-based process pause to suspend the process, wait for the signal personality to set the process running domain prctl to perform specific operations on the process ptrace Process Tracking worker get the maximum static priority sched_get_priority_min get the lower limit sched_getparam get the scheduling parameter sched_getscheduler of the process get the scheduling the sched_rr_get_interval policy gets the time slice length of the real-time process scheduled by the RR algorithm sched_setparam sets the scheduling parameter sched_setsched.pdf of the process to set the scheduling policy and parameter sched_yield of the specified process to take the initiative, create a sub-process for the vfork at the end of the scheduling queue to run new programs, usually use wait to wait for the sub-process to terminate wait3 see Wait waitpid wait for the sub-process to terminate wait4 see waitpid capget get process permission capset process permission getsid get meeting ID setsid set meeting ID no.
Ii. File System Control
1. file read/write operation fcntl file control open file creat create new file close file description word read file write Write File readv read data from file into buffer array writev will buffer Array write Data to the file pread random read to the file pwrite random write to the file lseek move the file pointer _ llseek in the 64-bit address space move the file pointer DUP copy the opened file description word dup2 according to the specified conditional copy file description flock file Add/unlock poll I/o multi-channel conversion truncate truncated file ftruncate see truncate umask set File Permission mask fsync write part of the file in memory back to disk
2. File System Operation access determine file accessibility chdir change current working directory fchdir see chdir chmod change file mode fchmod see chmod chown change file owner or user group fchown see chown lchown see chown chroot change root directory stat get File status information lstat see stat fstat see stat statfs get File System Information fstatfs see statfs readdir read directory item getdents read directory item mkdir create directory mknod create index node rmdir delete directory rename file rename link create link symlink Create Symbolic Link unlink Delete link readlink read symbolic link value mount Mount File System umount unload File System ustat get File System Information utime change file access Modification for more information about time utimes, see utime quotactl to control disk quotas.
Iii. System Control ioctl I/O total control function _ sysctl read/write system parameter Acct enable or disable process accounting getrlimit to get system resource upper limit setrlimit set system resource upper limit getrusage to get system resource usage uselib select the binary function library ioperm to be used to set port I/O permissions iopl change process I/o permission level outb low-level port operation reboot restart Swapon open swap file and device swapoff disable swap file and the device bdflush controls the bdflush daemon sysfs to obtain the file system type sysinfo supported by the core. Obtain the system information. adjtimex adjusts the system clock. alarm sets the process's alarm clock getitimer to get the timer value. setitimer sets the timer value get settimeofday set time and time zone stime set system date and time get system time times get process run time uname get current UNIX system name, version and host information vhangup suspend current terminal nfsservctl to NFS the daemon controls vm86 and enters the simulation 8086 mode. create_module creates a module item that can be loaded. delete_module deletes the module item that can be loaded. init_module initializes the module query_module and queries the module information. * get_kernel_syms obtains the core symbol, it has been replaced by query_module
4. Memory Management BRK changes data segment space allocation sbrk refer to BRK mlock Memory Page locking munlock Memory Page unlocking mlockall call process all memory page locking munlockall call process all memory page unlocking MMAP Virtual Memory Page munmap removes Memory Page ing mremap re virtual memory address msync writes data in the ing memory back to disk mprotect set memory image protection getpagesize get page size sync writes memory buffer data back to hard disk cacheflush write content back to disk
5. Network Management getdomainname get domain name setdomainname set domain name gethostid get host ID sethostid set host ID gethostname get host name sethostname set Host Name
6. Socket control socketcall Socket System Call socket establish socket bind socket to port connect remote host accept response socket connection request send message sendto send UDP message sendmsg refer to send Recv through socket receiving information recvfrom receiving UDP information recvmsg see Recv listen listening socket port select round-robin shutdown for multiple synchronous I/o close connection on socket getsockname get local socket name getpeername get communication peer socket name getsockopt get port set setsockopt set port parameter sendfile data transmission between files or ports socketpair create a pair of connected anonymous socket
7. User Management getuid get user ID setuid Set User ID getgid get group ID setgid set group ID getegid get valid group ID setegid set valid group ID geteuid get valid user ID number seteuid set valid user ID setregid set true and valid group ID setreuid set true and valid user ID getresgid respectively to obtain true, the valid and saved group ID setresgid are set to true, and the valid and saved group ID getresuid are obtained respectively, set valid and saved user ID setresuid to true, valid and saved user ID: setfsgid set the group ID used for file system check setfsuid set the user ID used for file system check getgroups get after population group flag list setgroups set after population group flag list
VIII. inter-process communication IPC inter-process communication control call
1. Signal sigaction setting the processing method for the specified signal sigprocmask execute blocking/unblocking operations on the signal set in the signal set according to the parameters sigpending for the specified blocked signal set the queue sigsuspend pending process to wait for a specific for signal, see signal kill to send a signal to a process or process group * sigblock to add a signal to the blocked signal mask, sigprocmask has replaced * siggetmask to obtain the existing blocking signal mask, and sigprocmask has replaced * sigsetmask with the given signal mask to replace the existing blocking signal mask, sigprocmask has replaced * sigmask to convert the given signal into a mask, and sigprocmask has replaced * sigpause as sigsuspend. sigsuspend has replaced sigvec as a signal processing function compatible with BSD, function similar to sigaction ssetmaskansi C signal processing function, function similar to sigaction
2. Message Queue msgctl message control operation msgget get message queue msgsnd send message msgrcv get message
3. Pipeline Pipe
4. semaphores semctl semaphores control semget to obtain a set of semaphores semop semaphores
5. Shared Memory shmctl control shared memory shmget get shared memory shmat connection shared memory shmdt remove share inside
For details, see UNIX advanced programming and UNIX Network Programming volumes 1 and 2.