flock() returns EHOSTUNREACH on 5.3 with 4.5 NFS server

Thomas David Rivers rivers at dignus.com
Wed Oct 5 09:55:59 PDT 2005


I'm applying flock() to a file that is on an NFS server.
The program calling flock() is built on a 4.5 system,
with the 4.5 libraries, etc...  

The NFS server is a 4.5-RELEASE system.  The program running on a 
4.5-release system doesn't display any problems.

But - when I run that same program on a 5.3-RELEASE system,
flock() returns with a -1 and sets errno to EHOSTUNREACH.

Of course, the code is checking for EEOPNOTSUPP, but it doesn't
expect to see EHOSTUNREACH from flock().  We changed it to set
errno to zero to make sure that simply wasn't a dangling value
in errno.

Any ideas about what could be going on?  Should flock() be
setting errno to EHOSTUNREACH?  And, as the file can be read,
I don't understand where the EHOSTUNREACH comes from (the host
is very reachable.)

	- Thanks! -
	- Dave Rivers -

--
rivers at dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com


More information about the freebsd-hackers mailing list