[comp.unix.aux] signal.h and sys/signal.h on 2.0

jim@jagmac2.gsfc.nasa.gov (Jim Jagielski) (09/13/90)

I have uncovered something in the A/UX 2.0 header files for signals
(/usr/include/signal.h and sys/signal.h) that, if I understand typedefs
right, might be wrong.

In signal.h, signal is defined as:

	extern sigfunct_t signal();

In sys/signal.h, sigfunct_t is defined as (assume !POSIX case):

	typedef int (*sigfunct_t) ();

which means that sigfunct_t is a type that is a "pointer to a function
that returns an int."

Now this definition of sigfunct_t is fine. My concern is back in signal.h.
What we want to say is:

	int (*signal)();

which would be accomplished by:

	sigfunct_t signal;
	("signal is a pointer to a function that returns an int")

but signal.h says something different (I think...):

	sigfunct_t signal();
	("signal is a function that returns a pointer to a function that
	  returns an int")

IS THIS RIGHT??? DO I UNDERSTAND THIS CORRECTLY???
--
=======================================================================
#include <std/disclaimer.h>
                                 =:^)
           Jim Jagielski                    NASA/GSFC, Code 711.1
     jim@jagmac2.gsfc.nasa.gov               Greenbelt, MD 20771

"Kilimanjaro is a pretty tricky climb. Most of it's up, until you reach
 the very, very top, and then it tends to slope away rather sharply."

jim@jagmac2.gsfc.nasa.gov (Jim Jagielski) (09/13/90)

In article <3392@dftsrv.gsfc.nasa.gov>  MY STUPID TWIN writes:
>I have uncovered something in the A/UX 2.0 header files for signals
>(/usr/include/signal.h and sys/signal.h) that, if I understand typedefs
>right, might be wrong.
>
>	sigfunct_t signal();
>	("signal is a function that returns a pointer to a function that
>	  returns an int")
>
>IS THIS RIGHT??? DO I UNDERSTAND THIS CORRECTLY???

Sorry, sorry, sorry.

Stupid me.

Of course, that is what signal is. For some reason I was thinking that
signal returned int (or void) directly...

Here it is only Wednesday and already my mind is mush...
--
=======================================================================
#include <std/disclaimer.h>
                                 =:^)
           Jim Jagielski                    NASA/GSFC, Code 711.1
     jim@jagmac2.gsfc.nasa.gov               Greenbelt, MD 20771

"Kilimanjaro is a pretty tricky climb. Most of it's up, until you reach
 the very, very top, and then it tends to slope away rather sharply."