Mailing List Archive

[PATCH] posix-io.c: Use off_t instead of off64_t
configure.ac checks for largefile support via AC_SYS_LARGEFILE already,
therefore use off_t and ino_t instead of 64bit variants. Musl e.g. does
not define them without _LARGEFILE64_SOURCE and error is not seen on
glibc because _GNU_SOURCE defines _LARGEFILE64_SOURCE

Fixes errors like below on 32-bit musl systems

../../../../../../../../workspace/sources/gpgme/src/posix-io.c:77:3: error: unknown type name 'ino64_t'; did you mean 'int64_t'?
ino64_t d_ino;
^~~~~~~
int64_t
^
../../../../../../../../workspace/sources/gpgme/src/posix-io.c:78:3: error: unknown type name 'off64_t'; did you mean 'off_t'?
off64_t d_off;
^~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/posix-io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/posix-io.c b/src/posix-io.c
index 0d0a98b..286a626 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -74,8 +74,8 @@
* define it ourselves. */
struct linux_dirent64
{
- ino64_t d_ino;
- off64_t d_off;
+ ino_t d_ino;
+ off_t d_off;
unsigned short d_reclen;
unsigned char d_type;
char d_name[];
--
2.39.0


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH] posix-io.c: Use off_t instead of off64_t [ In reply to ]
Hi!

On Thu, 15 Dec 2022 08:55, Khem Raj said:
> struct linux_dirent64
> {
> - ino64_t d_ino;
> - off64_t d_off;
> + ino_t d_ino;
> + off_t d_off;

The getdents(2) man page from 2020-11-01 still says to define it as we
did. Changing this just for non-conforming libc will for sure break
other applications. Please fix musl or provide a way to relible detect
the correct type for an 64 bit inode number within musl.


Salam-Shalom,

Werner

--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein