From: Stefan Jumarea Date: Sat, 29 Apr 2023 18:53:22 +0000 (+0300) Subject: patches: Fix ioctl signature in function definition X-Git-Tag: RELEASE-0.13.0~7 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb8f2dab68eb1ad5b1604617c52077557125210c;p=unikraft%2Flibs%2Fmusl.git patches: Fix ioctl signature in function definition The `ioctl()` function signature was changed to use an unsigned long as a second argument, in order to match the definition in Linux, glibc and our own implementation. The function definition however was not changed, leading to build errors due to function signature conflict. Signed-off-by: Stefan Jumarea Reviewed-by: Radu Nichita Reviewed-by: Rares Miculescu Approved-by: Eduard Vintilă Tested-by: Unikraft CI GitHub-Closes: #44 --- diff --git a/patches/0021-Use-ulong-in-ioctl-definition.patch b/patches/0021-Use-ulong-in-ioctl-definition.patch new file mode 100644 index 0000000..f3636b0 --- /dev/null +++ b/patches/0021-Use-ulong-in-ioctl-definition.patch @@ -0,0 +1,30 @@ +From 99e8a77e67e5a032f7e299d3c7466de00618d926 Mon Sep 17 00:00:00 2001 +From: Stefan Jumarea +Date: Sat, 29 Apr 2023 21:47:59 +0300 +Subject: [PATCH] [PATCH]: Change signature for ioctl + +The `ioctl()` function signature should be modified to match the definition +in Linux, glibc and our own implementation, since using `int` has lead +to a lot of problems (e.g. overflow into sign bit). + +Signed-off-by: Stefan Jumarea +--- + src/misc/ioctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/misc/ioctl.c b/src/misc/ioctl.c +index 35804f02..ea4e9111 100644 +--- a/src/misc/ioctl.c ++++ b/src/misc/ioctl.c +@@ -125,7 +125,7 @@ static void convert_ioctl_struct(const struct ioctl_compat_map *map, char *old, + else memcpy(new+new_offset, old+old_offset, old_size-old_offset); + } + +-int ioctl(int fd, int req, ...) ++int ioctl(int fd, unsigned long req, ...) + { + void *arg; + va_list ap; +-- +2.25.1 +