GETUMASK(3)

πŸ“¦ version 5.10, in ubuntu jammy

πŸ’– 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