HOME

TheInfoList




In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and software. It has sci ...

computing
, a system call (commonly abbreviated to syscall) is the programmatic way in which a
computer program In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative programming, a ''computer program'' is a Set (mathematics), set of instructions. A comp ...
requests a service from the
kernel Kernel may refer to: Computing * Kernel (operating system) In an operating system with a Abstraction layer, layered architecture, the kernel is the lowest level, has complete control of the hardware and is always in memory. In some systems it ...
of the
operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating systems (OS) like macOS, Linux, Android (operating system), Android and Mi ...

operating system
on which it is executed. This may include hardware-related services (for example, accessing a
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device File:Reel-to-reel recorder tc-630.jpg, On a reel-to-reel tape recorder (Sony TC-630), the recorder is data storage equipment an ...

hard disk drive
or accessing the device's camera), creation and execution of new
processes A process is a series or set of Action (philosophy), activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management *Business process, activities that pro ...
, and communication with integral kernel services such as
process schedulingIn computing, scheduling is the method by which work is assigned to resources that complete the work. The work may be virtual computation elements such as thread (computer science), threads, process (computing), processes or data flow (computer netw ...
. System calls provide an essential interface between a process and the operating system. In most systems, system calls can only be made from
userspace A modern computer operating system usually segregates virtual memory into kernel space and user space. Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour. Kernel s ...
processes, while in some systems,
OS/360 and successors OS/360, officially known as IBM System/360 Operating System, is a discontinued batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was influenced by the earlier IBM 7090/94 IB ...
for example, privileged system code also issues system calls.


Privileges

The
architecture upright=1.45, alt=Plan d'exécution du second étage de l'hôtel de Brionne (dessin) De Cotte 2503c – Gallica 2011 (adjusted), Plan of the second floor (attic storey) of the Hôtel de Brionne in Paris – 1734. Architecture (Latin ''archi ...
of most modern processors, with the exception of some embedded systems, involves a security model. For example, the ''
rings Ring most commonly refers either to a hollow circular shape or to a high-pitched sound. It thus may refer to: *Ring (jewellery) A ring is a round band, usually of metal A metal (from Ancient Greek, Greek μέταλλον ''métallon'', "mine ...
'' model specifies multiple privilege levels under which software may be executed: a program is usually limited to its own
address space In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algorithm) for calculating the greatest common ...
so that it cannot access or modify other running programs or the operating system itself, and is usually prevented from directly manipulating hardware devices (e.g. the
frame buffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory 8GB DDR3 RAM stick with a white Heat sink, heatsink Random-access memory (RAM; ) is a form of computer memory that can be read and changed in any or ...
or
network Network, networking and networked may refer to: Science and technology * Network theory Network theory is the study of Graph (discrete mathematics), graphs as a representation of either symmetric relations or directed graph, asymmetric relat ...
devices). However, many applications need access to these components, so system calls are made available by the operating system to provide well-defined, safe implementations for such operations. The operating system executes at the highest level of privilege, and allows applications to request services via system calls, which are often initiated via
interrupt In s, an interrupt is a response by the to an event that needs attention from the software. An interrupt condition alerts the processor and serves as a request for the processor to interrupt the currently executing code when permitted, so that ...

interrupt
s. An interrupt automatically puts the CPU into some elevated privilege level and then passes control to the kernel, which determines whether the calling program should be granted the requested service. If the service is granted, the kernel executes a specific set of instructions over which the calling program has no direct control, returns the privilege level to that of the calling program, and then returns control to the calling program.


The library as an intermediary

Generally, systems provide a
library A library is a collection of materials, books or media that are easily accessible for use and not just for display purposes. It is responsible for housing updated information in order to meet the user's needs on a daily basis. A library provi ...
or
API In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...

API
that sits between normal programs and the operating system. On
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
systems, that API is usually part of an implementation of the
C library The C standard library or libc is the standard library A standard library in computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to per ...
(libc), such as
glibc File:Linux kernel System Call Interface and glibc.svg, The GNU C Library is a wrapper around the system calls of the Linux kernel. The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. Des ...
, that provides
wrapper function A wrapper function is a subroutine In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming invol ...
s for the system calls, often named the same as the system calls they invoke. On
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user ...
, that API is part of the
Native API The Native API is a lightweight application programming interface In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of ...
, in the library; this is an undocumented API used by implementations of the regular
Windows API The Windows API, informally WinAPI, is Microsoft's core set of application programming interface In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experi ...
and directly used by some system programs on Windows. The library's wrapper functions expose an ordinary function
calling convention In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
(a
subroutine In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a particular task. Programming involves tasks such as analysis, generat ...
call on the
assembly Assembly may refer to: Organisations and meetings * Deliberative assembly A deliberative assembly is a gathering of members (of any kind of collective) who use parliamentary procedure Parliamentary procedure is the body of ethics, Procedural l ...
level) for using the system call, as well as making the system call more
modular Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a syst ...
. Here, the primary function of the wrapper is to place all the arguments to be passed to the system call in the appropriate
processor register Processor may refer to: Computing Hardware * Processor (computing) **Central processing unit (CPU), the hardware within a computer that executes a program *** Microprocessor, a central processing unit contained on a single integrated circuit (I ...
s (and maybe on the
call stack In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algor ...
as well), and also setting a unique system call number for the kernel to call. In this way the library, which exists between the OS and the application, increases portability. The call to the library function itself does not cause a switch to
kernel mode In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of ...
and is usually a normal
subroutine call In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as: analysis, generati ...
(using, for example, a "CALL" assembly instruction in some
Instruction set architecture In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of , ...
s (ISAs)). The actual system call does transfer control to the kernel (and is more implementation-dependent and platform-dependent than the library call abstracting it). For example, in
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
systems, fork and execve are C library functions that in turn execute instructions that invoke the fork and exec system calls. Making the system call directly in the
application code This glossary of computer software terms lists the general terms related to computer software Software is a collection of Instruction (computer science), instructions and data (computing), data that tell a computer how to work. This is in con ...
is more complicated and may require embedded assembly code to be used (in C and
C++ C++ () is a general-purpose programming language In computer software, a general-purpose programming language is a programming language dedicated to a general-purpose, designed to be used for writing software in a wide variety of application ...

C++
), as well as requiring knowledge of the low-level binary interface for the system call operation, which may be subject to change over time and thus not be part of the
application binary interface In computer software Software is a collection of Instruction (computer science), instructions that tell a computer how to work. This is in contrast to Computer hardware, hardware, from which the system is built and actually performs the work ...
; the library functions are meant to abstract this away. On
exokernel Exokernel is an operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating ...

exokernel
based systems, the library is especially important as an intermediary. On exokernels, libraries shield user applications from the very low level kernel
API In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...
, and provide
abstractions Abstraction in its main sense is a conceptual process where general rules Rule or ruling may refer to: Human activity * The exercise of political Politics (from , ) is the set of activities that are associated with Decision-making, ma ...
and
resource Resource refers to all the materials available in our environment which help us to satisfy our needs and wants. Resources can broadly be classified upon their availability — they are classified into renewable File:Global Vegetation.jpg, Global ...
management. IBM's
OS/360 OS/360, officially known as IBM System/360 Operating System, is a discontinued batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was influenced by the earlier IBM 7090/94 IB ...
and
DOS/360 Disk Operating System/360, also DOS/360, or simply DOS, is the discontinued first member of a sequence of operating systems for IBM System/360, System/370 and later IBM mainframe, mainframes. It was announced by IBM on the last day of 1964, and i ...
implement most system calls through a library of assembly language macros, although there are a few services with a call linkage. This reflects their origin at a time when programming in assembly language was more common than
high-level language In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
usage. IBM system calls were therefore not directly executable by high-level language programs, but required a callable assembly language wrapper subroutine. Since then, IBM has added many services that can be called from high level languages in, e.g.,
z/OS z/OS is a 64-bit computing, 64-bit operating system for IBM z/Architecture Mainframe_computer, mainframes, introduced by IBM in October 2000. It derives from and is the successor to OS/390, which in turn followed a string of MVS versions.St ...
and
z/VSE z/VSE (''Virtual Storage Extended'') is an operating system for IBM mainframe computers, the latest one in DOS/360 and successors, the DOS/360 lineage, which originated in 1965. Announced Feb. 1, 2005 by IBM as successor to VSE/ESA 2.7, then-new z/ ...
.


Examples and tools

On
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser Multi-user software is computer software Software is a collection of Instruction (computer science), instructions that tell a computer how to work. This is in contrast t ...

Unix
,
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
and other
POSIX The Portable Operating System Interface (POSIX) is a family of standard Standard may refer to: Flags * Colours, standards and guidons * Standard (flag), a type of flag used for personal identification Norm, convention or requirement * Sta ...
-compliant operating systems, popular system calls are
open Open or OPEN may refer to: Music * Open (band) Open is a band. Background Drummer Pete Neville has been involved in the Sydney/Australian music scene for a number of years. He has recently completed a Masters in screen music at the Australian ...
, read,
write Writing is a medium of human communication Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (philosophy), entities or Organization, groups through the use of sufficien ...
, close, wait, exec,
fork In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tine (structural), tines with which one ...
,
exit Exit(s) may refer to: Architecture and engineering * Door * Portal (architecture), an opening in the walls of a structure * Emergency exit * Overwing exit, a type of emergency exit on an airplane * Exit ramp, a feature of a road interchange (road ...
, and
kill Kill often refers to: *Homicide, one human killing another Kill may also refer to: Media *''Kill!'', a 1968 film directed by Kihachi Okamoto *Kill (Cannibal Corpse album), ''Kill'' (Cannibal Corpse album), 2006 *Kill (Electric Six album), ''Kill' ...
. Many modern operating systems have hundreds of system calls. For example,
Linux Linux ( or ) is a family of open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product ...
and
OpenBSD OpenBSD is a security-focused operating system, security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking N ...
each have over 300 different calls,
NetBSD NetBSD is a free and open-source Free and open-source software (FOSS) is software that is both free software and open-source software where anyone is free software license, freely licensed to use, copy, study, and change the software in any ...

NetBSD
has close to 500,
FreeBSD FreeBSD is a free and open-source Free and open-source software (FOSS) is software that is both free software and open-source software where anyone is free software license, freely licensed to use, copy, study, and change the software in any ...

FreeBSD
has over 500, Windows has close to 2000, divided between win32k (graphical) and ntdll (core) system calls while Plan 9 has 51. Tools such as
strace strace is a diagnostic, debugging In computer programming Computer programming is the process of designing and building an executable In computing, executable code, an executable file, or an executable program, sometimes simply referr ...
, ftrace and
truss A truss is an assembly of ''members'' such as beams, connected by ''nodes'', that creates a rigid structure. In engineering, a truss is a structure A structure is an arrangement and organization of interrelated elements in a material object ...
allow a process to execute from start and report all system calls the process invokes, or can attach to an already running process and intercept any system call made by the said process if the operation does not violate the permissions of the user. This special ability of the program is usually also implemented with system calls such as
ptrace ptrace is a system call In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer h ...
or system calls on files in
procfs The proc filesystem (procfs) is a special filesystem in Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software System software is software designed to provide a platf ...
.


Typical implementations

Implementing system calls requires a transfer of control from user space to kernel space, which involves some sort of architecture-specific feature. A typical way to implement this is to use a
software interrupt In digital computer A computer is a machine A machine is a man-made device that uses power to apply forces and control movement to perform an action. Machines can be driven by animals and people A people is a plurality of per ...
or
trap A trap is a Trapping#Trap_types, mechanical device used to capture or restrain an animal for purposes such as hunting, pest control, or ecological research. Trap or TRAP may also refer to: Art and entertainment Films and television * Trap (201 ...
. Interrupts transfer control to the operating system
kernel Kernel may refer to: Computing * Kernel (operating system) In an operating system with a Abstraction layer, layered architecture, the kernel is the lowest level, has complete control of the hardware and is always in memory. In some systems it ...
, so software simply needs to set up some register with the system call number needed, and execute the software interrupt. This is the only technique provided for many
RISC In computer engineering Computer engineering (CoE or CpE) is a branch of engineering Engineering is the use of scientific principles to design and build machines, structures, and other items, including bridges, tunnels, roads, v ...
processors, but
CISC CISC may refer to: *Caribbean Island Swimming Championships *Chongqing Iron and Steel Company * Clean intermittent self-catheterisation, a form of urinary catheterization *Complex instruction set computer *Criminal Intelligence Service Canada *Cana ...
architectures such as
x86 x86 is a family of instruction set architecture In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for th ...

x86
support additional techniques. For example, the x86
instruction set In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of co ...
contains the instructions SYSCALL/SYSRET and SYSENTER/SYSEXIT (these two mechanisms were independently created by
AMD Advanced Micro Devices, Inc. (AMD) is an American multinational Multinational may refer to: * Multinational corporation, a corporate organization operating in multiple countries * Multinational force, a military body from multiple countries * M ...

AMD
and
Intel Intel Corporation is an American multinational corporation A multinational company (MNC) is a corporate A corporation is an organization—usually a group of people or a company A company, abbreviated as co., is a Legal personalit ...

Intel
, respectively, but in essence they do the same thing). These are "fast" control transfer instructions that are designed to quickly transfer control to the kernel for a system call without the overhead of an interrupt.
Linux Linux ( or ) is a family of open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product ...

Linux
2.5 began using this on the
x86 x86 is a family of instruction set architecture In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for th ...

x86
, where available; formerly it used the INT instruction, where the system call number was placed in the EAX
register A register is an authoritative list of one kind of information. Register or registration may refer to: Arts entertainment, and media Music * Register (music), the relative "height" or range of a note, melody, part, instrument, etc. * ''Regis ...
before
interrupt In digital computer A computer is a machine A machine is a man-made device that uses power to apply forces and control movement to perform an action. Machines can be driven by animals and people A people is a plurality of pe ...
0x80 was executed. An older mechanism is the
call gate A call gate is a mechanism in Intel's x86 architecture for changing the privilege level of a process when it executes a predefined function call using a CALL FAR instruction. Overview Call gates are intended to allow less privileged code to call ...
; originally used in
Multics Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experi ...

Multics
and later, for example, see
call gate A call gate is a mechanism in Intel's x86 architecture for changing the privilege level of a process when it executes a predefined function call using a CALL FAR instruction. Overview Call gates are intended to allow less privileged code to call ...
on the Intel
x86 x86 is a family of instruction set architecture In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for th ...

x86
. It allows a program to call a kernel function directly using a safe control transfer mechanism, which the operating system sets up in advance. This approach has been unpopular on x86, presumably due to the requirement of a far call (a call to a procedure located in a different segment than the current code segment) which uses
x86 memory segmentation x86 memory segmentation refers to the implementation of memory segmentation Memory segmentation is an operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and pr ...
and the resulting lack of portability it causes, and the existence of the faster instructions mentioned above. For
IA-64 IA-64 (Intel Itanium architecture) is the instruction set architecture In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practica ...
architecture, EPC (Enter Privileged Code) instruction is used. The first eight system call arguments are passed in registers, and the rest are passed on the stack. In the
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer A computer is a machine that can be programmed to carry out sequences of arithmetic or ...
mainframe family, and its successors, a
Supervisor Call instruction : ''This article covers the specific instruction on the IBM System/360 and successor mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer A computer is a machine that can be programmed to car ...
(), with the number in the instruction rather than in a register, implements a system call for legacy facilities in most of IBM's own operating systems, and for all system calls in Linux. In later versions of MVS, IBM uses the Program Call (PC) instruction for many newer facilities. In particular, PC is used when the caller might be in
Service Request Block{{unreferenced, date=December 2019 A Service Request Block (SRB) is a data structure Image:Hash table 3 1 1 0 1 0 0 SP.svg, 315px, A data structure known as a hash table. In computer science, a data structure is a data organization, management, a ...
(SRB) mode. The
PDP-11 The PDP-11 is a series of 16-bit 16-bit microcomputer A microcomputer is a small, relatively inexpensive computer A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically ...
minicomputer A minicomputer, or colloquially mini, is a class of smaller general purpose computers that developed in the mid-1960s and sold for much less than Mainframe computer, mainframe and mid-size computers from IBM and BUNCH, its direct competitors. In ...
used the and instructions, which, similar to the IBM System/360 and x86 , put the code in the instruction; they generate interrupts to specific addresses, transferring control to the operating system. The
VAX VAX is a series of computers featuring a 32-bit 32-bit microcomputers are computers in which 32-bit microprocessor A microprocessor is a computer processor where the data processing logic and control is included on a single integrate ...
32-bit successor to the PDP-11 series used the , , and instructions to make system calls to privileged code at various levels; the code is an argument to the instruction.


Categories of system calls

System calls can be grouped roughly into six major categories: : # Process control #* create process (for example,
fork In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tine (structural), tines with which one ...
on Unix-like systems, or NtCreateProcess in the
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user ...
Native API The Native API is a lightweight application programming interface In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of ...
) #* terminate process #*
load Load or LOAD may refer to: Aeronautics and transportation *Load factor (aeronautics), the ratio of the lift of an aircraft to its weight *Passenger load factor, the ratio of revenue passenger miles to available seat miles of a particular transpor ...
, execute #* get/set process attributes #* wait for time, wait event,
signal In signal processing Signal processing is an electrical engineering subfield that focuses on analysing, modifying, and synthesizing signals such as audio signal processing, sound, image processing, images, and scientific measurements. Sig ...
event #* allocate and
free Free may refer to: Concept * Freedom, having the ability to act or change without constraint * Emancipate, to procure political rights, as for a disenfranchised group * Free will, control exercised by rational agents over their actions and decis ...
memory # File management #* create file, delete file #* open, close #* read, write, reposition #* get/set file attributes # Device management #* request device, release device #* read, write, reposition #* get/set device attributes #* logically attach or detach devices # Information maintenance #* get/set total system information (including time, date, computer name, enterprise etc.) #* get/set process, file, or device metadata (including author, opener, creation time and date, etc.) # Communication #* create, delete communication connection #* send, receive messages #* transfer status information #* attach or detach remote devices #Protection #*get/set file permissions


Processor mode and context switching

System calls in most
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system An operating system (OS) is system software that manages computer hardware, computer software, software resources, and provides common daemon (computing), services for compu ...
systems are processed in
kernel mode In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of ...
, which is accomplished by changing the processor execution mode to a more privileged one, but no ''process''
context switch In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...
is necessary although a ''privilege'' context switch does occur. The hardware sees the world in terms of the execution mode according to the processor status register, and processes are an abstraction provided by the operating system. A system call does not generally require a context switch to another process; instead, it is processed in the context of whichever process invoked it.Bach, Maurice J. (1986), ''The Design of the UNIX Operating System'', Prentice Hall, pp. 15-16. In a Multithreading_(computer_architecture), multithreaded process, system calls can be made from multiple Thread_(computing), threads. The handling of such calls is dependent on the design of the specific operating system kernel and the application runtime environment. The following list shows typical models followed by operating systems: * ''Many-to-one'' model: All system calls from any user thread in a process are handled by a single kernel-level thread. This model has a serious drawback any blocking system call (like awaiting input from the user) can freeze all the other threads. Also, since only one thread can access the kernel at a time, this model cannot utilize multiple cores of processors. * ''One-to-one'' model: Every user thread gets attached to a distinct kernel-level thread during a system call. This model solves the above problem of blocking system calls. It is found in all major Linux distributions, macOS, iOS, recent Microsoft Windows, Windows and Solaris (operating system), Solaris versions. * ''Many-to-many'' model: In this model, a pool of user threads is mapped to a pool of kernel threads. All system calls from a user thread pool are handled by the threads in their corresponding kernel thread pool. * ''Hybrid'' model: This model implements both many to many and one to one models depending upon the choice made by the kernel. This is found in old versions of IRIX, HP-UX and Solaris (operating system), Solaris.


See also

* Linux kernel API * VDSO


Notes


References


External links


Linux 64-bit system call reference/listing
Up to kernel version 4.20
Linux system call reference
Updated system call reference for Linux kernel 2.6.35.4, includes register and data structure references. Also for Linux kernel 4.1
64 bit
an
32 bit

A list of modern Unix-like system callsInteractive Linux kernel map
with main API functions and structures
PDF
version

system calls for Linux kernel 2.2, with IA-32
calling convention In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of Algori ...
s
How System Calls Work on Linux/i86
(1996, based on the 1993 0.99.2 kernel)

(2006)
''Kernel command using Linux system calls''
IBM developerWorks * Choudhary, Amit
HOWTO for Implementing a System Call on Linux 2.6
* Jorrit N. Herder, Herbert Bos, Ben Gras, Philip Homburg, and Andrew S. Tanenbaum
Modular system programming on Minix 3
'';login:'' 31, no. 2 (April 2006); 19-28, accessed March 5, 2018
A simple open Unix Shell in C language
examples on System Calls under Unix

Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user ...
Native API The Native API is a lightweight application programming interface In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of ...
, including system calls * Gulbrandsen, John
''System Call Optimization with the SYSENTER Instruction''
CodeGuru.com, 8 October 2004 {{DEFAULTSORT:System Call Operating system technology Application programming interfaces System calls,