Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen add psiginfo.
details: https://anonhg.NetBSD.org/src/rev/9cf108140c3f
branches: trunk
changeset: 757377:9cf108140c3f
user: christos <christos%NetBSD.org@localhost>
date: Fri Aug 27 08:38:41 2010 +0000
description:
add psiginfo.
diffstat:
lib/libc/gen/Makefile.inc | 4 ++--
lib/libc/gen/psignal.3 | 20 +++++++++++++++++---
lib/libc/gen/psignal.c | 16 ++++++++++------
3 files changed, 29 insertions(+), 11 deletions(-)
diffs (118 lines):
diff -r d56d04196616 -r 9cf108140c3f lib/libc/gen/Makefile.inc
--- a/lib/libc/gen/Makefile.inc Fri Aug 27 08:21:43 2010 +0000
+++ b/lib/libc/gen/Makefile.inc Fri Aug 27 08:38:41 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.170 2010/05/22 06:38:15 tnozaki Exp $
+# $NetBSD: Makefile.inc,v 1.171 2010/08/27 08:38:41 christos Exp $
# from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95
# gen sources
@@ -130,7 +130,7 @@
MLINKS+=humanize_number.3 dehumanize_number.3
MLINKS+=makecontext.3 swapcontext.3
MLINKS+=popen.3 pclose.3
-MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3
+MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3 psignal.3 psiginfo.3
MLINKS+=pwcache.3 user_from_uid.3 pwcache.3 group_from_gid.3
MLINKS+=pwcache.3 uid_from_user.3 pwcache.3 gid_from_group.3
MLINKS+=pwcache.3 pwcache_userdb.3 pwcache.3 pwcache_groupdb.3
diff -r d56d04196616 -r 9cf108140c3f lib/libc/gen/psignal.3
--- a/lib/libc/gen/psignal.3 Fri Aug 27 08:21:43 2010 +0000
+++ b/lib/libc/gen/psignal.3 Fri Aug 27 08:38:41 2010 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: psignal.3,v 1.16 2010/04/14 07:20:27 njoly Exp $
+.\" $NetBSD: psignal.3,v 1.17 2010/08/27 08:38:41 christos Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,11 +29,12 @@
.\"
.\" @(#)psignal.3 8.2 (Berkeley) 2/27/95
.\"
-.Dd February 27, 1995
+.Dd August 27, 2010
.Dt PSIGNAL 3
.Os
.Sh NAME
.Nm psignal ,
+.Nm psiginfo ,
.Nm sys_siglist ,
.Nm sys_signame
.Nd system signal messages
@@ -42,7 +43,8 @@
.Sh SYNOPSIS
.In signal.h
.Ft void
-.Fn psignal "unsigned sig" "const char *s"
+.Fn psignal "int sig" "const char *s"
+.Fn psiginfo "const siginfo_t *si" "const char *s"
.Vt extern const char * const sys_siglist[];
.Vt extern const char * const sys_signame[];
.Sh DESCRIPTION
@@ -66,6 +68,14 @@
.Dq "Unknown signal"
is produced.
.Pp
+The
+.Fn psiginfo
+function produces the same output as the
+.Fn psignal
+function, only it uses the signal number information from the
+.Fa si
+argument.
+.Pp
The message strings can be accessed directly using the external array
.Va sys_siglist ,
indexed by recognized signal numbers.
@@ -89,3 +99,7 @@
.Fn psignal
function appeared in
.Bx 4.2 .
+The
+.Fn psiginfo
+function appeared in
+.Nx 6.0 .
diff -r d56d04196616 -r 9cf108140c3f lib/libc/gen/psignal.c
--- a/lib/libc/gen/psignal.c Fri Aug 27 08:21:43 2010 +0000
+++ b/lib/libc/gen/psignal.c Fri Aug 27 08:38:41 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psignal.c,v 1.21 2005/11/29 03:11:59 christos Exp $ */
+/* $NetBSD: psignal.c,v 1.22 2010/08/27 08:38:41 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)psignal.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: psignal.c,v 1.21 2005/11/29 03:11:59 christos Exp $");
+__RCSID("$NetBSD: psignal.c,v 1.22 2010/08/27 08:38:41 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -55,13 +55,11 @@
#endif
void
-psignal(sig, s)
- unsigned int sig;
- const char *s;
+psignal(int sig, const char *s)
{
struct iovec *v;
struct iovec iov[4];
- static char buf[NL_TEXTMAX];
+ char buf[NL_TEXTMAX];
v = iov;
if (s && *s) {
@@ -79,3 +77,9 @@
v->iov_len = 1;
(void)writev(STDERR_FILENO, iov, (v - iov) + 1);
}
+
+void
+psiginfo(const siginfo_t *si, const char *s)
+{
+ psignal(si->si_signo, s);
+}
Home |
Main Index |
Thread Index |
Old Index