On Jan 6, 6:06 pm, Kaz Kylheku <
k...@kylheku.com> wrote:
> On 2012-01-06, Alex Vinokur <
ale...@users.sourceforge.net> wrote:
>
> > Does it mean the ftok() function has bug in design on Linux?
>
> According to the Single Unix Specification (where the requirement
> for ftok comes from: it is not a Linuxism) the ftok function is part of IPC. It
> is described as "ftok - generate an IPC key" and declared in the header
> <sys/ipc.h>.
>
> IPC objects (shared memory segments, message queues and semaphores) are
> volatile; they disappear when the machine is shut down.
>
> In other words, it is not meaningful to try to use a key from a previous
> boot of the system to try to find an IPC object.
>
> None of the functions which take a key_t argument such as shmget, msget
> and semget, will be able to retrieve anything after a fresh reboot,
> no matter what the key_t value is.
>