summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorArnaud Le Blanc <lbarnaud@php.net>2008-09-20 22:12:43 +0000
committerArnaud Le Blanc <lbarnaud@php.net>2008-09-20 22:12:43 +0000
commita7279c4457b6c20ada05ea0ac61ba7074edf1598 (patch)
tree83596232649b62af2f6b0c8c776dfebd266fdce4 /ext/posix
parentb6a4094c030c74561b94b2c8004d969719e42d3e (diff)
downloadphp-git-a7279c4457b6c20ada05ea0ac61ba7074edf1598.tar.gz
MFH: Fixed #46059 (Compile failure under IRIX 6.5.30 building posix.c)
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/config.m416
-rw-r--r--ext/posix/posix.c2
2 files changed, 17 insertions, 1 deletions
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4
index f88e2615ff..ada08ce946 100644
--- a/ext/posix/config.m4
+++ b/ext/posix/config.m4
@@ -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
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 685d4e3942..4c7d90d58d 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -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
}