> 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.


_______________________________________________
OpenAFS-info mailing list
OpenAFS-info@openafs.org
https://lists.openafs.org/mailman/listinfo/openafs-info

Reply via email to