starting to work on pty drivers, fork(), and scheduler redesign
This commit is contained in:
20
kernel/lib/ringbuf.h
Normal file
20
kernel/lib/ringbuf.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef KRINGBUF_H
|
||||
#define KRINGBUF_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define PTY_BUFFER_SIZE 1024
|
||||
|
||||
typedef struct {
|
||||
char data[PTY_BUFFER_SIZE];
|
||||
size_t head;
|
||||
size_t tail;
|
||||
} ring_buf_t;
|
||||
|
||||
void ring_buf_init(ring_buf_t* rb);
|
||||
int ring_buf_is_empty(ring_buf_t* rb);
|
||||
int ring_buf_is_full(ring_buf_t* rb);
|
||||
int ring_buf_write(ring_buf_t *buf, char c);
|
||||
int ring_buf_read(ring_buf_t *buf, char *c);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user