OrangeC icon indicating copy to clipboard operation
OrangeC copied to clipboard

FR: implement nanosleep

Open GitMensch opened this issue 7 years ago • 1 comments

nanosleep, defined in time.h seems to actually be referenced in some sources in the repository, but isn't implemented yet.

This issue has no priority for me at all, but it may be relative easy to implement.

Note (to quote the manpage):

The nanosleep() function shall return a value of 0 on success and -1 on failure or if interrupted. This latter case is different from sleep(). This was done because the remaining time is returned via an argument structure pointer, rmtp, instead of as the return value.

GitMensch avatar May 21 '18 17:05 GitMensch

As nanosleep is mostly (?) referenced in libcxx tests I think it would be reasonable to move this to the 3.5 milestone.

Note: Because of the expected return code for the interrupt and because we should not claim higher precision than milliseconds if we don't provide it I think the "quick addition" of adding a new new RTS function, adjusting the argument as necessary and call existing rts functions for sleeping in milliseconds should not be used.

GitMensch avatar Oct 03 '21 10:10 GitMensch

Just checked again: time.h defines _nanosleep - but neither that nor the non-underscore version is part of the runtime library.

GitMensch avatar Jun 30 '23 18:06 GitMensch

I've been adding library funcitons today, this is on the list of things to yet do...

LADSoft avatar Jul 01 '23 01:07 LADSoft