signal & sigvec error return codes

Mike Lijewski lijewski at batcomputer.tn.cornell.edu
Thu May 25 21:44:37 AEST 1989


     Do all vendors still document the return code of signal and
sigvec as being -1 (implicitely an int)?  My problem with this is
that if you try to be a "good" programmer and check for an error as
in 
    if(signal(SIGINT, SIG_IGN) == -1){
      perror("signal");
      exit(1);
    }

say, you will either get a warning or an error, depending on how smart
your compiler is.  Why not document the error return as being something
along the lines of SIG_ERR, where SIG_ERR is defined as

#define SIG_ERR ((int(*)())-1)

in <signal.h>?



More information about the Comp.lang.c mailing list