Re: Events

Jamie Lokier (lk@tantalophile.demon.co.uk)
Sat, 1 Jul 2000 01:17:02 +0200


Christoph Rohland wrote:
> > What I did was make the "struct timeval" which was passed to select a
> > global, and had the signal handler set it to 0,0. If the signal came
> > in before the select, the select would exit immediately due to a
> > timeout.
>
> What a hack ;-)

Agreed :-)

You can also do it with siglongjmp -- but the timeval method is nice
because it avoids sigsetjmp overhead.

I wonder if there are systems where it fails though due to the timeval
being copied into registers in libc, and the actual value being passed
to the kernel?

(Fwiw, I uses the siglongjmp method with Cygwin32 version 18 and it
tended to core dump... I haven't tried with a more recent Cygwin.
It's fine with Linux though).

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/