In the UCRT signal.h, I see these defines.
#define SIGABRT 22 // abnormal termination triggered by abort call
#define SIGABRT_COMPAT 6 // SIGABRT compatible with other platforms, same as SIGABRT
Full path is c:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\signal.h
if it helps.
In man signal.7
on my Ubuntu 18.04 system I see SIGABRT
is also mapped to 6
.
This is confusing to me. Being that Windows doesn't truly have "signals" under the hood, and this is all an emulation layer on top of the various messaging mechanisms native to Windows wrapped by the C++11 standard library, why did they choose something non-portable for the default SIGABRT
? Do they expect people to be using it as an argument to raise()
, or for comparison in a signal handler?
The only documentation I can find regarding the existence of SIGABRT_COMPAT
is the comment in the header file, and the table in the online documentation which is no more descriptive than the header.
The standard doesn't even define it: https://en.cppreference.com/w/cpp/header/csignal
I realize that these are all symbolic values and it may be considered poor form to depend on them being specific values (though it can be useful), but this must be here for a reason.
This is a bit upsetting to see because it seems to be there for portability reasons, but at the same time it looks like using it reduces code portability since it's only defined in the UCRT.