aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pfuse/a.h
blob: aaec3ef02b5bc0aec87898357e5ab89ef376ff97 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <u.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <libc.h>
#include <fcall.h>
#include <thread.h>
#include <9pclient.h>
#include "fuse_kernel.h"

/* Somehow the FUSE guys forgot to define this one! */
struct fuse_create_out {
	struct fuse_entry_out e;
	struct fuse_open_out o;
};

typedef struct FuseMsg FuseMsg;
struct FuseMsg
{
	FuseMsg *next;
	uchar *buf;
	int nbuf;
	struct fuse_in_header *hdr;	/* = buf */
	void *tx;	/* = hdr+1 */
};

extern int debug;

extern int fusefd;
extern int fuseeof;
extern int fusebufsize;
extern int fusemaxwrite;
extern FuseMsg *fusemsglist;
extern char *fusemtpt;

void		freefusemsg(FuseMsg *m);
int		fusefmt(Fmt*);
void		initfuse(char *mtpt);
void	waitfuse(void);
FuseMsg*	readfusemsg(void);
void		replyfuse(FuseMsg *m, void *arg, int narg);
void		replyfuseerrno(FuseMsg *m, int e);
void		replyfuseerrstr(FuseMsg*);
void		request9p(Fcall *tx);

void*		emalloc(uint n);
void*		erealloc(void *p, uint n);
char*		estrdup(char *p);

int		errstr2errno(void);
void unmountatexit(void);