gimpsignal

Name

gimpsignal -- Portable signal handling.

Synopsis



#define     SA_RESTART
void        (*GimpSignalHandlerFunc)        (gint signum);
GimpSignalHandlerFunc gimp_signal_private   (gint signum,
                                             GimpSignalHandlerFunc handler,
                                             gint flags);
#define     gimp_signal_syscallrestart      (signum,handler)

Description

Portable signal handling.

Details

SA_RESTART

#define SA_RESTART SA_SYSV

This is just an alias for systems which do not define SA_RESTART.


GimpSignalHandlerFunc ()

void        (*GimpSignalHandlerFunc)        (gint signum);

A prototype for signal handler functions. Note that each function which takes or returns a variable of this type also accepts or may return special values defined by your system's signal.h header file (like SIG_DFL or SIG_IGN).


gimp_signal_private ()

GimpSignalHandlerFunc gimp_signal_private   (gint signum,
                                             GimpSignalHandlerFunc handler,
                                             gint flags);

This function furnishes a workalike for signal(2) but which internally invokes sigaction(2) after certain sa_flags are set; these primarily to ensure restarting of interrupted system calls. See sigaction(2) It is a aid to transition and not new development: that effort should employ sigaction directly. [gosgood 18.04.2000]

Cause handler to be run when signum is delivered. We use sigaction(2) rather than signal(2) so that we can control the signal handler's environment completely via flags: some signal(2) implementations differ in their sematics, so we need to nail down exactly what we want. [austin 06.04.2000]


gimp_signal_syscallrestart()

#define gimp_signal_syscallrestart(signum,handler) gimp_signal_private ((signum), (handler), SA_RESTART)

Installs a signal handler in a way that system calls which were not finished at the time of signal handler invocation will be silently restarted by the system (without failing with an error of EINTR).

See Also

signal(2), signal(5 or 7), sigaction(2).