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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
.\" 1993 Michael Haardt, Ian Jackson.
.\"
.\" 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 1993-07-21 Rik Faith (faith@cs.unc.edu)
.\" Modified 1994-08-21 by Michael Chastain (mec@shell.portal.com):
.\" Removed note about old kernel (pre-1.1.44) using wrong id on path.
.\" Modified 1996-03-18 by Martin Schulze (joey@infodrom.north.de):
.\" Stated more clearly how it behaves with symbolic links.
.\" Added correction due to Nick Duffek (nsd@bbc.com), aeb, 960426
.\" Modified 1996-09-07 by Michael Haardt:
.\" Restrictions for NFS
.\" Modified 1997-09-09 by Joseph S. Myers <jsm28@cam.ac.uk>
.\" Modified 1998-01-13 by Michael Haardt:
.\" Using access is often insecure
.\" Modified 2001-10-16 by aeb
.\" Modified 2002-04-23 by Roger Luethi <rl@hellgate.ch>
.\" Modified 2004-06-23 by Michael Kerrisk
.\"
.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya
.\" all rights reserved.
.\" Translated 1997-12-17, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified 1998-05-11, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2001-12-14, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2002-06-17, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-02-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.\"WORD: permission
.\"WORD: privileges
.\"WORD: user 桼
.\"WORD: file system ե롦ƥ
.\"WORD: object ֥
.\"WORD: symbolic link ܥå
.\"WORD: refer Ȥ
.\"WORD: mask ޥ
.\"WORD: path ѥ
.\"WORD: effective user-ID ¸桼ID
.\"WORD: real user-ID ¥桼ID
.\"WORD: uid 桼 ID
.\"WORD: gid 롼 ID
.\"WORD: directory ǥ쥯ȥ
.\"WORD: call
.\"WORD: kernel ͥ
.\"WORD: memory
.\"WORD: dangling Τʤ
.\"
.TH ACCESS 2 2004-06-23 "Linux" "Linux Programmer's Manual"
.SH ̾
access \- 桼ΥեФ륢å
.SH
.nf
.B #include <unistd.h>
.sp
.BI "int access(const char *" pathname ", int " mode );
.fi
.SH
.BR access ()
.I pathname
Ȥ̾ĥե (ޤ¾Υե롦ƥΥ֥)
Фơץɤ߽ФߤƤ뤫
ե뤬¸ߤƤ뤫ʤɤΥåԤʤ
.I pathname
ܥåʤСΥܥåλȤ
եФ륢롣
.I mode
.BR R_OK ", " W_OK ", " X_OK ", " F_OK
ΰİʾ夫鹽ޥǤ롣
.BR R_OK ", " W_OK ", " X_OK
Ϥ줾
֥ե뤬¸ߤɤ߹ߵĤ뤫
֥ե뤬¸ߤƽߵĤ뤫
֥ե뤬¸ߤƼ¹ԵĤ뤫
Υå᤹롣
.B F_OK
ϥե뤬¸ߤ뤫ɤΤߤå褦᤹롣
.I pathname
ǻꤵ줿եؤΥѥ˸ǥ쥯ȥΥ˰¸롣
ޤܥåλȤԤǽв
ǥ쥯ȥեΥˤ¸롣
åϡºݤǻѤץμ¸ (effective) ID Ǥʤ
.I " (real)"
UID
.I " (real)"
GID ǹԤʤ롣
set-user-ID ץǡ¹ԥ桼θ¤ꤷ䤹
뤿Ǥ롣
ӥåȤΤߤå졢եμƤϥåʤ
äơǥ쥯ȥֽ꤬߲ǽפȤʤäϡǥ쥯ȥ
ե뤳ȤǽʤȤ̣ΤǤꡢǥ쥯ȥ
եȤƽळȤǽʤ櫓ǤϤʤ
Ʊͤ DOS Υեϡּ¹ԲǽפȽǤ뤬
.BR execve (2)
ϼԤ
ץŬڤʸ¤äƤ硢
եμ¹ԵĥӥåȤҤȤĤ⥻åȤƤʤƤ⡢
.B X_OK
֤⤢롣
.SH ֤
(Ƥᤵ줿Ĥ줿)֤롣
顼ξ (ʤȤĤ
.I mode
ᤵ줿Ĥʤä䡢¾Υ顼)
\-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.BR access ()
ϰʲξ˼Ԥ롣
.TP
.B EACCES
ᤵ줿
Υե뼫Ȥ˵ݤ줿
.I pathname
ػޤǥǥ쥯ȥΤ줫Ф븡
(search permission) ʤä
.RB ( path_resolution (2)
⻲ȤΤ)
.TP
.B ELOOP
.I pathname
褹ݤܥå¿롣
.TP
.B ENAMETOOLONG
.I pathname
Ĺ롣
.TP
.B ENOENT
.I pathname
Υǥ쥯ȥʬϥǽǤä
ե뤬¸ߤʤΤʤ (dangling) ܥå
ʤäƤ롣
.TP
.B ENOTDIR
.I pathname
Υǥ쥯ȥʬºݤˤϥǥ쥯ȥǤʤ
.TP
.B EROFS
ɤ߹ (read-only) Υե롦ƥФƽߵĤ
ᤷ
.PP
.BR access ()
ϰʲͳˤ꼺Ԥ뤳Ȥ롣
.TP
.B EFAULT
.I pathname
ǽʥɥ쥹֤γؤƤ롣
.TP
.B EINVAL
.I mode
ͤꤵ줿
.TP
.B EIO
I/O 顼ȯ
.TP
.B ENOMEM
ͥ˽ʬʥ꤬ʤ
.TP
.B ETXTBSY
¹ΥեФƽߤᤷ
.SH
.BR access ()
ᤵ줿̤Τ줫Υå˼Ԥˤϡ
Ȥ¾μ̤ΥåȤƤ⥨顼֤
.PP
.BR access ()
ϡ UID ޥåԥѤ NFS ե롦ƥǤ
ǽʤ⤷ʤʤʤ UID ΥޥåԥϥС
Ԥʤ졢Υå륯饤ȤˤϸʤǤ롣
.PP
桼㤨
.BR open (2)
ˤ륢ǽɤ(ºݤ˹Ԥ)
.BR access ()
ȤäƥåΤϡƥۡθˤʤ롣
ʤʤåƤ
ºݤ˥եΥץ֤ûֳ֤ѤǤ뤫Ǥ롣
.SH
SVr4, POSIX.1-2001, 4.3BSD
.SH Ϣ
.BR chmod (2),
.BR chown (2),
.BR faccessat (2),
.BR open (2),
.BR path_resolution (2),
.BR setgid (2),
.BR setuid (2),
.BR stat (2)
|