Messages in this thread |  | | Subject | Re: Desperately missing a working "pselect()" or similar... | Date | Sat, 6 Oct 2001 01:03:04 +0100 (BST) | From | Alan Cox <> |
| |
> A technique I used in a similar situation once went something like: > > tv.tv_sec=bignum; > tv.tv_usec = 0; > enable_signals(); > select(nfds, &readfds,&writefds,0,&tv); > > and have the signal handlers set tv.tv_sec to 0. (tv is a global > variable). > > Then if the signal comes before the select, the select exits > immediately.
You can do this more cleanly with sigsetjmp - it avoids any risk of suprises in the library itself - eg the select to poll mapper in some libraries - and indeed even the variable load into registers for a syscall
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |