Provided by:
manpages-fr-dev_2.64.1-1_all 
NOM
ftok - Convertir un nom de fichier et un identificateur de projet en
clé IPC Système V
SYNOPSIS
#include <sys/types.h>
#include <sys/ipc.h>
key_t ftok(const char *pathname, int proj_id);
DESCRIPTION
The ftok() function uses the identity of the file named by the given
pathname (which must refer to an existing, accessible file) and the
least significant 8 bits of proj_id (which must be non-zero) to
generate a key_t type System V IPC key, suitable for use with
msgget(2), semget(2), or shmget(2).
La valeur résultante est la même pour tous les chemins d’accès
identifiant le même fichier, en utilisant une valeur identique pour
proj_id. La valeur devrait être différente lorsque des fichiers
différents (existants simultanément), ou des identificateurs de projet
différents sont employés.
VALEUR RENVOYÉE
On success the generated key_t value is returned. On failure -1 is
returned, with errno indicating the error as for the stat(2) system
call.
CONFORMITÉ À
POSIX.1-2001.
NOTES
Avec les bibliothèques libc4 et libc5 (et également sous SunOS 4.x), le
prototype était
key_t ftok(char *pathname, char proj_id);
Today proj_id is an int, but still only 8 bits are used. Typical usage
has an ASCII character proj_id, that is why the behavior is said to be
undefined when proj_id is zero.
Of course no guarantee can be given that the resulting key_t is unique.
Typically, a best effort attempt combines the given proj_id byte, the
lower 16 bits of the i-node number, and the lower 8 bits of the device
number into a 32-bit result. Collisions may easily happen, for example
between files on /dev/hda1 and files on /dev/sda1.
VOIR AUSSI
msgget(2), semget(2), shmget(2), stat(2), svipc(7)
TRADUCTION
Cette page de manuel a été traduite et mise à jour par Christophe
Blaess <http://www.blaess.fr/christophe/> entre 1996 et 2003, puis par
Alain Portal <aportal AT univ-montp2 DOT fr> jusqu’en 2006, et mise à
disposition sur http://manpagesfr.free.fr/.
Les mises à jour et corrections de la version présente dans Debian sont
directement gérées par Florentin Duneau <fduneau@gmail.com> et l’équipe
francophone de traduction de Debian.
Veuillez signaler toute erreur de traduction en écrivant à
<debian-l10n-french@lists.debian.org> ou par un rapport de bogue sur le
paquet manpages-fr.
Vous pouvez toujours avoir accès à la version anglaise de ce document
en utilisant la commande « man -L C <section> <page_de_man> ».