In Linux, system calls are used by user-space processes to request services or functionality from the operating system kernel. There are various types of system calls, each serving a specific purpose. Here are some common categories of system calls in Linux:
Process Control: fork(): Create a new process.
execve(): Replace the current process image with a new one.
wait(): Wait for the child process to exit.
exit(): Terminate the current process.
File System Operations:
open(): Open a file.
read(): Read data from a file.
write(): Write data to a file.
close(): Close a file.
stat(), fstat(), lstat(): Retrieve file status information.
mkdir(), rmdir(), unlink(): Create, remove, or delete directories and files.
rename(): Rename a file.
I/O Operations:
read(): Read data from a file descriptor.
write(): Write data to a file descriptor.
ioctl(): Perform I/O control operations on devices.
Process Communication:
pipe(): Create a pipe for interprocess communication.
shmget(), shmat(), shmdt(), shmctl(): Manage shared memory segments.
msgget(), msgsnd(), msgrcv(), msgctl(): Manage message queues.
semget(), semop(), semctl(): Manage semaphores.
Network Communication:
socket(): Create a network socket.
bind(), listen(), accept(): Configure and accept incoming connections.
connect(): Establish a connection.
send(), recv(): Send and receive data over a socket.
Time and Date:
time(): Get the current time in seconds since the epoch.
gettimeofday(): Get the current time with microsecond precision.
clock_gettime(): Get the time of a specified clock.
nanosleep(): Sleep for a specified duration.
User and Group Management:
getuid(), geteuid(), setuid(), seteuid(): Manage user and effective user IDs.
getgid(), getegid(), setgid(), setegid(): Manage group and effective group IDs.
System Information:
uname(): Get system information.
sysinfo(): Get overall system statistics.
getrlimit(), setrlimit(): Get and set resource limits.
getpid(): Get the process ID of the current process.
Memory Management:
brk(): Change the data segment size.
mmap(), munmap(): Map and unmap files or devices into memory.
These are just some of the many system calls available in Linux. Each system call serves a specific purpose and provides an interface for user-space programs to interact with the kernel to perform various operations, from process control and file management to I/O and networking.
Comments