This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Test for GNU/XSI version of strerror_r


* Ian Pilcher:

> On 10/4/19 2:16 PM, Florian Weimer wrote:
>> * Ian Pilcher:
>> 
>>> Is there a better way to do this?
>> 
>> Can you use C++?
>> 
>
> Well, I did say better.  ;-)
>
> The extension is quite a simple.  (It provides a single function, which
> changes to a non-root user while retaining CAP_NET_ADMIN.)  It will
> likely weigh in under 100 lines.  Also, I haven't touched C++ since the
> 1990s.  (I still have the Turbo C++ 3.0 box!)

You could use generic selection and _Generic.  But these days, that's
more restrictive than C++ in terms of compiler support.

It's not really defined to add “#define _GNU_SOURCE” after the first
#include, so you could probably just check for _GNU_SOURCE.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]