Can someone please explain the difference between sigaction and signal. I know they signal works differently depending on which machine you are working on i.e. Mac, Windows, or Linux and that sigaction works the same on all platforms. But my question is why is that, because I have tried using signal on different platforms and have gotten the same result. Also which one would you guys recommend using for better practice.
I know few things about sigaction
and signal
. But what i know is that:
sigaction
call is more complex to use than signal
call (as you already know).sigaction
allows you to obtain more information about the signal received by your program (see siginfo_t
structure).sigaction
, rather than signal
to establish signal handlers."signal
as system call, this implementation provides the older, unreliable semantics. However, glibc
bypasses this system call by providing a signal library function that calls sigaction
"Hope it helps.