1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 2006, 2008, Michael Kerrisk (mtk.manpages@gmail.com)
4 .\" (A few fragments remain from an earlier (1992) version written in
5 .\" 1992 by Drew Eckhardt <drew@cs.colorado.edu>.)
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date. The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein. The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" Modified by Michael Haardt <michael@moria.de>
28 .\" Modified Sat Jul 24 12:51:53 1993 by Rik Faith <faith@cs.unc.edu>
29 .\" Modified Tue Oct 22 22:39:04 1996 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified Thu May 1 06:05:54 UTC 1997 by Nicolas Lichtmaier
31 .\" <nick@debian.com> with Lars Wirzenius <liw@iki.fi> suggestion
32 .\" 2006-05-13, mtk, substantial rewrite of description of 'mask'
33 .\" 2008-01-09, mtk, a few rewrites and additions.
35 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
36 .\" all rights reserved.
37 .\" Translated 1997-06-26, SUTO Mitsuaki <suto@av.crl.sony.co.jp>
38 .\" Modified 1999-03-21, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
39 .\" Modified 2005-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36
41 .\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77
43 .TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual"
46 .\"O umask \- set file mode creation mask
47 umask \- ファイルモード作成マスクを設定する
50 .B #include <sys/types.h>
52 .B #include <sys/stat.h>
54 .BI "mode_t umask(mode_t " mask );
58 .\"O sets the calling process's file mode creation mask (umask) to
60 .\"O & 0777 (i.e., only the file permission bits of
62 .\"O are used), and returns the previous value of the mask.
64 は、呼び出し元プロセスのファイルモード作成マスク (umask) を
68 のファイル許可に対応するビットのみを使用する)、
71 .\"O The umask is used by
74 .\"O and other system calls that create files
75 .\"O .\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open()
76 .\"O .\" but NOT the System V IPC *get() calls
77 .\"O to modify the permissions placed on newly created files or directories.
81 やファイル作成を行うその他のシステムコールで、
82 .\" 例えば mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open()
83 .\" System V IPC *get() コールは該当しない。
84 新しく作成されるファイルやディレクトリの許可 (permission) を
86 .\"O Specifically, permissions in the umask are turned off from
87 .\"O the \fImode\fP argument to
91 具体的には umask に設定されている許可が
95 の \fImode\fP 引き数から取り消される。
97 .\"O The constants that should be used to specify
99 .\"O are described under
106 .\"O The typical default value for the process umask is
107 .\"O .I S_IWGRP\ |\ S_IWOTH
109 .\"O In the usual case where the
113 .\"O is specified as:
114 プロセスの umask のよくあるデフォルト値は
115 .I S_IWGRP\ |\ S_IWOTH
124 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
126 を指定するというよくあるケースでは、作成されたファイルは
127 .\"O (octal 0666) when creating a new file, the permissions on the
128 .\"O resulting file will be:
131 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
134 .\"O (because 0666 & ~022 = 0644; i.e., rw\-r\-\-r\-\-).
136 (なぜなら 0666 & ~022 = 0644、つまり rw\-r\-\-r\-\-)。
137 .\"O .SH "RETURN VALUE"
139 .\"O This system call always succeeds and the previous value of the mask
141 このシステムコールは必ず成功し、以前の umask 値を返す。
142 .\"O .SH "CONFORMING TO"
144 SVr4, 4.3BSD, POSIX.1-2001.
147 .\"O A child process created via
149 .\"O inherits its parent's umask.
150 .\"O The umask is left unchanged by
153 で作成された子プロセスは、親プロセスの umask を継承する。
157 .\"O The umask setting also affects the permissions assigned to POSIX IPC objects
158 .\"O .RB ( mq_open (3),
159 .\"O .BR sem_open (3),
160 .\"O .BR shm_open (3)),
162 .\"O .RB ( mkfifo (3)),
163 .\"O and UNIX domain sockets
165 .\"O created by the process.
166 .\"O The umask does not affect the permissions assigned
167 .\"O to System V IPC objects created by the process (using
170 .\"O .BR shmget (2)).
171 umask の設定は、そのプロセスが生成する POSIX IPC オブジェクト
184 を使って) 生成する System V IPC オブジェクトに設定される許可には
192 .\" FIXME . eventually: .BR acl (5)