Linux learning summary (7) the relationship between library functions and system functions

The relationship between C standard library functions and Linux system functions

Insert picture description here

C standard IO function call flow

Insert picture description here
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

Guess you like

Origin blog.csdn.net/bureau123/article/details/111872903