aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
index eeb8735f6f05..ae26d55ba8be 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
@@ -25,7 +25,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
-#if defined(sun)
+#ifdef illumos
#include <sys/sysmacros.h>
#else
#define ABS(a) ((a) < 0 ? -(a) : (a))
@@ -33,7 +33,7 @@
#include <string.h>
#include <strings.h>
#include <stdlib.h>
-#if defined(sun)
+#ifdef illumos
#include <alloca.h>
#endif
#include <assert.h>
@@ -467,7 +467,7 @@ pfprint_time(dtrace_hdl_t *dtp, FILE *fp, const char *format,
* Below, we turn this into the canonical adb/mdb /[yY] format,
* "1973 Dec 3 17:20:00".
*/
-#if defined(sun)
+#ifdef illumos
(void) ctime_r(&sec, src, sizeof (src));
#else
(void) ctime_r(&sec, src);
@@ -518,7 +518,7 @@ pfprint_port(dtrace_hdl_t *dtp, FILE *fp, const char *format,
char buf[256];
struct servent *sv, res;
-#if defined(sun)
+#ifdef illumos
if ((sv = getservbyport_r(port, NULL, &res, buf, sizeof (buf))) != NULL)
#else
if (getservbyport_r(port, NULL, &res, buf, sizeof (buf), &sv) > 0)
@@ -544,7 +544,7 @@ pfprint_inetaddr(dtrace_hdl_t *dtp, FILE *fp, const char *format,
s[size] = '\0';
if (strchr(s, ':') == NULL && inet_pton(AF_INET, s, inetaddr) != -1) {
-#if defined(sun)
+#ifdef illumos
if ((host = gethostbyaddr_r(inetaddr, NS_INADDRSZ,
AF_INET, &res, buf, sizeof (buf), &e)) != NULL)
#else
@@ -694,7 +694,7 @@ static const dt_pfconv_t _dtrace_conversions[] = {
{ "S", "s", pfproto_cstr, pfcheck_str, pfprint_estr },
{ "T", "s", "int64_t", pfcheck_time, pfprint_time822 },
{ "u", "u", pfproto_xint, pfcheck_xint, pfprint_uint },
-#if defined(sun)
+#ifdef illumos
{ "wc", "wc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wchar_t */
{ "ws", "ws", pfproto_wstr, pfcheck_wstr, pfprint_wstr },
#else
@@ -1657,7 +1657,7 @@ dtrace_freopen(dtrace_hdl_t *dtp, FILE *fp, void *fmtdata,
if (rval == -1 || fp == NULL)
return (rval);
-#if defined(sun)
+#ifdef illumos
if (pfd->pfd_preflen != 0 &&
strcmp(pfd->pfd_prefix, DT_FREOPEN_RESTORE) == 0) {
/*
@@ -1739,7 +1739,7 @@ dtrace_freopen(dtrace_hdl_t *dtp, FILE *fp, void *fmtdata,
}
(void) fclose(nfp);
-#else
+#else /* !illumos */
/*
* The 'standard output' (which is not necessarily stdout)
* treatment on FreeBSD is implemented differently than on
@@ -1814,7 +1814,7 @@ dtrace_freopen(dtrace_hdl_t *dtp, FILE *fp, void *fmtdata,
/* Remember that the output has been redirected to the new file. */
dtp->dt_freopen_fp = nfp;
-#endif
+#endif /* illumos */
return (rval);
}