problem with gethostname() under 4.1

Jeffrey Mogul mogul at wrl.dec.com
Sat Jan 26 13:18:22 AEST 1991


In article <40589 at ucbvax.BERKELEY.EDU> robm at janus.Berkeley.EDU (Rob McNicholas) writes:
>I am trying to get nfswatch running on my DECstation 3100 (24 meg,
>ultrix 4.1, Rev. 52).  However, the program always immediately exits
>with a "No such file or directory" error.  Using gdb, I have
>traced the error down to a "gethostname" call.  When run from the
>debugger, I get this output:
>
>(gdb)
>154             if (gethostname(myhost, sizeof(myhost)) < 0) {
>(gdb)
>gethostname () (../gethostname.s line 18)
>../gethostname.s: No such file or directory.

I don't use gdb, but almost certainly the "No such file or directory"
message you are getting from gdb has nothing to do with the "No such file
or directory" message you are getting from nfswatch.  Gdb is merely
telling you that it cannot find the source file for the gethostname()
function.  The gethostname() system call cannot return this error code.

My guess is that your error comes when the program tries to open the
packet filter pseudo-device.  Before you can use nfswatch (or similar
programs such as tcpdump), you must
	(1) configure your kernel to include the packet filter
		("man 4 packetfilter" for details.)
	(2) create the proper entries in /dev/pf (again, "man 4
		packetfilter")
	(3) do "/usr/etc/pfconfig +p -a" ("man 8 pfconfig")
(Failing to do step #3 will not cause your error message, it will
simply cause the program to be very boring.)

-Jeff



More information about the Comp.unix.ultrix mailing list