Paul Gilmartin wrote:


What is IBM's rationale for supporting the deprecated usleep but not
POSIX nanosleep on z/OS?
   
https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html#tag_16_350

And providing the idiosyncratic cond_timed_wait.

-- gil

We added nanosleep() to the Dignus runtime library, and as IBM's documentation suggests, it uses the BPX cond_timed_wait function (there's a note there saying you
can use BPX cond_timed_wait to implement nanosleep.)

So - it would be pretty easy to add your own nanosleep if you want, just call
cond_timed_wait as IBM says.

nanosleep() is "newer" than the original POSIX-1, so I suppose until some customer submits an RFE for it it won't appear in the IBM C library. It's also part of the REALTIME
section of POSIX, which IBM doesn't support.


  https://pubs.opengroup.org/onlinepubs/009695399/functions/nanosleep.html

z/OS doesn't really let you do the REALTIME timers (yet, I suppose), but this function
is so handy and so common we added it to our runtime.

And, in fact, our usleep() just invokes nanosleep() as is now common on many implementations.


  - Dave R. -

--
[email protected]                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to