File: umask.2

package info (click to toggle)
manpages-ja 0.5.0.0.20061115-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,788 kB
  • ctags: 4
  • sloc: sh: 13,215; perl: 157; makefile: 117
file content (109 lines) | stat: -rw-r--r-- 3,515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\" and Copyright (c) 2006, Michael Kerrisk (mtk-manpages@gmx.net)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt <michael@moria.de>
.\" Modified Sat Jul 24 12:51:53 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Tue Oct 22 22:39:04 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Thu May  1 06:05:54 UTC 1997 by Nicolas Lichtmaier
.\"  <nick@debian.com> with Lars Wirzenius <liw@iki.fi> suggestion
.\" 2006-05-13, mtk, substantial rewrite of description of 'mask'
.\"
.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
.\"         all rights reserved.
.\" Translated 1997-06-26, SUTO Mitsuaki <suto@av.crl.sony.co.jp>
.\" Modified 1999-03-21, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified 2005-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36
.\"
.TH UMASK 2 2006-05-13 "Linux" "Linux Programmer's Manual"
.SH ̾
umask \- ե⡼ɺޥꤹ
.SH 
.B #include <sys/types.h>
.br
.B #include <sys/stat.h>
.sp
.BI "mode_t umask(mode_t " mask );
.SH 
.BR umask ()
ϡƤӽФץΥե⡼ɺޥ (umask) 
.I mask 
& 0777
ꤹ롣

umask ϡ
.BR open (2),
.BR mkdir (2)
եԤ¾Υƥॳǡ
.\" 㤨 mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open()
.\" System V IPC *get() ϳʤ
եǥ쥯ȥε (permission) 
뤿˻Ѥ롣
Ūˤ umask ꤵƤĤ
.BR open (2)

.BR mkdir (2)
 \fImode\fR ä롣

.I mask
˻ꤹΤ˻Ѥ٤ˤĤƤ
.BR stat (2)
Ƥ롣

ץ umask Τ褯ǥեͤ
S_IWGRP\ |\ S_IWOTH (8ʤ 022) Ǥ롣
եݤ
.BR open (2)

.I mode

.nf

    S_IRUSR | S_IWUSR | S_IRGRP | S_IWRGRP | S_IROTH | S_IWOTH

.fi
ꤹȤ褯륱Ǥϡ줿ե
.nf

    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH

.fi
ȤĤĤȤˤʤ
(ʤʤ 0666 & ~022 = 0644Ĥޤ rw-r--r--)
.SH ֤
Υƥॳɬ umask ֤ͤ
.\"O+ .SH NOTES
.SH 
.BR fork (2)
Ǻ줿ҥץϡƥץ umask Ѿ롣
.BR execve (2)
ˤä umask ѹʤ
.SH 
SVr4, 4.3BSD, POSIX.1-2001.
.SH Ϣ
.BR chmod (2),
.BR mkdir (2),
.BR open (2),
.BR stat (2)