OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man2 / syscall.2
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)syscall.2   8.1 (Berkeley) 6/16/93
33 .\"
34 .\"
35 .\" 2002-03-20  Christoph Hellwig <hch@infradead.org>
36 .\"     - adopted for Linux
37 .\"
38 .\" Japanese Version Copyright (c) 2002 Yuichi SATO
39 .\"         all rights reserved.
40 .\" Translated Tue Aug  6 03:43:25 JST 2002
41 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
42 .\"
43 .TH SYSCALL 2 2007-07-26 "Linux" "Linux Programmer's Manual"
44 .\"O .SH NAME
45 .SH Ì¾Á°
46 .\"O syscall \- indirect system call
47 syscall \- ´ÖÀÜ¥·¥¹¥Æ¥à¥³¡¼¥ë
48 .\"O .SH SYNOPSIS
49 .SH ½ñ¼°
50 .nf
51 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
52 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
53 .B #include <unistd.h>
54 .BR "#include <sys/syscall.h>   "  "/* For SYS_xxx definitions */"
55
56 .BI "int syscall(int " number ", ...);"
57 .fi
58 .\"O .SH DESCRIPTION
59 .SH ÀâÌÀ
60 .\"O .BR syscall ()
61 .\"O performs the system call whose assembly language
62 .\"O interface has the specified
63 .\"O .I number
64 .\"O with the specified arguments.
65 .BR syscall ()
66 ¤Ï
67 .I number
68 ¤Ç»ØÄꤵ¤ì¤¿¥¢¥»¥ó¥Ö¥ê¸À¸ì¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¡¢
69 »ØÄꤵ¤ì¤¿°ú¤­¿ô¤ò¤Ä¤±¤Æ¼Â¹Ô¤¹¤ë¡£
70 .\"O Symbolic constants for system calls can be found in the header file
71 .\"O .IR <sys/syscall.h> .
72 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥·¥ó¥Ü¥ëÄê¿ô¤Ï¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë
73 .I <sys/syscall.h>
74 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£
75 .\"O .SH RETURN VALUE
76 .SH ÊÖ¤êÃÍ
77 .\"O The return value is defined by the system call being invoked.
78 ÊÖ¤êÃͤϸƤӽФµ¤ì¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£
79 .\"O In general, a 0 return value indicates success.
80 °ìÈ̤ˡ¢ÊÖ¤êÃÍ 0 ¤ÏÀ®¸ù¤òɽ¤¹¡£
81 .\"O A \-1 return value indicates an error,
82 .\"O and an error code is stored in
83 .\"O .IR errno .
84 \-1 ¤Ï¥¨¥é¡¼¤òɽ¤·¡¢¥¨¥é¡¼¥³¡¼¥É¤Ï
85 .I errno
86 ¤ËÆþ¤ì¤é¤ì¤ë¡£
87 .\"O .SH NOTES
88 .SH Ãí°Õ
89 .\"O .BR syscall ()
90 .\"O first appeared in
91 .\"O 4BSD.
92 .BR syscall ()
93 ¤Ï 4BSD ¤ÇºÇ½é¤ËÅо줷¤¿¡£
94 .\"O .SH EXAMPLE
95 .SH Îã
96 .nf
97 #define _GNU_SOURCE
98 #include <unistd.h>
99 #include <sys/syscall.h>
100 #include <sys/types.h>
101
102 int
103 main(int argc, char *argv[])
104 {
105     pid_t tid;
106
107     tid = syscall(SYS_gettid);
108 }
109 .fi
110 .\"O .SH SEE ALSO
111 .SH ´ØÏ¢¹àÌÜ
112 .BR _syscall (2),
113 .BR intro (2),
114 .BR syscalls (2)