intro()函式 Unix/Linux


intro - 介紹系統呼叫

描述

本手冊的第二部分描述了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).

遵循於

某些術語和縮寫用於指示的Unix變體和標準在本節所謂符合。看 standards(7).

注意

直接呼叫

In most cases, it is unnecessary to invoke a system call directly, but there are times when the Standard C library does not implement a nice wrapper function for you. In this case, the programmer must manually invoke the system call using syscall(2). Historically, this was also possible using one of the _syscall macros described in_syscall(2).

作者和版權條款

Look at the header of the manual page source for the author(s) and copyright conditions. Note that these can be different from page to page!

另請參閱

This page is part of release 3.00 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.