MFH: Fixed #46059 (Compile failure under IRIX 6.5.30 building posix.c)

This commit is contained in:
Arnaud Le Blanc 2008-09-20 22:12:43 +00:00
parent b6a4094c03
commit a7279c4457
2 changed files with 17 additions and 1 deletions

View File

@ -31,4 +31,20 @@ int main(int argc, char *argv[])
], [
AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe])
])
AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <sys/utsname.h>
],[
return sizeof(((struct utsname *)0)->domainname);
],[
ac_cv_have_utsname_domainname=yes
],[
ac_cv_have_utsname_domainname=no
])
])
if test ac_cv_have_utsname_domainname=yes; then
AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname])
fi
fi

View File

@ -667,7 +667,7 @@ PHP_FUNCTION(posix_uname)
add_assoc_string(return_value, "version", u.version, 1);
add_assoc_string(return_value, "machine", u.machine, 1);
#if defined(_GNU_SOURCE) && !defined(DARWIN)
#if defined(_GNU_SOURCE) && !defined(DARWIN) && defined(HAVE_UTSNAME_DOMAINNAME)
add_assoc_string(return_value, "domainname", u.domainname, 1);
#endif
}