.\" 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 .\" Modified Sun Aug 21 18:18:14 1994: Michael Haardt's NFS diffs were .\" applied by hand .\" Translated 25 Feb 1998 by Vicente Pastor Gómez .\" Traslation revised 21 April 1998 by Juan Piernas .\" Traslation revised Mon Aug 17 1998 by Juan Piernas .\" .TH LINK 2 "10 diciembre 1997" "Linux 2.0.30" "Manual del Programador de Linux" .SH NOMBRE link \- crea un nuevo nombre para un fichero .SH SINOPSIS .B #include .sp .BI "int link(const char *" oldpath ", const char *" newpath ); .SH DESCRIPCIÓN .B link crea un nuevo enlace (también conocido como enlace físico) 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 operación; 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 DEVUELTO" Si hubo éxito, se devuelve cero. Si hubo error, se devuelve \-1, y .I errno se actualiza apropiadamente. .SH ERRORES .TP .B EXDEV .IR oldpath " y " newpath no están en el mismo sistema de ficheros. .TP .B EPERM El sistema de ficheros que contiene .IR oldpath " y " newpath no soporta la creación de enlaces físicos. .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 búsqueda (ejecución). .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 simbólico 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 núcleo insuficiente. .TP .B EROFS El fichero está en un sistema de ficheros de sólo lectura. .TP .B EEXIST .I newpath ya existe. .TP .B EMLINK El fichero a que se refiere .I oldpath ya tiene el número máximo de enlaces a él. .TP .B ELOOP Se han encontrado demasiados enlaces simbólicos al resolver .IR oldpath " o " newpath . .TP .B ENOSPC El dispositivo que contiene el fichero no tiene espacio para la nueva entrada de directorio. .TP .B EPERM .I oldpath es un directorio. .TP .B EIO Se ha producido un error de E/S. .SH OBSERVACIONES Los enlaces físicos, tal y como los crea .BR link , no pueden cruzar sistemas de ficheros. Utiliza .B symlink si esto es necesario. .SH "CONFORME A" SVr4, SVID, POSIX, BSD 4.3 y X/OPEN. SVr4 documenta las condiciones de error adicionales ENOLINK y EMULTIHOP; POSIX.1 no documenta ELOOP. X/OPEN no documenta EFAULT, ENOMEM ni EIO. .SH FALLOS En sistemas de ficheros NFS, el valor devuelto podría ser incorrecto en caso de que el servidor NFS lance la creación del enlace y muera antes de poder terminarlo. Utiliza .BR stat (2) para averiguar si se creó el enlace. .SH "VÉASE TAMBIÉN" .BR symlink (2), .BR unlink (2), .BR rename (2), .BR open (2), .BR stat (2), .BR ln (1)