Discussion:
How to access SIGWINCH?
(too old to reply)
Stefan Hagen
2018-05-13 20:13:45 UTC
Permalink
Hello,

I'm wondering how to get access to to the SIGWINCH signal. It is defined in
/usr/include/sys/signal.h and behind the -D__BSD_VISIBLE switch.

I can compile my code with this switch, but is this the proper way to do it?
I would expect something like this behind -D_BSD_SOURCE or
-D_XOPEN_SOURCE=700.

What's the right way to access this signal?

Best Regards,
Stefan
--
Stefan Hagen
Phone: +49 (0)176 642 925 17
Defender of RFC 1855 | PGP Key in Header.
Stefan Hagen
2018-05-13 20:36:42 UTC
Permalink
Post by Stefan Hagen
I can compile my code with this switch, but is this the proper way to do it?
I would expect something like this behind -D_BSD_SOURCE or
-D_XOPEN_SOURCE=700.
Answering myself. I had -D_XOPEN_SOURCE=700 defined which essentially blocks
access to SIGWINCH. Not defining -D_XOPEN_SOURCE on FreeBSD fixed my issue.

Best Regards,
Stefan
--
Stefan Hagen
Phone: +49 (0)176 642 925 17
Defender of RFC 1855 | PGP Key in Header.
Garrett Wollman
2018-05-13 22:16:28 UTC
Permalink
Post by Stefan Hagen
I'm wondering how to get access to to the SIGWINCH signal. It is defined in
/usr/include/sys/signal.h and behind the -D__BSD_VISIBLE switch.
I can compile my code with this switch, but is this the proper way to do it?
I would expect something like this behind -D_BSD_SOURCE or
-D_XOPEN_SOURCE=700.
What's the right way to access this signal?
The right way is to *not* request strict adherence to a standard that
doesn't include that signal. Do not define any of these macros and
you will get SIGWINCH defined.

The next POSIX revision will probably include SIGWINCH, so come 2022
you can define _POSIX_C_SOURCE to something like 202207 and get it.
(I'm not actually certain when the next revision is planned to be
released -- we just went through an IEEE-mandated reaffirmation cycle
but I don't believe a new signal and the related data structures can
be introduced in a technical corrigendum so it will have to wait for
the next opportunity to do a full revision of standard, which will
have to be agreed upon by IEEE, ISO/IEC JTC1, and The Open Group.)

-GAWollman

Loading...