Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <ipc.h>
Link against: libc.lib

IPC_CREAT

Interface status: externallyDefinedApi

IPC_CREAT 001000

Description

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

[Top]


IPC_EXCL

Interface status: externallyDefinedApi

IPC_EXCL 002000

Description

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

[Top]


IPC_NOWAIT

Interface status: externallyDefinedApi

IPC_NOWAIT 004000

Description

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

[Top]


IPC_PRIVATE

Interface status: externallyDefinedApi

IPC_PRIVATE (key_t)0

Description

private key

[Top]


IPC_RMID

Interface status: externallyDefinedApi

IPC_RMID 0

Description

remove identifier

[Top]


IPC_SET

Interface status: externallyDefinedApi

IPC_SET 1

Description

set options

[Top]


IPC_STAT

Interface status: externallyDefinedApi

IPC_STAT 2

Description

get options

[Top]


ftok(const char *,int)

Interface status: externallyDefinedApi

IMPORT_C key_t ftok(const char *pathname, int proj_id);

Description

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;
}

Parameters

const char *pathname

int proj_id

Return value

key_tkey_t

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.

See also: