I would like to know what is the difference between a Library call and a System call in Linux. Any pointers for a good understanding of the concepts behind both will be greatly appreciated.
|
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
For instance, you will find |
|||
|
|
|
System calls are handled directly by the kernel. Library calls are handled by a dynamic 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. |
|||
|
|
|
System calls are functions that the operating system provides for applications to use. Whereas functions like the ones in math.h, string.h, etc are those that doesn't have anything to do with interfacing with the operating system. |
|||
|
|