.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond .\" Modified 2001-12-17, aeb .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Thu Dec 11 23:36:57 JST 1997 .\" by HANATAKA Shinya .\" Updated Thu Jan 17 JST 2001 by Kentaro Shirakata .\" .\"WORD: session セッション .\"WORD: process プロセス .\" .TH GETSID 2 2008-12-05 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O getsid \- get session ID getsid \- セッション ID を取得する。 .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .BI "pid_t getsid(pid_t" " pid" ); .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR getsid (): _XOPEN_SOURCE\ >=\ 500 .\"O .SH DESCRIPTION .SH 説明 .\"O .I getsid(0) .\"O returns the session ID of the calling process. .\"O .I getsid(p) .\"O returns the session ID of the process with process ID .\"O .IR p . .I getsid(0) は呼び出し元のプロセスのセッション ID を返す。 .I getsid(p) はプロセス ID .I p を持つプロセスのセッション ID を返す .\"O (The session ID of a process is the process group ID of the .\"O session leader.) (プロセスのセッション ID は セッションリーダーのプロセスグループ ID である)。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, a session ID is returned. .\"O On error, \fI(pid_t)\ \-1\fP will be returned, and .\"O .I errno .\"O is set appropriately. 成功すると、セッション ID が返される。 エラーの場合、\fI(pid_t) \-1\fP が返され、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EPERM .\"O A process with process ID .\"O .I p .\"O exists, but it is not in the same session as the calling process, .\"O and the implementation considers this an error. プロセス ID .I p のプロセスは存在するが、呼び出し元のプロセスと同じセッションではなく、 さらに実装がこの状態をエラーと判断した場合。 .TP .B ESRCH .\"O No process with process ID .\"O .I p .\"O was found. プロセス ID が .I p のプロセスがない。 .\"O .SH VERSIONS .SH バージョン .\"O This system call is available on Linux since version 2.0. このシステムコールは Linux バージョン 2.0 以降で利用可能である。 .\" Linux has this system call since Linux 1.3.44. .\" There is libc support since libc 5.2.19. .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, POSIX.1-2001 .\"O .SH NOTES .SH 注意 .\"O Linux does not return .\"O .BR EPERM . Linux は .B EPERM を返さない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR getpgid (2), .BR setsid (2), .BR credentials (7)