> > > Is there a way for you to know you're on an NFS filesystem in Java?
> > 
> > One way would be to move the mess into NestedVM. I was thinking the
> > the code that calls the Java locking API could test to see if it works
> > (by attempting a second lock, etc), and if it doesn't, then return -1
> > to fcntl(). Then with SQLITE_ENABLE_LOCKING_STYLE enabled, SQLite will
> > drop to dotlockLocking without a recompile.

Is it possible to get f_fstypename info in Java?

static sqlite3LockingStyle sqlite3DetectLockingStyle(const char *filePath,
  int fd) {

#ifdef SQLITE_FIXED_LOCKING_STYLE
  return (sqlite3LockingStyle)SQLITE_FIXED_LOCKING_STYLE;
#else
  struct statfs fsInfo;

  if (statfs(filePath, &fsInfo) == -1)
    return sqlite3TestLockingStyle(filePath, fd);

  if (fsInfo.f_flags & MNT_RDONLY)
    return noLockingStyle;

  if( (!strcmp(fsInfo.f_fstypename, "hfs")) ||
    (!strcmp(fsInfo.f_fstypename, "ufs")) )
                return posixLockingStyle;

  if(!strcmp(fsInfo.f_fstypename, "afpfs"))
    return afpLockingStyle;

  if(!strcmp(fsInfo.f_fstypename, "nfs"))
    return sqlite3TestLockingStyle(filePath, fd);

  if(!strcmp(fsInfo.f_fstypename, "smbfs"))
    return flockLockingStyle;

  if(!strcmp(fsInfo.f_fstypename, "msdos"))
    return dotlockLockingStyle;

  if(!strcmp(fsInfo.f_fstypename, "webdav"))
    return unsupportedLockingStyle;

  return sqlite3TestLockingStyle(filePath, fd);
#endif /* SQLITE_FIXED_LOCKING_STYLE */
}



       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
 

--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to