System calls are a special set of procedures that regular programs (user space processes) can submit to the Linux kernel for working with files, interacting with hardware, accessing internal OS functionality, implement all sorts of communication and process management and basically do anything else that’s sensitive or performance critical enough that OS kernel must enforce strict controls around it.
Regular processes interface with the OS kernel by supplying a system call name and parameters, the kernel then verifies validity of a system call and executes it within kernel space, returning data and execution status back.
To review the full list of system calls in your Linux distribution, you’ll need to inspect the unistd-32.h or unistd-64.h file.
In CentOS and RedHat, this file is installed by the kernel-headers package.
When browsing the file, you’ll see a list like this:
For instance, __NR_mount indicates the syscall name - the actual name is the word without __NR_ bit, so in this case it’s mount. 21 is the syscall number in your Linux.
Syscall Man Pages
To get more information about using a system call, just use man command. Because syscalls are a pretty core part of man pages, they have their own section - it’s section number 2. So add .2 to the name of a syscall when looking for it:
Don’t forget: although oldest syscalls match across multiple distributions, there’s always a chance that a particular syscall will have a different number in your OS.
This is only relevant if you’re trying to use syscalls directly - which you probably shouldn’t. Use glibc instead - I’ll be sure to write a small article on it sometime in the future.