Annotation of researchv9/libc/gen/putshares.c, revision 1.1

1.1     ! root        1: /*LINTLIBRARY*/
        !             2: 
        !             3: /*
        !             4: **     Write a new ``shares'' file record from details in lnode.
        !             5: **
        !             6: **     Returns 0 for illegal uid,
        !             7: **             SYSERROR for bad system call,
        !             8: **             else sizeof(Share).
        !             9: */ 
        !            10: 
        !            11: #include       <sys/types.h>
        !            12: #include       <sys/lnode.h>
        !            13: #include       <shares.h>
        !            14: #include       <libc.h>
        !            15: 
        !            16: 
        !            17: int
        !            18: putshares(lp, extime)
        !            19:        register struct lnode * lp;
        !            20:        unsigned long           extime;
        !            21: {
        !            22:        register long           posn;
        !            23:        Share                   share;
        !            24: 
        !            25:        if ( lp->l_uid > MAXUID )
        !            26:                return 0;
        !            27: 
        !            28:        if ( !openshares(1) )
        !            29:                return SYSERROR;
        !            30: 
        !            31:        share.l = *lp;
        !            32:        share.extime = extime;
        !            33: 
        !            34:        posn = sizeof(Share) * lp->l_uid;
        !            35: 
        !            36:        if ( lseek(ShareFd, posn, 0) == SYSERROR )
        !            37:                return SYSERROR;
        !            38: 
        !            39:        return write(ShareFd, &share, sizeof(Share));
        !            40: }

unix.superglobalmegacorp.com

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