System Call could be called in order to obtain services from Unix-based operating system such as Linux and #macos.
The POSIX library provides several C functions, shown as the following, for a program to call system call:
-
fork
(create process by duplicating the calling Process#) -
exec
(execute a new Program# and replace the current process)-
execlp
(the file will be searched in PATH environmental variable) -
execl
-
execle
-
execvp
(the file will be searched in PATH environmental variable) -
execv
-
execve
-
-
wait
(suspends the parent process until the child finish its execution) -
waitpid
(likewait
but with specific process ID)-
WIFEXITED
returns non-zero if child terminated normally -
WEXITSTATUS
returns the exit status of the child process -
WNOHANGS
flags the process to not wait for the child
-
-
exit
(to terminate Process#) -
socket
-
stat
(get file attributes) -
fstat
(get file attributes) -
system
(invoke commands) -
open
(open file) -
creat
(create file) -
close
(close File Descriptor#) -
read
(read information from file) -
write
(write information to file) -
lseek
(moves the file pointer) -
fcntl
(change the running file’s properties) -
kill
(send signal to process) -
msgget
(create or access to Message Queue) -
msgctl
(control operations on a message queue) -
msgsnd
(write message to the message queue) -
msgrcv
(read message from the message queue) -
semget
(create or access to Semaphore in System V) -
semctl
(control operations on a semaphore) -
semop
(perform operations on semaphore)