view src/impl/pipe.h @ 178:0ef5c1d852fe

mofidy show caller line number at generate_context
author anatofuz
date Fri, 17 Jan 2020 15:25:05 +0900
parents 21e83548d738
children 7fc3c3da2159
line wrap: on
line source

typedef struct pipe<Impl, Isa> impl file {
    #define PIPESIZE 512
    struct spinlock lock;
    char data[PIPESIZE];
    uint nread;     // number of bytes read
    uint nwrite;    // number of bytes written
    int readopen;   // read fd is still open
    int writeopen;  // write fd is still open

    // interface field
    int n;
    char* addr;

    // private code gear
    __code piperead1(Impl* pipe, char* addr, int n, __code next(...));
    __code piperead2(Impl* pipe, char* addr, int n, __code next(...));
} pipe;