summaryrefslogtreecommitdiff
path: root/src/kernel/fd.h
blob: 7f7cbdde544507b5fa08d3fc68c1c4fa533c6276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include <stddef.h>

#define FD_MAX 16

typedef int fd_t; // TODO duplicated in syscalls.h

enum fd_type {
	FD_EMPTY,
};

struct fd {
	enum fd_type type;
};


enum fdop { // describes the operations which can be done on file descriptors
	FDOP_READ,
	FDOP_WRITE,
	FDOP_CLOSE,
};

int fdop_dispatch(enum fdop fdop, struct fd *fd, void *ptr, size_t len);