summaryrefslogtreecommitdiff
path: root/lib/libc/devctl/posix_devctl.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-15 18:24:54 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-15 18:24:54 +0100
commit69e6fe89fa9baafeca3e3515bb50897cd8ee7c35 (patch)
tree489046ce167b8b20d205f87f4ae1f4b680c19b43 /lib/libc/devctl/posix_devctl.c
parent0d5bffe9d2caadc1215c875e560c52bca5161c54 (diff)
Add getauxval and cleanup libc startup
Diffstat (limited to 'lib/libc/devctl/posix_devctl.c')
-rw-r--r--lib/libc/devctl/posix_devctl.c18
1 files changed, 7 insertions, 11 deletions
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 <devctl.h>
+#include <sys/cdefs.h>
+#include <syscall.h>
-
-#include <devctl.h> // for posix_devctl, size_t
-#include <errno.h> // for errno
-#include <libc.h> // for __unused
-#include <stddef.h>
-#include <syscall.h> // 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;