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 CallTo 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-relatedcloseClose 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 CallsProcess relatedexecveExecute programexitTerminate the calling processgetpidGet process identificationsetuidSet the user identity of the current processprtraceProvides 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 CallsScheduling relatedsched_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 CallsInterprocess Communication (IPC) relatedmsgrevA 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 callsSocket (Networking) relatedbindAssigns 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 callsMiscallaneouscreate_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); }#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); }Outputsyscall (SYS_getpid) = 3 getpid() = 3 engineering subjects Operating System Operating System