The ftok() function returns a key based on path and id that is usable in subsequent calls to msgget(2), semget(2) and shmget(2). The path argument must be the pathname of an existing file that the process is able to stat(2).
The ftok() function will return the same key value for all paths that name the same file, when called with the same id value, and will return different key values when called with different id values.
If the file named by path is removed while still referred to by a key, a call to ftok() with the same path and id returns an error. If the same file is recreated, then a call to ftok() with
the same path and id is likely to return a different key.
Only the low order 8-bits of id are significant. The behavior of ftok() is unspecified if these bits are 0.
|