Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.system > #375

Re: May device identifier be changed without reboot?

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.os.linux.development.system, comp.unix.programmer
Subject Re: May device identifier be changed without reboot?
Followup-To comp.os.linux.development.system
Date 2012-01-06 16:06 +0000
Organization A noiseless patient Spider
Message-ID <20120106075325.580@kylheku.com> (permalink)
References (2 earlier) <barmar-9F90CC.21241505012012@news.eternal-september.org> <slrnjgd73m.1ls.grahn+nntp@frailea.sa.invalid> <517950e6-e9cb-4dc2-85e6-af8c4ec6b3a7@ck5g2000vbb.googlegroups.com> <87ehvdjicl.fsf@araminta.anjou.terraraq.org.uk> <je6f7t$4uv$1@speranza.aioe.org>

Cross-posted to 2 groups.

Followups directed to: comp.os.linux.development.system

Show all headers | View raw


On 2012-01-06, Alex Vinokur <alexvn@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.

I'm afraid that the design of whatever you are writing has a bug (by relying
on ftok to be more/other than an IPC key generator).

Back to comp.os.linux.development.system | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[Linux] May device identifier be changed without reboot? Alex Vinokur <alex.vinokur@gmail.com> - 2012-01-04 20:53 -0800
  Re: [Linux] May device identifier be changed without reboot? Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-01-05 16:01 +0000
    Re: [Linux] May device identifier be changed without reboot? Barry Margolin <barmar@alum.mit.edu> - 2012-01-05 21:24 -0500
      Re: [Linux] May device identifier be changed without reboot? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-06 07:02 +0000
        Re: [Linux] May device identifier be changed without reboot? "Alex Vinokur" <alexvn@users.sourceforge.net> - 2012-01-06 10:21 +0200
        Re: May device identifier be changed without reboot? Alex Vinokur <alex.vinokur@gmail.com> - 2012-01-06 00:14 -0800
          Re: May device identifier be changed without reboot? Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-06 09:22 +0000
            Re: May device identifier be changed without reboot? "Alex Vinokur" <alexvn@users.sourceforge.net> - 2012-01-06 11:34 +0200
              Re: May device identifier be changed without reboot? Barry Margolin <barmar@alum.mit.edu> - 2012-01-06 07:57 -0500
              Re: May device identifier be changed without reboot? Kaz Kylheku <kaz@kylheku.com> - 2012-01-06 16:06 +0000
                Re: May device identifier be changed without reboot? Alex Vinokur <alex.vinokur@gmail.com> - 2012-01-06 10:17 -0800
  Re: [Linux] May device identifier be changed without reboot? Tim Roberts <timr@probo.com> - 2012-01-05 22:43 -0800

csiph-web