|
||
Interface status: | externallyDefinedApi |
IPC_CREAT 001000
SVID required constants (same values as system 5). create entry if key does not exist.
Interface status: | externallyDefinedApi |
IPC_EXCL 002000
SVID required constants (same values as system 5). fail if key exists.
Interface status: | externallyDefinedApi |
IPC_NOWAIT 004000
SVID required constants (same values as system 5). error if request must wait.
Interface status: | externallyDefinedApi |
IMPORT_C key_t ftok(const char *pathname, int proj_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;
}
|
|
semget(key_t,int,int)
semget(key_t,int,int)
Based on the values of key and semflg, semget returns the identifier of a newly ...shmget(key_t,int,int)
shmget(key_t,int,int)
Based on the values of key and shmflg, shmget returns the identifier of a newly ...msgget(key_t,int)
msgget(key_t,int)
...