What is the difference between a Library call and a System call in Linux?

There's not really such a thing as a "library call". You can call a function that's linked to a shared library. And that just means that the library path is looked up at runtime to determine the location of the function to call.

System calls are low level kernel calls handled by the kernel.


If you type man man in your shell, you will see the list of the manual sections

2 System calls (functions provided by the kernel)

3 Library calls (functions within program libraries)

For instance, you will find chmod in the section 2 of the manual when typing man chmod. And fprintf in the section 3.


System calls are handled directly by the kernel.

Library calls are handled by a dynamic (or statically linked) library. The program making the library call must first import that library, before the call will work. The library calls themselves may use system calls.

Sometimes libraries are provided as "front-ends" to system calls, to provide extra functionality or ease of use not provided by the kernel.