pipe.h

来自「南京航空航天大学开发的一个类Unix和Linux的操作系统,好不好看看就知道了,」· C头文件 代码 · 共 42 行

H
42
字号
#ifndef _KERNPIPE_H#define _KERNPIEP_H#include <kern/fdes.h>#include <lib/fifoq.h>#include <kern/sched.h>struct pipe_t : protected fifoq_t {	waitq_t waitq;	char * page;	int nreader;	int nwriter;	pipe_t();	~pipe_t();	void rhold() { nreader++; }	void whold() { nwriter++; }	void rlose();	void wlose();	int read(void * buf, int count);	int write(void * buf, int count);};struct pipefd_t : public fdes_t {	pipe_t * pipe;	pipefd_t(int flags, pipe_t * p)	{		type = PIPEFD;		fdflags = flags;		refcnt = 1;		pipe = p;	}	~pipefd_t();	int read(void * buf, int count);	int write(void * buf, int count);	int lseek(off_t off, int whence);	int ioctl(int cmd, ulong arg); 	int readdir(dirent_t * de, int count);};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?