-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpipe_buf.h
More file actions
33 lines (22 loc) · 754 Bytes
/
Copy pathpipe_buf.h
File metadata and controls
33 lines (22 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */
#ifndef __PIPE_BUF_H_
#define __PIPE_BUF_H_
#include <pthread.h>
#include "MKPlugin.h"
struct pipe_buf_t {
int pipe[2];
int filled; // amount of data filled in pipe
int cap; // tatal buffer size of pipe (should block afterwards)
pthread_mutex_t write_mutex; // write access to the buffer
struct mk_list _head;
};
void pipe_buf_thread_init();
void pipe_buf_process_init();
void pipe_buf_exit();
int pipe_buf_mem_used();
// map userspace memory as pipe data
int pipe_buf_vmsplice(struct pipe_buf_t *dest, void *mem, int len);
struct pipe_buf_t *pipe_buf_new();
void pipe_buf_flush(struct pipe_buf_t *);
void pipe_buf_free(struct pipe_buf_t *);
#endif