GETUMASK(3)
π GETUMASK β getumask(3) π
okay bestie, pull up a chair, we're in the Linux Programmer's Manual today and the vibe is chaotic π¦
β¨ NAME β¨
getumask β get file creation mask πΈ
β¨ SYNOPSIS β¨
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/types.h>
#include <sys/stat.h>
mode_t getumask(void);
β¨ DESCRIPTION β¨
so like, this function returns the current file creation mask. that's it. that's the whole job π
it is equivalent to this lil guy right here:
mode_t getumask(void)
{
mode_t mask = umask( 0 );
umask(mask);
return mask;
}
EXCEPT β and this is the part that's giving main character energy β it is documented to be thread-safe. which is to say, it shares a lock with the umask(2) library call π«Ά
so yeah, same result, but it plays nice with your threads. iconic behavior, honestly. β¨
β¨ CONFORMING TO β¨
this is a vaporware GNU extension π
bestie. vaporware. it is not real. it does not exist. it's a β¨conceptβ¨. no cap.
β¨ NOTES β¨
so here's the tea π΅ β this function is documented in the glibc manual, but as at glibc version 2.24, it is not implemented on Linux. like, at all. it's a ghost. it's a rumor. it's the group chat member who never speaks π
(if you actually want to find out a process's umask in a thread-safe way, go check out umask(2), it's got you π)
β¨ SEE ALSO β¨
π COLOPHON π
this page is part of release 5.10 of the Linux man-pages project π
a description of the project, info about reporting bugs, and the latest version of this page can all be found at:
https://www.kernel.org/doc/man-pages/
okay so that's the whole page, bestie, you ate that reading it fr fr π
β¨ this was the GNU version, dated 2017-09-15, and it's giving GETUMASK(3) energy from start to finish. slay, go touch some files π¦π
π¦ where this page comes from
- ubuntu jammy: manpages-dev 5.10-1ubuntu1
- Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms