wait on ipc message

Michael Rawdon rawdon at rex.cs.tulane.edu
Mon Dec 10 06:13:54 AEST 1990


In <1990Dec9.091203.4188 at bbt.se> pgd at bbt.se writes:
>I want to stall a process, to wake up on a message received
>through a SYSV ipc message, or data available on any file.
>That is, i want a select/poll to also include messages received
>through an ipc channel.

If I understand what you're asking correctly, I believe if you have the
following command format for receiving a message:

msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)

then if you simply do *not* set IPC_NOWAIT in msgflg, the process will
block until a message of type 'msgtyp' appears on the message queue with
id 'msqid'.  'msqid' is an int and 'msgtyp' is a long.  'msgflg' is an int
also, actually, but INC_NOWAIT is predefined in one of the relevant header
files.

I got this info from IBM's AIX manuals, but the functionality was identical
(or nearly so, enough so that I don't recall having any problems with it)
on our Pyramid 9815 running System V.

-- 
			     Michael Rawdon
		Tulane University, New Orleans, Louisiana
------------------------------------------------------------------------------
Internet: rawdon at rex.cs.tulane.edu | Knowledge may be power, but 
Usenet: rex!rawdon.uucp            | withholding knowledge can be a 
Bitnet: CS6FECU at TCSVM              | dangerous thing.
-----------------------------------------------------------------------------
Disclaimer: Opinions mine, typos and grammar errors someone else's.



More information about the Comp.unix.questions mailing list