4.2 BSD replacement for jobs

John Nelson john at genrad.UUCP
Sun Jan 22 10:42:03 AEST 1984


I DID post such a thing on net.sources about a week ago.  Sigh.

1. replace sigset and sigsys with signal().  #define sigset signal
   works great.  Also note that 4.2 can be detected from signal.h -
   I always use the code fragment below, and ifdef BSD42 when necessary:

#ifdef SIGVTALRM
#define BSD42
#endif

2. sighold, sigrelse sigignore can be emulated as:

sighold(sig)
int sig; {
    sigblock (1 << (sig - 1));
}
sigrelse(sig)
int sig; {
    sigsetmask(sigblock(0) & ~(1 << (sig - 1)));
}
sigignore(sig)
int sig; {
    signal(sig, SIG_IGN);
}

3. Watch out for sigpause().  4.2 has it's own sigpause that
   has a different syntax.

4. Be careful about signal handlers.  Signals handlers do NOT
   revert to the default automatically.  This is the same
   behavior as sigset and sigsys, but different from the old
   signal().  Signals are also blocked within the handler
   that caught them (translation: An extra sigrelse may
   be necessary to unblock the signal if you wish to resend
   it after catching it and cleaning up).



More information about the Comp.unix.wizards mailing list