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: recvfrom interrupt



On 22/08/2016 11:11, Godmar Back wrote:
> On Mon, Aug 22, 2016 at 9:33 AM, Manfred <mx2927@gmail.com> wrote:
>> Thanks a lot for the reply.
>> Indeed signal(2) clarifies the "portability mess" about signal(). This
>> probably explains why the code I was debugging used to work in the past and
>> not any more now.
>>
>> The manpage I have for glibc 2.22 is a bit different than yours:
> 
> Sad in a way. I just updated to Ubuntu 16.04.1 LTS a few days ago and
> don't even get an up-to-date man page. I have GLibc 2.23.
> 
> Usually you're faster experimenting it or reading the kernel or glibc
> code than the man page.
> 
>  - Godmar
> 

If it is worth, on GLIBC 2.19 NEWS we added:

* A new feature test macro _DEFAULT_SOURCE is available to enable the same
  set of header declarations that are enabled by default, even when other
  feature test macros or compiler options such as -std=c99 would otherwise
  disable some of those declarations.

* The _BSD_SOURCE feature test macro no longer enables BSD interfaces that
  conflict with POSIX.  The libbsd-compat library (which was a dummy library
  that did nothing) has also been removed.

And on 2.20:

* The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer
  supported; they now act the same as _DEFAULT_SOURCE (but generate a
  warning).  Except for cases where _BSD_SOURCE enabled BSD interfaces that
  conflicted with POSIX (support for which was removed in 2.19), the
  interfaces those macros enabled remain available when compiling with
  _GNU_SOURCE defined, with _DEFAULT_SOURCE defined, or without any feature
  test macros defined.

Also, the issue that motivated these changes are described on some details
in GLIBC 2.20 wiki [1] part 3.2.3.  Basically:

  * _BSD_SOURCE and _SVID_SOURCE feature macros are not yet deprecated, 
    but use of those macros will produce the following warning:

In file included from /usr/include/stdio.h:27:0,
                 from test3.c:2:
/usr/include/features.h:152:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" 

  So do not ignore warning in your application, specially the one emitted
  by GLIBC.

  * If the application does indeed need _BSD_SOURCE and/or _SVID_SOURCE and you 
    must support glibc < 2.19 and glibc >= 2.20 then define all three unconditionally:

/* Legacy feature macros.  */
#define _BSD_SOURCE 1
#define _SVID_SOURCE 1
/* New feature macro that provides everything _BSD_SOURCE and
   _SVID_SOURCE provided and possibly more.  */
#define _DEFAULT_SOURCE 1

Unfortunately the manual only contains the current intended for _DEFAULT_SOURCE,
not version history or rationale to add it.

[1] https://sourceware.org/glibc/wiki/Release/2.20


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