.\" -*- coding: UTF-8 -*- .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" Modified 2001-11-28, by Michael Kerrisk, .\" Changed data type of proj_id; minor fixes .\" aeb: further fixes; added notes. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH FTOK 3 "11 Abril 2020" GNU "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 \fB#include \fP \fB#include \fP .fi .PP \fBkey_t ftok(const char *\fP\fIcamino\fP\fB, int \fP\fIproy\fP\fB);\fP .SH DESCRIPCIÓN La función \fBftok\fP() utiliza la identidad del fichero que indica \fIcamino\fP (que debe referirse a un fichero existente y accesible) y los 8 bits menos significativos de \fIproy\fP (que debe ser distinto de cero) para generar una clave IPC de System V de tipo \fIkey_t\fP, adecuada para el uso con \fBmsgget\fP(2), \fBsemget\fP(2) o \fBshmget\fP(2). .PP El valor resultante es el mismo para todos los nombres de ruta que hacen referencia al mismo fichero, cuando se utiliza el mismo valor de \fIproy\fP. El valor devuelto debería ser diferente cuando los ficheros (que existen simultáneamente) o los identificadores de proyecto son distintos. .SH "VALOR DEVUELTO" En caso de éxito se devuelve la clave \fIkey_t\fP generada. En caso de fallo se devuelve \-1, y la variable \fIerrno\fP indica el error al igual que con la llamada al sistema \fBstat\fP(2). .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBftok\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008. .SH NOTAS On some ancient systems, the prototype was: .PP .in +4n .EX \fBkey_t ftok(char *\fP\fIcamino\fP\fB, char \fP\fIproy\fP\fB);\fP .EE .in .PP Today, \fIproj_id\fP is an \fIint\fP, but still only 8 bits are used. Typical usage has an ASCII character \fIproj_id\fP, that is why the behavior is said to be undefined when \fIproj_id\fP is zero. .PP Of course, no guarantee can be given that the resulting \fIkey_t\fP is unique. Typically, a best\-effort attempt combines the given \fIproj_id\fP byte, the lower 16 bits of the inode number, and the lower 8 bits of the device number into a 32\-bit result. Collisions may easily happen, for example between files on \fI/dev/hda1\fP and files on \fI/dev/sda1\fP. .SH EJEMPLOS See \fBsemget\fP(2). .SH "VÉASE TAMBIÉN" \fBmsgget\fP(2), \fBsemget\fP(2), \fBshmget\fP(2), \fBstat\fP(2), \fBsysvipc\fP(7) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García y Miguel Pérez Ibars . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .