[OpenAFS] Re: experience of SQLite on AFS

Buhrmaster, Gary gtb@slac.stanford.edu
Fri, 30 Apr 2010 15:20:08 -0700


> After some offline discussion, this appears to probably be the case.
> sqlite opens the db file O_RDONLY, and attempts to acquire an fcntl
> F_WRLCK on it, to which it gets EROFS back. Trying to acquire a
> writelock on a file opened readonly doesn't make a lot of sense to me;
> can someone tell me if POSIX specifies that that should fail?

Should fail with EBADF....

From: http://www.opengroup.org/onlinepubs/009695399/functions/fcntl.html

Errors:

[EBADF]
    The fildes argument is not a valid open file descriptor, or the
    argument cmd is F_SETLK or F_SETLKW, the type of lock, l_type,
    is a shared lock (F_RDLCK), and fildes is not a valid file
    descriptor open for reading, or the type of lock, l_type, is
    an exclusive lock (F_WRLCK), and fildes is not a valid file
    descriptor open for writing.