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
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2021-08-12 19:05:38 +02:00
|
|
|
#include <toolchain.h>
|
2021-01-05 14:40:18 +01:00
|
|
|
|
2021-02-28 18:08:08 +01:00
|
|
|
__shared ssize_t read(int fildes, void *buf, size_t nbyte);
|
|
|
|
__shared ssize_t write(int fildes, const void *buf, size_t nbyte);
|
2021-08-09 19:20:40 +02:00
|
|
|
__shared ssize_t sleep(unsigned long int millis);
|
2021-08-12 19:05:38 +02:00
|
|
|
/**
|
|
|
|
* @brief Create a new thread.
|
|
|
|
*
|
|
|
|
* Embedded systems typically don't have a MMU and thus no virtual memory,
|
|
|
|
* meaning it is impossible to implement a proper fork. So, the `fork()` and
|
|
|
|
* `execve()` system calls have to be combined into one.
|
|
|
|
*/
|
|
|
|
__shared pid_t exec(int (*entry)(void));
|
|
|
|
__shared __noreturn void exit(int status);
|
|
|
|
__shared pid_t waitpid(pid_t pid, int *stat_loc, int options);
|
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
|
|
|
*/
|