|
|
1.1 ! root 1: .TH LINK 2 "12 February 1983" ! 2: .UC 4 ! 3: .SH NAME ! 4: link \- make a hard link to a file ! 5: .SH SYNOPSIS ! 6: .nf ! 7: .ft B ! 8: link(name1, name2) ! 9: char *name1, *name2; ! 10: .fi ! 11: .ft R ! 12: .SH DESCRIPTION ! 13: A hard link ! 14: to ! 15: .I name1 ! 16: is created; ! 17: the link has the name ! 18: .IR name2 . ! 19: .I Name1 ! 20: must exist. ! 21: .PP ! 22: With hard links, ! 23: both ! 24: .I name1 ! 25: and ! 26: .I name2 ! 27: must be in the same file system. ! 28: Unless the caller is the super-user, ! 29: .I name1 ! 30: must not be a directory. ! 31: Both the old and the new ! 32: .I link ! 33: share equal access and rights to ! 34: the underlying object. ! 35: .SH "RETURN VALUE ! 36: Upon successful completion, a value of 0 is returned. Otherwise, ! 37: a value of \-1 is returned and ! 38: .I errno ! 39: is set to indicate the error. ! 40: .SH "ERRORS ! 41: .I Link ! 42: will fail and no link will be created if one or more of the following ! 43: are true: ! 44: .TP 15 ! 45: [EPERM] ! 46: Either pathname contains a byte with the high-order bit set. ! 47: .TP 15 ! 48: [ENOENT] ! 49: Either pathname was too long. ! 50: .TP 15 ! 51: [ENOTDIR] ! 52: A component of either path prefix is not a directory. ! 53: .TP 15 ! 54: [ENOENT] ! 55: A component of either path prefix does not exist. ! 56: .TP 15 ! 57: [EACCES] ! 58: A component of either path prefix denies search permission. ! 59: .TP 15 ! 60: [ENOENT] ! 61: The file named by \fIname1\fP does not exist. ! 62: .TP 15 ! 63: [EEXIST] ! 64: The link named by \fIname2\fP does exist. ! 65: .TP 15 ! 66: [EPERM] ! 67: The file named by \fIname1\fP is a directory and the effective ! 68: user ID is not super-user. ! 69: .TP 15 ! 70: [EXDEV] ! 71: The link named by \fIname2\fP and the file named by \fIname1\fP ! 72: are on different file systems. ! 73: .TP 15 ! 74: [EACCES] ! 75: The requested link requires writing in a directory with a mode ! 76: that denies write permission. ! 77: .TP 15 ! 78: [EROFS] ! 79: The requested link requires writing in a directory on a read-only file ! 80: system. ! 81: .TP 15 ! 82: [EFAULT] ! 83: One of the pathnames specified ! 84: is outside the process's allocated address space. ! 85: .TP 15 ! 86: [ELOOP] ! 87: Too many symbolic links were encountered in translating the pathname. ! 88: .SH "SEE ALSO" ! 89: symlink(2), unlink(2)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.