1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
.\" 1993 Michael Haardt, Ian Jackson.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified Fri Jul 23 22:01:51 1993 Rik Faith (faith@cs.unc.edu)
.\" Modified Sun Aug 21 18:18:14 1994: Michael Haardt's NFS diffs were
.\" applied by hand (faith@cs.unc.edu)
.\"
.\"
.\" Traduction 10/10/1996 Christophe BLAESS (ccb@club-internet.fr)
.\" Mise a jour 08/04/1997
.\" Mise a jour 19/07/1997
.\" mj 10/12/1997 (LDP man-pages 1.18)
.\" mj 25/04/1998 (LDP man-pages 1.19)
.TH LINK 2 "25 Avril 1998" "Linux" "Manuel du programmeur Linux"
.SH NOM
link \- Cre un nouveau nom pour un fichier.
.SH SYNOPSIS
.B #include <unistd.h>
.sp
.BI "int link (const char *" oldpath ", const char *" newpath );
.SH DESCRIPTION
.B link
cre un nouveau lien (aussi appel lien matriel ou hard link) sur
un fichier existant.
Si
.I newpath
existe il ne sera
.I pas
ecras.
Ce nouveau nom pourra tre utilis exactement comme l'ancien quelque
soit l'opration. Les deux noms se rfrent au mme fichier (et ont
donc les mmes permissions et propritaire) et il est impossible de
dterminer quel nom tait l'original.
.SH "VALEUR RENVOYE"
En cas de russite 0 est renvoy, en cas d'chec \-1 est renvoy,
et
.I errno
contient le code d'erreur.
.SH ERREURS
.TP 0.8i
.B EXDEV
.IR oldpath " et " newpath
ne rsident pas sur le mme systme de fichiers.
.TP
.B EPERM
Le systme de fichier contenant
.IR oldpath " et " newpath
ne permet pas la cration de liens matriels.
.TP
.B EFAULT
.IR oldpath " ou " newpath " pointent en dehors de l'espace d'adressage accessible."
.TP
.B EACCES
L'criture dans le rpertoire contenant
.I newpath
n'est pas autoris pour l'UID effectif du processus, ou l'un des
rpertoires de
.IR oldpath " ou " newpath
ne permet pas le parcours (excution).
.TP
.B ENAMETOOLONG
.IR oldpath " ou " newpath " sont trop longs."
.TP
.B ENOENT
Un rpertoire contenu dans
.IR oldpath " ou " newpath
n'existe pas, ou est un lien symbolique pointant nulle part.
.TP
.B ENOTDIR
Un lment du chemin d'accs
.IR oldpath " ou " newpath
n'est pas rellement un rpertoire.
.TP
.B ENOMEM
pas assez de mmoire pour le noyau
.TP
.B EROFS
Le fichier se trouve sur un systme de fichier en lecture seule
.TP
.B EEXIST
.I newpath
xiste deja.
.TP
.B EMLINK
Le fichier rfrenc par
.I oldpath
possde dj le nombre maximal de liens.
.TP
.B ELOOP
.IR oldpath " ou " newpath
contiennent une rfrence circulaire ( travers un lien symbolique).
.TP
.B ENOSPC
Le support du systme de fichier ne dispose pas d'assez de place
pour un nouveau point d'entre dans le rpertoire.
.TP
.B EPERM
.I oldpath
est un rpertoire.
.TP
.B EIO
Une erreur d'entre/sortie bas-niveau s'est produite.
.SH NOTES
Les liens matriels crs par
.BR link ,
ne peuvent pas s'tendre sur plusieurs systmes de fichiers.
On peut utiliser plutt
.B symlink
si ceci est ncessaire.
.SH "CONFORMIT"
SVr4, SVID, POSIX, BSD 4.3, X/OPEN. SVr4 documente des conditions d'erreurs
supplmentaires ENOLINK et EMULTIHOP. POSIX.1 ne dcrit pas ELOOP.
X/OPEN ne dcrit pas les erreurs EFAULT, ENOMEM, ni EIO.
.SH BUGS
Sur les systmes de fichiers NFS, le code de retour peut tre faux,
si le serveur NFS a cr correctement le lien mais s'est arrt
avant de donner le code de retour. Utiliser dans ce cas
.IR stat (2)
pour vrifier si le lien a t effectivement cr
.SH "VOIR AUSSI"
.BR symlink (2),
.BR unlink (2),
.BR rename (2),
.BR open (2),
.BR stat (2),
.BR ln (1)
.SH TRADUCTION
Christophe Blaess, 1997.
|