wait on ipc message

pgd at bbt.se pgd at bbt.se
Mon Dec 10 20:52:47 AEST 1990


In article <5335 at rex.cs.tulane.edu> rawdon at rex.cs.tulane.edu (Michael Rawdon) writes:
>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'. 

Yes, but i want the process to wake up on input from a selected normal
file also. (Which in this case means the keyboard or a serial port).
One way of doing it is to have a separate process reading the
keyboard, send an ipc message to wake up the main process. But to
avoid the extra overhead, I want to do both things in the same
process.

The os Xenix/386 has the poll() system call, but I have no manual page
for poll. In the signal.h system file I find the SIGPOLL signal. Is it
possible to make a poll() interrupt with SIGPOLL? Then the problem
could be solved by issuing an interrupting poll(), and then a
msgrcv().  If a message is coming in, the msgrcv() returns ok, if a
poll is satisfied, the msgrcv() would return EINTR, and a character is
available on one of the files (which could be checked out with another
poll()).



More information about the Comp.unix.questions mailing list