File:  [XINU] / xinu / sys / getname.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:02 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* getname.c - getname */

#include <conf.h>
#include <kernel.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  getname  -  get name of this host and place it where specified
 *------------------------------------------------------------------------
 */
SYSCALL	getname(nam)
char	*nam;
{
	IPaddr	myaddr[4];
	char	*p;

	*nam = NULLCH;
	if (!Net.mnvalid) {
		getaddr(myaddr);
		if (ip2name(myaddr, Net.myname) == SYSERR)
			return(SYSERR);
		Net.mnvalid = TRUE;
	}
	for (p=Net.myname ; *p != NULLCH && *p != '.' ; )
		*nam++ = *p++;
	*nam = NULLCH;
	return(OK);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.