问题描述
什么是系统调用和函数调用的区别?是fopen()函数的系统调用或函数调用?
What is the difference between a system call and a function call? Is fopen() a system call or a function call?
推荐答案
一个系统调用是一个调用到内核code,通常由执行中断执行。中断导致内核接管并执行请求的操作,然后把控制权返回给应用程序。这个模式切换的原因是系统调用是慢于等效的应用程序级的函数来执行。
A system call is a call into kernel code, typically performed by executing an interrupt. The interrupt causes the kernel to take over and perform the requested action, then hands control back to the application. This mode switching is the reason that system calls are slower to execute than an equivalent application-level function.
的fopen
是从C库,内部,执行一个或多个系统调用的函数。一般情况下,作为一个C程序员,你很少需要,因为C库包装他们为你使用系统调用。
fopen
is a function from the C library that, internally, performs one or more system calls. Generally, as a C programmer, you rarely need to use system calls because the C library wraps them for you.
这篇关于系统调用VS函数调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!