What is the difference between a system call and a function call? Is fopen() a system call or a function call?
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 .