mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH v2] dirent: fix signature for getdents64
@ 2022-05-28 12:37 Jiaqing Zhao
  0 siblings, 0 replies; only message in thread
From: Jiaqing Zhao @ 2022-05-28 12:37 UTC (permalink / raw)
  To: musl; +Cc: Jiaqing Zhao

Currently musl's getdents64 is an alias for getdents, but the API is
different. According to man page[1], the 2nd arguments of getdents64
is void* instead of struct dirent*.
    ssize_t getdents64(int fd, void *dirp, size_t count);
This patch adds type cast to the redirect macro for API compatibility.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
---
 include/dirent.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dirent.h b/include/dirent.h
index 650ecf64..0ac1ce60 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -65,7 +65,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
+#define getdents64(fd, buf, len) getdents((fd), (struct dirent *)(buf), (len))
 #endif
 
 #ifdef __cplusplus
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-28 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28 12:37 [musl] [PATCH v2] dirent: fix signature for getdents64 Jiaqing Zhao

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).