shmat() & shmdt() questions.
Brandon S. Allbery KB8JRR
allbery at NCoast.ORG
Sun Sep 23 02:36:31 AEST 1990
As quoted from <583 at dptechno.UUCP> by dave at dptechno.UUCP (Dave Lee):
+---------------
| In article <13783 at hydra.gatech.EDU> gt0178a at prism.gatech.EDU (BURNS,JIM) writes:
| >in article <13782 at hydra.gatech.EDU>, I write:
| >> myshmid = shmget (some-made-up-not-in-use-int-id, 4096, IPC_CREAT|600);
| > ^^^
| >I suppose that should actually be 'long', as in 'key_t'. I actually
| >normally use an ascii representation of a 4-char string (assuming
| >key_t=long). E.g. - if I want the key to be 'phs1', I use '0x70687331'.
|
| And just how is one supposed to know what is "not-in-use" ?, unless ofcourse,
| you just happen to be in controll of all the sources to all programs that
| may ever run on your machine.
|
| If everyone would use ftok(path,id) (see stdipc(3C)) as recomended in the FM,
| (and then document the path and id used), then selecting a key would have a
| lot less chance of colliding with other program uses. Unless you really
| want a private key, then use IPC_PRIVATE.
+---------------
If shared memory were in the standard namespace, this wouldn't be a problem.
Yes, this is a change of tune for me. But I was hoping that AT&T would
eventually integrate the two namespaces into a single one. From the
UNIX/WORLD description, it looks like they have... research, at least. (See
the article on Plan 9.) I wonder how long before the commercial side picks up
on that concept?
++Brandon
--
Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery at NCoast.ORG Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY
More information about the Comp.unix.internals
mailing list