Messages in this thread | | | Subject | Re: [linux-pm] [PATCH] Block on access to temporarily unavailable pci device | From | Alan Cox <> | Date | Wed, 18 Oct 2006 17:05:02 +0100 |
| |
Ar Mer, 2006-10-18 am 11:52 -0400, ysgrifennodd Alan Stern: > Don't you want the user process to wait in TASK_INTERRUPTIBLE? It would > require only a very simple change.
That just makes the problem even worse, to go with the kernel driver "what the hell do do if.." we get a user space one thats based around incompatibility with the existing behaviour.
There are much saner ways to sort that out without breaking the API
If its going to be a bounded short wait -> pause If its might be a long wait -> cached If its gone for good then error
If the user specified O_NDELAY then -EWOULDBLOCK not wait
That way you don't break anything and you get sensible Unix semantics. The wait queue Matthew added also means select() can be fitted up to do the right thing for the O_NDELAY case.
Alan - 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/
| |