]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getumask.3
proc.5: Note kernel version for /proc/PID/smaps VmFlags "wf" flag
[thirdparty/man-pages.git] / man3 / getumask.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" This replaces an earlier man page written by Walter Harms
26.\" <walter.harms@informatik.uni-oldenburg.de>.
27.\"
4b8c67d9 28.TH GETUMASK 3 2017-09-15 "GNU" "Linux Programmer's Manual"
fea681da
MK
29.SH NAME
30getumask \- get file creation mask
31.SH SYNOPSIS
86b91fdf 32.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
cc4615cc 33.br
fea681da
MK
34.B "#include <sys/types.h>"
35.br
36.B "#include <sys/stat.h>"
68e4db0a 37.PP
fea681da
MK
38.B "mode_t getumask(void);"
39.SH DESCRIPTION
40This function returns the current file creation mask.
41It is equivalent to
e646a1ba 42.PP
a08ea57c 43.in +4n
e646a1ba 44.EX
c13182ef 45mode_t getumask(void)
b9f02710 46{
4a632544 47 mode_t mask = umask( 0 );
b9f02710
MK
48 umask(mask);
49 return mask;
fea681da 50}
e646a1ba 51.EE
a08ea57c 52.in
e646a1ba 53.PP
fea681da
MK
54except that it is documented to be thread-safe (that is, shares
55a lock with the
fb186734 56.BR umask (2)
fea681da 57library call).
47297adb 58.SH CONFORMING TO
d9bfdb9c 59This is a vaporware GNU extension.
2b2581ee 60.SH NOTES
48523e34
MK
61This function is documented in the glibc manual, but,
62as at glibc version 2.24, it is not implemented on Linux.
fb229116
MK
63(See
64.BR umask (2)
65for a thread-safe method of discovering a process's umask.)
47297adb 66.SH SEE ALSO
fea681da 67.BR umask (2)