Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
_POSIX_C_SOURCE not defined on a musl system #113
When I try to build sway-1.0-rc3 on the musl version of Void Linux, meson stops saying that
More details are available in this issue: void-linux/void-packages#8962
If that was the case, how was it possible then to build elogind?
I can't find a definition of
So I have either missed something elogind-specific that enables it to be built on musl-systems, or there is something wrong with either the sway build system or your setup.
The change suggested by your PR is seemingly harmless. It would not, in any case, break stuff for others. But this is a delivered header ending up in
The masks are needed, or your changes would be possibly reverted by any upstream commit I migrate. Therefore the patch should look like this:
Masks like this are protected by my migration tools.
However, I hope you can see why such masks should be rare in API headers, right?
Down the line I'd like to make sure that this is actually a problem caused by elogind, and not an issue caused elsewhere. We can't fix other people bugs, right?
I think this is a problem with sway:
The file in question,
There had been a few issues about that define. See:
Sorry, but this is not our problem here. The sway crew could move such stuff into config.h. Which macros to define where can be configured with meson.
Short term fix would be to add a #define for _POSIX_C_SOURCE to
For further reference:
referenced this issue
Feb 21, 2019
I believe this is a elogind issue. We don't use POSIX functions in this file, so I don't see why we should define it.
#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L
#ifdef _POSIX_C_SOURCE #if _POSIX_C_SOURCE >= 199309L
elogind should do the same.
@emersion : Not quite.
We do not change systemd source code as long as we do not have to.
Nope. If it were, you'd see elogind specific preprocessor masks like above around it. This is a systemd line.
This is the offending line in systemd master:
So the very latest version of that file does it like that since May 2017.
However, this line means, that neither
Very well. As the sway crew declines, and the systemd crew will definitely answer that they do not support non-gnu-non-posix systems, it's up to us again.
@Derriick : Please adapt your commit like I noted above and I'll merge it.
Oh, man... You are right of course!
That's great! And Lennart Poettering has already checked in on the PR. That's fast!