Penguin
Annotated edit history of link(2) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 PerryLorier 2 link - make a new name for a file
1 perry 3
4 !!SYNOPSIS
5
2 PerryLorier 6 #include <unistd.h>
7 __int link(const char *__''oldpath''__, const char *__''newpath''__);__
1 perry 8
9 !!DESCRIPTION
2 PerryLorier 10 link(2) creates a new link (also known as a hard link) to an existing file.
1 perry 11
2 PerryLorier 12 If ''newpath'' exists it will ''not'' be overwritten.
1 perry 13
2 PerryLorier 14 This new name may be used exactly as the old one for any operation; both names refer to the same file (and so have the same permissions and ownership) and it is impossible to tell which name was the `original'.
1 perry 15
16 !!RETURN VALUE
2 PerryLorier 17 On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately.
1 perry 18
19 !!ERRORS
2 PerryLorier 20 ;[EXDEV]: ''oldpath'' and ''newpath'' are not on the same filesystem.
21 ;[EPERM]: The filesystem containing ''oldpath'' and ''newpath'' does not support the creation of hard links.
22 ;[EFAULT]: ''oldpath'' or ''newpath'' points outside your accessible address space.
23 ;[EACCES]: Write access to the directory containing ''newpath'' is not allowed for the process's effective uid, or one of the directories in ''oldpath'' or ''newpath'' did not allow search (execute) permission.
24 ;[ENAMETOOLONG]: ''oldpath'' or ''newpath'' was too long.
25 ;[ENOENT]: A directory component in ''oldpath'' or ''newpath'' does not exist or is a dangling symbolic link.
26 ;[ENOTDIR]: A component used as a directory in ''oldpath'' or ''newpath'' is not, in fact, a directory.
27 ;[ENOMEM]: Insufficient kernel memory was available.
28 ;[EROFS]: The file is on a read-only filesystem.
29 ;[EEXIST]: ''newpath'' already exists.
30 ;[EMLINK]: The file referred to by ''oldpath'' already has the maximum number of links to it.
31 ;[ELOOP]: Too many symbolic links were encountered in resolving ''oldpath'' or ''newpath''.
32 ;[ENOSPC]: The device containing the file has no room for the new directory entry.
33 ;[EPERM]: ''oldpath'' is a directory.
34 ;[EIO]: An I/O error occurred.
1 perry 35
36 !!NOTES
2 PerryLorier 37 Hard links, as created by link(2), cannot span filesystems. Use symlink(2) if this is required.
1 perry 38
39 !!CONFORMING TO
2 PerryLorier 40 SVr4, SVID, POSIX, BSD 4.3, X/OPEN. SVr4 documents additional [ENOLINK] and [EMULTIHOP] error conditions; POSIX.1 does not document [ELOOP]. X/OPEN does not document [EFAULT], [ENOMEM] or [EIO].
1 perry 41 !!BUGS
2 PerryLorier 42 On NFS file systems, the return code may be wrong in case the NFS server performs the link creation and dies before it can say so. Use stat(2) to find out if the link got created.
1 perry 43
44 !!SEE ALSO
2 PerryLorier 45 symlink(2), unlink(2), rename(2), open(2), stat(2), ln(1)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 8 times)