Skip to contentSkip to conversation

New issue with 64 bits wrapper

DISCUSSION François Legal 1 participant 1 message Nov 12

lore
Share & tools
lore
#0 lore raw

Still in the process of porting my app to linux 6.12/x3.3, I've got a build issue regarding mmap. Arch is arm.

if I build a function that calls mmap without __STD decoration, it gets translated to
bl 0 <mmap64>
by the compiler.
However, when I use the __STD decoration, it gets translated to
bl 0 <__real_mmap>

which itself fails because the real mmap expects the offset be a 32 bits integer, which is it not.

So I wondering whether the definitions in cobalt/sys/mman.h COBALT_DECL(void *, mmap,

	    (void *addr, size_t length, int prot, int flags, int fd,
	     off_t offset));

#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) COBALT_DECL(void *, mmap64,

	    (void *addr, size_t length, int prot, int flags, int fd,
	     off64_t offset));

#endif

should be replaced with

COBALT_DECL_TIME64(void *, mmap, mmap64,

	    (void *addr, size_t length, int prot, int flags, int fd,
	     off_t offset));

Thanks in advance

François