From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b49e4fb62704b995 X-Google-Attributes: gidfee84,public From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) Subject: Re: nfs file locking? Date: 1998/10/06 Message-ID: <6vdlfo$6m6@ds2.acs.ucalgary.ca>#1/1 X-Deja-AN: 398342271 References: <6unq2e$rsp$1@news.fr.internet.bosch.de> <6vdhm1$lbh$1@nntpd.lkg.dec.com> Organization: The University of Calgary Newsgroups: comp.unix.osf.osf1 Eric Werme - replace nospam with werme (nospam@zk3.dec.com) wrote: : Mario Zimmermann writes: : >we use nfs-file-locking. : >Is there a way figure out, who has a lock on a file? : >OS: Digital Unix 4.0d : No. Wrong. There are several ways of figuring out who has an NFS lock on a file. You can either walk kernel lock tables, or you can use the F_GETLK/F_RGETLK fcntl() interface. The latter case is trivial, and Vic Abell's lslk will do the first one for you. In either case, you'll get the PID of the process holding the lock, and may get the IP number of the machine the said process is running on. Given this, figuring out whatever else you may need is trivial. lslk is available at: vic.cc.purdue.edu:pub/tools/unix/lslk Cheers, /Serge.P