Subject: Re: sig*wait() implementation, RFC
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 02/10/2003 09:08:14
On Sun, Feb 09, 2003 at 12:26:23PM +0100, Jaromir Dolecek wrote:
> You might note support for timeout parameter for sigtimedwait() is
> not implemented at this moment for the libpthread wrapper yet.
> It's quite simple to do - the nonmaster threads would use pthread
> alarms to handle the timeout, and the master thread's timeout would
> be handled by the syscall. Of course, master thread must adjust
> it's timeout any time it's _lwp_wakeup()ped, and nonmaster thread
> has to adjust the timeout when it would become a master. This is
> SMOP, but I thought it would be useful to get feedback for the
> general handling while finishing this.
>
> Opinions?
Perhaps the system call should be __sigtimedwait, which takes a non-const
timespec *, and updates the timeout parameter to indicate how much time is
left? Then the sigtimedwait syscall could simply copy the const timespec
to a non-const, and pass the non-const.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>