Systemcalls: Process Control
Systemcalls: Process Control
Systemcalls: Process Control
Process Control
These system calls deal with processes such as process creation, process termination etc.
File Management
These system calls are responsible for file manipulation such as creating a file, reading a file,
writing into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading from device buffers,
writing into device buffers etc.
Information Maintenance
These system calls handle information and its transfer between the operating system and the user
program.
Communication
These system calls are useful for interprocess communication. They also deal
with creating and deleting a communication connection.
The Unix alarm() system call specifies a number of seconds after which the calling process should
receive an instance of the SIGALRM signal. The signal is generated the specified number of seconds
after the time the alarm() call is executed.This can be used for error recovery, to arrange a "timeout"
for an operation that the application expects might take too long, such as a potentially infinite loop,
or a system call that might block forever.If the application does not install a handler for SIGALRM,
the timeout will kill the process abruptly. That may not be good if the application was doing
anything that cannot safely be left incomplete. For example, the process might be holding locks, or
might have buffered output.Therefore, an application that uses alarm() will usually use sigaction()
to install a handler for SIGALRM, which allows the process to recover or to exit gracefully.
A computer program (process, task, or thread) may sleep, which places it into an inactive state for a
period of time. Eventually the expiration of an interval timer, or the receipt of a signal or interrupt
causes the program to resume execution. the sleep() function is called providing a single
parameter of type unsigned integer of the number of seconds to sleep.A typical sleep system call
takes a time value as a parameter, specifying the minimum amount of time that the process is to
sleep before resuming execution. The parameter typically specifies seconds, although some
operating systems provide finer resolution, such as milliseconds or microseconds.
Conceptually, a pipe is a connection between two processes, such that the standard output from one
process becomes the standard input of the other process. In UNIX Operating System, Pipes are
useful for communication between related processes(inter-process communication). The pipe
system call finds the first two available positions in the process’s open file table and allocates them
for the read and write ends of the pipe.Pipes behave FIFO(First in First out), Pipe behave like a
queue data structure. Size of read and write don’t have to match here.
In order to create a new message queue, or access an existing queue, the shmget() system call is
used.This particular call should almost seem like old news at this point. It is strikingly similar to the
corresponding get calls for message queues and semaphore sets. The first argument to shmget()
is the key value (in our case returned by a call to ftok()). This key value is then compared to
existing key values that exist within the kernel for other shared memory segments. At that point, the
open or access operation is dependent upon the contents of the shmflg argument.
In computing, mmap(2) is a POSIX-compliant Unix system call that maps files or devices into
memory. It is a method of memory-mapped file I/O. It implements demand paging, because file
contents are not read from disk directly and initially do not use physical RAM at all. The actual
reads from disk are performed in a "lazy" manner, after a specific location is accessed. After the
memory is no longer needed, it is important to munmap(2) the pointers to it. Protection
information can be managed using mprotect(2), and special treatment can be enforced using
madvise(2).
In Unix and Unix-like operating systems, chmod is the command and system call which is used to
change the access permissions of file system objects (files and directories). It is also used to change
special mode flags. On success, zero is returned. On error, -1 is returned, and errno is set
appropriately.The mode of the file given by path or referenced by fildes is changed.
In computing, umask is a command that determines the settings of a mask that controls how file
permissions are set for newly created files. It may also affect how the file permissions are changed
explicitly. umask is also a function that sets the mask, or it may refer to the mask itself, which is
formally known as the file mode creation mask. The mask is a grouping of bits, each of which
restricts how its corresponding permission is set for newly created files. The bits in the mask may
be changed by invoking the umask command. This system call always succeeds and the previous
value of the mask is returned.
The command chown, an abbreviation of change owner, is used on Unix and
Unixlike operating systems to change the owner of file system files, directories.
Unprivileged (regular) users who wish to change the group membership of a file
that they own may use chgrp. The ownership of any file in the system may only
be altered by a superuser. A user cannot give away ownership of a file, even
when the user owns it. Similarly, only a member of a group can change a file's
group ID to that group.On success, zero is returned. On error, 1 is returned,
and errno is set appropriately.