mirror of
https://github.com/justinian/jsix.git
synced 2025-12-11 08:54:31 -08:00
Organize system calls
* syscalls should all return j6_status_t now * syscalls are grouped by category in name as well as in files
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "j6/types.h"
|
||||
#include "j6/errors.h"
|
||||
|
||||
extern "C" {
|
||||
int32_t getpid();
|
||||
int32_t fork();
|
||||
void sleep(uint64_t til);
|
||||
void debug();
|
||||
void message(const char *msg);
|
||||
j6_status_t getpid(uint64_t *);
|
||||
j6_status_t fork(uint64_t *);
|
||||
j6_status_t sleep(uint64_t til);
|
||||
j6_status_t debug();
|
||||
j6_status_t message(const char *msg);
|
||||
|
||||
int main(int, const char **);
|
||||
}
|
||||
@@ -15,10 +18,21 @@ extern "C" {
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
{
|
||||
int32_t pid = getpid();
|
||||
int32_t child = fork();
|
||||
uint64_t pid = 0;
|
||||
uint64_t child = 0;
|
||||
|
||||
j6_status_t result = fork(&child);
|
||||
if (result != j6_status_ok)
|
||||
return result;
|
||||
|
||||
message("hello from nulldrv!");
|
||||
|
||||
result = getpid(&pid);
|
||||
if (result != j6_status_ok)
|
||||
return result;
|
||||
|
||||
for (int i = 1; i < 5; ++i)
|
||||
sleep(i*10);
|
||||
return 0;
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user