System Call

A system call is a mechanism used by an application to request a service from the operating system’s kernel.

Purpose: It allows user-level processes to request services of the kernel, which has privileged access to hardware and system resources.

Examples: Reading or writing files, creating processes, and communicating over networks.

Example System Call

Call from C program: count = read(fd, &buffer, length);

  • read up to length bytes of data from from file
  • descriptor fd into buffer, and returns the number of
  • bytes actually read or -1 if an error occurred.
  • C library call for read() calls the read system call.