PatchworkOS
Loading...
Searching...
No Matches
seek.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
seek
(
fd_t
fd,
int64_t
offset,
seek_origin_t
origin)
10
{
11
uint64_t
result =
_syscall_seek
(fd, offset, origin);
12
if
(result ==
ERR
)
13
{
14
errno
=
_syscall_errno
();
15
}
16
return
result;
17
}
errno
#define errno
Error number variable.
Definition
errno.h:27
seek
uint64_t seek(fd_t fd, int64_t offset, seek_origin_t origin)
System call for changing the file offset.
Definition
seek.c:9
seek_origin_t
uint8_t seek_origin_t
Type for the seek() origin argument.
Definition
io.h:262
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_seek
static uint64_t _syscall_seek(fd_t fd, int64_t offset, seek_origin_t origin)
Definition
syscalls.h:168
_syscall_errno
static errno_t _syscall_errno(void)
Definition
syscalls.h:118
stdarg.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
int64_t
__INT64_TYPE__ int64_t
Definition
stdint.h:16
stdio.h
stdlib.h
src
libstd
user
functions
io
seek.c
Generated by
1.9.8