intro()函数 Unix/Linux
描述
本手册的第二部分描述了Linux的系统调用。系统调用是一个入口点到Linux内核中。通常情况下,系统调用不直接调用:相反,大多数系统调用都有相应的C库函数的包装而执行所需的步骤(例如,捕获到内核模式),以便调用系统调用。因此,做一个系统调用看起来一样调用一个正常的库函数。对于Linux系统调用列表,请参阅 syscalls(2).
返回值
On error, most system calls return a negative error number (i.e., the negated value of one of the constants described in errno(3)). The C library wrapper hides this detail from the caller: when a system call returns a negative value, the wrapper copies the absolute value into the errno variable, and returns -1 as the return value of the wrapper.一个成功的系统调用返回的值取决于调用。许多系统调用返回0表示成功,但有些可以从一个成功的调用返回非零值。详情载于个别的手册页描述。
In some cases, the programmer must define a feature test macro in order to obtain the declaration of a system call from the header file specified in the man page SYNOPSIS section. In such cases, the required macro is described in the man page. For further information on feature test macros, see feature_test_macros(7).