# HG changeset patch # User tobaru # Date 1577011295 -32400 # Node ID e47eaee4e8c137e4eba5ed6089b4aec3d7298ece # Parent c8965bb0f84cb260b3108cb22252c4d7a208c164 struct pipe is not generated in context.h diff -r c8965bb0f84c -r e47eaee4e8c1 src/file.cbc --- a/src/file.cbc Sun Dec 22 19:14:07 2019 +0900 +++ b/src/file.cbc Sun Dec 22 19:41:35 2019 +0900 @@ -113,6 +113,8 @@ goto next(r); } +extern __code cbc_piperead(struct pipe *p, char *addr, int n, __code (*next)(int ret)); + __ncode cbc_fileread (struct file *f, char *addr, int n, __code (*next)(int ret)) { if (f->readable == 0) { diff -r c8965bb0f84c -r e47eaee4e8c1 src/interface/pipe.dg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/interface/pipe.dg Sun Dec 22 19:41:35 2019 +0900 @@ -0,0 +1,10 @@ +#define PIPESIZE 512 + +typedef struct pipe { + 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 +} pipe;