]>
Commit | Line | Data |
---|---|---|
a209ce80 | 1 | .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 2 | .\" |
a209ce80 MK |
3 | .\" Permission is granted to make and distribute verbatim copies of this |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
fea681da | 6 | .\" |
a209ce80 MK |
7 | .\" Permission is granted to copy and distribute modified versions of this |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
fea681da | 11 | .\" |
a209ce80 MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
fea681da | 19 | .\" |
a209ce80 MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
fea681da | 22 | .\" |
a209ce80 MK |
23 | .\" 2007-10-23 mtk: moved the _syscallN specific material to the |
24 | .\" new _syscall(2) page, and substantially enhanced and rewrote | |
25 | .\" the remaining material on this page. | |
fea681da | 26 | .\" |
4af700b7 | 27 | .TH INTRO 2 2010-11-11 "Linux" "Linux Programmer's Manual" |
fea681da | 28 | .SH NAME |
f68512e9 | 29 | intro \- introduction to system calls |
fea681da | 30 | .SH DESCRIPTION |
a209ce80 MK |
31 | Section 2 of the manual describes the Linux system calls. |
32 | A system call is an entry point into the Linux kernel. | |
33 | Usually, system calls are not invoked directly: | |
34 | instead, most system calls have corresponding C library | |
35 | wrapper functions which perform the steps required | |
36 | (e.g., trapping to kernel mode) in order to invoke | |
37 | the system call. | |
8e09de4e | 38 | Thus, making a system call looks the same as invoking a normal |
a209ce80 MK |
39 | library function. |
40 | ||
41 | For a list of the Linux system calls, see | |
42 | .BR syscalls (2). | |
43 | .SH RETURN VALUE | |
44 | On error, most system calls return a negative error number | |
45 | (i.e., the negated value of one of the constants described in | |
46 | .BR errno (3)). | |
47 | The C library wrapper hides this detail from the caller: when a | |
48 | system call returns a negative value, the wrapper copies the | |
49 | absolute value into the | |
50 | .I errno | |
51 | variable, and returns \-1 as the return value of the wrapper. | |
fea681da | 52 | |
a209ce80 | 53 | The value returned by a successful system call depends on the call. |
c7094399 | 54 | Many system calls return 0 on success, but some can return nonzero |
a209ce80 MK |
55 | values from a successful call. |
56 | The details are described in the individual manual pages. | |
fea681da | 57 | |
a209ce80 MK |
58 | In some cases, |
59 | the programmer must define a feature test macro in order to obtain | |
60 | the declaration of a system call from the header file specified | |
61 | in the man page SYNOPSIS section. | |
e417acb0 MK |
62 | (Where required, these feature test macros must be defined before including |
63 | .I any | |
64 | header files.) | |
a209ce80 MK |
65 | In such cases, the required macro is described in the man page. |
66 | For further information on feature test macros, see | |
67 | .BR feature_test_macros (7). | |
a1d5f77c | 68 | .SH "CONFORMING TO" |
008f1ecc | 69 | Certain terms and abbreviations are used to indicate UNIX variants |
a209ce80 | 70 | and standards to which calls in this section conform. |
a1d5f77c MK |
71 | See |
72 | .BR standards (7). | |
fea681da | 73 | .SH NOTES |
c634028a | 74 | .SS "Calling directly" |
a209ce80 MK |
75 | In most cases, it is unnecessary to invoke a system call directly, |
76 | but there are times when the Standard C library does not implement | |
77 | a nice wrapper function for you. | |
78 | In this case, the programmer must manually invoke the system call using | |
79 | .BR syscall (2). | |
80 | Historically, this was also possible using one of the _syscall macros | |
81 | described in | |
82 | .BR _syscall (2). | |
c634028a | 83 | .SS Authors and copyright conditions |
a209ce80 MK |
84 | Look at the header of the manual page source for the author(s) and copyright |
85 | conditions. | |
86 | Note that these can be different from page to page! | |
fea681da | 87 | .SH "SEE ALSO" |
4af700b7 MK |
88 | .ad l |
89 | .nh | |
a209ce80 | 90 | .BR _syscall (2), |
fea681da | 91 | .BR syscall (2), |
4af700b7 MK |
92 | .BR syscalls (2), |
93 | .BR errno (3), | |
94 | .BR intro (3), | |
95 | .BR capabilities (7), | |
96 | .BR credentials (7), | |
97 | .BR feature_test_macros (7), | |
98 | .BR mq_overview (7), | |
99 | .BR path_resolution (7), | |
100 | .BR pipe (7), | |
101 | .BR pty (7), | |
102 | .BR sem_overview (7), | |
103 | .BR shm_overview (7), | |
104 | .BR signal (7), | |
4af700b7 | 105 | .BR socket (7), |
2bfa8272 MK |
106 | .BR standards (7), |
107 | .BR svipc (7), | |
4af700b7 MK |
108 | .BR symlink (7), |
109 | .BR time (7) |