⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 access.2

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 2
字号:
.\" SCCSID: @(#)access.2	2.4	8/10/87.TH access 2.SH Nameaccess \- determine the accessibility of file.SH Syntax.nf.B #include <unistd.h>.br.B accessible = access(\fIpath, mode\fP).br.B int accessible;.br.B char *\fIpath\fP;.br.B int \fImode;\fP.fi.SH Description.NXR "access system call".NXR "file" "checking accessibility"The system call,.PN access ,checks the given file.I pathfor accessibility according to.IR mode .The argument .I modeis an inclusive OR of the bits R_OK, W_OK, and X_OK.Specifying the argument.I modeas F_OKtests whether the directories leading to the file can besearched and whether the file exists..PPThe real user ID and the group access list(including the real group ID) are usedto verify permissions.  This call is useful to set-UID programs..PPNote that only access bits are checked.The .PN access call may indicate that a directory is writeable, but an attempt to openthe directory fails, although files are present in the directory.Additionally, a file may appear to be executable, but .PN execvefails unless the file is in proper format..PPIf a.I pathcannot be found, or if the desired access modes arenot granted, a \-1 value is returned; otherwise,a 0 value is returned..SH DiagnosticsAccess to the file is denied if any of the following is true:.TP 15[EACCES]Permission bits of the file mode do not permit the requestedaccess or search permission is denied on a component of thepath prefix.  The owner of a file has permission checked withrespect to the owner's read, write, and execute mode bits.Members of the file's group, other than the owner, have permissionchecked with respect to the group's mode bits.  All others have permissions checked with respect to the othermode bits..TP 15[EFAULT]The.I pathpoints outside the process's allocated address space..TP 15[EIO]An I/O error occurred while reading from or writing to thefile system..TP 15[ELOOP]Too many symbolic links were encountered in translating the pathname..TP[ENAMETOOLONG]A .I pathcomponent length exceeds 255 characters or the length of \fIpath\fP exceeds1023 characters..TP 15[ENOENT]The file referred to by.I pathdoes not exist or the .I pathpoints to an empty string and the environment defined is POSIX or SYSTEM_FIVE..TP 15[ENOTDIR]A component of the path prefix is not a directory..TP 15[EROFS]Write access is requested for a file on a read-only file system..TP 15[ESTALE]The file handle given in the argument was invalid.  The filereferred to by that file handle no longer exists or has been revoked..TP 15[ETIMEDOUT]A connect request or remote file operation failsbecause the connected partydid not respond after a periodof time determined by the communications protocol..TP 15[ETXTBSY]Write access is requested for a pure procedure (shared text)file that is being executed..SH See Alsochmod(2), stat(2)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -