System Call
System Call
Programming interface to the services provided by the OS. Typically written in a high-level language (C
or C++). Mostly accessed by programs via a high-level Application Program Interface (API) rather than
direct system call use. Three most common APIs are Win32 API for Windows, POSIX API for POSIX-
based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the
Java virtual machine (JVM).
System call sequence to copy the contents of one file to another file
You can use "strace" (strace is a powerful command line tool for debugging) to see more examples of the large
number of system calls invoked by a single simple command. Read the man page for strace, and try some
simple examples.
GPS
TYPES OF SYSTEM CALLS
Six major categories, as outlined in Figure and the following six subsections:
GPS
File Management
File management system calls include create file, delete file, open, close, read, write, reposition,
get file attributes, and set file attributes.
These operations may also be supported for directories as well as ordinary files.
The actual directory structure may be implemented using ordinary files on the file system, or
through other means.
GPS
Device Management
Device management system calls include request device, release device, read, write, reposition,
get/set device attributes, and logically attach or detach devices.
Devices may be physical ( e.g. disk drives ), or virtual / abstract ( e.g. files, partitions, and RAM
disks) .
Some systems represent devices as special files in the file system, so that accessing the "file" calls
upon the appropriate device drivers in the OS. See for example the /dev directory on any UNIX
system.
Information Maintenance
Information maintenance system calls include calls to get/set the time, date, system data, and
process, file, or device attributes.
Systems may also provide the ability to dump memory at any time, single step programs pausing
execution after each instruction, and tracing the operation of programs, all of which can help to
debug programs.
Communication
GPS
Protection
Protection provides mechanisms for controlling which users / processes have access to which
system resources.
System calls allow the access mechanisms to be adjusted as needed, and for non-priveleged users
to be granted elevated access permissions under carefully controlled temporary circumstances.
Once only of concern on multi-user systems, protection is now important on all systems, in the
age of ubiquitous network connectivity.
GPS