PatchworkOS
Loading...
Searching...
No Matches
open.c
Go to the documentation of this file.
1
#include <
stdarg.h
>
2
#include <
stdio.h
>
3
#include <
stdlib.h
>
4
#include <
sys/io.h
>
5
6
#include "
common/print.h
"
7
#include "
user/common/syscalls.h
"
8
9
fd_t
open
(
const
char
* path)
10
{
11
fd_t
fd =
_syscall_open
(path);
12
if
(fd ==
ERR
)
13
{
14
errno
=
_syscall_errno
();
15
}
16
return
fd;
17
}
errno
#define errno
Error number variable.
Definition
errno.h:27
open
fd_t open(const char *path)
System call for opening files.
Definition
open.c:9
ERR
#define ERR
Integer error value.
Definition
ERR.h:17
fd_t
__UINT64_TYPE__ fd_t
A file descriptor.
Definition
fd_t.h:12
io.h
print.h
syscalls.h
_syscall_open
static fd_t _syscall_open(const char *path)
Definition
syscalls.h:143
_syscall_errno
static errno_t _syscall_errno(void)
Definition
syscalls.h:118
stdarg.h
stdio.h
stdlib.h
src
libstd
user
functions
io
open.c
Generated by
1.9.8