[comp.sys.mips] Signal return value?

bin@primate.wisc.edu (Brain in Neutral) (02/09/90)

For the signal() system call in RISC/os 4, there are multiple versions.
The BSD man page indicates that the handler function returns int:

SIGNAL(3C-BSD)      RISC/os Reference Manual       SIGNAL(3C-BSD)
SYNOPSIS
     #include <signal.h>

     (*signal(sig, func))()
     int (*func)();

NOTES  (MIPS)
     The handler routine can be declared:

         handler(sig, code, scp)
         int sig, code;
         struct sigcontext *scp;

That's fine, and consistent.
----------------------------------------------------------------------------

On the other hand, one SYSV man page indicates that the function returns
void, but then the example declaration is that of a function that returns
int.  Which is it?

SIGNAL(2-SysV)      RISC/os Reference Manual       SIGNAL(2-SysV)
SYNOPSIS
     #include <signal.h>

     void (*signal (sig, func))()
     int sig;
     void (*func)();

NOTES  (MIPS)
     The handler routine can be declared:

         handler(sig, code, scp)
         int sig, code;
         struct sigcontext *scp;

Even more confusing, there is a SIGNAL(3-SysV) man page, which says:

     (*signal(sig, func))()
     int (*func)();

which is the same as SIGNAL(3C-BSD), but different than SIGNAL(3-SysV)!

I seek enlightenment...

Paul DuBois
Internet:	dubois@primate.wisc.edu
UUCP:		rhesus!dubois
FAX:		608/263-4031

kris@mips.COM (Kris Solem) (02/10/90)

In article <1568@uakari.primate.wisc.edu> bin@primate.wisc.edu (Brain in Neutral) writes:
>
>For the signal() system call in RISC/os 4, there are multiple versions.
>The BSD man page indicates that the handler function returns int:
>	
	[example deleted]

>On the other hand, one SYSV man page indicates that the function returns
>void, but then the example declaration is that of a function that returns
>int.  Which is it?

	[example deleted]

>Paul DuBois
>Internet:	dubois@primate.wisc.edu
>UUCP:		rhesus!dubois
>FAX:		608/263-4031

The signal(2-SYSV) man pages has been fixed to indicate that the
return type for handler is void.

The signal(3C-SYSV) man page was removed in RISC/os 4.0, at least on-line.
It shouldn't show up in the manual in the next release.

Kris Solem 		{ames,decwrl,pyramid,prls}!mips!kris or kris@mips.com
MIPS Computer Systems	408-991-7726
930 Arques Avenue
Sunnyvale, CA 94086



-- 
Kris Solem 		{ames,decwrl,pyramid,prls}!mips!kris or kris@mips.com
MIPS Computer Systems	408-991-7726
930 Arques Avenue
Sunnyvale, CA 94086