getumask(3)

getumask3

Get file creation mask

Usage

#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/types.h>
#include <sys/stat.h>

mode_t getumask(void);

Overview

This function returns the current file creation mask. It is equivalent to

mode_t getumask(void)
{
    mode_t mask = umask( 0 );
    umask(mask);
    return mask;
}

except that it is documented to be thread-safe (that is, shares a lock with the umask(2) library call).

Notes

This function is documented in the glibc manual, but, as at glibc version 2.24, it is not implemented on Linux. (See umask(2) for a thread-safe method of discovering a process's umask.)

Releases

9 releases since Debian 3.1 (Sarge); the text changed 8 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10
  9. 11

Conforming to

This is a vaporware GNU extension.

Colophon

This page is part of release 5.10 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.

From manpages-dev 5.10-1 in Debian 11 (Bullseye). Parsed by carta from the page's man source.