unlink.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 99 行

2
99
字号
.\" SCCSID: @(#)unlink.2	2.1	3/10/87.TH unlink 2.SH Nameunlink \- remove directory entry.SH Syntax.nf.B unlink(\fIpath\fP).B char *\fIpath\fP;.fi.SH Description.NXR "unlink system call".NXA "link system call" "unlink system call".NXR "file" "unlinking"The.PN unlinksystem call removes the entry for the file.I pathfrom its directory.If this entry was the last link to the file,and no process has the file open, thenall resources associated with the file are reclaimed.If, however, the file was open in any process, the actualresource reclamation is delayed until it is closed,even though the directory entry has disappeared..SH Return ValuesUpon successful completion, a value of 0 is returned.Otherwise, a value of \-1 is returned, and.I errnois set to indicate the error..SH DiagnosticsThe.PN unlink system call succeeds unless:.TP 15[ENOTDIR]A component of the \fIpath\fP prefix is not a directory..TP 15[ENOENT]The named file does not exist or.I pathpoints to an empty string and the environment defined is POSIX or SYSTEM_FIVE..TP 15[EACCES]Search permission is denied for a component of the \fIpath\fP prefix..TP 15[EACCES]Write permission is denied on the directory containing the linkto be removed..TP 15[EBUSY]The entry to be unlinked is the mount point for a mounted file system..TP 15[EROFS]The named file resides on a read-only file system..TP 15[EFAULT]The.I pathpoints outside the process's allocated address space..TP 15[ELOOP]Too many symbolic links were encountered in translating the pathname..TP 15[ENAMETOOLONG]A component of a pathname exceeded 255 characters, or anentire pathname exceeded 1023 characters..TP 15[EPERM]The named file is a directory and the effective user IDof the process is not the superuser..TP 15[EPERM]The named file is a directory and the environmentis defined is POSIX..TP 15[EPERM]The directory containing the file is marked sticky, andneither the containing directory nor the file to be removedare owned by the effective user ID..TP 15[EIO]An I/O error occurred while deleting the directory entry ordeallocating the inode..TP[ETIMEDOUT]A connect request or remote file operation failed, because the connected partydid not properly respond after a period of time that is dependent on thecommunications protocol..TP 15[ETXTBSY]The named file is the last link to a shared textexecutable and the environment defined is POSIX orSYSTEM_FIVE..SH EnvironmentDiffers from the System V definition in that ELOOPis a possible error condition..SH See Alsoclose(2), link(2), rmdir(2)

⌨️ 快捷键说明

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