Messages in this thread | | | Date | Fri, 2 Apr 1999 09:43:48 -0500 | From | Arvind Sankar <> | Subject | Re: What is the intended function of open() system call? |
| |
On Fri, Apr 02, 1999 at 09:07:59AM -0500, Richard B. Johnson wrote: > On Thu, 1 Apr 1999, Vassili Leonov wrote: > > > I was coding a driver and come to a realisation that open() system call is > > not a good place to prepare hardware for read or write operatioin, since > > dd for example uses RDWR mode to open of= device. And there is no warranty > > othewise. Generally, seems like this is a bug in Unix design, but maybe I > > do not understand something. Or maybe it's a long lining bug in dd... > > > In your cited example of O_RDWR, you probably want to allow the device > to be opened R/W (with attributes), but if the illegal operation within > the driver occurs, you return a failure code, probably -ENOSYS. >
I think Leonov meant that the driver won't know inside open() whether it's going to be read or written (since dd opens O_RDWR when it wants O_WRONLY), so if different initialization is required for the two, you're screwed.
-- arvind
- 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/
| |