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

setpgrp.3p (2513B)


  1. '\" et
  2. .TH SETPGRP "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. setpgrp
  12. \(em set the process group ID
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. pid_t setpgrp(void);
  19. .fi
  20. .SH DESCRIPTION
  21. If the calling process is not already a session leader,
  22. \fIsetpgrp\fR()
  23. sets the process group ID of the calling process to the process ID of
  24. the calling process. If
  25. \fIsetpgrp\fR()
  26. creates a new session, then the new session has no controlling
  27. terminal.
  28. .P
  29. The
  30. \fIsetpgrp\fR()
  31. function has no effect when the calling process is a session leader.
  32. .SH "RETURN VALUE"
  33. Upon completion,
  34. \fIsetpgrp\fR()
  35. shall return the process group ID.
  36. .SH ERRORS
  37. No errors are defined.
  38. .LP
  39. .IR "The following sections are informative."
  40. .SH EXAMPLES
  41. None.
  42. .SH "APPLICATION USAGE"
  43. It is unspecified whether this function behaves as
  44. .IR setpgid (0,0)
  45. or
  46. \fIsetsid\fR()
  47. unless the process is already a session leader. Therefore, applications
  48. are encouraged to use
  49. \fIsetpgid\fR()
  50. or
  51. \fIsetsid\fR()
  52. as appropriate.
  53. .SH RATIONALE
  54. None.
  55. .SH "FUTURE DIRECTIONS"
  56. The
  57. \fIsetpgrp\fR()
  58. function may be removed in a future version.
  59. .SH "SEE ALSO"
  60. .IR "\fIexec\fR\^",
  61. .IR "\fIfork\fR\^(\|)",
  62. .IR "\fIgetpid\fR\^(\|)",
  63. .IR "\fIgetsid\fR\^(\|)",
  64. .IR "\fIkill\fR\^(\|)",
  65. .IR "\fIsetpgid\fR\^(\|)",
  66. .IR "\fIsetsid\fR\^(\|)"
  67. .P
  68. The Base Definitions volume of POSIX.1\(hy2017,
  69. .IR "\fB<unistd.h>\fP"
  70. .\"
  71. .SH COPYRIGHT
  72. Portions of this text are reprinted and reproduced in electronic form
  73. from IEEE Std 1003.1-2017, Standard for Information Technology
  74. -- Portable Operating System Interface (POSIX), The Open Group Base
  75. Specifications Issue 7, 2018 Edition,
  76. Copyright (C) 2018 by the Institute of
  77. Electrical and Electronics Engineers, Inc and The Open Group.
  78. In the event of any discrepancy between this version and the original IEEE and
  79. The Open Group Standard, the original IEEE and The Open Group Standard
  80. is the referee document. The original Standard can be obtained online at
  81. http://www.opengroup.org/unix/online.html .
  82. .PP
  83. Any typographical or formatting errors that appear
  84. in this page are most likely
  85. to have been introduced during the conversion of the source files to
  86. man page format. To report such errors, see
  87. https://www.kernel.org/doc/man-pages/reporting_bugs.html .