diff options
author | kib <kib@FreeBSD.org> | 2010-04-18 18:23:11 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-04-18 18:23:11 +0000 |
commit | 5df7b59b8b3c38e0836b18a01fa58dbf9b662d5e (patch) | |
tree | 4034e27195067833f2c31dba6a3714cad46b646d /lib/libc | |
parent | 7558b73168802a840eb385281ab7c4be1665f673 (diff) | |
download | FreeBSD-src-5df7b59b8b3c38e0836b18a01fa58dbf9b662d5e.zip FreeBSD-src-5df7b59b8b3c38e0836b18a01fa58dbf9b662d5e.tar.gz |
Revert r206649.
Simplify the presented declaration of struct sigaction, noting the
caveat in the text. Real layout of the structure and exposed
implementation namespace only obfuscates the usage.
Submitted by: bde
MFC after: 3 days
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/sigaction.2 | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2 index 51b6c47..3b4f2f0 100644 --- a/lib/libc/sys/sigaction.2 +++ b/lib/libc/sys/sigaction.2 @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd April 13, 2010 +.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, siginfo_t *, 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 @@ -496,16 +501,6 @@ or .Dv SIG_IGN this way. .Pp -If preprocessing symbol -.Va _POSIX_C_SOURCE -with the value >= 199309 is not defined, the following declaration for -the handler shall be used: -.Bl -tag -offset indent -width short -.It Tn POSIX Dv SA_SIGINFO : -.Ft void -.Fn handler int "struct __sigaction *" "void *" ; -.El -.Pp If the .Dv SA_SIGINFO flag is not set, the handler function should match |