Date: 09/20/99
- Next message: Thies C. Arntzen: "[PHP-DEV] cvs: /phpdoc/functions array.sgml"
- Previous message: andras.pali <email protected>: "[PHP-DEV] Bug #2332: php_ODBC.dll is missing from the binary distribution 3.0.11"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
bjh Mon Sep 20 06:10:06 1999 EDT
Modified files:
/php3 config.h.in configure.in
/php3/functions posix.c
Log:
Make posix module work on OS/2 again by conditionally compiling functions
that aren't available. Functions affected are setsid(), ctermid() & mkfifo().
Index: php3/config.h.in
diff -u php3/config.h.in:1.194 php3/config.h.in:1.195
--- php3/config.h.in:1.194 Fri Sep 17 13:43:11 1999
+++ php3/config.h.in Mon Sep 20 06:10:05 1999
@@ -407,15 +407,18 @@
#define HAVE_POSIX 0
-/* The number of bytes in a int. */
-#undef SIZEOF_INT
-
/* The number of bytes in a long. */
#undef SIZEOF_LONG
+/* The number of bytes in a int. */
+#undef SIZEOF_INT
+
/* Define if you have the crypt function. */
#undef HAVE_CRYPT
+/* Define if you have the ctermid function. */
+#undef HAVE_CTERMID
+
/* Define if you have the cuserid function. */
#undef HAVE_CUSERID
@@ -461,6 +464,9 @@
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
+/* Define if you have the mkfifo function. */
+#undef HAVE_MKFIFO
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -478,6 +484,9 @@
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
+
+/* Define if you have the setsid function. */
+#undef HAVE_SETSID
/* Define if you have the setsockopt function. */
#undef HAVE_SETSOCKOPT
Index: php3/configure.in
diff -u php3/configure.in:1.462 php3/configure.in:1.463
--- php3/configure.in:1.462 Thu Sep 16 13:20:14 1999
+++ php3/configure.in Mon Sep 20 06:10:05 1999
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.462 1999/09/16 17:20:14 musone Exp $
+dnl $Id: configure.in,v 1.463 1999/09/20 10:10:05 bjh Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
@@ -243,7 +243,7 @@
dnl Checks for library functions.
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton shutdown truncate getpgid getsid getrlimit snprintf)
+AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton shutdown truncate getpgid getsid getrlimit snprintf ctermid setsid mkfifo)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
AC_BROKEN_SPRINTF
Index: php3/functions/posix.c
diff -u php3/functions/posix.c:1.11 php3/functions/posix.c:1.12
--- php3/functions/posix.c:1.11 Sun Sep 12 13:19:56 1999
+++ php3/functions/posix.c Mon Sep 20 06:10:06 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: posix.c,v 1.11 1999/09/12 17:19:56 kk Exp $ */
+/* $Id: posix.c,v 1.12 1999/09/20 10:10:06 bjh Exp $ */
#include "php.h"
@@ -55,6 +55,11 @@
#include <pwd.h>
#include "php3_list.h"
+/* OS/2's gcc defines _POSIX_PATH_MAX but not PATH_MAX */
+#if !defined(PATH_MAX) && defined(_POSIX_PATH_MAX)
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
#define SAFE_STRING(s) ((s)?(s):"")
function_entry posix_functions[] = {
@@ -143,7 +148,7 @@
void php3_info_posix(void)
{
- php3_printf("$Revision: 1.11 $\n");
+ php3_printf("$Revision: 1.12 $\n");
}
/* {{{ proto int posix_kill(int pid, int sig)
@@ -347,10 +352,14 @@
Create session and set process group id (POSIX.1, 4.3.2) */
void php3_posix_setsid(INTERNAL_FUNCTION_PARAMETERS)
{
+#if HAVE_SETSID
pid_t sid;
sid = setsid();
RETURN_LONG(sid);
+#else
+ RETURN_FALSE;
+#endif
}
/* }}} */
@@ -495,6 +504,7 @@
Generate terminal path name (POSIX.1, 4.7.1) */
void php3_posix_ctermid(INTERNAL_FUNCTION_PARAMETERS)
{
+#if HAVE_CTERMID
char buffer[L_ctermid];
char *p;
@@ -506,6 +516,9 @@
}
RETURN_STRING(buffer, 1);
+#else
+ RETURN_FALSE;
+#endif
}
/* }}} */
@@ -590,6 +603,7 @@
Make a FIFO Special File (POSIX.1, 5.4.2) */
void php3_posix_mkfifo(INTERNAL_FUNCTION_PARAMETERS)
{
+#if HAVE_MKFIFO
pval *path;
pval *mode;
int result;
@@ -612,6 +626,9 @@
}
RETURN_TRUE;
+#else
+ RETURN_FALSE;
+#endif
}
/*
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Thies C. Arntzen: "[PHP-DEV] cvs: /phpdoc/functions array.sgml"
- Previous message: andras.pali <email protected>: "[PHP-DEV] Bug #2332: php_ODBC.dll is missing from the binary distribution 3.0.11"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

