Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilise _FILE_OFFSET_BITS=64 #508

Closed
nekopsykose opened this issue Mar 19, 2023 · 0 comments · Fixed by #510
Closed

utilise _FILE_OFFSET_BITS=64 #508

nekopsykose opened this issue Mar 19, 2023 · 0 comments · Fixed by #510
Assignees
Labels
bug Something isn't working

Comments

@nekopsykose
Copy link

Describe the bug

building btop with a recent commit of musl will fail, with:

/home/demon/src/aports/community/btop/src/btop-1.2.13/src/linux/btop_collect.cpp:1082:23: error: variable has incomplete type 'struct statvfs64'
                                        struct statvfs64 vfs;
                                                         ^
/home/demon/src/aports/community/btop/src/btop-1.2.13/src/linux/btop_collect.cpp:1082:13: note: forward declaration of 'statvfs64'
                                        struct statvfs64 vfs;
                                               ^
/home/demon/src/aports/community/btop/src/btop-1.2.13/src/linux/btop_collect.cpp:1083:46: error: invalid operands to binary expression ('statvfs64' and 'int')
                                        if (statvfs64(mountpoint.c_str(), &vfs) < 0) {
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

this is because of bminor/musl@25e6fee , but the reason is mostly that the 64 interfaces are legacy; they are from a period where they were created for transitional reasons.

in modern programming, it suffices to pass -D_FILE_OFFSET_BITS=64, and to utilise the non-64 name, i.e. statvfs, and the types are 64-bit on linux. see e.g. the glibc docs for it: https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html . in musl, the non-64 names were always 64-bit; the 64 wrappers were added as a compatibility shim that are now not exposed (and will eventually be removed, left in ABI compat only).

To Reproduce

build against musl since bminor/musl@25e6fee without passing -D_LARGEFILE64_SOURCE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants