From 372c633aa22d826bc515213ad4211791440f60f8 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 3 Oct 2024 16:08:46 +0200 Subject: libc: Add sendfile and queue --- userland/libc/fcntl/fcntl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 userland/libc/fcntl/fcntl.c (limited to 'userland/libc/fcntl/fcntl.c') diff --git a/userland/libc/fcntl/fcntl.c b/userland/libc/fcntl/fcntl.c new file mode 100644 index 0000000..0a4be9e --- /dev/null +++ b/userland/libc/fcntl/fcntl.c @@ -0,0 +1,15 @@ +#include +#include +#include + +int fcntl(int fd, int cmd, ...) { + int arg = 0; + + if ((F_GETFL == cmd) || (F_SETFL == cmd)) { + va_list ap; + va_start(ap, cmd); + arg = va_arg(ap, int); + va_end(ap); + } + RC_ERRNO(syscall(SYS_FCNTL, fd, cmd, arg, 0, 0)); +} -- cgit v1.2.3