2021-02-28 02:18:39 +01:00
|
|
|
/* See the end of this file for copyright, license, and warranty information. */
|
2021-01-05 14:40:18 +01:00
|
|
|
|
|
|
|
#include <ardix/syscall.h>
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2021-02-28 18:08:08 +01:00
|
|
|
ssize_t read(int fildes, void *buf, size_t nbyte)
|
2021-01-05 15:30:36 +01:00
|
|
|
{
|
2021-08-05 16:15:35 +02:00
|
|
|
return syscall(SYS_read, (sysarg_t)fildes, (sysarg_t)buf, (sysarg_t)nbyte);
|
2021-01-05 15:30:36 +01:00
|
|
|
}
|
|
|
|
|
2021-02-28 18:08:08 +01:00
|
|
|
ssize_t write(int fildes, const void *buf, size_t nbyte)
|
2021-01-05 14:40:18 +01:00
|
|
|
{
|
2021-08-05 16:15:35 +02:00
|
|
|
return syscall(SYS_write, (sysarg_t)fildes, (sysarg_t)buf, (sysarg_t)nbyte);
|
2021-01-05 14:40:18 +01:00
|
|
|
}
|
|
|
|
|
2021-08-09 19:20:40 +02:00
|
|
|
ssize_t sleep(unsigned long int millis)
|
|
|
|
{
|
|
|
|
return syscall(SYS_sleep, (sysarg_t)millis);
|
|
|
|
}
|
|
|
|
|
2021-08-12 19:05:38 +02:00
|
|
|
pid_t exec(int (*entry)(void))
|
|
|
|
{
|
|
|
|
return (pid_t)syscall(SYS_exec, (sysarg_t)entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
void exit(int status)
|
|
|
|
{
|
|
|
|
syscall(SYS_exit, status);
|
|
|
|
|
|
|
|
/* make gcc happy */
|
|
|
|
while (1);
|
|
|
|
}
|
|
|
|
|
2021-01-05 14:40:18 +01:00
|
|
|
/*
|
2021-02-28 02:18:39 +01:00
|
|
|
* This file is part of Ardix.
|
|
|
|
* Copyright (c) 2020, 2021 Felix Kopp <owo@fef.moe>.
|
2021-01-05 14:40:18 +01:00
|
|
|
*
|
2021-05-10 16:19:38 +02:00
|
|
|
* Ardix is non-violent software: you may only use, redistribute,
|
|
|
|
* and/or modify it under the terms of the CNPLv6+ as found in
|
|
|
|
* the LICENSE file in the source code root directory or at
|
|
|
|
* <https://git.pixie.town/thufie/CNPL>.
|
2021-01-05 14:40:18 +01:00
|
|
|
*
|
2021-05-10 16:19:38 +02:00
|
|
|
* Ardix comes with ABSOLUTELY NO WARRANTY, to the extent
|
|
|
|
* permitted by applicable law. See the CNPLv6+ for details.
|
2021-01-05 14:40:18 +01:00
|
|
|
*/
|