0% found this document useful (0 votes)
57 views5 pages

System Call

System calls provide an interface for programs to request services from the operating system. There are six major categories of system calls: file management, device management, information maintenance, communication, and protection. File management calls allow reading, writing and modifying files. Device management calls allow interacting with physical devices and accessing them as files. Information maintenance calls get/set system information. Communication calls establish connections and transfer messages between processes. Protection calls control access to resources based on user/process permissions.

Uploaded by

dee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views5 pages

System Call

System calls provide an interface for programs to request services from the operating system. There are six major categories of system calls: file management, device management, information maintenance, communication, and protection. File management calls allow reading, writing and modifying files. Device management calls allow interacting with physical devices and accessing them as files. Information maintenance calls get/set system information. Communication calls establish connections and transfer messages between processes. Protection calls control access to resources based on user/process permissions.

Uploaded by

dee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

System Calls

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

 Communication system calls create/delete communication connection, send/receive messages,


transfer status information, and attach/detach remote devices.

 The message passing model must support calls to:

o Identify a remote process and/or host with which to communicate.


o Establish a connection between the two processes.
o Open and close the connection as needed.
o Transmit messages along the connection.
o Wait for incoming messages, in either a blocking or non-blocking state.
o Delete the connection when no longer needed.
 The shared memory model must support calls to:
o Create and access memory that is shared amongst processes ( and threads. )
o Provide locking mechanisms restricting simultaneous access.
o Free up shared memory and/or dynamically allocate it as needed.
 Message passing is simpler and easier, ( particularly for inter-computer communications ), and is
generally appropriate for small amounts of data.
 Shared memory is faster, and is generally the better approach where large amounts of data are to
be shared, ( particularly when most processes are reading the data rather than writing it, or at least
when only one or a small number of processes need to change any given data item. )

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

You might also like