From: Razvan Deaconescu Date: Tue, 29 Nov 2022 22:26:52 +0000 (+0200) Subject: Use function declaration for getdents64 X-Git-Tag: RELEASE-0.11.0^0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=81315b9556f262fee452be68abb18d4cf4a1052d;p=unikraft%2Flibs%2Fmusl.git Use function declaration for getdents64 When defining `getdents64` as a macro aliasing `getdents`, the syscall shim layer complains. This patch uses a typical C-style declaration of `getdents64()`. This, combined with the `LFS64(getdents)`, aliasing used in `src/dirent/__getdents.c` solves the issue with the syscall shim layer. Signed-off-by: Razvan Deaconescu Reviewed-by: Stefan Jumarea Approved-by: Simon Kuenzer Tested-by: Unikraft CI GitHub-Closes: #31 --- diff --git a/patches/0022-include-Use-function-declaration-for-getdents64.patch b/patches/0022-include-Use-function-declaration-for-getdents64.patch new file mode 100644 index 0000000..65b00fb --- /dev/null +++ b/patches/0022-include-Use-function-declaration-for-getdents64.patch @@ -0,0 +1,33 @@ +From 40feadbd7fb360033089787a60b7d58deaae4892 Mon Sep 17 00:00:00 2001 +Message-Id: <40feadbd7fb360033089787a60b7d58deaae4892.1669764551.git.razvand@unikraft.io> +From: Razvan Deaconescu +Date: Wed, 30 Nov 2022 01:27:36 +0200 +Subject: [PATCH] include: Use function declaration for getdents64() + +When defining `getdents64` as a macro aliasing `getdents`, the syscall +shim layer complains. + +The declaration of `getdents64()`, combined with the `LFS64(getdents)` +aliasing used in `src/dirent/__getdents.c` solves this. + +Signed-off-by: Razvan Deaconescu +--- + include/dirent.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/dirent.h b/include/dirent.h +index e0a8fe6..12bb28c 100644 +--- a/include/dirent.h ++++ b/include/dirent.h +@@ -75,7 +75,7 @@ int versionsort(const struct dirent **, const struct dirent **); + #define versionsort64 versionsort + #define off64_t off_t + #define ino64_t ino_t +-#define getdents64 getdents ++int getdents64(int, struct dirent64 *, size_t); + #endif + + #ifdef __cplusplus +-- +2.17.1 +