tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* lockf and nfs files
@ 2003-11-06 14:00 Jean-Pol Guillement
  0 siblings, 0 replies; only message in thread
From: Jean-Pol Guillement @ 2003-11-06 14:00 UTC (permalink / raw)


Dear managers,

Can somebody explain me the behavior of the lockf function
on a Tru64, 4.0F, Alpha-server 1000A with NFS mounted files ?

The following is a part of a program named testlock:

...
if ((fd=open(atester,O_WRONLY)) < 0) {
	printf("impossible ouvrir %s.\n",atester);
	exit(1);
	}
t=lockf(fd,F_TEST,0);
if (t) {
	printf("%s est locke',\nt=%d,errno = %d\n",
		atester,t,errno);
	printf("EBADF=%d,EACCES=%d,EAGAIN=%d,EDEADLK=%d\n\
EINTR=%d,EINVAL=%d,EOPNOTSUPP=%d\n",
		EBADF,EACCES,EAGAIN,EDEADLK,EINTR,EINVAL,
		EOPNOTSUPP);
	} else {
	printf("%s pas locke'.\n",atester);
	}
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	test 1:
	touch /tmp/e; chmod 600 /tmp/e; testlock -> not locked
	(and the same on any not nfs mounted file).

	test 2:
	/usr/users/namath is an nfs mounted directory from a linux box 
	by the following fstab (lebesgue) entry
	/usr/users/namath@condorcet /usr/users/namath nfs
		rw,bg,rsize=8192,wsize=8192,hard,intr,nfsvers=3 0 0
	and the exports line on the linux system (condorcet)
	/usr/users/namath	lebesgue(rw,no_root_squash)

	cd /usr/users/namath/myhome
	touch e; chmod 600 e; testlock -> locked (errno=EACCES)
	chmod 640 e; testlock -> locked (errno=EACCES)
	chmod 644 e; testlock -> not locked

	test 3:
	On an other linux box, on the same nfs mounted directory,
	testlock gives always  not locked.


Thanks in advance,

Jean-Pol Guillement



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-06 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-06 14:00 lockf and nfs files Jean-Pol Guillement

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox