Re: [PATCH] Add build time guard to detect off_t mismatch

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
On Tue, 2026-05-12 at 17:04 +0200, Richard Weinberger wrote:
> On Tue, May 12, 2026 at 4:26 PM Florian Bezdeka
> <[email protected]> wrote:
> > __RT() might be the problem here. You will end up in __cobalt_mmap()
> > unconditionally, right? Does migrating to mmap() with all the wrapping
> > magic help here?
> 
> When not using __RT(), the unresolved symbol is  __wrap_mmap64().

I'm still confused about the missing __wrap symbol, but to repair __RT()
for mmap() we have to do something similar as glibc does:

#ifndef __USE_FILE_OFFSET64
extern void *mmap (void *__addr, size_t __len, int __prot,
		   int __flags, int __fd, __off_t __offset) __THROW;
#else
# ifdef __REDIRECT_NTH
extern void * __REDIRECT_NTH (mmap,
			      (void *__addr, size_t __len, int __prot,
			       int __flags, int __fd, __off64_t
__offset),
			      mmap64);
# else
#  define mmap mmap64
# endif
#endif

The redirect part is most likely missing in Xenomai. Redirect mmap() to
mmap64() in case 64bit offsets are in use.

> 
> > Probably the same question as we had for the time_t related services: Do
> > we want one libcobalt build to support both worlds at the same time?
> 
> At least the application on my desk uses __RT() a lot.
> Sorting all this out would make some pople rather unhappy, I guess.
> 
> -- 
> Thanks,
> //richard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.