.\" -*- 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 "31 outubro 2023" "Linux man\-pages 6.06" .SH NOME ftok \- converte um caminho de diretório e um identificador de projeto para uma chave IPC System V .SH BIBLIOTECA Biblioteca C Padrão (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSE .nf \fB#include \fP .fi .P \fBkey_t ftok(const char *\fP\fIpathname\fP\fB, int \fP\fIproj_id\fP\fB);\fP .SH DESCRIÇÃO The \fBftok\fP() function uses the identity of the file named by the given \fIpathname\fP (which must refer to an existing, accessible file) and the least significant 8 bits of \fIproj_id\fP (which must be nonzero) to generate a \fIkey_t\fP type System V IPC key, suitable for use with \fBmsgget\fP(2), \fBsemget\fP(2), or \fBshmget\fP(2). .P The resulting value is the same for all pathnames that name the same file, when the same value of \fIproj_id\fP is used. The value returned should be different when the (simultaneously existing) files or the project IDs differ. .SH "VALOR DE RETORNO" On success, the generated \fIkey_t\fP value is returned. On failure \-1 is returned, with \fIerrno\fP indicating the error as for the \fBstat\fP(2) system call. .SH ATRIBUTOS Para uma explicação dos termos usados nesta seção, consulte \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interface Atributo Valor T{ .na .nh \fBftok\fP() T} Thread safety MT\-Safe .TE .SH PADRÕES POSIX.1\-2008. .SH HISTÓRICO POSIX.1\-2001. .SH NOTAS On some ancient systems, the prototype was: .P .in +4n .EX \fBkey_t ftok(char *\fP\fIpathname\fP\fB, char \fP\fIproj_id\fP\fB);\fP .EE .in .P 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. .P 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 EXEMPLOS Veja \fBsemget\fP(2). .SH "VEJA TAMBÉM" \fBmsgget\fP(2), \fBsemget\fP(2), \fBshmget\fP(2), \fBstat\fP(2), \fBsysvipc\fP(7) .PP .SH TRADUÇÃO A tradução para português brasileiro desta página man foi criada por Rubens de Jesus Nogueira e André Luiz Fassone . .PP Esta tradução é uma documentação livre; leia a .UR https://www.gnu.org/licenses/gpl-3.0.html Licença Pública Geral GNU Versão 3 .UE ou posterior para as condições de direitos autorais. Nenhuma responsabilidade é aceita. .PP Se você encontrar algum erro na tradução desta página de manual, envie um e-mail para .MT debian-l10n-portuguese@lists.debian.org a lista de discussão de tradutores .ME .