Difference between write() and printf()

后端 未结 6 1838
春和景丽
春和景丽 2020-12-09 04:03

Recently I am studying operating system..I just wanna know:

What’s the difference between a system call (like write()) and a standard library function (like printf()

6条回答
  •  没有蜡笔的小新
    2020-12-09 04:44

    System calls are implemented by the operating system, and run in kernel mode. Library functions are implemented in user mode, just like application code. Library functions might invoke system calls (e.g. printf eventually calls write), but that depends on what the library function is for (math functions usually don't need to use the kernel).

提交回复
热议问题