*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> ftok (3)              
Title
Content
Arch
Section
 

FTOK(3)

Contents


NAME    [Toc]    [Back]

     ftok -- create IPC identifier from path name

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/ipc.h>

     key_t
     ftok(const char *path, int id);

DESCRIPTION    [Toc]    [Back]

     The ftok() function attempts to create a unique key suitable for use with
     the msgget(3), semget(2) and shmget(2) functions given the path of an
     existing file and a user-selectable id.

     The specified path must specify an existing file that is accessible to
     the calling process or the call will fail.  Also, note that links to
     files will return the same key, given the same id.

RETURN VALUES    [Toc]    [Back]

     The ftok() function will return -1 if path does not exist or if it cannot
     be accessed by the calling process.

SEE ALSO    [Toc]    [Back]

      
      
     semget(2), shmget(2), msgget(3)

HISTORY    [Toc]    [Back]

     The ftok() function originates with System V and is typically used by
     programs that use the System V IPC routines.

AUTHORS    [Toc]    [Back]

     Thorsten Lockert <[email protected]>

BUGS    [Toc]    [Back]

     The returned key is computed based on the device minor number and inode
     of the specified path in combination with the lower 8 bits of the given
     id.  Thus it is quite possible for the routine to return duplicate keys.


FreeBSD 5.2.1			 June 24, 1994			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ftok NetBSD create IPC indentifier from path name
mkdirp IRIX create, remove directories in a path
ftok OpenBSD create IPC identifier from a pathname
cs_oid_set_union Tru64 create an new object identifier (OID) set that is an union of two existingsets.
cs_oid_set_isect Tru64 create an new object identifier (OID) set that is an intersection oftwo existing sets.
cdptrec Tru64 Read Path Table Record from the CD-ROM Path Table
pthread_equal Tru64 Compares one thread identifier to another thread identifier
fmfontpath IRIX get the current font path.
vlgetconnection IRIX manage the connectivity of a VL path
pathchk HP-UX check path names
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service