aboutsummaryrefslogtreecommitdiff
path: root/libc/inc/sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inc/sys.h')
-rw-r--r--libc/inc/sys.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libc/inc/sys.h b/libc/inc/sys.h
index 5858579..c20eabc 100644
--- a/libc/inc/sys.h
+++ b/libc/inc/sys.h
@@ -16,6 +16,7 @@ enum sys {
SYS_STAT, // Get file information
SYS_READ, // Read file
SYS_WRITE, // Write to file
+ SYS_IOCTL, // Interact with a file/device
SYS_POLL, // Wait for multiple files
SYS_EXEC, // Execute path
SYS_EXIT, // Exit current process // TODO: Free all memory of process
@@ -70,6 +71,7 @@ int sysv(enum sys num, ...);
(s32) sys4(SYS_READ, (int)(path), (int)(buf), (int)(offset), (int)(count))
#define write(path, buf, offset, count) \
(s32) sys4(SYS_WRITE, (int)(path), (int)(buf), (int)(offset), (int)(count))
+#define ioctl(path, ...) (s32) sysv(SYS_IOCTL, (int)(path), ##__VA_ARGS__)
#define stat(path, stat) (s32) sys2(SYS_STAT, (int)(path), (int)(stat))
#define poll(files) (s32) sys1(SYS_POLL, (int)(files))
#define exec(path, ...) (s32) sysv(SYS_EXEC, (int)(path), ##__VA_ARGS__)