Library functions vs. System Calls
- Standard functions can be divided in two main categories :-
- Library function calls.
- System function calls.
- The functions which are a part of standard C library are known as Library functions. For instance, strcmp(), strlen() etc are all library functions.
- The functions which change the execution mode of the program from user mode to kernel mode are known as system calls. For instance, socket(), open(), read() , write() etc are all system calls.
- A library function is linked to the user program and executes in user space but a system call is not linked to a user program and executes in kernel space.
- A library function execution time is counted in user level time but a system call execution time is counted as a part of system time.
- Library functions can be debugged by using a debugger but System calls cannot be debugged because they are executed by the kernel.