System call vs Function call

后端 未结 10 692
遥遥无期
遥遥无期 2020-12-04 14:27

What is the difference between a system call and a function call? Is fopen() a system call or a function call?

10条回答
  •  独厮守ぢ
    2020-12-04 15:15

    Just to complete the picture presented by the others, fopen is commonly implemented as a wrapper around open, which is also a user-accessible function. fopen is, in a sense, higher-level than open since the FILE* structure it returns encapsulates stuff for the user. Some users use open directly for special needs. Therefore it wouldn't be right to call fopen a "system call" in any way. Nor does it execute system calls directly, since open is also a function callable by the user.

提交回复
热议问题