System calls and library calls
I have wondered for sometime what the difference is between
system calls (found in section 2 of the man pages)
and library calls (in section 3).
Its simple...
- system calls are provided by the system
and are executed in the system kernel. They are entry points
into the kernel and are therefore NOT linked into your
program. These are not portable
calls.
- Library calls include the ANSI C standard library and are
therefore portable. These functions are linked into your program.
It is worth noting that, because system calls are part of the
O/S. The program has to make a context switch to the kernel
when they are called and because of this, they have a high
startup overhead. The upside is that the time executing these
routines is assigned to the OS and not the user program.
Martin Leslie
file: /Techref/language/ccpp/cref/LIBRARIES/syscalls.htm,
1KB, , updated: 2003年3月20日 10:39, local time: 2025年9月7日 21:48,
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Questions?<A HREF="http://techref.massmind.org/techref/language/ccpp/cref/LIBRARIES/syscalls.htm"> System calls and library calls</A>
Did you find what you needed?
Welcome to massmind.org!
Welcome to techref.massmind.org!
.