Posted Apr 6, 2005 16:29 UTC (Wed) by amw
Parent article: Safe seeks
"this patch represents a change in how device drivers should be written, but the actual API has not been changed in any incompatible ways. Unmodified drivers will still work - at least, as well as they did before."
This is not true, at least it wasn't true of my driver and neither will it be true of any other driver including the "if (ppos != &filp->f_pos) return -ESPIPE;" code fragment quoted (which I, and presumably many others orginally got from Rubini & Corbet's "Linux Device Drivers", 2nd edition, p164). Until recently, all users of my driver had 2.6.5 kernels or earlier, then someone started using 2.6.8 and my driver broke, returning Illegal Seek on every write. Now I've toned down my test to "if (*ppos != filp->f_pos) return -ESPIPE;", but you shouldn't claim that "the actual API has not been changed in any incompatible ways. Unmodified drivers will still work" when the semantics of the well established relationship between the filp & ppos arguments has changed.
to post comments)