pipes: initial implementation

This commit is contained in:
Matheus
2022-10-10 10:46:27 -03:00
parent af69128800
commit 85bd0c0412
7 changed files with 158 additions and 6 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef _PIPE_H_INCLUDE
#define _PIPE_H_INCLUDE
#include <ringbuffer.h>
#include <kernel/event.h>
#include <stdint.h>
#include <stddef.h>
typedef struct{
int lock;
event_t revent, wevent;
ringbuffer_t buff;
uintmax_t readers, writers;
} pipe_t;
pipe_t* pipe_create(size_t buffsize);
void pipe_drestroy(pipe_t* pipe);
int pipe_read(pipe_t* pipe, void* buff, size_t count, int* error);
int pipe_write(pipe_t* pipe, void* buff, size_t count, int* error);
#endif
+1
View File
@@ -24,6 +24,7 @@ typedef struct _vnode_t {
void* fsdata;
size_t refcount;
struct _dirnode_t* parent;
void* objdata;
} vnode_t;
// folders are an expansion of vnode_t to save memory