This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21552] XPG4 bsd_signal namespace
- From: "pponnuvel at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 10 Nov 2017 16:50:19 +0000
- Subject: [Bug libc/21552] XPG4 bsd_signal namespace
- Auto-submitted: auto-generated
- References: <bug-21552-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21552
PP <pponnuvel at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pponnuvel at gmail dot com
--- Comment #4 from PP <pponnuvel at gmail dot com> ---
Request a clarification about how to get bsd_signal's prototype in glibc 2.26.
Man page of bsd_signal says:
> bsd_signal():
> Since glibc 2.26:
> _XOPEN_SOURCE >= 500
> && ! (_POSIX_C_SOURCE >= 200112L)
> Glibc 2.25 and earlier:
> _XOPEN_SOURCE
Defining those two macros as such works. But when I define _GNU_SOURCE
additionally, it doesn't work. The following demonstrates the problem:
```
$ cat x.c
#include <signal.h>
int main(void)
{
bsd_signal(0, 0);
}
$ gcc -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -std=gnu99 x.c
$ gcc -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -std=gnu99 -D_GNU_SOURCE
x.c
x.c: In function ‘main’:
x.c:4:5: warning: implicit declaration of function ‘bsd_signal’; did you mean
‘ssignal’? [-Wimplicit-function-declaration]
bsd_signal(0, 0);
^~~~~~~~~~
ssignal
```
As seen above, defining `_GNU_SOURCE` makes bsd_signal unavailable. Is this
expected?
Compiling using gcc 7.2.0/glibc 2.26 (Ubuntu 17.10).
--
You are receiving this mail because:
You are on the CC list for the bug.