The interface between a process and an operating system is provided by system calls. In general, system calls are available as assembly language instructions. They are also included in the manuals used by the assembly level programmers.
System calls in Unix are used for file system control, process control, interprocess communication etc. Access to the Unix kernel is only available through these system calls. Generally, system calls are similar to function calls, the only difference is that they remove the control from the user process.
There are around 80 system calls in the Unix interface currently. Details about some of the important ones are given as follows -
|access()||This checks if a calling process has access to the required file|
|chdir()||The chdir command changes the current directory of the system|
|chmod()||The mode of a file can be changed using this command|
|chown()||This changes the ownership of a particular file|
|kill()||This system call sends kill signal to one or more processes|
|link()||A new file name is linked to an existing file using link system call.|
|open()||This opens a file for the reading or writing process|
|pause()||The pause call suspends a file until a particular signal occurs.|
|stime()||This system call sets the correct time.|
|times()||Gets the parent and child process times|
|alarm()||The alarm system call sets the alarm clock of a process|
|fork()||A new process is created using this command|
|chroot()||This changes the root directory of a file.|
|exit()||The exit system call is used to exit a process.|
System calls in Windows are used for file system control, process control, interprocess communication, main memory management, I/O device handling, security etc. The programs interact with the Windows operating system using the system calls. Since system calls are the only way to access the kernel, all the programs requiring resources must use system calls.
Details about some of the important system calls in Windows are given as follows -
|CreateProcess()||A new process is created using this command|
|ExitProcess()||This system call is used to exit a process.|
|CreateFile()||A file is created or opened using this system call.|
|ReadFile()||Data is read from the file using this system call.|
|WriteFile()||Data is written into the file using this system call.|
|CloseHandle()||This system call closes the file currently in use.|
|SetTimer()||This system call sets the alarm or the timer of a process|
|CreatePipe()||A pipe is created using this system call|
|SetFileSecurity()||This system call sets the security for a particular process|
|SetConsoleMode()||This sets the input mode or output mode of the console’s|
input buffer or output screen buffer respectively.
|ReadConsole()||This reads the characters from the console input buffer.|
|WriteConsole()||This writes the characters into the console output buffer.|