?? link.2
字號:
.\" SCCSID: @(#)link.2 2.1 3/10/87.\" Last modified by Michaud 16Sept86..TH link 2.SH Namelink \- link to a file.SH Syntax.nf.B link(\fIname1, name2\fP).B char \fI*name1, *name2\fP;.fi.SH Description.NXR "link system call".NXA "link system call" "unlink system call".NXA "link system call" "symlink system call".NXR "file" "creating hard link"A hard linkto.I name1is created;the link has the name.IR name2 .The.I name1must exist..PPWith hard links,both.I name1and.I name2must be in the same file system.Unless the caller is the superuser,.I name1must not be a directory.Both the old and the new.PN linkshare equal access and rights tothe underlying object..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 linksystem callfails and no link is created under the following conditions:.TP 15[ENOTDIR]A component of either path prefix is not a directory..TP 15[ENAMETOOLONG]A component of either pathname exceeded 255 characters,or the entire length of either pathname exceeded 1023 characters..TP 15[ENOENT]A component of either path prefix does not exist..TP 15[ENOENT]The file named by \fIname1\fP does not exist..TP[ENOENT]When \fIname1\fP or \fIname2\fP point to an empty string andthe environment defined is POSIX or SYSTEM_FIVE..TP 15[EACCES]A component of either path prefix denies search permission..TP 15[EACCES]The requested link requires writing in a directory with a modethat denies write permission..TP 15[EEXIST]The link named by \fIname2\fP does exist..TP 15[EPERM]The file named by \fIname1\fP is a directory, and the effectiveuser ID is not that of superuser or the environment defined is POSIX..TP 15[EXDEV]The link named by \fIname2\fP and the file named by \fIname1\fPare on different file systems..TP 15[EROFS]The requested link requires writing in a directory on a read-only filesystem..TP 15[EFAULT]One of the pathnames specifiedis outside the process's allocated address space..TP 15[ELOOP]Too many symbolic links were encountered in translating one ofthe pathnames..TP 15[ENOSPC]The directory in which the entry for the new link is being placedcannot be extended because there is no space left on the filesystem containing the directory..TP 15[EDQUOT]The directory in which the entry for the new link is beingplaced cannot be extended because the user's quota of disk blockson the file system containing the directory has been exhausted..TP 15[EIO]An I/O error occurred while reading from or writing tothe file system to make the directory entry..TP 15[ESTALE]The file handle given in the argument is invalid. The file referred to by that file handle no longer exists or has been revoked..TP[ETIMEDOUT]A connect request or remote file operation failedbecause the connected partydid not properly respond after a periodof time that is dependent on the communications protocol..TP[EMLINK]The number of links to the file named by \fIpath1\fP wouldexceed {LINK_MAX}..SH EnvironmentIn the POSIX environment, linking to directories isnot allowed..SH See Alsosymlink(2), unlink(2)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -