From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jean-Pol.Guillement@math.univ-nantes.fr (Jean-Pol Guillement) Newsgroups: gmane.os.tru64.managers Subject: lockf and nfs files Date: Thu, 06 Nov 2003 15:00:18 +0100 (MET) Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <200311061400.PAA31269@lebesgue.math.univ-nantes.fr> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1068127251 23280 80.91.224.253 (6 Nov 2003 14:00:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2003 14:00:51 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Thu Nov 06 15:00:49 2003 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1AHkgq-00032t-00 for ; Thu, 06 Nov 2003 15:00:49 +0100 Original-Received: (qmail 5876 invoked by uid 5); 6 Nov 2003 14:00:38 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 5857 invoked by uid 49493); 6 Nov 2003 14:00:38 -0000 Original-Received: from Jean-Pol.Guillement@math.univ-nantes.fr by sws1 by uid 49491 with qmail-scanner-1.16 (iscan: v3.1/v5.600-1011/622/49252. clamscan: 20030605. spamassassin: 2.55. Clear:SA:0(-0.9/5.0):. Processed in 1.920926 secs); 06 Nov 2003 14:00:38 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (160.91.86.17) by 0 with SMTP; 6 Nov 2003 14:00:35 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HNX004TGO8V8Q@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 06 Nov 2003 09:00:34 -0500 (EST) Original-Received: from lebesgue.math.univ-nantes.fr (lebesgue.math.sciences.univ-nantes.fr [193.52.98.8]) by emroute2.cind.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HNX00B7XO8TXB@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 06 Nov 2003 09:00:31 -0500 (EST) Original-Received: from (guilleme@localhost) by lebesgue.math.univ-nantes.fr (8.9.3/jtpda-5.3.3) id PAA31269 for tru64-unix-managers@ornl.gov; Thu, 06 Nov 2003 15:00:18 +0100 (MET) Original-To: tru64-unix-managers@ornl.gov Xref: main.gmane.org gmane.os.tru64.managers:5746 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:5746 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