kshirish
kshirish

Reputation: 1539

System calls vs System programs

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 ??

Upvotes: 4

Views: 12045

Answers (4)

Manodhya Opallage
Manodhya Opallage

Reputation: 301

System call provides an interface between the process and the Operating System. System call allows user-level process to request some services from the OS which process itself is not allowed to do. In handling the trap, the OS will enter in the kernel mode, where it has access to privileged instructions, can perform the desired services on behalf of user-level process.

Upvotes: 0

Hossein Kardgar
Hossein Kardgar

Reputation: 7

The system calls are list of the function that will be call in section between user and kernel . But the system program is the program that can do system works like : Change system settings . Access to registeries . Access to memory . Access to disk and etc .

Upvotes: 0

leminibleu
leminibleu

Reputation: 11

System programs are executable files while system calls are C routines which interact with operating system features and can be compiled into system programs.

For example 'ls' and '/bin/hostname' are executable system programs:

sh-3.2$ ls -l /bin/hostname
-rwxr-xr-x  1 root  wheel  14304 Jul 14 11:03 /bin/hostname
sh-3.2$ /bin/hostname
mycomputer

If you look at the man page for hostname it will refer you to 'gethostname(3)' which is a C system call, and in fact the same call used to provide the output for the hostname program.

Upvotes: 1

Jonathan Leffler
Jonathan Leffler

Reputation: 753695

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

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:

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

Upvotes: 4

Related Questions