logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

getsid.3p (2544B)


  1. '\" et
  2. .TH GETSID "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. getsid
  12. \(em get the process group ID of a session leader
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. pid_t getsid(pid_t \fIpid\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIgetsid\fR()
  23. function shall obtain the process group ID of the process that is the
  24. session leader of the process specified by
  25. .IR pid .
  26. If
  27. .IR pid
  28. is (\fBpid_t\fR)0, it specifies the calling process.
  29. .SH "RETURN VALUE"
  30. Upon successful completion,
  31. \fIgetsid\fR()
  32. shall return the process group ID of the session leader of the specified
  33. process. Otherwise, it shall return \-1 and set
  34. .IR errno
  35. to indicate the error.
  36. .SH ERRORS
  37. The
  38. \fIgetsid\fR()
  39. function shall fail if:
  40. .TP
  41. .BR EPERM
  42. The process specified by
  43. .IR pid
  44. is not in the same session as the calling process, and the
  45. implementation does not allow access to the process group ID of the
  46. session leader of that process from the calling process.
  47. .TP
  48. .BR ESRCH
  49. There is no process with a process ID equal to
  50. .IR pid .
  51. .LP
  52. .IR "The following sections are informative."
  53. .SH EXAMPLES
  54. None.
  55. .SH "APPLICATION USAGE"
  56. None.
  57. .SH RATIONALE
  58. None.
  59. .SH "FUTURE DIRECTIONS"
  60. None.
  61. .SH "SEE ALSO"
  62. .IR "\fIexec\fR\^",
  63. .IR "\fIfork\fR\^(\|)",
  64. .IR "\fIgetpid\fR\^(\|)",
  65. .IR "\fIgetpgid\fR\^(\|)",
  66. .IR "\fIsetpgid\fR\^(\|)",
  67. .IR "\fIsetsid\fR\^(\|)"
  68. .P
  69. The Base Definitions volume of POSIX.1\(hy2017,
  70. .IR "\fB<unistd.h>\fP"
  71. .\"
  72. .SH COPYRIGHT
  73. Portions of this text are reprinted and reproduced in electronic form
  74. from IEEE Std 1003.1-2017, Standard for Information Technology
  75. -- Portable Operating System Interface (POSIX), The Open Group Base
  76. Specifications Issue 7, 2018 Edition,
  77. Copyright (C) 2018 by the Institute of
  78. Electrical and Electronics Engineers, Inc and The Open Group.
  79. In the event of any discrepancy between this version and the original IEEE and
  80. The Open Group Standard, the original IEEE and The Open Group Standard
  81. is the referee document. The original Standard can be obtained online at
  82. http://www.opengroup.org/unix/online.html .
  83. .PP
  84. Any typographical or formatting errors that appear
  85. in this page are most likely
  86. to have been introduced during the conversion of the source files to
  87. man page format. To report such errors, see
  88. https://www.kernel.org/doc/man-pages/reporting_bugs.html .