NetBSD Problem Report #3633

Received: (qmail 1044 invoked from network); 16 May 1997 21:44:55 -0000
Message-Id: <>
Date: Fri, 16 May 1997 14:44:47 -0700 (PDT)
From: "Erik E. Fair" <>
Subject: inconsistent declaration of "struct sigaction" in sys/signal.h
X-Send-Pr-Version: 3.95

>Number:         3633
>Category:       lib
>Synopsis:       inconsistent declaration of "struct sigaction" in sys/signal.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 16 14:50:01 +0000 1997
>Closed-Date:    Fri Jun 28 21:34:05 +0000 2002
>Last-Modified:  Fri Jun 28 21:34:05 +0000 2002
>Originator:     Erik E. Fair
>Release:        NetBSD-current, May 16, 1997
International Organization of Internet Clock Watchers

System: NetBSD 1.2E NetBSD 1.2E (GENERIC) #59: Sun May 11 12:38:57 PDT 1997 sparc

	The declaration of struct sigaction in sys/signal.h is

		struct	sigaction {
			void	(*sa_handler) __P((int));
			sigset_t sa_mask;
			int	sa_flags;

	However, sigaction(2) says:

		     The handler routine can be declared:

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

	An attempt to properly prototype this declaration, e.g.

		static	void sighandler __P((int, int, struct sigcontext *));

	as opposed to 

		static	void sighandler __P((int));

	leads to cc -Wall complaining

		===> usr.sbin/screenblank
		cc -O  -Werror  -c screenblank.c
		cc1: warnings being treated as errors
		screenblank.c: In function `main':
		screenblank.c:160: warning: assignment from incompatible
			pointer type
		*** Error code 1

	When the prototyped function is assigned to "sa_handler" as declared
	above. See also PR# lib/2718

	Attempt to compile code as described above.

	1. fix /usr/include/sys/signal.h
	2. clean up all code that uses sigaction(2) to declare a handler.
State-Changed-From-To: open->closed 
State-Changed-By: jdolecek 
State-Changed-When: Fri Jun 28 14:32:14 PDT 2002 
The 'official' version is 'void (*)(int)', the sigcontext thing 
is BSD extension. The EXAMPLES section now contains note that 
the function has to be cast to the 'official' prototype. 
So, the manpage is updated and this problem is fixed. 
Thanks for report. 

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.