restarting signals

Top Page
Delete this message
Reply to this message
Author: Neal Becker
Date:  
To: exim-users
Subject: restarting signals
On hpux9.05 the signal interface is not restarting. POSIX sigaction
is available, but restart is not an option (nor does POSIX specify
it).

On hpux9, sigvector is available which *does* have a restart option,
but this is not very portable, so I don't recommend we use it. Also,
it must not be mixed with signal().

A simple way is available to fix this. We can wrap all the needed
syscalls. Define the wrapper in a header file that all source files
include. Make these wrappers inline (where available) so performance
will not be degraded.

On systems that don't need the wrappers these can be made to have zero
overhead. If inline is not available we can use defines instead.

The following functions need wrappers on hpux9:

                    Call                  | sc_syscall value
                    ----------------------+------------------
                    read (slow devices)   | SYS_READ
                    readv (slow devices)  | SYS_READV
                    write (slow devices)  | SYS_WRITE
                    writev (slow devices) | SYS_WRITEV
                    open (slow devices)   | SYS_OPEN
                    ioctl (slow requests) | SYS_IOCTL
                    close (slow requests) | SYS_CLOSE
                    wait                  | SYS_WAIT
                    select                | SYS_SELECT
                    pause                 | SYS_PAUSE
                    sigpause              | SYS_SIGPAUSE
                    semop                 | SYS_SEMOP
                    msgsnd                | SYS_MSGSND
                    msgrcv                | SYS_MSGRCV


e.g.:

inline int READ (a, b, c) {
  int res;
  do {
    res = read (a, b, c);
  } while (res < 0 && errno == EINTR);
  return res;
}