OSDN Git Service

df48ac191900d9d4e9ff3834143cde9af529ca42
[linuxjm/LDP_man-pages.git] / draft / man2 / getsid.2
1 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond <esr@y\thyrsus.com>
24 .\" Modified 2001-12-17, aeb
25 .\"
26 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
27 .\"         all rights reserved.
28 .\" Translated Thu Dec 11 23:36:57 JST 1997
29 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
30 .\" Updated Thu Jan 17 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
31 .\"
32 .\"WORD:        session                 ¥»¥Ã¥·¥ç¥ó
33 .\"WORD:        process                 ¥×¥í¥»¥¹
34 .\"
35 .TH GETSID 2 2008-12-05 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH Ì¾Á°
38 .\"O getsid \- get session ID
39 getsid \- ¥»¥Ã¥·¥ç¥ó ID ¤ò¼èÆÀ¤¹¤ë¡£
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .B #include <unistd.h>
43 .sp
44 .BI "pid_t getsid(pid_t" " pid" );
45 .sp
46 .in -4n
47 .\"O Feature Test Macro Requirements for glibc (see
48 .\"O .BR feature_test_macros (7)):
49 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
50 .RB ( feature_test_macros (7)
51 »²¾È):
52 .in
53 .sp
54 .BR getsid ():
55 _XOPEN_SOURCE\ >=\ 500
56 .\"O .SH DESCRIPTION
57 .SH ÀâÌÀ
58 .\"O .I getsid(0)
59 .\"O returns the session ID of the calling process.
60 .\"O .I getsid(p)
61 .\"O returns the session ID of the process with process ID
62 .\"O .IR p .
63 .I getsid(0)
64 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹¡£
65 .I getsid(p)
66 ¤Ï¥×¥í¥»¥¹ ID
67 .I p 
68 ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹
69 .\"O (The session ID of a process is the process group ID of the
70 .\"O session leader.)
71 (¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤Ï ¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¡¼¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ç¤¢¤ë)¡£
72 .\"O .SH RETURN VALUE
73 .SH ÊÖ¤êÃÍ
74 .\"O On success, a session ID is returned.
75 .\"O On error, \fI(pid_t)\ \-1\fP will be returned, and
76 .\"O .I errno
77 .\"O is set appropriately.
78 À®¸ù¤¹¤ë¤È¡¢¥»¥Ã¥·¥ç¥ó ID ¤¬ÊÖ¤µ¤ì¤ë¡£
79 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\fI(pid_t) \-1\fP ¤¬ÊÖ¤µ¤ì¡¢
80 .I errno
81 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
82 .\"O .SH ERRORS
83 .SH ¥¨¥é¡¼
84 .TP
85 .B EPERM
86 .\"O A process with process ID
87 .\"O .I p
88 .\"O exists, but it is not in the same session as the calling process,
89 .\"O and the implementation considers this an error.
90 ¥×¥í¥»¥¹ ID
91 .I p
92 ¤Î¥×¥í¥»¥¹¤Ï¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ç¤Ï¤Ê¤¯¡¢
93 ¤µ¤é¤Ë¼ÂÁõ¤¬¤³¤Î¾õÂÖ¤ò¥¨¥é¡¼¤ÈȽÃǤ·¤¿¾ì¹ç¡£
94 .TP
95 .B ESRCH
96 .\"O No process with process ID
97 .\"O .I p
98 .\"O was found.
99 ¥×¥í¥»¥¹ ID ¤¬
100 .I p
101 ¤Î¥×¥í¥»¥¹¤¬¤Ê¤¤¡£
102 .\"O .SH VERSIONS
103 .SH ¥Ð¡¼¥¸¥ç¥ó
104 .\"O This system call is available on Linux since version 2.0.
105 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥Ð¡¼¥¸¥ç¥ó 2.0 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
106 .\" Linux has this system call since Linux 1.3.44.
107 .\" There is libc support since libc 5.2.19.
108 .\"O .SH "CONFORMING TO"
109 .SH ½àµò
110 SVr4, POSIX.1-2001
111 .\"O .SH NOTES
112 .SH Ãí°Õ
113 .\"O Linux does not return
114 .\"O .BR EPERM .
115 Linux ¤Ï
116 .B EPERM
117 ¤òÊÖ¤µ¤Ê¤¤¡£
118 .\"O .SH "SEE ALSO"
119 .SH ´ØÏ¢¹àÌÜ
120 .BR getpgid (2),
121 .BR setsid (2),
122 .BR credentials (7)