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