PatchworkOS  19e446b
A non-POSIX operating system.
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/fs.h>
5
7
8size_t seek(fd_t fd, ssize_t offset, seek_origin_t origin)
9{
10 uint64_t result = _syscall_seek(fd, offset, origin);
11 if (result == ERR)
12 {
14 }
15 return result;
16}
#define errno
Error number variable.
Definition errno.h:27
size_t seek(fd_t fd, ssize_t offset, seek_origin_t origin)
System call for changing the file offset.
Definition seek.c:8
uint8_t seek_origin_t
Type for the seek() origin argument.
Definition fs.h:260
__INT64_TYPE__ ssize_t
Signed size type.
Definition ssize_t.h:11
#define ERR
Integer error value.
Definition ERR.h:17
__UINT64_TYPE__ fd_t
File descriptor type.
Definition fd_t.h:10
static uint64_t offset
Definition screen.c:19
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
static uint64_t _syscall_seek(fd_t fd, ssize_t offset, seek_origin_t origin)
Definition syscalls.h:157
static errno_t _syscall_errno(void)
Definition syscalls.h:107