位置:首頁 > 其他技術 > Unix/Linux係統調用 > intro()函數 Unix/Linux

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/.