[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sleep() and device drivers ...



Hello,

> Is there a safe way for a device driver function to decide whether a call to
> sleep() was interrupted by delivery of a signal, or (even better) a way to
> make sure the functions arguments are still valid after a sleep()?
> 
I just looked into the source of the FreeBSD distribution to see how they
deal with the problem. It turned out that the sleep function returns
a value indicating if the sleep was interrupted or not and if the system
call should be restarted (this can be set for each signal handler).
I think that this would provide the simplest solution for MiNT and it's
device drivers, and it would be completely backward compatible :-)

Regards,
Ulrich

--
Ulrich Kuehn                               email: kuehn@serd.cscs.ch
Section of Research and Development
Swiss Scientific Computing Centre