[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apt and NFS?



On Tue, Sep 26, 2000 at 01:37:30AM -0500, Eric Gillespie, Jr. wrote:
> On Mon, Sep 25, 2000 at 12:02:34PM -0400,
> Noah L. Meyerhans <frodo@morgul.net> wrote:
> > The best way to do it is to use the kernel space NFS server, as it does
> > support file locking and will allow programs like dpkg to work as
> > intended.
> 
> I *am* using the kernel NFS server, and it doesn't work.


try this program i found it in the BTS regarding mutt and NFS:

#include <fcntl.h>
#include <errno.h>
#include <stdio.h>

int main (int argc, char *argv[])
{
  struct flock lck;
  int fd, ret;
  if (argc != 2) {
    printf ("Usage: %s file to lock\n", argv[0]);
    return 1;
  }
  fd = open (argv[1], O_RDONLY);
  memset (&lck, 0, sizeof (struct flock));
  lck.l_type = F_RDLCK;
  lck.l_whence = SEEK_SET;
  ret = fcntl (fd, F_SETLK, &lck);
  printf ("fcntl()=%i, errno=%i\n", ret, errno);
  return 0;
}

it is supposed to test whether a lock can be established or not, iirc
it returns errno=1 or such on failure (i tried it on userspace-nfs and
got different results then with kernel-nfs)

i don't know much else about it though.

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpU0rr9vnyLn.pgp
Description: PGP signature


Reply to: