File: devfuse.h

package info (click to toggle)
vuos 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: ansic: 22,155; python: 284; makefile: 28; sh: 4
file content (41 lines) | stat: -rw-r--r-- 1,420 bytes parent folder | download | duplicates (2)
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
#ifndef _DEVFUSE_H
#define _DEVFUSE_H

#include <stdio.h>
#include <stdint.h>
#include <errno.h>

#define FUSE_INT_REQ_BIT (1ULL << 0)
#define FUSE_REQ_ID_STEP (1ULL << 1)

#define FUSE_NOREPLY (-1)

int vu_devfuse_lstat(char *pathname, struct vu_stat *buf, int flags, int sfd, void *fdprivate);
int vu_devfuse_open(const char *pathname, int flags, mode_t mode, void **fdprivate);
int vu_devfuse_close(int fd, void *fdprivate);
int vu_devfuse_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event, void *fdprivate);
ssize_t vu_devfuse_read(int fd, void *buf, size_t count, void *fdprivate);
ssize_t vu_devfuse_write(int fd, const void *buf, size_t count, void *fdprivate);
#define vu_devfuse_nosys(...) (errno = ENOSYS, -1)


int32_t vu_devfuse_conversation(struct fusemount_t *fusemount,
		uint32_t opcode, uint64_t nodeid,
		struct iovec *reqiov, int reqcnt,
		struct iovec *replyiov, int replycnt,
		size_t *return_len);

void fusemount_free(struct fusemount_t *fusemount);

#define IOV0	NULL, 0
#define IOV_NOREPLY	NULL, FUSE_NOREPLY
#define IOV1(BASE, LEN)	(struct iovec []) {{(void *) (BASE), (LEN)}}, 1
#define IOV2(BASE0, LEN0, BASE1, LEN1)	\
	(struct iovec []) {{(void *) (BASE0), (LEN0)}, {(void *) (BASE1), (LEN1)}}, 2
#define IOV3(BASE0, LEN0, BASE1, LEN1, BASE2, LEN2)	\
	(struct iovec []) { \
		{(void *) (BASE0), (LEN0)}, \
		{(void *) (BASE1), (LEN1)}, \
		{(void *) (BASE2), (LEN2)}}, 3

#endif