Annotation of xinu/sys/nqalloc.c, revision 1.1

1.1     ! root        1: /* nqalloc.c - nqalloc */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <proc.h>
        !             6: #include <network.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  nqalloc  -  allocate a network demultiplexing queue
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: nqalloc()
        !            13: {
        !            14:        int     i;
        !            15:        struct  netq    *nqptr;
        !            16:        PStype  ps;
        !            17: 
        !            18:        disable(ps);
        !            19:        for (i=0 ; i<NETQS ; i++) {
        !            20:                nqptr = &Net.netqs[i];
        !            21:                if (!nqptr->valid) {
        !            22:                        nqptr->valid = TRUE;
        !            23:                        nqptr->uport = -1;
        !            24:                        nqptr->pid = BADPID;
        !            25:                        restore(ps);
        !            26:                        return(i);
        !            27:                }
        !            28:        }
        !            29:        restore(ps);
        !            30:        return(SYSERR);
        !            31: }

unix.superglobalmegacorp.com

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