Annotation of xinu/sys/getname.c, revision 1.1.1.1

1.1       root        1: /* getname.c - getname */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <network.h>
                      6: 
                      7: /*------------------------------------------------------------------------
                      8:  *  getname  -  get name of this host and place it where specified
                      9:  *------------------------------------------------------------------------
                     10:  */
                     11: SYSCALL        getname(nam)
                     12: char   *nam;
                     13: {
                     14:        IPaddr  myaddr[4];
                     15:        char    *p;
                     16: 
                     17:        *nam = NULLCH;
                     18:        if (!Net.mnvalid) {
                     19:                getaddr(myaddr);
                     20:                if (ip2name(myaddr, Net.myname) == SYSERR)
                     21:                        return(SYSERR);
                     22:                Net.mnvalid = TRUE;
                     23:        }
                     24:        for (p=Net.myname ; *p != NULLCH && *p != '.' ; )
                     25:                *nam++ = *p++;
                     26:        *nam = NULLCH;
                     27:        return(OK);
                     28: }

unix.superglobalmegacorp.com

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