Annotation of xinu/sys/insertd.c, revision 1.1.1.2

1.1       root        1: /* insertd.c - insertd */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <q.h>
                      6: 
                      7: /*------------------------------------------------------------------------
                      8:  *  insertd  --  insert process pid in delta list "head", given its key
                      9:  *------------------------------------------------------------------------
                     10:  */
                     11: insertd(pid, head, key)
                     12:        int     pid;
                     13:        int     head;
                     14:        int     key;
                     15: {
                     16:        int     next;                   /* runs through list            */
                     17:        int     prev;                   /* follows next through list    */
                     18: 
1.1.1.2 ! root       19: #ifdef DEBUG
        !            20:        dotrace("insertd", &pid, 3);
        !            21: #endif
1.1       root       22:        for(prev=head,next=q[head].qnext ;
                     23:            q[next].qkey < key ; prev=next,next=q[next].qnext)
                     24:                key -= q[next].qkey;
                     25:        q[pid].qnext = next;
                     26:        q[pid].qprev = prev;
                     27:        q[pid].qkey  = key;
                     28:        q[prev].qnext = pid;
                     29:        q[next].qprev = pid;
                     30:        if (next < NPROC)
                     31:                q[next].qkey -= key;
                     32:        return(OK);
                     33: }

unix.superglobalmegacorp.com

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