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
|
.\" 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>
.\" Translated 25 Feb 1998 by Vicente Pastor Gmez <VPASTORG@santandersupernet.com , vicpastor@hotmail.com>
.\"
.TH LINK 2 "17 Agosto 1994" "Linux" "Manual del Programador Linux"
.SH NOMBRE
link \- crea un nuevo nombre para un fichero
.SH SINOPSIS
.B #include <unistd.h>
.sp
.BI "int link(const char *" oldpath ", const char *" newpath );
.SH DESCRIPCIN
.B link
crea un nuevo enlace (tambin conocido como enlace fsico) a un fichero
existente.
Si
.I newpath
existe,
.I no
ser sobreescrito.
Este nuevo nombre podr ser usado exactamente igual que el viejo para cualquier
operacin; ambos nombres se refieren al mismo fichero (y por lo tanto, tienen
los mismos permisos y propietario) y es imposible decir qu nombre era el
`original'.
.SH "VALOR REGRESADO"
Si hubo xito, se devuelve cero. Si hubo error, se devuelve \-1, y
.I errno
se actualiza apropiadamente.
.SH ERRORES
.TP 0.8i
.B EXDEV
.IR oldpath " y " newpath
no estn en el mismo sistema de ficheros.
.TP
.B EPERM
El sistema de ficheros que contiene
.IR oldpath " y " newpath
no soporta la creacin de enlaces fsicos.
.TP
.B EFAULT
.IR oldpath " o " newpath " apunta fuera de tu espacio de direcciones
accesibles.
.TP
.B EACCES
El acceso de escritura al directorio que contiene
.I newpath
no est permitido para el uid efectivo del proceso, o uno de los directorios en
.IR oldpath " o " newpath
no da permiso de bsqueda (ejecucin).
.TP
.B ENAMETOOLONG
.IR oldpath " o " newpath " es demasiado largo."
.TP
.B ENOENT
Un componente del directorio en
.IR oldpath " o " newpath
no existe o es un enlace simblico colgado.
.TP
.B ENOTDIR
Un componente usado como directorio en
.IR oldpath " o " newpath
no es, de hecho, un directorio.
.TP
.B ENOMEM
Memoria de kernel insuficiente.
.TP
.B EROFS
El fichero est en un sistema de ficheros de slo lectura.
.TP
.B EEXIST
.I newpath
ya existe.
.TP
.B EMLINK
El fichero a que se refiere
.I oldpath
ya tiene el nmero mximo de enlaces a l.
.TP
.B ELOOP
.IR oldpath " o " newpath
contiene una referencia a un enlace simblico circular, p.ej. un enlace
simblico que al expansionarse contiene una referencia a s mismo.
.TP
.B ENOSPC
El dispositivo que contiene el fichero no tiene espacio para la nueva entrada
de directorio.
.TP
.B EPERM
.I oldpath
es la entrada
.B . " o " ..
de un directorio.
.SH NOTAS
Los enlaces fsicos, tal y como los crea
.BR link ,
no pueden cruzar sistemas de ficheros. Utiliza
.B symlink
si esto es necesario.
.SH "CONFORMA CON"
SVr4, SVID, POSIX, BSD 4.3. SVr4 documenta las condiciones de error
adicionales ENOLINK y EMULTIHOP; POSIX.1 no documenta ELOOP.
.SH BUGS
En sistemas de ficheros NFS, el valor de retorno podra ser incorrecto en
caso de que el servidor NFS lance la creacin del enlace y muera antes de
poder terminarlo. Utiliza
.IR stat(2)
para averiguar si se cre el enlace.
.SH "VASE TAMBIN"
.BR symlink "(2), " unlink "(2), " rename "(2), " open (2),
.BR stat "(2), " ln "(1)."
|