Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Microprocessor
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • Solutions
    • HackerRank
      • C Solutions
      • C++ Solutions
      • Java Solutions
      • Python Solutions
      • Algorithms Solutions
      • Data Structures Solutions
    • HackerEarth Solutions
    • Leetcode Solutions
  • JEE 2027
The Computer Science
TheCScience

System Call in Operating System | OS Tutorials

YASH PAL, May 18, 2026May 18, 2026

In the Operating System, a system call is the service provided by the Linux kernel. In C programming, it often uses functions defined in libc, which provides a wrapper for many system calls.

Linux System Call

  • To get an overview, use “man 2 intro” in a command shell.
  • It is also possible to invoke the syscall() function directly.
  • Each system call has a function number defined in <syscall.h> or <unistd.h>.
  • Internally, a system call is invoked by software interrupt 0x80 to transfer control to the kernel. System call table is defined in the Linux kernel source file “arch/i386/kernel/entry.S”.

Here are some Linux system calls used by an operating system, given in the tables.

File system-related
closeClose a file descriptor.
linkMake a new name for a file.
openOpen and possibly create a file or device.
readRead from file descriptor.
writeWrite to the file descriptor.
Table for File System Calls
Process related
execveExecute program
exitTerminate the calling process
getpidGet process identification
setuidSet the user identity of the current process
prtraceProvides a means by which a parent process may observe and control the execution of another process, and examine and change its core image and registers.
Table for Process System Calls
Scheduling related
sched_getparamSets the scheduling parameters associated with the scheduling policy for the process identified by pid.
sched_get_priority_maxReturn the maximum priority value that can be used with the scheduling algorithm identified by policy.
sched_setschedulerSets both the scheduling policy (e.g., FIFO) and the associated parameters for the process pid.
sched_rr_get_intervalWrites into the timespec structure pointed to by the parameter, setting the round-robin time quantum for process pid.
sched_yieldA process can relinquish the processor voluntarily without blocking via this system call. The process will then be moved to the end of the queue due to its static priority, and a new process can run.
Table for Scheduling System Calls
Interprocess Communication (IPC) related
msgrevA message buffer structure is allocated to receive a message. The system call then reads a message from the message queue specified by msqid into the newly created message buffer.
semctlPerforms the control operation specified by cmd on the semaphore set semid.
semopPerforms operations on selected members of the semaphore set semid.
shmatAttaches the shared memory segment identified by shmid to the data segment of the calling process.
shmctlAllows the user to receive information on a shared memory segment, set the owner, group, and permission of a shared memory segment, or destroy a segment.
Table for Interprocess communication system calls
Socket (Networking) related
bindAssigns the local IP address and port for a socket. Returns 0 for success and -1 for error.
connectEstablishes a connection between the given socket and the remote socket associated with sockaddr.
gethostnameReturns the local host name.
sendSend the bytes contained in the buffer pointed to by *msg over the given socket.
setsockoptSets the options on a socket.
Table for Socket (Networking) system calls
Miscallaneous
create_moduleAttempts to create a loadable module entry and reserve the kernel memory that will be needed to hold the module.
fsyncCopies all in-core parts of a file to disk, and waits until the device reports that all parts are on stable storage.
query_moduleRequests information related to loadable modules from the kernel.
timeReturns the time in seconds since January 1, 1970.
vhangupSimulates a hangup on the current terminal. This call arranges for other users to have a “clean” try at login time.
#include <syscall.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>

int main(void){
    long ID1, ID2;
    
    ID1 = syscall(SYS_getpid);
    printf("syscall (SYS_getpid) = %ld\n",ID1);
    
    ID2 = getpid();
    printf("getpid() = %ld\n",ID2);
    return(0);
}

Output

syscall (SYS_getpid) = 3
getpid() = 3
engineering subjects Operating System Operating System

Post navigation

Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *

Engineering Core Subjects

Digital Communication Subject
Internet of Things Subject
Computer Architecture subject
Human Value Subject

JEE Study Materials

JEE Physics Notes
JEE Chemistry Notes

TheCScience

At TheCScience.com, our mission is to make quality education accessible to everyone. We provide in-depth, easy-to-understand articles covering Secondary, Senior Secondary, and Graduation-level subjects.

Our content is designed to simplify complex concepts through clear explanations, diagrams, and structured learning—helping students build strong fundamentals and succeed academically without financial barriers.

Pages

About US

Contact US

Privacy Policy

DMCA

Our Tools

Hosting - get 20% off

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Microprocessor

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes