system Callsthe so-called system call refers to the operating system provided to the user program calls a "special" interface, the user program through this set of "special" interface to obtain the service provided by the operating system kernel. For example, the user can use Process Control related system transfer to create processes, implement process scheduling, process management, etc. Why does the user program not directly access the services provided by the system kernel? This is because in Linux, in order to better protect the kernel space, the running space of the program is divided into kernel space and user space (known as the kernel State and user state), they run at different levels, are logically isolated from each other. As a result, user processes typically do not allow access to kernel data, nor can they use kernel functions, which can only manipulate user data in user space and invoke user-space functions. However, in some cases, the process of user space needs to obtain a certain system service (call kernel space program), then the operating system must take advantage of the system provided to the user's "special Interface"-system calls to specify the user process into the specific location of the kernel space. When making a system call, the program run space needs to enter the kernel space from the user space, and then return to the user space after processing. The system call mentioned earlier is not directly interacting with the programmer, it is just an interface that submits a request to the kernel through a soft interrupt mechanism to get the kernel service. In practice, programmers call the user programming interface--apiThe System command is a layer higher than the API, and it is actually an executable program that internally references the user programming interface (API) to implement the appropriate functionality.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux system call and User programming interface (API)