System Call
Definition
A system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. This may include hardware-related services, creation and execution of new processes, and communication with integral kernel services such as process scheduling.
Why It Matters
System calls are the only way for user-level programs to access privileged kernel-level functions. They are the bridge between an application and the operating system, providing a controlled and secure interface.
Contextual Example
When your program wants to open a file, it doesn't access the disk directly. It makes a system call (e.g., `open()`) to the OS kernel. The kernel then performs the necessary checks and operations and returns a file handle to your program.
Common Misunderstandings
- System calls are a fundamental concept in the interaction between applications and the OS.
- They are different from library calls. A library function (like `printf` in C) might make one or more system calls behind the scenes.