signals

J

Joe Van Dyk

The C++ language doesn't deal with signals (i.e. SIGINT, SIGKILL), right?

Joe
 
T

Tejas Kokje

Right, signals are OS level semantics. C++ standard does not say
anything about signals. Closest thing which I can think of is
exceptions. But then, those are different then signals.

However, this does not mean that you cannot use signals in C++. You can
include <signal.h> and then use signal system call to specify signal
handler and signal type.

Tejas Kokje
 
P

Phlip

Tejas said:
However, this does not mean that you cannot use signals in C++. You can
include <signal.h> and then use signal system call to specify signal
handler and signal type.

Are you POSIX-tive about that?

;-)
 
P

Pete C

Joe said:
The C++ language doesn't deal with signals (i.e. SIGINT, SIGKILL), right?

It does, in the standard header <csignal>. SIGINT, SIGTERM etc are
standard macros.
However the conditions under which these signals are delivered are not
specified, except when you raise them yourself with the "raise"
function.

IIRC, Windows will never deliver these signals unless you raise them
manually, but POSIX systems will.
 
P

Palik Imre

Joe Van Dyk said:
The C++ language doesn't deal with signals (i.e. SIGINT, SIGKILL), right?

Wrong.

Section 17.3.1.2 mentions the header <csignal>, and says the following:

Except as noted in Clauses 18 through 27, the contents of each header cname
shall be the same as that of the corresponding header name.h, as specified
in ISO/IEC 9899:1990 Programming Languages C (Clause 7), or ISO/IEC:1990
Programming Languages?C AMENDMENT 1: C Integrity, (Clause 7), as
appropriate, as if by inclusion.

I.e., it deals with signals with the same extent as the C language.
E.g. it says something about SIGINT, but nothing about SIGKILL.

ImRe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top