[comp.sources.wanted] looking for usleep

bruce@servio.UUCP (Bruce Schuchardt) (10/17/89)

I have a queue of programs I would like to port to my DECstation 3100 that
require a usleep() function for implementing delays.  I can't find a
usleep() function under ULTRIX, and am hoping some kind person will share
their implementation with me, or point me to the ULTRIX libxx that has one.

Please e-mail responses.  Thanks!


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Bruce Schuchardt          Ph: (503) 629-8383
  Servio Logic              bruce@servio.SLC.COM
  Beaverton, OR             uunet!servio!bruce

muth@buffer.dec.com (Bill Muth) (10/18/89)

    Here is a macro for usleep() which appeared in comp.sources.x in the
    program xchomp.

    #ifdef ULTRIX
    #include <sys/time.h>
    EXTERN struct timeval   st_delay;
    #define usleep(x)       { st_delay.tv_usec = (x); st_delay.tv_sec = 0; \
                              select(32, NULL, NULL, NULL, &st_delay); }
    #endif



						    Bill