From 69e6fe89fa9baafeca3e3515bb50897cd8ee7c35 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 15 Dec 2025 18:24:54 +0100 Subject: Add getauxval and cleanup libc startup --- lib/libc/devctl/posix_devctl.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'lib/libc/devctl') diff --git a/lib/libc/devctl/posix_devctl.c b/lib/libc/devctl/posix_devctl.c index 7403ec53..59497833 100644 --- a/lib/libc/devctl/posix_devctl.c +++ b/lib/libc/devctl/posix_devctl.c @@ -1,17 +1,13 @@ +#include +#include +#include - -#include // for posix_devctl, size_t -#include // for errno -#include // for __unused -#include -#include // for __syscall_3, syscall - -int posix_devctl(int fildes, int dcmd, void *restrict dev_data_ptr, - size_t __unused nbyte, int *restrict dev_info_ptr) +int posix_devctl(int fildes, int dcmd, void *restrict dev_data_ptr, size_t __unused nbyte, int *restrict dev_info_ptr) { - long r; + int r; - if ((r = syscall(ioctl, fildes, dcmd, dev_data_ptr)) < 0) + r = syscall(ioctl, fildes, dcmd, dev_data_ptr); + if (r < 0) return errno; *dev_info_ptr = r; -- cgit v1.2.3