aboutsummaryrefslogtreecommitdiff
path: root/include/sys.h
blob: 15fba2aaab29510c99ee1791947328926721a571 (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
#pragma once

#include <arch/constants.h>
#include <arch/errno.h>

// -----------------------------------------------------------------------
// global constants

/* open */
#define sys·ORead    0x0u
#define sys·OWrite   0x1u
#define sys·ORdwr    0x2u

/* seek */
#define sys·SeekSet  0u
#define sys·SeekCur  1u
#define sys·SeekEnd  2u

// -----------------------------------------------------------------------
// functions

/*
 * system calls with errno-free interface
 */
int sys·call(int num, ...);

/* file operations */
int sys·open(char *path, int flag, int mode, int *fd);
int sys·close(int fd);
int sys·write(int fd, intptr len, void *buf, intptr *nw);
int sys·read(int fd, intptr len, void *buf, intptr *nr);
int sys·seek(int fd, intptr offset, int from, intptr *pos);
int sys·dup(int from, int to);