ipc.h File Reference

Typedef gid_t

typedef __gid_t gid_t

_GID_T_DECLARED

Typedef key_t

typedef __key_t key_t

Used for XSI interprocess communication.

_KEY_T_DECLARED

Typedef mode_t

typedef __mode_t mode_t

_MODE_T_DECLARED

Typedef uid_t

typedef __uid_t uid_t

_UID_T_DECLARED

IPC_CREAT

SVID required constants (same values as system 5). create entry if key does not exist.

IPC_EXCL

SVID required constants (same values as system 5). fail if key exists.

IPC_NOWAIT

SVID required constants (same values as system 5). error if request must wait.

IPC_PRIVATE

private key

IPC_RMID

remove identifier

IPC_SET

set options

IPC_STAT

get options

ftok ( const char *, int )

IMPORT_C key_tftok(const char *pathname,
intproj_id
)

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

The specified pathname 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.

Examples:
#include <sys/types.h>
#include <sys/ipc.h>
#include <stdio.h>

int main(void)
{
    char *pathame = "C:\XXX";
    int proj_id = 100;
    key_t fkey;
    if ((fkey = ftok(pathame, proj_id)) == -1) {
        printf("ftok() failed
");
    }
    return 0;
}

See also: semget() shmget() msgget()

Return Value
The ftok function will return -1 if pathname does not exist or if it cannot be accessed by the calling process. On success the generated key_t value is returned.
Capability
DeferredRFs::Entry(const TDesC16&, TEntry&)