summaryrefslogtreecommitdiff
path: root/src/shared/vfs.h
blob: 9419b11f6419dc49aa1c1c112acb8c34714a4671 (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
#pragma once

#ifndef TYPES_INCLUDED
#  error "please include <kernel/types.h> or <init/types.h> before this file"
#endif

enum vfs_op_types {
	VFSOP_OPEN,
	VFSOP_WRITE,
};

/* currently, this struct is fully created in kernelspace
 * i might add a syscall which allows a process to just pass it raw, with some
 * validation - so keep that in mind */
struct vfs_op {
	enum vfs_op_types type;
	union {
		struct {
			char *path;
			int path_len;
		} open;
		struct {
			user_ptr buf;
			int buf_len;
			int id; // filled in by the kernel
		} rw;
	};
};