1

Is it "user mask" or something?

Wikipedia does not have details, but says the feature has been in Unix since 1978.

POSIX just says it is the "file mode creation mask".

2
  • u = user g=group o=others
    – admstg
    Apr 29, 2020 at 9:41
  • 4
    @admstg the wrong u. Apr 29, 2020 at 9:55

3 Answers 3

6

There's a long-standing explanation, exemplified by this entry in Wolfram Rosler's list, that it means "user". That entry was submitted in 2000, and attributes it to the fact that the "umask" set a U_cmask field in the process' "u area".

This is a somewhat dubious explanation, the doubt acknowledged in the original by it being put in the form of a question, because there are several other things in the "u area", all of whose fields were conventionally named u_something, that are not set by system calls begining with "u". It is possible that it is a rationalization two decades after the fact.

That the "u" stands for "user" is, on the other hand, widely accepted nowadays, and was widely accepted back in 2000, even though the "u area" explanation for that is dubious. Books about UNIX have described the umask as the "user file creation mask" since the late 1980s (although none of them make any mention of the "u area").

  • It's described that way in the printed manuals for AT&T Unix System 5 Release 3.
  • It's described that way in the 1989 X/Open Portability Guide.
  • It's described that way in Peter Norton's 1991 Guide to Unix.
  • Simson Garfinkel's and Gene Spafford's 1991 Practical UNIX Security explicitly outright says
    umask (UNIX shorthand for "user file-creation mode mask")

The problem is that the word "user" in the expansion of the name doesn't occur in works before 1985. The earliest that I have been able to find is Rebecca Thomas' 1985 A user guide to the UNIX system, followed by "umask (user mask)" in the Andersons' 1986 The UNIX C Shell Field Guide.

  • Stephen R. Bourne's 1983 The UNIX System has a collection of manual entries for 7th Edition UNIX. The one for the umask() system call on page 294 does not contain the word "user" anywhere, just calling it a "file creation mode mask". The one for sh makes no mention of the subject at all.
  • The 1983 Unix Time-Sharing System: Unix Programmer's Manual from Bell Labs repeats Bourne's wording (which is to be expected):
    NAME umask — set file creation mode mask

    SYNOPSIS
    umask(complmode)

    DESCRIPTION
    Umask sets a mask used whenever a file is created by creat(T) or mknod(2): […]

  • On the BSD side of the universe, the 1987 UNIX Programmer's Reference Manual (PRM): 4.3 Berkeley Software Distribution, Virtual VAX-11 Version also makes no mention of the word "user":
    NAME umask — set file creation mode mask

    SYNOPSIS
    oumask = umask(numask) int oumask, numask;

    DESCRIPTION
    Umask sets the process's file mode creation mask to numask and returns the previous value of the mask. […]

  • There's no "user" in Marc J. Rochkind's 1985 Advanced UNIX programming, just "file mode creation mask".
  • Nor in the Waite Group's 1987 Unix System V Bible ("file-creation mask").

It has been widely accepted for the better part of 4 decades that the "u" stands for "user"; but it's hard to trace that back to the initial coinage of the name, the linkage to the "u area" only appears two decades after the fact, the word "user" seems to have appeared at some point between 7th Edition UNIX and AT&T Unix System 5 Release 3, and that word may have been introduced after the fact as a seemingly reasonable expansion for "u" by people writing formal doco.

Further reading

1
  • An absolutely exemplary answer in every respect. Thank you very much for your dedication.
    – Lassi
    Apr 30, 2020 at 8:02
1

Nothing in man umask, but in bash help umask says Sets the user file-creation mask to MODE. While this is incorrect: it sets the process's file-creation mask to MODE. It shown that the u may stand for user. This is also what I was told back in 1991.

7
  • While your remark is correct and on point, maybe they meant it as the "user mask" in the sense that if you set the process mask in your login shell, all the processes you launch from that shell will inherit the mask :) Anyway, thanks for adding another data point in favor of "user".
    – Lassi
    Apr 29, 2020 at 10:44
  • 1
    The u could also be for "update" (the umask utility updates the file creation mask), but that's just pure speculation, and not very likely true. I checked the V7 Unix sources and manual, but they were not helpful.
    – Kusalananda
    Apr 29, 2020 at 11:00
  • 4
    It is worth remembering that the umask and ulimits were stored in a "u area".
    – JdeBP
    Apr 29, 2020 at 11:02
  • @JdeBP Do you know whether the u area was originally per-user or per-process?
    – Lassi
    Apr 29, 2020 at 11:07
  • 2
    unix.stackexchange.com/q/583316/5132 now exists.
    – JdeBP
    Apr 29, 2020 at 12:01
-5

Calling man umask (on Solaris) gives the right answer:

...
  sh
 The user file-creation mode mask is set to ooo.   The  three
 octal  digits  refer  to  read/write/execute permissions for
 owner,  group,  and  other,  respectively   (see   chmod(1),
 chmod(2),  and umask(2)).  The value of each specified digit
...

So in some cases it is important to have a real UNIX to get better man pages.

2
  • 1
    Not sure whether this answers the question at all, or what makes the answer right, but it does also talk about the "user" file-creation mode mask.
    – Lassi
    Apr 29, 2020 at 17:35
  • Well, did you read the text? Your question was where does the "u" comes from? and my answer quotes a part from a UNIX man page that calls it user file-createion mode mask. If you like to get a different answer, you would need to ask a different question.
    – schily
    Apr 29, 2020 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.