Path: utzoo!attcan!uunet!dptechno!dave From: dave@dptechno.UUCP (Dave Lee) Newsgroups: comp.unix.internals Subject: Re: shmat() & shmdt() questions. Message-ID: <583@dptechno.UUCP> Date: 19 Sep 90 17:58:52 GMT References: <13782@hydra.gatech.EDU> <13783@hydra.gatech.EDU> Reply-To: dave@dptechno.UUCP (Dave Lee) Organization: D.P. Technology Corp. Camarillo California Lines: 25 In article <13783@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (BURNS,JIM) writes: >in article <13782@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. IMHO of course. -- Dave Lee uunet!dptechno!dave