Bug 273712 - off64_t namespace pollution in <sys/types.h> or incomplete LFS64 API support
Summary: off64_t namespace pollution in <sys/types.h> or incomplete LFS64 API support
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-10 20:53 UTC by Jan Beich
Modified: 2023-09-15 15:25 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2023-09-10 20:53:00 UTC
off64_t is part of Large File Support API that FreeBSD never supported as off_t is always 64-bit. base 6710d21d9f7fc added off64_t for glibc compatibility but not the rest of LFS like stat64, fseek64, etc. Unfortunately, this namespace pollution is incompatible with glibc and musl where off64_t is limited to _LARGEFILE64_SOURCE.

See also
https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/sys/types.h;hb=refs/tags/glibc-2.38#l87
https://git.musl-libc.org/cgit/musl/commit/?id=2dd8d5e1b8ba
Comment 1 Jan Beich freebsd_committer freebsd_triage 2023-09-10 21:04:46 UTC
Solaris also hides off64_t behind _LARGEFILE64_SOURCE per https://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/sys/types.h?r=ed093b41#151-155
Comment 2 Mina Galić freebsd_triage 2023-09-11 09:52:22 UTC
let's do that too, then.
I think it breaks expectations to not provide these behind _LARGEFILE64_SOURCE
Comment 3 Warner Losh freebsd_committer freebsd_triage 2023-09-15 15:25:42 UTC
FreeBSD's headers have a dichotomy between the _foo_SOURCE macro defined and what's visible by checking _foo_VISIBLE. We should maintain that here.

However, FreeBSD doesn't implement the full range of these functions. It was dubious at best that they were ever defined in the first place. And we'd need to make a number of other changes before this would be safe.

So it's not quite so simple to provide the interface.