#include <sys/types.h>
|
#include <sys/ipc.h>
|
key_t
ftok (const char *path, int id); |
The specified path 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.
#include <sys/types.h> #include <sys/ipc.h> #include <stdio.h> int main(void) { char *pathame = "C:\XX"; int proj_id = 100; key_t fkey; if ((fkey = ftok(pathame, proj_id)) == -1) { printf("ftok() failed\n"); } return 0; }
© 2005-2007 Nokia |