diff options
Diffstat (limited to 'lib/libc/devctl')
| -rw-r--r-- | lib/libc/devctl/posix_devctl.c | 18 |
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; |
