Subject: Re: Curious SYNOPSIS in signal(3)
To: None <firstname.lastname@example.org, email@example.com>
From: None <firstname.lastname@example.org>
Date: 06/26/2002 16:11:37
| On Wed 26 Jun 2002 at 11:27:44 +0200, Jaromir Dolecek wrote:
| > Indeed, I find the form using typedef easier to parse, too. It's much
| > more obvious that the returned value is pointer to a function.
| and that the returned function is of the same type as the function that
| you pass in. Which is not very clear from the expanded form, either.
| > I'm going to update the manpage to use typedef.
| Good idea.
POSIX defines it as:
void (*signal(int sig, void (*func)(int)))(int);
While sig_t is easier to read, it's not standard, and even in the
header file it's not defined for POSIX compatibility:
#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
typedef void (*sig_t) __P((int)); /* type of signal function */
I don't know if using that in the manpage is such a good idea. It
promotes the use of non-portable code.