[PHP-CVS] cvs: php-src /ext/posix config.m4 posix.c

2008-09-20 Thread Arnaud Le Blanc
lbarnaudSat Sep 20 22:12:31 2008 UTC

  Modified files:  
/php-src/ext/posix  config.m4 posix.c 
  Log:
  Fixed #46059 (Compile failure under IRIX 6.5.30 building posix.c)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/config.m4?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/posix/config.m4
diff -u php-src/ext/posix/config.m4:1.17 php-src/ext/posix/config.m4:1.18
--- php-src/ext/posix/config.m4:1.17Thu Mar  1 11:23:07 2007
+++ php-src/ext/posix/config.m4 Sat Sep 20 22:12:31 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.17 2007/03/01 11:23:07 tony2001 Exp $
+dnl $Id: config.m4,v 1.18 2008/09/20 22:12:31 lbarnaud Exp $
 dnl
 
 PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
@@ -31,4 +31,20 @@
   ], [
 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
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.102r2=1.103diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.102 php-src/ext/posix/posix.c:1.103
--- php-src/ext/posix/posix.c:1.102 Mon Jun 23 17:54:14 2008
+++ php-src/ext/posix/posix.c   Sat Sep 20 22:12:31 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.102 2008/06/23 17:54:14 felipe Exp $ */
+/* $Id: posix.c,v 1.103 2008/09/20 22:12:31 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -345,7 +345,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.102 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.103 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -666,7 +666,7 @@
add_assoc_string(return_value, release,  u.release,  1);
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
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/posix config.m4 posix.c

2007-01-05 Thread Sara Golemon
pollita Fri Jan  5 21:30:06 2007 UTC

  Modified files:  
/php-src/ext/posix  config.m4 posix.c 
  Log:
  Refix posix_ttyname(), test for a working implementation of ttyname_r() -- 
which BSD doesn't have
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/config.m4?r1=1.15r2=1.16diff_format=u
Index: php-src/ext/posix/config.m4
diff -u php-src/ext/posix/config.m4:1.15 php-src/ext/posix/config.m4:1.16
--- php-src/ext/posix/config.m4:1.15Thu Dec  7 01:41:29 2006
+++ php-src/ext/posix/config.m4 Fri Jan  5 21:30:06 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.15 2006/12/07 01:41:29 iliaa Exp $
+dnl $Id: config.m4,v 1.16 2007/01/05 21:30:06 pollita Exp $
 dnl
 
 PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
@@ -11,5 +11,22 @@
 
   AC_CHECK_HEADERS(sys/mkdev.h)
 
-  AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo 
mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r 
ttyname_r)
+  AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo 
mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r)
+
+  AC_MSG_CHECKING([for working ttyname_r() implementation])
+  AC_TRY_RUN([
+#include unistd.h
+
+int main(int argc, char *argv[])
+{
+   char buf[64];
+
+   return ttyname_r(0, buf, 64) ? 1 : 0;
+}
+  ],[
+AC_MSG_RESULT([yes])
+AC_DEFINE(HAVE_TTYNAME_R, 1, [Whether you have a working ttyname_r])
+  ],[
+AC_MSG_RESULT([no, posix_ttyname() will be thread-unsafe])
+  ])
 fi
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.86r2=1.87diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.86 php-src/ext/posix/posix.c:1.87
--- php-src/ext/posix/posix.c:1.86  Fri Jan  5 20:01:44 2007
+++ php-src/ext/posix/posix.c   Fri Jan  5 21:30:06 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.86 2007/01/05 20:01:44 pollita Exp $ */
+/* $Id: posix.c,v 1.87 2007/01/05 21:30:06 pollita Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -147,7 +147,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.86 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.87 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -575,12 +575,7 @@
fd = Z_LVAL_PP(z_fd);
}
 #if HAVE_TTYNAME_R
-#ifdef _SC_TTY_NAME_MAX
buflen = sysconf(_SC_TTY_NAME_MAX);
-#else
-   /* Arbitrary buffer size for systems which don't extrospect their tty 
name lengths, way overkill */
-   buflen = 64;
-#endif
p = emalloc(buflen);
 
if (ttyname_r(fd, p, buflen)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/posix config.m4 posix.c

2005-06-30 Thread Derick Rethans
derick  Thu Jun 30 06:03:38 2005 EDT

  Modified files:  
/php-src/ext/posix  config.m4 posix.c 
  Log:
  - Added check for makedev systemcall, which Netware doesn't support.
  
  
http://cvs.php.net/diff.php/php-src/ext/posix/config.m4?r1=1.10r2=1.11ty=u
Index: php-src/ext/posix/config.m4
diff -u php-src/ext/posix/config.m4:1.10 php-src/ext/posix/config.m4:1.11
--- php-src/ext/posix/config.m4:1.10Mon Jun  6 18:04:14 2005
+++ php-src/ext/posix/config.m4 Thu Jun 30 06:03:36 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.10 2005/06/06 22:04:14 wez Exp $
+dnl $Id: config.m4,v 1.11 2005/06/30 10:03:36 derick Exp $
 dnl
 
 PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
@@ -11,5 +11,5 @@
 
   AC_CHECK_HEADERS(sys/mkdev.h)
 
-  AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo 
mknod getrlimit getlogin getgroups)
+  AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo 
mknod getrlimit getlogin getgroups makdev)
 fi
http://cvs.php.net/diff.php/php-src/ext/posix/posix.c?r1=1.67r2=1.68ty=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.67 php-src/ext/posix/posix.c:1.68
--- php-src/ext/posix/posix.c:1.67  Mon Jun  6 18:04:14 2005
+++ php-src/ext/posix/posix.c   Thu Jun 30 06:03:36 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: posix.c,v 1.67 2005/06/06 22:04:14 wez Exp $ */
+/* $Id: posix.c,v 1.68 2005/06/30 10:03:36 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -143,7 +143,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, Revision, $Revision: 1.67 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.68 $);
php_info_print_table_end();
 }
 /* }}} */
@@ -698,7 +698,11 @@
expects argument 4 to be non-zero for 
POSIX_S_IFCHR and POSIX_S_IFBLK);
RETURN_FALSE;
} else {
+#ifdef HAVE_MAKEDEV
php_dev = makedev(major, minor);
+#else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Can not 
create a block or character device, creating a normal file instead);
+#endif
}
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php