mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 05:38:21 +00:00
pipes: initial implementation
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user