]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Use function declaration for getdents64 RELEASE-0.11.0
authorRazvan Deaconescu <razvand@unikraft.io>
Tue, 29 Nov 2022 22:26:52 +0000 (00:26 +0200)
committerUnikraft <monkey@unikraft.io>
Thu, 1 Dec 2022 10:58:13 +0000 (10:58 +0000)
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 <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #31

patches/0022-include-Use-function-declaration-for-getdents64.patch [new file with mode: 0644]

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 (file)
index 0000000..65b00fb
--- /dev/null
@@ -0,0 +1,33 @@
+From 40feadbd7fb360033089787a60b7d58deaae4892 Mon Sep 17 00:00:00 2001
+Message-Id: <40feadbd7fb360033089787a60b7d58deaae4892.1669764551.git.razvand@unikraft.io>
+From: Razvan Deaconescu <razvand@unikraft.io>
+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 <razvand@unikraft.io>
+---
+ 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
+