Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!panda!talcott!harvard!seismo!umcp-cs!cvl!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.unix Subject: Re: Dumb question: why is "gethostid" a system call? Message-ID: <5075@elsie.UUCP> Date: Tue, 12-Mar-85 10:33:03 EST Article-I.D.: elsie.5075 Posted: Tue Mar 12 10:33:03 1985 Date-Received: Fri, 15-Mar-85 02:49:41 EST References: <5071@elsie.UUCP> Organization: NIH-LEC, Bethesda, MD Lines: 17 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@seismo.ARPA DEC, VAX and Elsie are Digital Equipment and Borden trademarks