2020-06-06 17:25:58 +02:00
|
|
|
module os
|
|
|
|
|
|
|
|
#include <sys/stat.h> // #include <signal.h>
|
|
|
|
#include <errno.h>
|
2020-11-07 20:19:46 +01:00
|
|
|
struct C.dirent {
|
|
|
|
d_name [256]char
|
|
|
|
}
|
|
|
|
|
|
|
|
fn C.readdir(voidptr) &C.dirent
|
2020-06-06 17:25:58 +02:00
|
|
|
|
|
|
|
fn C.getpid() int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.readlink() int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.getline(voidptr, voidptr, voidptr) int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.ftell(fp voidptr) int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.sigaction(int, voidptr, int)
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.open(charptr, int, int) int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.fdopen(int, string) voidptr
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.CopyFile(&u32, &u32, int) int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.fork() int
|
2020-11-07 20:19:46 +01:00
|
|
|
|
2020-06-06 17:25:58 +02:00
|
|
|
fn C.wait() int
|
|
|
|
|
2020-11-07 20:19:46 +01:00
|
|
|
// fn C.proc_pidpath(int, byteptr, int) int
|
2020-06-06 17:25:58 +02:00
|
|
|
struct C.stat {
|
|
|
|
st_size int
|
|
|
|
st_mode u32
|
|
|
|
st_mtime int
|
|
|
|
}
|
|
|
|
|
2020-11-07 20:19:46 +01:00
|
|
|
struct C.DIR {
|
|
|
|
}
|
2020-06-06 17:25:58 +02:00
|
|
|
|
|
|
|
struct C.sigaction {
|
|
|
|
mut:
|
|
|
|
sa_mask int
|
|
|
|
sa_sigaction int
|
|
|
|
sa_flags int
|
|
|
|
}
|
|
|
|
|
|
|
|
struct C.dirent {
|
|
|
|
d_name byteptr
|
|
|
|
}
|