.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" 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 "15 Diciembre 2022" "Páginas de manual de Linux 6.03" .SH NOMBRE ftok \- convierte un nombre de camino y un identificador de proyecto en una clave IPC de System V .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \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). .ad l .nh .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ \fBftok\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .hy .ad .sp 1 .SH ESTÁNDARES 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) .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 .