What's the difference between “C system calls” and “C library routines”?

前端 未结 5 1051
误落风尘
误落风尘 2020-12-01 01:20

There are multiple sections in the manpages. Two of them are:

2     Unix and C system calls
3     C Library routines for C programs

For example there i

5条回答
  •  长情又很酷
    2020-12-01 01:41

    System calls are operating system functions, like on UNIX, the malloc() function is built on top of the sbrk() system call (for resizing process memory space).

    Libraries are just application code that's not part of the operating system and will often be available on more than one OS. They're basically the same as function calls within your own program.

    The line can be a little blurry but just view system calls as kernel-level functionality.

提交回复
热议问题