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

getuid.3p (2794B)


  1. '\" et
  2. .TH GETUID "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. getuid
  12. \(em get a real user ID
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. uid_t getuid(void);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIgetuid\fR()
  23. function shall return the real user ID of the calling process.
  24. The
  25. \fIgetuid\fR()
  26. function shall not modify
  27. .IR errno .
  28. .SH "RETURN VALUE"
  29. The
  30. \fIgetuid\fR()
  31. function shall always be successful and no return value is reserved to
  32. indicate the error.
  33. .SH ERRORS
  34. No errors are defined.
  35. .LP
  36. .IR "The following sections are informative."
  37. .SH EXAMPLES
  38. .SS "Setting the Effective User ID to the Real User ID"
  39. .P
  40. The following example sets the effective user ID of the calling
  41. process to the real user ID.
  42. .sp
  43. .RS 4
  44. .nf
  45. #include <unistd.h>
  46. \&...
  47. seteuid(getuid());
  48. .fi
  49. .P
  50. .RE
  51. .SH "APPLICATION USAGE"
  52. None.
  53. .SH RATIONALE
  54. In a conforming environment,
  55. \fIgetuid\fR()
  56. will always succeed. It is possible for implementations to provide
  57. an extension where a process in a non-conforming environment
  58. will not be associated with a user or group ID. It is recommended
  59. that such implementations return (\c
  60. .BR uid_t )\-1
  61. and set
  62. .IR errno
  63. to indicate such an environment; doing so does not violate
  64. this standard, since such an environment is already an extension.
  65. .SH "FUTURE DIRECTIONS"
  66. None.
  67. .SH "SEE ALSO"
  68. .IR "\fIgetegid\fR\^(\|)",
  69. .IR "\fIgeteuid\fR\^(\|)",
  70. .IR "\fIgetgid\fR\^(\|)",
  71. .IR "\fIsetegid\fR\^(\|)",
  72. .IR "\fIseteuid\fR\^(\|)",
  73. .IR "\fIsetgid\fR\^(\|)",
  74. .IR "\fIsetregid\fR\^(\|)",
  75. .IR "\fIsetreuid\fR\^(\|)",
  76. .IR "\fIsetuid\fR\^(\|)"
  77. .P
  78. The Base Definitions volume of POSIX.1\(hy2017,
  79. .IR "\fB<sys_types.h>\fP",
  80. .IR "\fB<unistd.h>\fP"
  81. .\"
  82. .SH COPYRIGHT
  83. Portions of this text are reprinted and reproduced in electronic form
  84. from IEEE Std 1003.1-2017, Standard for Information Technology
  85. -- Portable Operating System Interface (POSIX), The Open Group Base
  86. Specifications Issue 7, 2018 Edition,
  87. Copyright (C) 2018 by the Institute of
  88. Electrical and Electronics Engineers, Inc and The Open Group.
  89. In the event of any discrepancy between this version and the original IEEE and
  90. The Open Group Standard, the original IEEE and The Open Group Standard
  91. is the referee document. The original Standard can be obtained online at
  92. http://www.opengroup.org/unix/online.html .
  93. .PP
  94. Any typographical or formatting errors that appear
  95. in this page are most likely
  96. to have been introduced during the conversion of the source files to
  97. man page format. To report such errors, see
  98. https://www.kernel.org/doc/man-pages/reporting_bugs.html .