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

setegid.3p (2761B)


  1. '\" et
  2. .TH SETEGID "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. setegid
  12. \(em set the effective group ID
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. int setegid(gid_t \fIgid\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. If
  22. .IR gid
  23. is equal to the real group ID or the saved set-group-ID, or if the
  24. process has appropriate privileges,
  25. \fIsetegid\fR()
  26. shall set the effective group ID of the calling process to
  27. .IR gid ;
  28. the real group ID, saved set-group-ID, and any supplementary group IDs
  29. shall remain unchanged.
  30. .P
  31. The
  32. \fIsetegid\fR()
  33. function shall not affect the supplementary group list in any way.
  34. .SH "RETURN VALUE"
  35. Upon successful completion, 0 shall be returned; otherwise, \-1 shall
  36. be returned and
  37. .IR errno
  38. set to indicate the error.
  39. .SH ERRORS
  40. The
  41. \fIsetegid\fR()
  42. function shall fail if:
  43. .TP
  44. .BR EINVAL
  45. The value of the
  46. .IR gid
  47. argument is invalid and is not supported by the implementation.
  48. .TP
  49. .BR EPERM
  50. The process does not have appropriate privileges and
  51. .IR gid
  52. does not match the real group ID or the saved set-group-ID.
  53. .LP
  54. .IR "The following sections are informative."
  55. .SH EXAMPLES
  56. None.
  57. .SH "APPLICATION USAGE"
  58. None.
  59. .SH RATIONALE
  60. Refer to the RATIONALE section in
  61. .IR "\fIsetuid\fR\^(\|)".
  62. .SH "FUTURE DIRECTIONS"
  63. None.
  64. .SH "SEE ALSO"
  65. .IR "\fIexec\fR\^",
  66. .IR "\fIgetegid\fR\^(\|)",
  67. .IR "\fIgeteuid\fR\^(\|)",
  68. .IR "\fIgetgid\fR\^(\|)",
  69. .IR "\fIgetuid\fR\^(\|)",
  70. .IR "\fIseteuid\fR\^(\|)",
  71. .IR "\fIsetgid\fR\^(\|)",
  72. .IR "\fIsetregid\fR\^(\|)",
  73. .IR "\fIsetreuid\fR\^(\|)",
  74. .IR "\fIsetuid\fR\^(\|)"
  75. .P
  76. The Base Definitions volume of POSIX.1\(hy2017,
  77. .IR "\fB<sys_types.h>\fP",
  78. .IR "\fB<unistd.h>\fP"
  79. .\"
  80. .SH COPYRIGHT
  81. Portions of this text are reprinted and reproduced in electronic form
  82. from IEEE Std 1003.1-2017, Standard for Information Technology
  83. -- Portable Operating System Interface (POSIX), The Open Group Base
  84. Specifications Issue 7, 2018 Edition,
  85. Copyright (C) 2018 by the Institute of
  86. Electrical and Electronics Engineers, Inc and The Open Group.
  87. In the event of any discrepancy between this version and the original IEEE and
  88. The Open Group Standard, the original IEEE and The Open Group Standard
  89. is the referee document. The original Standard can be obtained online at
  90. http://www.opengroup.org/unix/online.html .
  91. .PP
  92. Any typographical or formatting errors that appear
  93. in this page are most likely
  94. to have been introduced during the conversion of the source files to
  95. man page format. To report such errors, see
  96. https://www.kernel.org/doc/man-pages/reporting_bugs.html .