X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=draft%2Fman2%2Fumask.2;h=30f612699e2e12e7799c99df57bed2b2ac6cdf53;hb=40274b7d79d419993de4a745e3ae86ca6d0f417f;hp=3835ddb3fea7d61d38ab27a14df264c5551e4909;hpb=633a2252e0be3c867dce264a180a89ce8181d36f;p=linuxjm%2FLDP_man-pages.git diff --git a/draft/man2/umask.2 b/draft/man2/umask.2 index 3835ddb3..30f61269 100644 --- a/draft/man2/umask.2 +++ b/draft/man2/umask.2 @@ -1,9 +1,8 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" .\" Copyright (c) 2006, 2008, Michael Kerrisk (mtk.manpages@gmail.com) .\" (A few fragments remain from an earlier (1992) version written in .\" 1992 by Drew Eckhardt .) .\" +.\" %%%LICENSE_START(VERBATIM) .\" 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. @@ -23,14 +22,20 @@ .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END .\" .\" Modified by Michael Haardt .\" Modified Sat Jul 24 12:51:53 1993 by Rik Faith .\" Modified Tue Oct 22 22:39:04 1996 by Eric S. Raymond -.\" Modified Thu May 1 06:05:54 UTC 1997 by Nicolas Lichtmaier +.\" Modified Thu May 1 06:05:54 UTC 1997 by Nicolás Lichtmaier .\" with Lars Wirzenius suggestion .\" 2006-05-13, mtk, substantial rewrite of description of 'mask' .\" 2008-01-09, mtk, a few rewrites and additions. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki .\" all rights reserved. @@ -40,153 +45,56 @@ .\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 .\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77 .\" -.TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH ̾Á° -.\"O umask \- set file mode creation mask -umask \- ¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯¤òÀßÄꤹ¤ë -.\"O .SH SYNOPSIS -.SH ½ñ¼° -.B #include +.TH UMASK 2 2008\-01\-09 Linux "Linux Programmer's Manual" +.SH 名前 +umask \- ファイルモード作成マスクを設定する +.SH 書式 +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "mode_t umask(mode_t " mask ); -.\"O .SH DESCRIPTION -.SH ÀâÌÀ -.\"O .BR umask () -.\"O sets the calling process's file mode creation mask (umask) to -.\"O .I mask -.\"O & 0777 (i.e., only the file permission bits of -.\"O .I mask -.\"O are used), and returns the previous value of the mask. -.BR umask () -¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯ (umask) ¤ò -.I mask -& 0777 ¤ËÀßÄꤷ -.RI ( umask -¤Î¥Õ¥¡¥¤¥ëµö²Ä¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤Î¤ß¤ò»ÈÍѤ¹¤ë)¡¢ -Êѹ¹Á°¤Î¥Þ¥¹¥¯ÃͤòÊÖ¤¹¡£ +\fBmode_t umask(mode_t \fP\fImask\fP\fB);\fP +.SH 説明 +\fBumask\fP() は、呼び出し元プロセスのファイルモード作成マスク (umask) を \fImask\fP & 0777 に設定し (\fIumask\fP +のファイル許可に対応するビットのみを使用する)、 変更前のマスク値を返す。 -.\"O The umask is used by -.\"O .BR open (2), -.\"O .BR mkdir (2), -.\"O and other system calls that create files -.\"O .\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() -.\"O .\" but NOT the System V IPC *get() calls -.\"O to modify the permissions placed on newly created files or directories. -umask ¤Ï¡¢ -.BR open (2), -.BR mkdir (2) -¤ä¥Õ¥¡¥¤¥ëºîÀ®¤ò¹Ô¤¦¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢ -.\" Î㤨¤Ð mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() -.\" System V IPC *get() ¥³¡¼¥ë¤Ï³ºÅö¤·¤Ê¤¤¡£ -¿·¤·¤¯ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä (permission) ¤ò -½¤Àµ¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ -.\"O Specifically, permissions in the umask are turned off from -.\"O the \fImode\fP argument to -.\"O .BR open (2) -.\"O and -.\"O .BR mkdir (2). -¶ñÂÎŪ¤Ë¤Ï umask ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëµö²Ä¤¬ -.BR open (2) -¤ä -.BR mkdir (2) -¤Î \fImode\fP °ú¤­¿ô¤«¤é¼è¤ê¾Ã¤µ¤ì¤ë¡£ +.\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() +.\" but NOT the System V IPC *get() calls +umask は、 \fBopen\fP(2), \fBmkdir\fP(2) やファイル作成を行うその他のシステムコールで、 +新しく作成されるファイルやディレクトリの許可 (permission) を 修正するために使用される。 具体的には umask に設定されている許可が +\fBopen\fP(2) や \fBmkdir\fP(2) の \fImode\fP 引き数から取り消される。 -.\"O The constants that should be used to specify -.\"O .I mask -.\"O are described under -.\"O .BR stat (2). -.I mask -¤Ë»ØÄꤹ¤ë¤Î¤Ë»ÈÍѤ¹¤Ù¤­Äê¿ô¤Ë¤Ä¤¤¤Æ¤Ï -.BR stat (2) -¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +\fImask\fP に指定するのに使用すべき定数については \fBstat\fP(2) で説明されている。 -.\"O The typical default value for the process umask is -.\"O .I S_IWGRP\ |\ S_IWOTH -.\"O (octal 022). -.\"O In the usual case where the -.\"O .I mode -.\"O argument to -.\"O .BR open (2) -.\"O is specified as: -¥×¥í¥»¥¹¤Î umask ¤Î¤è¤¯¤¢¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï -.I S_IWGRP\ |\ S_IWOTH -(8¿Ê¤Ç 022) ¤Ç¤¢¤ë¡£ -¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëºÝ¤Ë -.BR open (2) -¤Î -.I mode -°ú¤­¿ô¤Ë +プロセスの umask のよくあるデフォルト値は \fIS_IWGRP\ |\ S_IWOTH\fP (8進で 022) である。 +新しいファイルを作成する際に \fBopen\fP(2) の \fImode\fP 引き数に .nf S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH + .fi -¤ò»ØÄꤹ¤ë¤È¤¤¤¦¤è¤¯¤¢¤ë¥±¡¼¥¹¤Ç¤Ï¡¢ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï -.\"O (octal 0666) when creating a new file, the permissions on the -.\"O resulting file will be: +を指定するというよくあるケースでは、作成されたファイルは .nf S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH .fi -.\"O (because 0666 & ~022 = 0644; i.e., rw\-r\-\-r\-\-). -¤È¤¤¤¦µö²Ä¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ë -(¤Ê¤¼¤Ê¤é 0666 & ~022 = 0644¡¢¤Ä¤Þ¤ê rw\-r\-\-r\-\-)¡£ -.\"O .SH "RETURN VALUE" -.SH ÊÖ¤êÃÍ -.\"O This system call always succeeds and the previous value of the mask -.\"O is returned. -¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ïɬ¤ºÀ®¸ù¤·¡¢°ÊÁ°¤Î umask ÃͤòÊÖ¤¹¡£ -.\"O .SH "CONFORMING TO" -.SH ½àµò -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES -.SH Ãí°Õ -.\"O A child process created via -.\"O .BR fork (2) -.\"O inherits its parent's umask. -.\"O The umask is left unchanged by -.\"O .BR execve (2). -.BR fork (2) -¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î umask ¤ò·Ñ¾µ¤¹¤ë¡£ -.BR execve (2) -¤Ë¤è¤Ã¤Æ umask ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +という許可を持つことになる (なぜなら 0666 & ~022 = 0644、つまり rw\-r\-\-r\-\-)。 +.SH 返り値 +このシステムコールは必ず成功し、以前の umask 値を返す。 +.SH 準拠 +SVr4, 4.3BSD, POSIX.1\-2001. +.SH 注意 +\fBfork\fP(2) で作成された子プロセスは、親プロセスの umask を継承する。 \fBexecve\fP(2) によって umask +は変更されない。 -.\"O The umask setting also affects the permissions assigned to POSIX IPC objects -.\"O .RB ( mq_open (3), -.\"O .BR sem_open (3), -.\"O .BR shm_open (3)), -.\"O FIFOs -.\"O .RB ( mkfifo (3)), -.\"O and Unix domain sockets -.\"O .RB ( unix (7)) -.\"O created by the process. -.\"O The umask does not affect the permissions assigned -.\"O to System V IPC objects created by the process (using -.\"O .BR msgget (2), -.\"O .BR semget (2), -.\"O .BR shmget (2)). -umask ¤ÎÀßÄê¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬À¸À®¤¹¤ë POSIX IPC ¥ª¥Ö¥¸¥§¥¯¥È -.RB ( mq_open (3), -.BR sem_open (3), -.BR shm_open (3)) -¤ä FIFO -.RB ( mkfifo (3))¡¢ -Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È -.RB ( unix (7)) -¤ËÀßÄꤵ¤ì¤ëµö²Ä¤Ë¤â±Æ¶Á¤òÍ¿¤¨¤ë¡£ -°ìÊý¡¢umask ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬ -.RB ( msgget (2), -.BR semget (2), -.BR shmget (2) -¤ò»È¤Ã¤Æ) À¸À®¤¹¤ë System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤ËÀßÄꤵ¤ì¤ëµö²Ä¤Ë¤Ï -±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ -.\"O .SH "SEE ALSO" -.SH ´ØÏ¢¹àÌÜ -.BR chmod (2), -.BR mkdir (2), -.BR open (2), -.BR stat (2) -.\" FIXME . eventually: .BR acl (5) +umask の設定は、そのプロセスが生成する POSIX IPC オブジェクト (\fBmq_open\fP(3), \fBsem_open\fP(3), +\fBshm_open\fP(3)) や FIFO (\fBmkfifo\fP(3))、 UNIX ドメインソケット (\fBunix\fP(7)) +に設定される許可にも影響を与える。 一方、umask は、そのプロセスが (\fBmsgget\fP(2), \fBsemget\fP(2), +\fBshmget\fP(2) を使って) 生成する System V IPC オブジェクトに設定される許可には 影響を与えない。 +.SH 関連項目 +\fBchmod\fP(2), \fBmkdir\fP(2), \fBopen\fP(2), \fBstat\fP(2), \fBacl\fP(5) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。