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

umask.3p (3442B)


  1. '\" et
  2. .TH UMASK "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. umask
  12. \(em set and get the file mode creation mask
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/stat.h>
  17. .P
  18. mode_t umask(mode_t \fIcmask\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIumask\fR()
  23. function shall set the file mode creation mask of the process to
  24. .IR cmask
  25. and return the previous value of the mask. Only the file permission
  26. bits of
  27. .IR cmask
  28. (see
  29. .IR <sys/stat.h> )
  30. are used; the meaning of the other bits is implementation-defined.
  31. .P
  32. The file mode creation mask of the process is used to turn off
  33. permission bits in the
  34. .IR mode
  35. argument supplied during calls to the following functions:
  36. .IP " *" 4
  37. \fIopen\fR(),
  38. \fIopenat\fR(),
  39. \fIcreat\fR(),
  40. \fImkdir\fR(),
  41. \fImkdirat\fR(),
  42. \fImkfifo\fR(),
  43. and
  44. \fImkfifoat\fR()
  45. .IP " *" 4
  46. \fImknod\fR(),
  47. \fImknodat\fR()
  48. .IP " *" 4
  49. \fImq_open\fR()
  50. .IP " *" 4
  51. \fIsem_open\fR()
  52. .P
  53. Bit positions that are set in
  54. .IR cmask
  55. are cleared in the mode of the created file.
  56. .SH "RETURN VALUE"
  57. The file permission bits in the value returned by
  58. \fIumask\fR()
  59. shall be the previous value of the file mode creation mask. The state
  60. of any other bits in that value is unspecified, except that a
  61. subsequent call to
  62. \fIumask\fR()
  63. with the returned value as
  64. .IR cmask
  65. shall leave the state of the mask the same as its state before the
  66. first call, including any unspecified use of those bits.
  67. .SH ERRORS
  68. No errors are defined.
  69. .LP
  70. .IR "The following sections are informative."
  71. .SH EXAMPLES
  72. None.
  73. .SH "APPLICATION USAGE"
  74. None.
  75. .SH RATIONALE
  76. Unsigned argument and return types for
  77. \fIumask\fR()
  78. were proposed. The return type and the argument were both changed to
  79. .BR mode_t .
  80. .P
  81. Historical implementations have made use of additional bits in
  82. .IR cmask
  83. for their implementation-defined purposes. The addition of the text
  84. that the meaning of other bits of the field is implementation-defined
  85. permits these implementations to conform to this volume of POSIX.1\(hy2017.
  86. .SH "FUTURE DIRECTIONS"
  87. None.
  88. .SH "SEE ALSO"
  89. .IR "\fIcreat\fR\^(\|)",
  90. .IR "\fIexec\fR\^",
  91. .IR "\fImkdir\fR\^(\|)",
  92. .IR "\fImkfifo\fR\^(\|)",
  93. .IR "\fImknod\fR\^(\|)",
  94. .IR "\fImq_open\fR\^(\|)",
  95. .IR "\fIopen\fR\^(\|)",
  96. .IR "\fIsem_open\fR\^(\|)"
  97. .P
  98. The Base Definitions volume of POSIX.1\(hy2017,
  99. .IR "\fB<sys_stat.h>\fP",
  100. .IR "\fB<sys_types.h>\fP"
  101. .\"
  102. .SH COPYRIGHT
  103. Portions of this text are reprinted and reproduced in electronic form
  104. from IEEE Std 1003.1-2017, Standard for Information Technology
  105. -- Portable Operating System Interface (POSIX), The Open Group Base
  106. Specifications Issue 7, 2018 Edition,
  107. Copyright (C) 2018 by the Institute of
  108. Electrical and Electronics Engineers, Inc and The Open Group.
  109. In the event of any discrepancy between this version and the original IEEE and
  110. The Open Group Standard, the original IEEE and The Open Group Standard
  111. is the referee document. The original Standard can be obtained online at
  112. http://www.opengroup.org/unix/online.html .
  113. .PP
  114. Any typographical or formatting errors that appear
  115. in this page are most likely
  116. to have been introduced during the conversion of the source files to
  117. man page format. To report such errors, see
  118. https://www.kernel.org/doc/man-pages/reporting_bugs.html .