[Overview][Constants][Types][Procedures and functions] Reference for unit 'ipc' (#rtl)

ftok

Create token from filename

Declaration

Source position: ipc.pp line 88

function ftok(

  Path: pchar;

  ID: cint

):TKey;

Description

ftokreturns a key that can be used in a semgetshmgetor msggetcall to access a new or existing IPC resource.

Pathis the name of a file in the file system, IDis a character of your choice. The ftok call does the same as it's C couterpart, so a pascal program and a C program will access the same resource if they use the same Pathand ID

For an example, see msgctl, semctlor shmctl.

Errors

ftokreturns -1 if the file in Pathdoesn't exist.

See also

semget

  

Return the ID of a semaphore set, possibly creating the set

shmget

  

Return the ID of a shared memory block, possibly creating it

msgget

  

Return message queue ID, possibly creating the queue