* VAX or DEC C and sleeping using select()
@ 1993-07-02 15:42 Gareth Richards
1993-07-06 17:49 ` Ken Cowan
0 siblings, 1 reply; 2+ messages in thread
From: Gareth Richards @ 1993-07-02 15:42 UTC (permalink / raw)
At the moment I am trying put in a delay into the event loop
of some program to slow it down.
I'm attempting to use the select() function to
select an invalid socket and using the timeout
for the delay. For example,
struct timeval delay;
delay.tv_sec = 0;
delay.tv_usec = 200000;
select(0,0,0,0,&delay);
this snippet should delay the processor for 1/5 th of
a second.
BUT, it doesn't seems to work. Why????
Some background info:
it works on a HP.
Oddly, select() should be in time.h but
is in fact in socket.h despite what the help says.
I've compiled the code on an Alpha using the /stand=vaxc
option.
Any help would be much appreciated.
Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: VAX or DEC C and sleeping using select()
1993-07-02 15:42 VAX or DEC C and sleeping using select() Gareth Richards
@ 1993-07-06 17:49 ` Ken Cowan
0 siblings, 0 replies; 2+ messages in thread
From: Ken Cowan @ 1993-07-06 17:49 UTC (permalink / raw)
In article <richards.741627733@hpopc4>, richards@hpopc4.cern.ch (Gareth Richards) writes:
|>Newsgroups: comp.sys.dec
|>
|>At the moment I am trying put in a delay into the event loop
|>of some program to slow it down.
|>
|>I'm attempting to use the select() function to
|>select an invalid socket and using the timeout
|>for the delay. For example,
|>
|>struct timeval delay;
|>
|>delay.tv_sec = 0;
|>delay.tv_usec = 200000;
|>
|>select(0,0,0,0,&delay);
|>
|>this snippet should delay the processor for 1/5 th of
|>a second.
|>
|>BUT, it doesn't seems to work. Why????
|>
|>Some background info:
|>
|>it works on a HP.
|>Oddly, select() should be in time.h but
|>is in fact in socket.h despite what the help says.
|>
|>I've compiled the code on an Alpha using the /stand=vaxc
|>option.
|>
|>Any help would be much appreciated.
|>
|>Peter
|>
|>
DEC C on VMS does not implement select() for general file descriptors. There is
a special version of select that only works with socket descriptors.
I put this on the wishlist. In the meantime, you could a VMS specific routine
(such as lib$wait ) to wait for a small amount of time. [If you're interested
lib$wait is documented under $ HELP RTL LIB LIB$WAIT. It takes an float by
reference]
--
Ken Cowan, ZK2-3/Q8 cowan@rtl.enet.dec.com
Digital Equipment Corporation decwrl!rtl!cowan
110 Spit Brook Rd,
Nashua, NH 03062
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1993-07-06 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-07-02 15:42 VAX or DEC C and sleeping using select() Gareth Richards
1993-07-06 17:49 ` Ken Cowan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox