whiterose

linux unikernel
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/whiterose

commit a1b9d55a388e9f42f85502f546f1c6c3540bf49e
parent b4d6cab6f65c5d03420d428b549be0a6c9c55d58
Author: Louis Solofrizzo <lsolofrizzo@online.net>
Date:   Thu, 25 Apr 2019 09:45:58 +0200

ukl: Add ioctl

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>

Diffstat:
Ainclude/ukl/sys/ioctl.h | 8++++++++
Mukl/sys/Makefile | 2+-
Aukl/sys/ioctl.c | 14++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/include/ukl/sys/ioctl.h b/include/ukl/sys/ioctl.h @@ -0,0 +1,8 @@ +#ifndef IOCTL_H +#define IOCTL_H + +#include <stdarg.h> + +int ioctl(int, int, ...); + +#endif /* IOCTL_H */ diff --git a/ukl/sys/Makefile b/ukl/sys/Makefile @@ -1 +1 @@ -obj-y := uio.o +obj-y := uio.o ioctl.o diff --git a/ukl/sys/ioctl.c b/ukl/sys/ioctl.c @@ -0,0 +1,14 @@ +#include <sys/ioctl.h> +#include <linux/syscalls.h> + +int ioctl(int fd, int req, ...) +{ + void *arg; + va_list ap; + + va_start(ap, req); + arg = va_arg(ap, void *); + va_end(ap); + + return ksys_ioctl(fd, req, (unsigned long)arg); +}