.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) .\" .\" 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. .\" Translated into Spanish Wed Jan 21 1998 by Gerardo Aburruzaga .\" García .\" .TH FTOK 3 "21 Enero 1998" "Linux 0.99.13" "Manual del Programador de Linux" .SH NOMBRE ftok \- convierte un nombre de camino y un identificador de proyecto en una clave IPC de System V .SH SINOPSIS .nf .B # include .B # include .fi .sp .BI "key_t ftok ( char *" camino , .BI "char " proy " )" .SH DESCRIPCIÓN La función convierte el nombre de camino de un fichero existente y accesible y un identificador de proyecto a una clave IPC de System V de tipo \fBkey_t\fP. .SH "VALOR DEVUELTO" En caso de éxito el valor devuelto será el valor .B key_t convertido; en otro caso, .B \-1 con .B errno indicando el error como para la llamada al sistema .BR stat (2). .SH FALLOS El valor .B key_t generado se obtiene llamando a .B stat sobre el fichero de disco correspondiente a \fIcamino\fP para así poder coger su número de nodo\-í y el número menor de dispositivo del sistema de ficheros en el cual reside el fichero de disco, después combinando el valor de 8 bits .I proy junto con los 16 bits más bajos del número del nodo\-í, más los 8 bits del número menor de dispositivo. El algoritmo no garantiza un valor único para la clave. De hecho .IP \(bu Dos nombres diferentes enlazados al mismo fichero producen los mismos valores de clave. .IP \(bu Emplear los 16 bits más bajos del número de nodo\-í proporciona alguna probabilidad (también pequeña normalmente) de tener los mismos valores de clave para nombres de ficheros con nodos\-í diferentes. .IP \(bu El no discriminar entre números mayores de dispositivo, da alguna probabilidad de colisión (también usualmente pequeña) para sistemas con varios controladores de disco. .SH "VÉASE TAMBIÉN" .BR ipc (5), .BR msgget (2), .BR semget (2), .BR shmget (2), .BR stat (2).