toaruos/kernel/include/pipe.h

29 lines
486 B
C
Raw Normal View History

2012-01-25 03:56:35 +04:00
/* vim: tabstop=4 shiftwidth=4 noexpandtab
*
* Pipe
*/
#ifndef PIPE_H
#define PIPE_H
#include <types.h>
2012-01-25 03:58:19 +04:00
typedef struct _pipe_device {
2012-01-25 03:56:35 +04:00
uint8_t * buffer;
size_t write_ptr;
size_t read_ptr;
size_t size;
size_t refcount;
2015-05-21 11:28:14 +03:00
volatile int lock_read[2];
volatile int lock_write[2];
list_t * wait_queue_readers;
list_t * wait_queue_writers;
int dead;
2012-01-25 03:56:35 +04:00
} pipe_device_t;
2012-01-25 04:40:25 +04:00
fs_node_t * make_pipe(size_t size);
2013-03-23 02:11:19 +04:00
int pipe_size(fs_node_t * node);
2014-04-03 09:50:32 +04:00
int pipe_unsize(fs_node_t * node);
2012-01-25 03:56:35 +04:00
#endif