The relationship between C standard library functions and Linux system functions
C standard IO function call flow
The C library IO function provides a buffer, but the system IO function does not have a buffer
in conclusion
As can be seen from the above two figures, the C standard library functions belong to the upper-level calls, which are ultimately realized by calling Linux system functions. Therefore, programs written using standard library functions can be cross-platform , while the underlying calls are platform-related, and Linux calls belong Linux system functions, windows call windows system functions.
distinguish
Distinguish whether a function is a system function or a library function according to:
- Whether to access the kernel data structure
- Whether to access external hardware resources
Either of the two is a system function, and neither is a library function