148 lines
4.7 KiB
Groff
148 lines
4.7 KiB
Groff
.\" Copyright (c) 1980, 1991, 1993
|
||
.\" The Regents of the University of California. All rights reserved.
|
||
.\"
|
||
.\" Redistribution and use in source and binary forms, with or without
|
||
.\" modification, are permitted provided that the following conditions
|
||
.\" are met:
|
||
.\" 1. Redistributions of source code must retain the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer.
|
||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer in the
|
||
.\" documentation and/or other materials provided with the distribution.
|
||
.\" 3. All advertising materials mentioning features or use of this software
|
||
.\" must display the following acknowledgement:
|
||
.\" This product includes software developed by the University of
|
||
.\" California, Berkeley and its contributors.
|
||
.\" 4. Neither the name of the University nor the names of its contributors
|
||
.\" may be used to endorse or promote products derived from this software
|
||
.\" without specific prior written permission.
|
||
.\"
|
||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||
.\" SUCH DAMAGE.
|
||
.\"
|
||
.\" @(#)access.2 8.2 (Berkeley) 4/1/94
|
||
.\" %FreeBSD: src/lib/libc/sys/access.2,v 1.18 2002/12/19 09:40:24 ru Exp %
|
||
.\"
|
||
.\" $FreeBSD$
|
||
.Dd September 21, 2001
|
||
.Dt ACCESS 2
|
||
.Os
|
||
.Sh ̾¾Î
|
||
.Nm access , eaccess
|
||
.Nd ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹²ÄǽÀ¤ò¥Á¥§¥Ã¥¯¤¹¤ë
|
||
.Sh ¥é¥¤¥Ö¥é¥ê
|
||
.Lb libc
|
||
.Sh ½ñ¼°
|
||
.In unistd.h
|
||
.Ft int
|
||
.Fn access "const char *path" "int mode"
|
||
.Ft int
|
||
.Fn eaccess "const char *path" "int mode"
|
||
.Sh ²òÀâ
|
||
.Fn access
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤È
|
||
.Fn eaccess
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
|
||
.Fa mode
|
||
°ú¿ô¤Ë¤è¤Ã¤Æ¼¨¤µ¤ì¤¿¥¢¥¯¥»¥¹µö²Ä¤Ë¤Ä¤¤¤Æ
|
||
.Fa path
|
||
°ú¿ô¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹²ÄǽÀ¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
|
||
.Fa mode
|
||
¤ÎÃͤϡ¢¥Á¥§¥Ã¥¯¤µ¤ì¤ë¥¢¥¯¥»¥¹µö²Ä (ÆÉ¼è¤êµö²Ä¤Ë¤Ä¤¤¤Æ¤Ï
|
||
.Dv R_OK
|
||
¡¢½ñ¹þ¤ßµö²Ä¤Ë¤Ä¤¤¤Æ¤Ï
|
||
.Dv W_OK
|
||
¡¢¼Â¹Ô / ¸¡º÷µö²Ä¤Ë¤Ä¤¤¤Æ¤Ï
|
||
.Dv X_OK )
|
||
¤Î¥Ó¥Ã¥Èñ°Ì¤Î OR¡¢¤Þ¤¿¤Ï¸ºß»î¸³ (
|
||
.Dv F_OK
|
||
) ¤Î¤É¤Á¤é¤«¤Ç¤¹¡£
|
||
.Pp
|
||
¤µ¤é¤Ê¤ë¾ðÊó¤Ï¡¢
|
||
.Xr intro 2
|
||
¤Î
|
||
.Sx ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó
|
||
¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
|
||
.Pp
|
||
.Fn eaccess
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤òÍѤ¤¤Æ
|
||
Í×µá¤òµö²Ä¤·¤Þ¤¹¡£
|
||
°ìÊý
|
||
.Fn access
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ÎÂå¤ï¤ê¤Ë¼Â¥æ¡¼¥¶ ID ¤ò¡¢
|
||
¼Â¸ú¥°¥ë¡¼¥× ID ¤ÎÂå¤ï¤ê¤Ë¼Â¥°¥ë¡¼¥×¤È»Ä¤ê¤Î¥°¥ë¡¼¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤ò
|
||
ÍѤ¤¤Þ¤¹¡£
|
||
.Pp
|
||
¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¤â¤·¤¯¤Ï¼Â¸ú¥æ¡¼¥¶¤ËŬÀÚ¤ÊÆÃ¸¢¤¬¤¢¤ê¡¢
|
||
.Dv X_OK
|
||
¤Ë¤Ä¤¤¤ÆÀ®¸ù¤ò¼¨¤·¤Æ¤¤¤Æ¤â¡¢¼ÂºÝ¤Ë¤Ï¥Õ¥¡¥¤¥ë¤Î¼Â¹Ôµö²Ä¥Ó¥Ã¥È¤¬
|
||
ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
|
||
Ʊ¤¸¤³¤È¤¬¡¢
|
||
.Dv R_OK
|
||
¤ª¤è¤Ó
|
||
.Dv W_OK
|
||
¤Ë¤â³ºÅö¤·¤Þ¤¹¡£
|
||
.Sh Ìá¤êÃÍ
|
||
.Rv -std
|
||
.Sh ¥¨¥é¡¼
|
||
¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¼¡¤Î¾ì¹ç¤ËµñÀ䤵¤ì¤Þ¤¹:
|
||
.Bl -tag -width Er
|
||
.It Bq Er ENOTDIR
|
||
¥Ñ¥¹¤Î¹½À®Í×ÁÇÃæ¤Ë¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
|
||
.It Bq Er ENAMETOOLONG
|
||
¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬ 255 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤ë¤«¡¢
|
||
¤Þ¤¿¤Ï¥Ñ¥¹Ì¾Á´ÂΤ¬ 1023 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤Þ¤¹¡£
|
||
.It Bq Er ENOENT
|
||
»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£
|
||
.It Bq Er ELOOP
|
||
¥Ñ¥¹Ì¾¤òÊÑ´¹¤¹¤ë¤È¤¤Ë¸¡½Ð¤µ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤Þ¤¹¡£
|
||
.It Bq Er EROFS
|
||
ÆÉ¼è¤êÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ½ñ¹þ¤ß¥¢¥¯¥»¥¹¤¬
|
||
Í׵ᤵ¤ì¤Þ¤·¤¿¡£
|
||
.It Bq Er ETXTBSY
|
||
¸½»þÅÀ¤Ç¼Â¹ÔÃæ¤Î½ã¿è¤Ê¼ê³¤ (¶¦Í¥Æ¥¥¹¥È)
|
||
¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ½ñ¹þ¤ß¥¢¥¯¥»¥¹¤¬Í׵ᤵ¤ì¤Æ¤¤¤Þ¤¹¡£
|
||
.It Bq Er EACCES
|
||
¥Õ¥¡¥¤¥ë¥â¡¼¥É¤Îµö²Ä¥Ó¥Ã¥È¤¬Í׵ᤵ¤ì¤¿¥¢¥¯¥»¥¹¤òµöÍÆ¤·¤Ê¤¤¤«¡¢
|
||
¤Þ¤¿¤Ï¥Ñ¥¹¤Î¹½À®Í×ÁǤˤĤ¤¤Æ¸¡º÷µö²Ä¤¬µñÀ䤵¤ì¤Æ¤¤¤Þ¤¹¡£
|
||
.It Bq Er EFAULT
|
||
.Fa path
|
||
°ú¿ô¤¬¡¢¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤ÎÈϰϳ°¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£
|
||
.It Bq Er EIO
|
||
¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÆÉ¤ß½ñ¤¤·¤Æ¤¤¤ë´Ö¤ËÆþ½ÐÎÏ¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£
|
||
.El
|
||
.Sh ¥»¥¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë¹Í»¡
|
||
.Fn access
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¶¥¹ç¾õÂ֤ˤè¤Ã¤ÆÀøºßŪ¤Ê¥»¥¥å¥ê¥Æ¥£¥Û¡¼¥ë¤È¤Ê¤ë¤Î¤Ç¡¢
|
||
»È¤¦¤Ù¤¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
||
¥æ¡¼¥¶ ID ÀßÄê¤È¥°¥ë¡¼¥× ID ÀßÄꤵ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢
|
||
¼Â¸ú¥æ¡¼¥¶ ID ¤â¤·¤¯¤Ï¼Â¸ú¥°¥ë¡¼¥× ID ¤òÉü¸µ¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
|
||
¤½¤·¤Æ¼Â¥æ¡¼¥¶ ID ¤â¤·¤¯¤Ï¼Â¥°¥ë¡¼¥× ID ¤Ç¤Î¥¢¥¯¥»¥¹¤ò¡¢
|
||
.Fn access
|
||
¤ò»ÈÍѤ·¤ÆÌϵ¼Åª¤Ë¥Á¥§¥Ã¥¯¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢Ä¾Àܼ¹Ԥ¹¤ë¤Ù¤¤Ç¤¹¡£
|
||
ÉÔŬÀڤ˻ÈÍѤµ¤ì¤¿¾ì¹ç¡¢
|
||
.Fn eaccess
|
||
¸Æ¤Ó½Ð¤·¤âƱÍͤˤ·¤Æ¶¥¹ç¤ÎÂоݤȤʤ뤳¤È¤¬¤¢¤ê¤Þ¤¹¡£
|
||
.Sh ´ØÏ¢¹àÌÜ
|
||
.Xr chmod 2 ,
|
||
.Xr intro 2 ,
|
||
.Xr stat 2
|
||
.Sh µ¬³Ê
|
||
.Fn access
|
||
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
||
.St -p1003.1-90
|
||
¤ËŬ¹ç¤·¤Æ¤¤¤Þ¤¹¡£
|
||
.Sh Îò»Ë
|
||
.Fn access
|
||
´Ø¿ô¤Ï
|
||
.At v7
|
||
¤ÇÅо줷¤Þ¤·¤¿¡£
|