Subject: Re: Possible problem with sleep(3).
To: Greg Cronau <>
From: J.T. Conklin <>
List: current-users
Date: 05/25/1994 23:00:55
> This code will just keep calling sigpause() everytime it is interupted until
> the real SIGALRM arrives. I need the ability to interupt the sleep() call.
> I see 3 solutions here:

> 1.) This is the correct symantics for BSD and I'm just going to have to
>     write my own sleep() function.

I don't know.

POSIX.1 says: The sleep() function shall cause the current process to be
suspended from execution until either the number of real-time seconds
specifed by the argument "seconds" has elapsed, or a signal is delivered 
to the calling process and its action is to invoke a signal-catching 
function or to terminate the process.

And: If the sleep() function returns due to the deliver of a signal, the
value returned shall be the unslept amount (the requested time minus the
time actually slept) in seconds. 

Since  we want NetBSD to move towards POSIX compliance, I'd say that our 
sleep() is broken.

> 2.) This is a bug and I should fix sleep() and post fixes.

I'm on it already.