System calls vs System programs

linux, unix

Solution

A system call looks like a function that is called from a program. Examples of system calls include:

- `open()`,

- `close()`,

- `read()`,

- `write()`.

A system utility is a complete program that you execute from a shell prompt, from within a shell script, or (possibly confusingly) via the `system()` function in C (which in turn uses, amongst other system calls, `fork()` and `execv()`).

Example commands (system utilities) include:

- `cat`

- `ls`

- `date`

- `make`

Thus, system calls are used within programs; system utilities are programs.

Problem

I was just reading about System programs (sometimes called system utilities). Then I had a doubt in my mind that what is the difference between system calls and system programs ??

Original source