When acpid is compiled against musl (a new C library implementation) it fails due to the absence of TEMP_FAILURE_RETRY. musl are averse to implementing glibcisms such as this.
I have a patch which fixes this, and also cleans up a few compiler warnings associated with musl and recent toolchains - can I pass it on for review ? SF's SCM widgets are down right now so I'm not sure what method works best ..
Sure, just attach it here.
Ted,
Here goes as a first cut. Happy to rework these if you feel it appropriate.
I placed the missing elements in a new header libc_compat.h and included this from each file which uses the missing elements.
I've also attached a patch which fixes some compiler warnings. I've tested the code builds under buildroot w/ musl and on Fedora 22.
Comments welcome!
Last edit: Brendan Heading 2015-07-21
These look fine. My only question would be... Is there a way to detect musl? If so, it would be good to wrap the two items in an #if or #ifdef. Something like:
This way non-musl builds won't accidentally end up using these. It will also document why these were added.
Ted,
Happy to make this enhancement but I'm wondering if we should do it the other way around. Since the macro is a glibcism, it might be best to detect glibc ? This way any non-glibc library now or in the future should also work.
(I have a feeling the macro has been added to uclibc, but I'd need to check).
Let me know your thoughts and I'll look at respinning the patch.
Brendan
Sure, go for it. We can always adjust later.
Ted,
OK I added in checks for glibc where appropriate (uclibc defines GLIBC so the check for TEMP_FAILURE_RETRY handles both cases).
The compiler warning patch is unchanged.
[update - I decided the missing CLOEXEC is really a C library bug rather than something an application should support; patches exist to fix this, so I took it out here.]
Last edit: Brendan Heading 2015-07-22
Fixed in 2.0.25.