For instance, if
_GNU_SOURCE
isn't defined before you include a header from glibc, you don't get access to all its interfaces. And SwiftGlibc.h (?) doesn't define_GNU_SOURCE
, so in order to access something likepthread_setname_np()
, you need to either resort to dynamic loading withdlsym()
or to adding a C module to your package that provides wrapper functions. (Swift Testing has both. Yay.)
Speaking of _GNU_SOURCE stuff, it reminds of the discussion of using dladdr in Swift. Many people (including me) has a demand for it and currently we have to use a C shim layer to export it for Linux platform.