From: Dmitry V. Levin Date: Tue, 1 May 2012 20:56:32 +0000 (+0000) Subject: Make printing of utsname.domainname more portable X-Git-Tag: v4.7~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea22e9753d577aed0b5564d083a6dac18a51eccd;p=strace 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. --- 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("}");