Annotation of researchv10no/libc/fio/fioflush.c, revision 1.1

1.1     ! root        1: #define        FIO_IMP
        !             2: #include       "fio.h"
        !             3: #include       <libc.h>
        !             4: 
        !             5: Fflush(fd)
        !             6: {
        !             7:        register Fbuffer *f;
        !             8: 
        !             9:        FIOSET(f, fd);
        !            10:        if(f->flags&FIO_WRITING)
        !            11:                return(F_flush(f, fd));
        !            12:        else
        !            13:                return(0);
        !            14: }
        !            15: 
        !            16: F_flush(f, fd)
        !            17:        register Fbuffer *f;
        !            18: {
        !            19:        register COUNT n;
        !            20: 
        !            21:        f->flags &= ~FIO_WRITING;
        !            22:        if(n = f->next - f->buf){
        !            23:                if(write(fd, f->buf, n) != n)
        !            24:                        return(-1);
        !            25:                f->next = f->buf;
        !            26:        }
        !            27:        return(0);
        !            28: }

unix.superglobalmegacorp.com

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