]> granicus.if.org Git - php/commitdiff
Modified for NetWare.
authorAnantha Kesari H Y <hyanantha@php.net>
Fri, 3 Jan 2003 14:37:42 +0000 (14:37 +0000)
committerAnantha Kesari H Y <hyanantha@php.net>
Fri, 3 Jan 2003 14:37:42 +0000 (14:37 +0000)
ext/standard/exec.c
ext/standard/file.c
ext/standard/filestat.c
ext/standard/html.c
ext/standard/syslog.c

index 4b7bbfc699168acbb79628b222dee8844c8a2bd3..2ca6dc07cfa09204c63d71faa08eae9f18eaf966 100644 (file)
@@ -896,6 +896,18 @@ PHP_FUNCTION(proc_open)
        child = pi.hProcess;
        CloseHandle(pi.hThread);
 
+#elif defined(NETWARE)
+
+       /* clean up all the descriptors */
+       for (i = 0; i < ndesc; i++) {
+               close(descriptors[i].childend);
+               close(descriptors[i].parentend);
+       }
+
+       php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork not supported on NetWare");
+
+       goto exit_fail;
+
 #else
        /* the unix way */
 
index cd1042a56b41ca85a1acced7bd799090543cc2e8..ca87537691dfc21da4b84e9a12dc85ecd0873afd 100644 (file)
@@ -54,6 +54,7 @@
 #include "netware/param.h"
 #else
 #include <sys/param.h>
+#include <sys/select.h>
 #if defined(NETWARE) && defined(USE_WINSOCK)
 #include <novsock2.h>
 #else
@@ -1979,9 +1980,16 @@ PHP_NAMED_FUNCTION(php_if_fstat)
        MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); 
 #endif
        MAKE_LONG_ZVAL_INCREF(stat_size, stat_ssb.sb.st_size);
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+       MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime.tv_sec);
+       MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime.tv_sec);
+       MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime.tv_sec);
+#else
        MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime);
        MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime);
        MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime);
+#endif
+
 #ifdef HAVE_ST_BLKSIZE
        MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_ssb.sb.st_blksize); 
 #else
index d3a056568f689cd68e0d291c0fe55812647e68b9..aa5e2ebda7c687ea0dfd5a45f335b3d473815298 100644 (file)
@@ -664,26 +664,30 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
        case FS_INODE:
                RETURN_LONG((long)BG(sb).st_ino);
        case FS_SIZE:
+#if defined(NETWARE) && defined(NEW_LIBC)
+               RETURN_LONG((long)(stat_sb->st_size));
+#else
                RETURN_LONG((long)BG(sb).st_size);
+#endif
        case FS_OWNER:
                RETURN_LONG((long)BG(sb).st_uid);
        case FS_GROUP:
                RETURN_LONG((long)BG(sb).st_gid);
        case FS_ATIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_atime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_atime).tv_sec));
 #else
                RETURN_LONG((long)BG(sb).st_atime);
 #endif
        case FS_MTIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_mtime).tv_sec));
 #else
-       RETURN_LONG((long)BG(sb).st_mtime);
+               RETURN_LONG((long)BG(sb).st_mtime);
 #endif
        case FS_CTIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_ctime).tv_sec));
 #else
                RETURN_LONG((long)BG(sb).st_ctime);
 #endif
@@ -706,28 +710,25 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT);
                RETURN_STRING("unknown", 1);
        case FS_IS_W:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        RETURN_TRUE; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode & wmask) != 0);
        case FS_IS_R:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        RETURN_TRUE; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode&rmask)!=0);
        case FS_IS_X:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        xmask = S_IXROOT; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode&xmask)!=0 && !S_ISDIR(BG(sb).st_mode));
        case FS_IS_FILE:
                RETURN_BOOL(S_ISREG(BG(sb).st_mode));
@@ -762,9 +763,9 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
 #endif
                MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size);
 #if defined(NETWARE) && defined(NEW_LIBC)
-               MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_nsec);
-               MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_nsec);
-               MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_nsec);
+               MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_sec);
+               MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_sec);
+               MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_sec);
 #else
                MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime);
                MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime);
index 4e7d51be5985b593cc7f634bacf3df6b0de8e7c2..c784deec60ef8f4fda0b4df1afb4ede330f67604 100644 (file)
@@ -23,6 +23,8 @@
 #include "php.h"
 #if PHP_WIN32
 #include "config.w32.h"
+#elif defined NETWARE
+#include "config.nw.h"
 #else
 #include "php_config.h"
 #endif
index 39d57d66861f9db7ff90faadd915a761648e082d..14294fb3eb74867375ed1354046114d9685abf17 100644 (file)
@@ -75,7 +75,7 @@ PHP_MINIT_FUNCTION(syslog)
        /* AIX doesn't have LOG_AUTHPRIV */
        REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT);
 #endif
-#if !defined(PHP_WIN32)
+#if !defined(PHP_WIN32) && !defined(NETWARE)
        REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT);
@@ -159,7 +159,7 @@ static void start_syslog(TSRMLS_D)
        /* AIX doesn't have LOG_AUTHPRIV */
        SET_VAR_LONG("LOG_AUTHPRIV", LOG_AUTHPRIV);
 #endif
-#if !defined(PHP_WIN32)
+#if !defined(PHP_WIN32) && !defined(NETWARE)
        SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0);
        SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1);
        SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2);