> This race condition is documented as being unsolvable in the book
> "Advanced Programming in the Unix Environment" by Richard Stevens.
> Though it is getting obsolete, the book is still very good.
> (it does not cover Linux, BSD 4.4, or anything else recent)
Then I guess Stevens did not know about setjmp/longjmp, or the solution
I use is wrong:
1. you call sigsetjmp, and set a flag/store the jmpbuf address
2. you check the buffer - it is empty
3. a signal arrives - the handler sees the flag, clears it, calls siglongjmp
4. control continues from point 2
2b. you check the buffer - it is not empty
If select() returns, you clear the flag of course.
-- 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/