Linux call list

Source: Internet
Author: User

The following is a list of Linux system calls, including most common system calls and functions derived from system calls. This may be the only Linux system call list with Chinese notes that you can see on the Internet. Even a simple list of English letters in alphabetical order, it is rare to achieve this completely.

By convention, this list is based on man pages section 2nd, that is, the system call section. According to my understanding, I made a rough classification and made some small changes. I deleted a few system calls that are only used by the kernel and are not allowed to be called by users, I have made some minor changes to some areas that I may find inappropriate, and attached a brief comment to all listed system calls.

Some functions have the same effect, but the parameters are different. (Many people who are familiar with C ++ can immediately think of function overloading, but do not forget that the Linux core is written in C language, so they can only get different function names ). Some other functions are outdated and replaced by new and better functions (GCC issues a warning when linking these functions), but they are retained for compatibility reasons, for these functions, I will mark "*" as a difference.

I. Process Control:
Fork Create a new process
Clone Create a sub-process based on specified conditions
Execve Run executable files
Exit Abort a process
_ Exit Stop the current process immediately
Getdtablesize Maximum number of files that a process can open
Getpgid Obtains the ID of a specified process group.
Setpgid Set the flag number of the specified process group
Getpgrp Get the ID of the current process group
Setpgrp Set the flag number of the current process group
Getpid Get process ID
Getppid Obtain the parent process ID
Getpriority Get scheduling priority
Setpriority Set scheduling priority
Modify_ldt Local description table of the read/write process
Nanosleep Specifies the time for the process to sleep.
Nice Change the priority of a time-based process
Pause Pending process and waiting for Signal
Personality Set the process running domain
Prctl Perform specific operations on processes
Ptrace Process Tracking
Sched_get_priority_max Obtain the maximum static priority
Sched_get_priority_min Get the lower limit of Static Priority
Sched_getparam Obtain the scheduling parameters of a process.
Sched_getscheduler Obtains the scheduling policy of a specified process.
Sched_rr_get_interval Obtain by rrAlgorithmThe time slice length of the Scheduled real-time process
Sched_setparam Set process scheduling Parameters
Sched_setscheduler Set Scheduling Policies and parameters for a specified process
Sched_yield The process takes the initiative to let out the processor and waits for itself to wait for the end of the scheduling queue
Vfork Create a sub-process for executionProgram, Usually used together with execve
Wait Wait for the sub-process to terminate
Wait3 See wait
Waitpid Wait for the specified sub-process to terminate
Wait4 See waitpid
Capget Obtain process Permissions
Capset Set process Permissions
Getsid Get meeting ID number
Setsid Set meeting ID

 

Ii. File System Control

1. file read/write operations

Fcntl File Control
Open Open a file
Creat Create a new file
Close Close file description
Read Read files
Write Write files
Readv Read data from a file into a buffer Array
Writev Write Data in the buffer array to a file
Pread Random File Read
Pwrite Random file write
Lseek Move file pointer
_ Llseek Move the file pointer in a 64-bit address space
DUP Copy the description of an opened file
Dup2 Copy the file description according to the specified conditions
Flock Add/unlock files
Poll I/O multiplexing
Truncate File Truncation
Ftruncate See truncate
Umask Set the File Permission mask
Fsync Write the part of the file in the memory back to the disk.

2. File System Operations

Access Determine File accessibility
Chdir Change current working directory
Fchdir See chdir
Chmod Change file Mode
Fchmod See chmod
Chown Change the owner or user group of a file
Fchown See chown
Lchown See chown
Chroot Change root directory
Stat Retrieve File status information
Lstat See stat
Fstat See stat
Statfs Retrieve File System Information
Fstatfs See statfs
Readdir Read directory items
Getdents Read directory items
Mkdir Create directory
Mknod Create an index Node
Rmdir Delete directory
Rename File rename
Link Create Link
Symlink Create a symbolic link
Unlink Delete Link
Readlink Value of the read Symbolic Link
Mount Install a File System
Umount Detach a File System
Ustat Retrieve File System Information
Utime Change the file access modification time
Utimes See utime
Quotactl Disk Quota Control

 

