Sunday, March 19, 2006

How is a Library Call Different from System Call?

Answer: Simply, Library calls are part of the language/ application, system calls are part of the Operating System.

How: A system call gets into the kernel by issuing a "trap" or interrupt.

Below is the versus between these two calls:

  1. Example, the C Library is same on every ANSI C implmentation. System calls are different in each OS.
  2. Library call is a call to a routine in a library. System call is a call to the kernel for a service.
  3. Library call are linked with user program. System call is an entry point to the OS.
  4. Library calls are executed in user address space. System calls are executed in kernel address space.
  5. Library calls are counted as part of "user" time. System calls are counted as part of the "system" time.
  6. Library calls has the lower overhead of the procedural call. System calls have higher overhead context switch to kernel and back.

No comments: