C Language
System calls: See all
getpid()
- Gets PID of current processgetppid()
- Gets PID of the parrent of the current processprintf("Got pid %d .\n", pid)
- Write message and int to stdoutfflush(stdout)
- Flush stdoutsleep(1)
- Sleep for 1 secondexecvp("/bin/bash", args)
- execute process with argumentsfork()
- create a new process, cloned from the current one
System calls refer to calling functions implemented in the kernel. Glibc simplifies calling those functions(so that you don’t have to work with registers and know each function’s number). Shell utilities like chmod
, are merely some executables that make the system call.
See also:
- https://www.slashroot.in/what-is-system-call-in-unix-and-linux