diff options
author | Abhinandan Ekande <Abhinandan.Ekande@Sun.COM> | 2009-05-12 02:21:55 -0700 |
---|---|---|
committer | Abhinandan Ekande <Abhinandan.Ekande@Sun.COM> | 2009-05-12 02:21:55 -0700 |
commit | d6c90996e9f85ae712e669bf3b6efd3ba5fafde2 (patch) | |
tree | f5f13355bd1867e526b3c020545f502571a177a7 /usr/src/uts/common/os/printf.c | |
parent | 1697051e07282edb5ab1c816f4caba20fbc47c88 (diff) | |
download | illumos-gate-d6c90996e9f85ae712e669bf3b6efd3ba5fafde2.tar.gz |
PSARC 2009/222 Add zone support to uprintf() and vuprintf()
6676374 If Solaris Kills a process, the user needs to know why
Diffstat (limited to 'usr/src/uts/common/os/printf.c')
-rw-r--r-- | usr/src/uts/common/os/printf.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/uts/common/os/printf.c b/usr/src/uts/common/os/printf.c index a50bfa0db9..1caedb33b6 100644 --- a/usr/src/uts/common/os/printf.c +++ b/usr/src/uts/common/os/printf.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/types.h> #include <sys/sysmacros.h> @@ -213,8 +211,19 @@ zprintf(zoneid_t zoneid, const char *fmt, ...) void vuprintf(const char *fmt, va_list adx) { + va_list adxcp; + va_copy(adxcp, adx); + + /* Message the user tty, if any, and the global zone syslog */ cprintf(fmt, adx, SL_CONSOLE | SL_LOGONLY | SL_USER | SL_NOTE, "", "", caller(), 0, 0, 0, GLOBAL_ZONEID); + + /* Now message the local zone syslog */ + if (!INGLOBALZONE(curproc)) + cprintf(fmt, adxcp, SL_CONSOLE | SL_LOGONLY | SL_NOTE, + "", "", caller(), 0, 0, 0, getzoneid()); + + va_end(adxcp); } /*PRINTFLIKE1*/ @@ -224,8 +233,9 @@ uprintf(const char *fmt, ...) va_list adx; va_start(adx, fmt); - cprintf(fmt, adx, SL_CONSOLE | SL_LOGONLY | SL_USER | SL_NOTE, - "", "", caller(), 0, 0, 0, GLOBAL_ZONEID); + + vuprintf(fmt, adx); + va_end(adx); } |