linux(musl): deprecate LFS64 bindings#5170
Conversation
911a9e2 to
348a55e
Compare
This comment has been minimized.
This comment has been minimized.
|
I haven't yet taken a close look here but I think deprecation of |
|
I've double-checked the changes in this patch with upstream. There really isn't a difference between unsuffixed types and suffixed types. musl will just provide 64-bit definitions no matter what. I don't quite understand how does this change not solve the issue altogether. All users, no matter their machine word size or memory model, are already using 64-bit file offset types. The point being, there's no special treatment as there is with |
348a55e to
59f8ad5
Compare
This comment has been minimized.
This comment has been minimized.
|
The history of these are a bit convoluted but these should probably be removed in 1.0, for glibc as well. This is not based on any formal standard, and to my understanding was only added by musl for compatibility as a workaround for nonportable C code that did not use a feature test for these. In my opinion, LFS types should not be used at all, irrespective of libc. Musl intends to remove all aliases to them, even if
As @dybucc mentioned, the *64 suffixed types are functionally equivalent to the non-suffixed ones on musl. No matter what you use, you always get large file support, which carried over to this crate - off_t is 64 bit even on 32 bit architectures on musl. More/misc info below for those interested: Rich himself has this summary, where he describes the history as well. Rich opened an issue on this repo: #2934 Musl commits relating to this: kraj/musl@f0b85fd, kraj/musl@2dd8d5e, kraj/musl@3b94dab, kraj/musl@25e6fee Google removed LFS64 from Bionic as well (where funnily enough they also talk about this crate): https://www.openwall.com/lists/musl/2022/09/30/8 Oracle removed LFS64 usages in Java: https://bugs.openjdk.org/browse/JDK-8318696 |
59f8ad5 to
97afd91
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
These types are defined upstream in terms of their unsuffixed types, and a large part of the surface API in the exposed bindings does the same. The `libc` crate is moving towards providing unsuffixed types and routines that avoid the need for aliases. This intent was expressed on Windows platforms in rust-lang#5032. This patch altogether deprecates all items under Linux musl that are conditionally exposed upstream under the `_LARGEFILE64_SOURCE` feature test macro.
97afd91 to
13044f8
Compare
Description
This PR removes support for the exposed LFS64 bindings under Linux musl. This follows from the
libccrate's attempts at providing a single, unsuffixed type with which to provide 64-bit functionality.This follows from #5032, where I understood
libcwas meant to provide a single, unsuffixed type and not necessarily support aliases (much less conditional aliases.) Upstream musl also defines the LFS64 types routines in terms of the unsuffixed types and routines.This patch ensures we deprecate these types and the whole
musl/lfs64module in favor of using only the unsuffixed types and routines.Sources
No specific sources are provided. Running the following command with
rgin the main worktree of latest musl should yield search results that show the uniform aliasing mentioned above across all header files.Checklist
libc-test/semverhave been updated*LASTor*MAXare included (see #3131)cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI