Annotation of researchv10dc/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       <shares.h>
        !            12: #include       <libc.h>
        !            13: 
        !            14: 
        !            15: int
        !            16: putshares(lp, extime)
        !            17:        register struct lnode * lp;
        !            18:        unsigned long           extime;
        !            19: {
        !            20:        register long           posn;
        !            21:        Share                   share;
        !            22: 
        !            23:        if ( lp->l_uid > MAXUID )
        !            24:                return 0;
        !            25: 
        !            26:        if ( !openshares(1) )
        !            27:                return SYSERROR;
        !            28: 
        !            29:        share.l = *lp;
        !            30:        share.extime = extime;
        !            31: 
        !            32:        posn = sizeof(Share) * lp->l_uid;
        !            33: 
        !            34:        if ( lseek(ShareFd, posn, 0) == SYSERROR )
        !            35:                return SYSERROR;
        !            36: 
        !            37:        return write(ShareFd, &share, sizeof(Share));
        !            38: }

unix.superglobalmegacorp.com

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