HP 3000 Manuals

ftok [ MPE/iX Developer's Kit Reference Manual Volume II ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume II

ftok 

Returns a key used in calls to msgget(), semget(), and shmget() function
calls.

Syntax 

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

     key_t ftok (char *pathname, char id);

Parameters 

pathname   Passes a pointer to a string containing the pathname of a file
           accessible to the calling process.

id         Passes a character used to further qualify the returned key.

Return Values 

!=-1       Key value returned.

-1         Error.  The specified pathname does not exist or is not
           accessible to the calling process.

Description 
[REV BEG]

The ftok() function can be used to return a key based on both pathname 
and id.  This key [REV END]can be used in subsequent calls to the SVID
IPC msgget(), semget(), and shmget() functions.

A different key is returned when called with the same pathname but a
different character is passed in id.

Implementation Considerations 

None.

Errors 

If an error occurs, errno is set to the following value.

EINVAL            CAUSE           The pathname parameter points to an invalid address,
                                  or pathname specifies a nonexistent file, or the
                                  caller does not have the correct access to the
                                  pathname.

                  ACTION          Make sure that pathname points to a valid and
                                  existing pathname to which the caller has access.

See Also 

msgget(), semget(), shmget()



MPE/iX 5.0 Documentation