diff options
author | Marvin Borner | 2020-11-20 23:05:07 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-20 23:05:07 +0100 |
commit | cbdf41189c4627fbea719e96b93e2237f38ef5de (patch) | |
tree | ba159ea2e2f726d4cc10db95babf59279ff03fc8 /libc/inc/sys.h | |
parent | 33d3ac6b5302f5e3a23cc7e318cf1f0605c398e5 (diff) |
Added stat syscall
This currently only returns the file size, other stats will
follow soon!
Diffstat (limited to 'libc/inc/sys.h')
-rw-r--r-- | libc/inc/sys.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libc/inc/sys.h b/libc/inc/sys.h index 42b1c8a..a9f7820 100644 --- a/libc/inc/sys.h +++ b/libc/inc/sys.h @@ -11,6 +11,7 @@ enum sys { SYS_LOOP, // To infinity and beyond (debug)! SYS_MALLOC, // Allocate memory SYS_FREE, // Free memory + SYS_STAT, // Get file information SYS_READ, // Read file SYS_WRITE, // Write to file SYS_EXEC, // Execute path @@ -67,6 +68,7 @@ int sysv(enum sys num, ...); */ #define loop() sys0(SYS_LOOP) +#define stat(path) (u32) sys1(SYS_STAT, (int)(path)) #define read(path) (void *)sys1(SYS_READ, (int)(path)) #define write(path, buf) sys2(SYS_WRITE, (int)(path), (buf)) #define exec(path, ...) (int)sysv(SYS_EXEC, (int)(path), ##__VA_ARGS__) |