.Nm umask
.Nd set file creation mode mask
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/stat.h>
.Ft mode_t
-.Fn umask "mode_t numask"
+.Fo umask
+.Fa "mode_t cmask"
+.Fc
.Sh DESCRIPTION
The
.Fn umask
routine sets the process's file mode creation mask to
-.Fa numask
-and returns the previous value of the mask. The 9 low-order
-access permission
-bits of
-.Fa numask
+.Fa cmask
+and returns the previous value of the mask.
+The 9 low-order access permission bits of
+.Fa cmask
are used by system calls, including
.Xr open 2 ,
.Xr mkdir 2 ,
-.Xr mkfifo 2
+.Xr mkfifo 2 ,
and
.Xr mknod 2
to turn off corresponding bits
This clearing allows each user to restrict the default access
to his files.
.Pp
-The default mask value is S_IWGRP|S_IWOTH (022, write access for the
+The default mask value is S_IWGRP | S_IWOTH (022, write access for the
owner only).
Child processes inherit the mask of the calling process.
.Sh RETURN VALUES
The
.Fn umask
function is always successful.
+.Sh LEGACY SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/stat.h>
+.Pp
+The include file
+.In sys/types.h
+is necessary.
.Sh SEE ALSO
.Xr chmod 2 ,
.Xr mkdir 2 ,
.Xr mkfifo 2 ,
.Xr mknod 2 ,
-.Xr open 2
+.Xr open 2 ,
+.Xr compat 5
.Sh STANDARDS
The
.Fn umask