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

1.1     ! root        1: /* rfopen.c - rfopen */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <network.h>
        !             6: 
        !             7: /*------------------------------------------------------------------------
        !             8:  *  rfopen  --  open a remote file
        !             9:  *------------------------------------------------------------------------
        !            10:  */
        !            11: rfopen(devptr, name, mode)
        !            12: struct devsw   *devptr;
        !            13: char   *name;
        !            14: char   *mode;
        !            15: {
        !            16:        struct  rfblk   *rfptr;
        !            17:        int     i;
        !            18:        int     mbits;
        !            19:        int     devnum;
        !            20:        PStype  ps;
        !            21: 
        !            22:        disable(ps);
        !            23:        if (strlen(name) > RNAMLEN || (mbits=ckmode(mode)) == SYSERR
        !            24:            || (i=rfalloc()) == SYSERR) {
        !            25:                restore(ps);
        !            26:                return(SYSERR);
        !            27:        }
        !            28:        rfptr = &Rf.rftab[i];
        !            29:        devnum = rfptr->rf_dnum;
        !            30:        strcpy(rfptr->rf_name, name);
        !            31:        rfptr->rf_mode = mbits;
        !            32:        rfptr->rf_pos = 0L;
        !            33: 
        !            34:        /* send remote file open request */
        !            35: 
        !            36:        if ( rfio(&devtab[devnum], FS_OPEN, NULLSTR, mbits) == SYSERR ) {
        !            37:                rfptr->rf_state = RFREE;
        !            38:                restore(ps);
        !            39:                return(SYSERR);
        !            40:        }
        !            41:        restore(ps);
        !            42:        return(devnum);
        !            43: }

unix.superglobalmegacorp.com

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