From owner-svn-src-all@FreeBSD.ORG Wed Apr 21 11:09:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B465106564A; Wed, 21 Apr 2010 11:09:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7F38FC19; Wed, 21 Apr 2010 11:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LB9DEF035116; Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LB9DQO035114; Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004211109.o3LB9DQO035114@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Apr 2010 11:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206990 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 11:09:13 -0000 Author: kib Date: Wed Apr 21 11:09:13 2010 New Revision: 206990 URL: http://svn.freebsd.org/changeset/base/206990 Log: MFC r206549: Align the declaration for sa_sigaction with POSIX. MFC r206649: Still reference struct __sigaction with clarification when this form of argument declaration is needed. MFC r206802: Revert r206649. Simplify the presented declaration of struct sigaction. Modified: stable/8/lib/libc/sys/sigaction.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigaction.2 ============================================================================== --- stable/8/lib/libc/sys/sigaction.2 Wed Apr 21 10:21:34 2010 (r206989) +++ stable/8/lib/libc/sys/sigaction.2 Wed Apr 21 11:09:13 2010 (r206990) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd June 7, 2004 +.Dd April 18, 2010 .Dt SIGACTION 2 .Os .Sh NAME @@ -40,16 +40,11 @@ .In signal.h .Bd -literal struct sigaction { - union { - void (*__sa_handler)(int); - void (*__sa_sigaction)(int, struct __siginfo *, void *); - } __sigaction_u; /* signal handler */ + void (*sa_handler)(int); + void (*sa_sigaction)(int, siginfo_t *, void *); int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ }; - -#define sa_handler __sigaction_u.__sa_handler -#define sa_sigaction __sigaction_u.__sa_sigaction .Ed .Ft int .Fo sigaction @@ -148,6 +143,16 @@ If is non-zero, the previous handling information for the signal is returned to the user. .Pp +The above declaration of +.Vt "struct sigaction" +is not literal. +It is provided only to list the accessible members. +See +.In sys/signal.h +for the actual definition. +In particular, the storage occupied by sa_handler and sa_sigaction overlaps, +and an application can not use both simultaneously. +.Pp Once a signal handler is installed, it normally remains installed until another .Fn sigaction