From ea22e9753d577aed0b5564d083a6dac18a51eccd Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 1 May 2012 20:56:32 +0000 Subject: [PATCH] Make printing of utsname.domainname more portable * configure.ac: Check for struct utsname.domainname field. * process.c (sys_uname): Print utsname.domainname when the field is available. --- configure.ac | 2 ++ process.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 879ad9a9..ec8db2d1 100644 --- a/configure.ac +++ b/configure.ac @@ -232,6 +232,8 @@ AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include # include #endif]) +AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include ]) + AC_CHECK_DECLS([sys_errlist]) AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include ]) AC_CHECK_DECLS(m4_normalize([ diff --git a/process.c b/process.c index 8824abd1..fa304e58 100644 --- a/process.c +++ b/process.c @@ -1175,7 +1175,7 @@ sys_uname(struct tcb *tcp) tprintf("release=\"%s\", version=\"%s\", ", uname.release, uname.version); tprintf("machine=\"%s\"", uname.machine); -#if defined(_GNU_SOURCE) && defined(__GLIBC__) +#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME tprintf(", domainname=\"%s\"", uname.domainname); #endif tprints("}"); -- 2.40.0