System call vs Function call

后端 未结 10 708
遥遥无期
遥遥无期 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:10

    System call is executed at kernet level and not in user spce because it requires some prievilege to access the hardware.

    Therfore when programming in user space and making some ordinary function call like fopen in C language the libc generally wrap this function to specific code code where an interrupt is generated to switch from user space to kernel space , then in kernel space the required system call to perform the functionality of the function call at hardware level will be executed in kernel space .

提交回复
热议问题