OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man2 / syscall.2
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\"    must display the following acknowledgement:
15 .\"     This product includes software developed by the University of
16 .\"     California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\" %%%LICENSE_END
33 .\"
34 .\"     @(#)syscall.2   8.1 (Berkeley) 6/16/93
35 .\"
36 .\"
37 .\" 2002-03-20  Christoph Hellwig <hch@infradead.org>
38 .\"     - adopted for Linux
39 .\"
40 .\"*******************************************************************
41 .\"
42 .\" This file was generated with po4a. Translate the source file.
43 .\"
44 .\"*******************************************************************
45 .TH SYSCALL 2 2012\-08\-14 Linux "Linux Programmer's Manual"
46 .SH 名前
47 syscall \- 間接システムコール
48 .SH 書式
49 .nf
50 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
51 \fB#include <unistd.h>\fP
52 \fB#include <sys/syscall.h>   \fP/* For SYS_xxx definitions */
53
54 \fBint syscall(int \fP\fInumber\fP\fB, ...);\fP
55 .fi
56 .SH 説明
57 \fBsyscall\fP()  is a small library function that invokes the system call whose
58 assembly language interface has the specified \fInumber\fP with the specified
59 arguments.  Employing \fBsyscall\fP()  is useful, for example, when invoking a
60 system call that has no wrapper function in the C library.
61
62 \fBsyscall\fP()  saves CPU registers before making the system call, restores
63 the registers upon return from the system call, and stores any error code
64 returned by the system call in \fBerrno\fP(3)  if an error occurs.
65
66 Symbolic constants for system call numbers can be found in the header file
67 \fI<sys/syscall.h>\fP.
68 .SH 返り値
69 返り値は呼び出されたシステムコールによって定義される。 一般に、返り値 0 は成功を表す。 \-1 はエラーを表し、エラーコードは \fIerrno\fP
70 に入れられる。
71 .SH 注意
72 \fBsyscall\fP()  は 4BSD で最初に登場した。
73 .SH 例
74 .nf
75 #define _GNU_SOURCE
76 #include <unistd.h>
77 #include <sys/syscall.h>
78 #include <sys/types.h>
79
80 int
81 main(int argc, char *argv[])
82 {
83     pid_t tid;
84
85     tid = syscall(SYS_gettid);
86     tid = syscall(SYS_tgkill, getpid(), tid);
87 }
88 .fi
89 .SH 関連項目
90 \fB_syscall\fP(2), \fBintro\fP(2), \fBsyscalls\fP(2)
91 .SH この文書について
92 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
93 である。プロジェクトの説明とバグ報告に関する情報は
94 http://www.kernel.org/doc/man\-pages/ に書かれている。