.\" 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 .\" Дата последней коррекции перевода 01.01.2004 .\" Перевод с английского сделал Виктор Вислобоков .\" http://www.linuxshare.ru/projects/trans/mans.html .\" .TH GETSID 2 2001-12-17 "Linux 2.5.0" "Руководство программиста Linux" .SH NAME getsid \- получить ID сессии .SH ОБЗОР .B #include .sp .BI "pid_t getsid(pid_t" " pid" ); .SH ОПИСАНИЕ .B getsid(0) возвращает идентификатор (ID) сессии, вызвавшего процесса. .BI getsid( p ) возвращает идентификатор сессии процесса с номером .IR p . (Идентификатор сессии процесса \- это идентификатор группы процесса, который является лидером сессии). В случае ошибки, (pid_t) будет возвращено значение \-1 и значение .I errno будет установлено соответствующим образом. .SH ОШИБКИ .TP .B EPERM Процесс с номером .I p существует, но он не находится в той же сессии, что и текущий процесс, в результате это считается ошибкой. .TP .B ESRCH Не найден процесс с указанным номером .I p . .SH "СООТВЕТСТВИЕ СТАНДАРТАМ" SVr4, POSIX 1003.1-2001. .SH ЗАМЕЧАНИЯ Linux не возвращает EPERM. .LP Linux имеет данный системный вызов начиная с версии Linux 1.3.44. Поддержка вызова в libc реализована, начиная с libc 5.2.19. .LP Чтобы получить прототип в glibc, задайте _XOPEN_SOURCE и _XOPEN_SOURCE_EXTENDED, или используйте "#define _XOPEN_SOURCE \fIn\fP", где значение \fIn\fP должно быть целым и быть больше или равно 500. .SH "СМОТРИТЕ ТАКЖЕ" .BR getpgid (2), .BR setsid (2) .SH ПЕРЕВОД Перевёл с английского Виктор Вислобоков 2003