Linux – System call

In Linux, a system call is a mechanism that allows a user-level program to request services from the operating system’s kernel.

What services from Kernel ?

  • file input/output
  • process management, and
  • network communication

How it works ?

When a user-level program makes a system call, it transitions from user mode to kernel mode, allowing it to access privileged resources and perform operations that would otherwise be inaccessible to it.

The kernel then executes the requested operation on behalf of the user program and returns the result back to the user program.

Some common system calls in Linux include:

  • open() – to open a file
  • read() – to read data from a file
  • write() – to write data to a file
  • fork() – to create a new process
  • execve() – to execute a new program
  • socket() – to create a network socket

Overall, system calls are a critical component of the Linux operating system, enabling user-level programs to interact with the kernel and access system resources in a safe and controlled manner.