lkml.org 
[lkml]   [1999]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: 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/

    \
     
     \ /
      Last update: 2005-03-22 13:51    [W:5.321 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site