Iii. System Control
IOCTL I/O total control functions
_ Sysctl Read/write System Parameters
Acct Enable or disable process accounting
Getrlimit Obtain the upper limit of system resources
Setrlimit Set system resource limit
Getrusage Obtain system resource usage
Uselib Select the binary function library to use
Ioperm Set port I/O Permissions
Iopl Change process I/O permission level
Outb Low-level port operations
Reboot Restart
Swapon Open swap files and devices
Swapoff Disable swap files and devices
Bdflush Control the bdflush daemon
Sysfs Obtain the file system types supported by the core
Sysinfo Obtain system information
Adjtimex Adjust system clock
Alarm Set an alarm for a process
Getitimer Get the timer Value
Setitimer Set the timer Value
Gettimeofday Time and time zone
Settimeofday Set Time and time zone
Stime Set system date and time
Time Obtain system time
Times Process running time
Uname Obtain the name, version, host, and other information of the current UNIX system.
Vhangup Suspend current terminal
Nfsservctl Control the NFS Daemon
Vm86 Enter the simulated 8086 Mode
Create_module Create module items that can be loaded
Delete_module Delete module items that can be loaded
Init_module Initialization module
Query_module Query module information
* Get_kernel_syms Obtain the core symbol, which has been replaced by query_module

 

Iv. Memory Management
BRK Change Data Segment space allocation
Sbrk See BRK
Mlock Memory Page locking
Munlock Memory Page unlock
Mlockall Call the process to lock all memory pages
Munlockall Call the process to unlock all memory pages
MMAP Ing Virtual Memory Page
Munmap Remove Memory Page ing
Mremap Remap the virtual memory address
Msync Write the data in the ing memory back to the disk
Mprotect Set memory image protection
Getpagesize Get page size
Sync Write memory buffer data back to Hard Disk
Cacheflush Writes the content in the specified buffer to the disk.

 

V. Network Management
Getdomainname Retrieve Domain Name
Setdomainname Set Domain Name
Gethostid Obtain the host ID
Sethostid Set host ID
Gethostname Obtain the Host Name
Sethostname Set Host Name

 

Vi. Socket Control
Socketcall Socket System Call
Socket Establish socket
Bind Bind socket to Port
Connect Connect to a remote host
Accept Response to socket connection request
Send Send messages through socket
Sendto Send UDP messages
Sendmsg See send
Recv Receive information through socket
Recvfrom Receive UDP Information
Recvmsg See Recv
Listen Listen to socket Port
Select Round Robin of multiple synchronous I/O
Shutdown Close the connection on the socket
Getsockname Obtain the local socket name
Getpeername Obtain the socket name of the contact.
Getsockopt Port fetch settings
Setsockopt Set port Parameters
Sendfile Transmit data between files or ports
Socketpair Create a pair of connected anonymous sockets

VII. User Management
Getuid Get user ID
Setuid Set User ID
Getgid Get group ID
Setgid Set Group flag number
Getegid Get valid group ID
Setegid Set valid group ID
Geteuid Get valid user ID
Seteuid Set valid user ID
Setregid Set true and valid group ID numbers respectively
Setreuid Set real and valid user ID numbers respectively
Getresgid Obtain the true, valid, and saved group ID numbers respectively.
Setresgid Set true, valid, and saved group ID numbers respectively.
Getresuid Obtain the real, valid, and saved user ID numbers respectively.
Setresuid Set real, valid, and saved user ID numbers respectively
Setfsgid Set the group ID used for file system check
Setfsuid Set the user ID used for file system check
Getgroups Retrieve the list of post-completion group flag
Setgroups Set the post-completion group flag list

 

8. inter-process communication

 

IPC Inter-process communication control calls

1. Signal

Sigaction Set the processing method for the specified signal
Sigprocmask Blocks or unblocks signals in a set of signals based on parameters.
Sigpending Set a queue for the specified blocked Signal
Sigsuspend Pending a process to wait for a specific signal
Signal See Signal
Kill Send a signal to a process or process group
* Sigblock Add a signal to the blocked signal mask, which has been replaced by sigprocmask
* Siggetmask Obtain the existing blocking signal mask, which has been replaced by sigprocmask
* Sigsetmask Use the given signal mask to replace the existing blocking signal mask, which has been replaced by sigprocmask.
* Sigmask Converts a given signal to a mask, which has been replaced by sigprocmask.
* Sigpause Same as sigsuspend, which has been replaced by sigsuspend
Sigvec Signal processing functions for BSD compatibility, similar to sigaction
Ssetmask The signal processing function of ansi c, similar to sigaction

2. Messages

Msgctl Message control operations
Msgget Get Message Queue
Msgsnd Send message
Msgrcv Retrieve message

3. Pipelines

Pipe Create MPs queue

4. semaphores

Semctl Semaphore Control
Semget Obtain a set of semaphores
Semop Semaphore operation

5. Shared Memory

Shmctl Control shared memory
Shmget Get shared memory
Shmat Connect to shared memory
Shmdt Remove shared memory

 

References

    • Linux man pages

    • Advanced Programming in the Unix environment, W. Richard Steven S, 1993

 

From: http://www.ibm.com/developerworks/cn/linux/kernel/syscall/part1/appendix.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.