D6597: Add magic define to enable setgroups(2)

2017-07-26 Thread Michael Pyne
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:15451d505fdb: Fix build on musl libc by exposing 
setgroups(2). (authored by mpyne).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D6597?vs=16422=17270

REVISION DETAIL
  https://phabricator.kde.org/D6597

AFFECTED FILES
  src/kpac/kpac_dhcp_helper.c

To: mpyne, #frameworks


D6597: Add magic define to enable setgroups(2)

2017-07-22 Thread Michael Pyne
mpyne added a comment.


  With the help of the KDE sysadmins, I've tested this to build on FreeBSD.  
BSD-specific defines remain available on FreeBSD unless you start to use 
`_POSIX_C_SOURCE`, `_ANSI_SOURCE`, or `_XOPEN_SOURCE`.  So `_BSD_SOURCE` and 
`_DEFAULT_SOURCE` appear to be safe for FreeBSD.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D6597

To: mpyne, #frameworks


D6597: Add magic define to enable setgroups(2)

2017-07-09 Thread Michael Pyne
mpyne created this revision.
Restricted Application added a project: Frameworks.

REVISION SUMMARY
  The KIO KPAC DHCP helper uses `setgroups(2)`.  But this is apparently not 
specified in POSIX due to being a "privileged call", so it is only available as 
an extension, typically needing `_BSD_SOURCE` to be explicitly defined from 
what I can gather.
  
  glibc will gladly provide `setgroups()` as a GNU extension without requiring 
`_BSD_SOURCE`, but musl libc requires one of `_{BSD_GNU}_SOURCE` and doesn't 
pre-define either.
  
  Defining `_BSD_SOURCE` is easy enough but it seems that glibc now complains 
about that, calling it deprecated, so I also threw in a `_DEFAULT_SOURCE` 
define, which appears to be the new hotness.  But maybe it would be easier to 
find a way to avoid `setgroups()`?

TEST PLAN
  KIO now builds under musl libc
  KIO still builds under glibc

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D6597

AFFECTED FILES
  src/kpac/kpac_dhcp_helper.c

To: mpyne, #frameworks