PatchworkOS
Loading...
Searching...
No Matches
getdents.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
uint64_t
getdents
(
fd_t
fd,
dirent_t
*
buffer
,
uint64_t
count
)
10
{
11
uint64_t
result =
_syscall_getdents
(fd,
buffer
,
count
);
12
if
(result ==
ERR
)
13
{
14
errno
=
_syscall_errno
();
15
}
16
return
result;
17
}
errno
#define errno
Error number variable.
Definition
errno.h:27
getdents
uint64_t getdents(fd_t fd, dirent_t *buffer, uint64_t count)
System call for reading directory entires.
Definition
getdents.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
buffer
EFI_PHYSICAL_ADDRESS buffer
Definition
mem.c:15
print.h
count
static atomic_long count
Definition
main.c:9
syscalls.h
_syscall_getdents
static uint64_t _syscall_getdents(fd_t fd, dirent_t *buffer, uint64_t count)
Definition
syscalls.h:208
_syscall_errno
static errno_t _syscall_errno(void)
Definition
syscalls.h:118
stdarg.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
stdio.h
stdlib.h
dirent_t
Directory entry struct.
Definition
io.h:424
src
libstd
user
functions
io
getdents.c
Generated by
1.9.8