Subject: lib/2252: signal man page is misleading.
To: None <gnats-bugs@NetBSD.ORG>
From: Peter Seebach <seebs@taniemarie.solon.com>
List: netbsd-bugs
Date: 03/24/1996 02:30:59
>Number:         2252
>Category:       lib
>Synopsis:       The man page for signal(3) is misleading.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 24 03:50:01 1996
>Last-Modified:
>Originator:     Peter Seebach
>Organization:
Usenet Fact Police (Undercover)
>Release:        Mar 08 1996
>Environment:
System: NetBSD taniemarie 1.1A NetBSD 1.1A (SEEBS) #0: Sat Mar 9 11:19:31 CST 1996 seebs@taniemarie:/usr/src/sys/arch/amiga/compile/SEEBS amiga


>Description:
	The man page for signal does not show the complete type of func;
	this is incomplete (compared with, say, the man page for qsort)
	and may lead a naive user to believe that func does not take an
	argument.  It also requires a separate declaration of func,
	using some arcane macro stuff I can't figure out.
>How-To-Repeat:
	man signal.
>Fix:
	This patch replaces
		void *signal(sig, func());

		void (*func)();
	with
		void (*signal(int sig, void (*func)(int)))(int);
	which is correct.  (Confusing, but correct.)

	It also expands the description to state that func() is called with
	the signal to be handled as an argument.

	I would be happy to see someone who actually knows nroff get these
	results in a more elegant way.

*** signal.3old	Sun Mar 24 02:07:48 1996
--- signal.3	Sun Mar 24 02:29:04 1996
***************
*** 42,52 ****
  .Sh SYNOPSIS
  .Fd #include <signal.h>
  .Ft void
- .Fn *signal sig func\*(lp\*(rp
- .Ft void
- .\" can not do this with .Fn yet
  .br
! \*(lp\|\*(fN*func\*(rp\*(lp\|\*(rp\fR
  .Sh DESCRIPTION
  This
  .Fn signal
--- 42,49 ----
  .Sh SYNOPSIS
  .Fd #include <signal.h>
  .Ft void
  .br
! \*(lp\|\*(fN*signal\*(lpint sig, void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint\*(rp\fR
  .Sh DESCRIPTION
  This
  .Fn signal
***************
*** 148,154 ****
  further occurrences of the signal are
  automatically blocked and
  .Fa func
! is called.
  .Pp
  The handled signal is unblocked with the
  function returns and
--- 145,151 ----
  further occurrences of the signal are
  automatically blocked and
  .Fa func
! is called, with the signal to be handled as an argument.
  .Pp
  The handled signal is unblocked with the
  function returns and
>Audit-Trail:
>Unformatted: