Dumb question: why is "gethostid" a system call?

Arthur David Olson ado at elsie.UUCP
Wed Mar 13 01:33:03 AEST 1985


Thanks to everyone who replied to my question about why 4.2bsd's "gethostid"
is a system call, rather than a function that reads information from a file.

>From what I gather, the implementation of networking in 4.2bsd requires that
the kernel know what the host ID is.  Berkeley folks created a "sethostid"
system call to allow a privileged program to pass the ID to the kernel.
And with "sethostid" came "gethostid".

Another way of doing things would have been to implement a special device
(named, for example, "/dev/hostid") to which the ID could have been written and
from which the ID could have been read.  This would have avoided the addition
of exotic system calls.
--
UNIX is an AT&T Bell Laboratories trademark.
--
	UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado at seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks



More information about the Comp.unix mailing list