Customized SELECT function

bridged with qdn.public.qnxrtp.x86
Post Reply
John C. Collins

Customized SELECT function

Post by John C. Collins » Fri Nov 22, 2002 8:55 pm

In the Help for (QNX 4.25) Watcom 10.6/C Library Reference/select()
there is a paragraph that states that one could write one's own select
function if, for example, one wanted to Receive messages during a call
to select(). This is exactly what I want to do. Has anyone done this?
Could I steal (excuse me, borrow) such code?

Thanks.
--
## John C. Collins 812-855-2891
## Division Head, Computers & Electronics 812-855-6645 FAX
## Indiana University Cyclotron Facility 2401 N. Milo
Sampson Lane
## collins@iucf.indiana.edu Bloomington,
IN 47408-1398

David Gibbs

Re: Customized SELECT function

Post by David Gibbs » Fri Nov 22, 2002 11:06 pm

John C. Collins <collins@iucf.indiana.edu> wrote:
In the Help for (QNX 4.25) Watcom 10.6/C Library Reference/select()
there is a paragraph that states that one could write one's own select
function if, for example, one wanted to Receive messages during a call
to select(). This is exactly what I want to do. Has anyone done this?
Could I steal (excuse me, borrow) such code?
Have you read further down to the select_receive section of the
docs on select()? Basically you over-ride the blocking point that
select() uses with your own...that looks something like:

pid_t _select_receive(pid_t select_proxy)
{
while (1)
{
pid = Receive( 0, buf, size );
if (pid == -1) return -1;
if (pid == select_proxy ) return select_proxy;
my_message_processing(pid, buf );
}
}

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs

Re: Customized SELECT function

Post by David Gibbs » Fri Nov 22, 2002 11:07 pm

John C. Collins <collins@iucf.indiana.edu> wrote:
In the Help for (QNX 4.25) Watcom 10.6/C Library Reference/select()
there is a paragraph that states that one could write one's own select
function if, for example, one wanted to Receive messages during a call
to select(). This is exactly what I want to do. Has anyone done this?
Could I steal (excuse me, borrow) such code?
And...btw...this is a QNX4 question...and the QNXRTP newsgroups are
directed at QNX6.

For future QNX4 questions, try qdn.public.qnx4

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Post Reply

Return to “qdn.public.qnxrtp.x86”