Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!rutgers!att!holin!bes From: bes@holin.ATT.COM (Bradley Smith) Newsgroups: comp.unix.questions Subject: Re: System V message queues? Message-ID: <408@holin.ATT.COM> Date: 22 Feb 89 12:56:29 GMT References: <561@pvab.PVAB.SE> Organization: AT&T Bell Labs, OIL, Holmdel, NJ Lines: 15 > Now, the first process creates a message queue with a parameter of > IPC_PRIVATE to msgget() before it starts the second process. But how > do I pass the queue id to the new process? I could probably use sema- > phores or shared memory for this, but how do I then pass the semaphore > id to the new process? How are the System V IPC facilities intended to > be used, by the way? I am not sure you want to use PRIVATE, but what you could do is to use the same key. ie before the fork use getpid and save it, after the fork then use that number as the key. If you have 2 different programgs, then send the number on the command line. -- Bradley Smith Computer Systems Offer Integration Laboratory AT&T Bell Labs, Holmdel, NJ 201-949-0090 att!holin!bes or bes@holin.ATT.COM