Hi, Please find attached, the NetWare diff (text file) in the unified format taken using the command: cvs diff -uN.
When I attached the diff of the whole php5 project, my mails were bouncing. So, I have split it up manually and then sending the diff in two mails. The first part is attached below. Let me know of your observations on this and if we can check this into the php5 sources. Thanks, Ananth.
Index: TSRM/TSRM.c =================================================================== RCS file: /repository/TSRM/TSRM.c,v retrieving revision 1.55 diff -u -r1.55 TSRM.c --- TSRM/TSRM.c 14 Dec 2003 15:41:50 -0000 1.55 +++ TSRM/TSRM.c 3 Feb 2004 07:26:28 -0000 @@ -106,6 +106,18 @@ pth_init(); #elif defined(PTHREADS) pthread_key_create( &tls_key, 0 ); +#ifdef NETWARE + /* Anantha Kesari + * For NetWare we have made it such a way that TSRM is started twice when + * Apache 2 is reloaded. When Apache2 is restarted, TSRM is started only once. + * Due to this, pthread_key_create is called twice. First time when TSRM + * is unloaded, the value associated with the key doesn't get cleared properly + * though the value itself is freed up. So for safety, the pthread_setspecific + * call below clears this value every time the key is created. Without this call, + * Apache 2.0 would crash even when it is loading. + */ + pthread_setspecific(tls_key, 0); +#endif #elif defined(TSRM_ST) st_init(); st_key_create(&tls_key, 0); @@ -294,15 +306,6 @@ int hash_value; tsrm_tls_entry *thread_resources; -#ifdef NETWARE - /* The below if loop is added for NetWare to fix an abend while unloading PHP - * when an Apache unload command is issued on the system console. - * While exiting from PHP, at the end for some reason, this function is called - * with tsrm_tls_table = NULL. When this happened, the server abends when - * tsrm_tls_table is accessed since it is NULL. - */ - if(tsrm_tls_table) { -#endif if (!th_id) { #if defined(PTHREADS) /* Fast path for looking up the resources for the current @@ -365,9 +368,6 @@ * changes to the structure as we read it. */ TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); -#ifdef NETWARE - } /* if(tsrm_tls_table) */ -#endif } @@ -434,13 +434,6 @@ { #ifdef TSRM_WIN32 return GetCurrentThreadId(); -#elif defined(NETWARE) - /* There seems to be some problem with the LibC call: NXThreadGetId(). - * Due to this, the PHPMyAdmin application is abending in PHP calls. - * Used the call, kCurrentThread instead and it works fine. - */ -/* return NXThreadGetId(); */ - return kCurrentThread(); #elif defined(GNUPTH) return pth_self(); #elif defined(PTHREADS) @@ -451,6 +444,20 @@ return PIThread_getCurrent(); #elif defined(TSRM_ST) return st_thread_self(); +#elif defined(NETWARE) +/* Anantha Kesari. 20 Aug 2003. + * + * Apache 1.3 is Clib based and it creats the threads using Clib calls. + * PHP is LibC based and so here also we should use the Clib calls to + * get the ID for these threads. If not, there will be a mismatch in the + * threads created and its usage. This will lead to abend when complex scripts + * are run and also when multiple scripts are run simulataneously. + */ +#ifdef APACHE_2_BUILD + return NXThreadGetId(); +#else + return kCurrentThread(); +#endif #elif defined(BETHREADS) return find_thread(NULL); #endif @@ -461,24 +468,10 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void) { MUTEX_T mutexp; -#ifdef NETWARE -#ifndef USE_MPK - /* To use the Recursive Mutex Locking of LibC */ - long flags = NX_MUTEX_RECURSIVE; - NXHierarchy_t order = 0; - NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0); -#endif -#endif #ifdef TSRM_WIN32 mutexp = malloc(sizeof(CRITICAL_SECTION)); InitializeCriticalSection(mutexp); -#elif defined(NETWARE) -#ifdef USE_MPK - mutexp = kMutexAlloc((BYTE*)"PHP-TSRM"); -#else - mutexp = NXMutexAlloc(flags, order, &lockInfo); -#endif #elif defined(GNUPTH) mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); pth_mutex_init(mutexp); @@ -491,6 +484,17 @@ mutexp = PIPlatform_allocLocalMutex(); #elif defined(TSRM_ST) mutexp = st_mutex_new(); +#elif defined(NETWARE) +#ifdef USE_MPK + mutexp = kMutexAlloc((BYTE*)"PHP-TSRM"); +#else + /* To use the Recursive Mutex Locking of LibC */ + long flags = NX_MUTEX_RECURSIVE; + NXHierarchy_t order = 0; + NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0); + + mutexp = NXMutexAlloc(flags, order, &lockInfo); +#endif #elif defined(BETHREADS) mutexp = (beos_ben*)malloc(sizeof(beos_ben)); mutexp->ben = 0; @@ -510,12 +514,6 @@ #ifdef TSRM_WIN32 DeleteCriticalSection(mutexp); free(mutexp); -#elif defined(NETWARE) -#ifdef USE_MPK - kMutexFree(mutexp); -#else - NXMutexFree(mutexp); -#endif #elif defined(GNUPTH) free(mutexp); #elif defined(PTHREADS) @@ -527,6 +525,12 @@ PISync_delete(mutexp); #elif defined(TSRM_ST) st_mutex_destroy(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + kMutexFree(mutexp); +#else + NXMutexFree(mutexp); +#endif #elif defined(BETHREADS) delete_sem(mutexp->sem); free(mutexp); @@ -545,12 +549,6 @@ #ifdef TSRM_WIN32 EnterCriticalSection(mutexp); return 1; -#elif defined(NETWARE) -#ifdef USE_MPK - return kMutexLock(mutexp); -#else - return NXLock(mutexp); -#endif #elif defined(GNUPTH) return pth_mutex_acquire(mutexp, 0, NULL); #elif defined(PTHREADS) @@ -561,6 +559,12 @@ return PISync_lock(mutexp); #elif defined(TSRM_ST) return st_mutex_lock(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + return kMutexLock(mutexp); +#else + return NXLock(mutexp); +#endif #elif defined(BETHREADS) if (atomic_add(&mutexp->ben, 1) != 0) return acquire_sem(mutexp->sem); @@ -576,12 +580,6 @@ #ifdef TSRM_WIN32 LeaveCriticalSection(mutexp); return 1; -#elif defined(NETWARE) -#ifdef USE_MPK - return kMutexUnlock(mutexp); -#else - return NXUnlock(mutexp); -#endif #elif defined(GNUPTH) return pth_mutex_release(mutexp); #elif defined(PTHREADS) @@ -592,6 +590,12 @@ return PISync_unlock(mutexp); #elif defined(TSRM_ST) return st_mutex_unlock(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + return kMutexUnlock(mutexp); +#else + return NXUnlock(mutexp); +#endif #elif defined(BETHREADS) if (atomic_add(&mutexp->ben, -1) != 1) return release_sem(mutexp->sem); Index: TSRM/TSRM.h =================================================================== RCS file: /repository/TSRM/TSRM.h,v retrieving revision 1.43 diff -u -r1.43 TSRM.h --- TSRM/TSRM.h 3 Dec 2003 14:26:41 -0000 1.43 +++ TSRM/TSRM.h 3 Feb 2004 07:26:28 -0000 @@ -42,6 +42,12 @@ # endif # include <windows.h> # include <shellapi.h> +#elif defined(GNUPTH) +# include <pth.h> +#elif defined(PTHREADS) +# include <pthread.h> +#elif defined(TSRM_ST) +# include <st.h> #elif defined(NETWARE) # include <nks/thread.h> #ifdef USE_MPK @@ -49,12 +55,6 @@ #else # include <nks/synch.h> #endif -#elif defined(GNUPTH) -# include <pth.h> -#elif defined(PTHREADS) -# include <pthread.h> -#elif defined(TSRM_ST) -# include <st.h> #elif defined(BETHREADS) #include <kernel/OS.h> #include <TLS.h> @@ -66,13 +66,6 @@ #ifdef TSRM_WIN32 # define THREAD_T DWORD # define MUTEX_T CRITICAL_SECTION * -#elif defined(NETWARE) -# define THREAD_T NXThreadId_t -#ifdef USE_MPK -# define MUTEX_T MUTEX -#else -# define MUTEX_T NXMutex_t * -#endif #elif defined(GNUPTH) # define THREAD_T pth_t # define MUTEX_T pth_mutex_t * @@ -88,6 +81,13 @@ #elif defined(TSRM_ST) # define THREAD_T st_thread_t # define MUTEX_T st_mutex_t +#elif defined(NETWARE) +# define THREAD_T NXThreadId_t +#ifdef USE_MPK +# define MUTEX_T MUTEX +#else +# define MUTEX_T NXMutex_t * +#endif #elif defined(BETHREADS) # define THREAD_T thread_id typedef struct { Index: TSRM/acconfig.h =================================================================== RCS file: /repository/TSRM/acconfig.h,v retrieving revision 1.3 diff -u -r1.3 acconfig.h --- TSRM/acconfig.h 24 Sep 1999 20:52:46 -0000 1.3 +++ TSRM/acconfig.h 3 Feb 2004 07:26:28 -0000 @@ -1 +1,24 @@ +/* Anantha Kesari. 20 Aug 2003. + * + * Define PTHREADS only for Apache 2 and not for Apache 1.3. + * This is because the former is LibC based and everything works fine in that case. + * The latter is Clib based and so the thread calls will change if we use PTHREADS + * and the server abends if we use PTHREADS in PHP for Apache 1.3. + * + * Explanation: + * + * In the case of Apache 1.3, pthread_self always returns 0 due to mismatch in + * the function calls used to create the treads and getting the IDs for them. + * (Threads are created by Apache 1.3 using Clib calls whereas LibC's PTHREAD call + * is used to get the ID for these threads). + * Now, using this thread specific ID returned by pthread_self, we store some + * thread specific data into different hash tables. When we execute multiple scripts + * simultaneously, since the ID is always 0, one thread reads/writs data from/into + * another thread's data area. + * This causes the server to abend. + */ +#ifdef APACHE_2_BUILD +#define PTHREADS +#else #undef PTHREADS +#endif Index: TSRM/tsrm_virtual_cwd.c =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.60 diff -u -r1.60 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 8 Jan 2004 08:14:03 -0000 1.60 +++ TSRM/tsrm_virtual_cwd.c 3 Feb 2004 07:26:28 -0000 @@ -42,7 +42,6 @@ #endif #ifdef NETWARE -/*#include "pipe.h"*/ #include "tsrm_nw.h" #endif @@ -100,10 +99,12 @@ (len == 1 && element[0] == '.') #elif defined(NETWARE) -/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows -- - but rest of the stuff is like Unix */ -/* strtok() call in LibC is abending when used in a different address space -- hence using - PHP's version itself for now */ +/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows. + * But rest of the stuff is like Unix + */ +/* strtok() call in LibC is abending when used in a different address space. + * Hence using PHP's version itself for now + */ /*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/ #define TOKENIZER_STRING "/\\" @@ -139,18 +140,16 @@ #define CWD_STATE_FREE(s) \ free((s)->cwd); - -static int php_is_dir_ok(const cwd_state *state) + +static int php_is_dir_ok(const cwd_state *state) { -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc buf; +#else struct stat buf; +#endif if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) -#else - struct stat_libc buf; - - if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode)) -#endif return (0); return (1); @@ -158,15 +157,13 @@ static int php_is_file_ok(const cwd_state *state) { -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc buf; +#else struct stat buf; +#endif if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) -#else - struct stat_libc buf; - - if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode)) -#endif return (0); return (1); @@ -373,6 +370,9 @@ #ifdef TSRM_WIN32 } else if (IS_SLASH(path_copy[0])) { copy_amount = 2; +#elif defined(NETWARE) + } else if (IS_SLASH(path_copy[0])) { + copy_amount = 4; /* This is the size of the string "sys:" which is 4 */ #endif } @@ -693,8 +693,11 @@ return retval; } -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) +CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC) +#else CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) +#endif { cwd_state new_state; int retval; @@ -707,21 +710,6 @@ CWD_STATE_FREE(&new_state); return retval; } -#else -CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - retval = stat(new_state.cwd, (struct stat*)buf); - - CWD_STATE_FREE(&new_state); - return retval; -} -#endif #if !defined(TSRM_WIN32) && !defined(NETWARE) CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) @@ -811,8 +799,8 @@ #elif defined(NETWARE) -/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform - a VCWD_CHDIR() and mutex it +/* On NetWare, the trick of prepending "cd cwd;" doesn't work. + * So we need to perform a VCWD_CHDIR() and mutex it. */ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) { Index: TSRM/tsrm_virtual_cwd.h =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v retrieving revision 1.42 diff -u -r1.42 tsrm_virtual_cwd.h --- TSRM/tsrm_virtual_cwd.h 8 Jan 2004 17:31:46 -0000 1.42 +++ TSRM/tsrm_virtual_cwd.h 3 Feb 2004 07:26:29 -0000 @@ -141,10 +141,10 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); -#else +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC); +#else +CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); #endif #if !defined(TSRM_WIN32) && !defined(NETWARE) CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); Index: Zend/zend.h =================================================================== RCS file: /repository/ZendEngine2/zend.h,v retrieving revision 1.232 diff -u -r1.232 zend.h --- Zend/zend.h 8 Jan 2004 17:31:47 -0000 1.232 +++ Zend/zend.h 3 Feb 2004 07:26:29 -0000 @@ -46,6 +46,7 @@ #elif defined(NETWARE) # include "zend_config.nw.h" # include "acconfig.h" +# define ZEND_PATHS_SEPARATOR ';' #elif defined(__riscos__) # include "zend_config.h" # define ZEND_PATHS_SEPARATOR ';' Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.235 diff -u -r1.235 zend_API.c --- Zend/zend_API.c 19 Jan 2004 00:39:29 -0000 1.235 +++ Zend/zend_API.c 3 Feb 2004 07:26:31 -0000 @@ -1382,10 +1382,23 @@ } #if HAVE_LIBDL +#if (!defined (NETWARE) || !defined (APACHE_1_BUILD)) + /* For NetWare: + * Anantha Kesari. 31 July 2003. Unload Apache issue. + * + * When Apache is unloaded, it calls dlclose on all the PHP extensions + * that are loaded in memory. In the case of Apache 1.3, this call is hanging + * and is not unloading the PHP extensions and in turn hangs the system. + * As a work around, this call is bypassed for Apache 1.3 build on NetWare only. + * This means that none of the loaded PHP extensions are unloaded. + * They will have to be manually unloaded before re-loading Apache (1.3) again. + * On Apache 2 build on NetWare and on other platforms, dlclose will be called. + */ if (module->handle) { dlclose(module->handle); } #endif +#endif } Index: Zend/zend_arg_defs.c =================================================================== RCS file: /repository/ZendEngine2/zend_arg_defs.c,v retrieving revision 1.1 diff -u -r1.1 zend_arg_defs.c --- Zend/zend_arg_defs.c 31 Aug 2003 12:38:50 -0000 1.1 +++ Zend/zend_arg_defs.c 3 Feb 2004 07:26:31 -0000 @@ -1,3 +1,7 @@ +#ifdef NETWARE +#include "zend_api.h" +#endif + ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0) ZEND_ARG_PASS_INFO(1) ZEND_END_ARG_INFO(); Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.584 diff -u -r1.584 zend_execute.c --- Zend/zend_execute.c 19 Jan 2004 12:22:02 -0000 1.584 +++ Zend/zend_execute.c 3 Feb 2004 07:26:34 -0000 @@ -1260,6 +1260,17 @@ } #endif +#ifdef NETWARE + /* K Murugan. 13 Nove 2003 + * Stack limit will be checked while executing the script. + * nw_stack_limit flag will be set by the php_printf function, + * if that is called recursively like a while loop script. + */ + if (EG(nw_stack_limit) || (stackavail() <= 2048)) { + zend_nw_stack_limit(0); + } +#endif + zend_clean_garbage(TSRMLS_C); if (EX(opline)->handler(&execute_data, op_array TSRMLS_CC)) { return; Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.251 diff -u -r1.251 zend_execute_API.c --- Zend/zend_execute_API.c 18 Jan 2004 23:47:10 -0000 1.251 +++ Zend/zend_execute_API.c 3 Feb 2004 07:26:35 -0000 @@ -49,6 +49,10 @@ static int timeout_thread_initialized=0; #endif +#ifdef NETWARE +ZEND_API void zend_nw_stack_limit(int dummy); +#endif + #if ZEND_DEBUG static void (*original_sigsegv_handler)(int); @@ -174,10 +178,15 @@ zend_objects_store_init(&EG(objects_store), 1024); EG(full_tables_cleanup) = 0; + #ifdef ZEND_WIN32 EG(timed_out) = 0; #endif +#ifdef NETWARE + EG(nw_stack_limit) = 0; +#endif + EG(exception) = NULL; EG(scope) = NULL; @@ -986,6 +995,16 @@ } +#ifdef NETWARE +/* K Murugan 13 Nov 2003 */ +ZEND_API void zend_nw_stack_limit(int dummy) +{ + TSRMLS_FETCH(); + zend_error(E_ERROR, "Stack limit exceeded"); +} +#endif + + #ifdef ZEND_WIN32 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { Index: Zend/zend_globals.h =================================================================== RCS file: /repository/ZendEngine2/zend_globals.h,v retrieving revision 1.131 diff -u -r1.131 zend_globals.h --- Zend/zend_globals.h 10 Jan 2004 11:43:42 -0000 1.131 +++ Zend/zend_globals.h 3 Feb 2004 07:26:35 -0000 @@ -203,6 +203,10 @@ zend_bool timed_out; #endif +#ifdef NETWARE + zend_bool nw_stack_limit; +#endif + HashTable regular_list; HashTable persistent_list; Index: Zend/zend_modules.h =================================================================== RCS file: /repository/ZendEngine2/zend_modules.h,v retrieving revision 1.56 diff -u -r1.56 zend_modules.h --- Zend/zend_modules.h 8 Jan 2004 17:31:48 -0000 1.56 +++ Zend/zend_modules.h 3 Feb 2004 07:26:36 -0000 @@ -31,11 +31,20 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC +#ifdef NETWARE +/* To avoid compilation errors */ +struct _zend_arg_info first_arg_force_ref[2]; +struct _zend_arg_info second_arg_force_ref[3]; +struct _zend_arg_info third_arg_force_ref[4]; +struct _zend_arg_info fourth_arg_force_ref[5]; +struct _zend_arg_info all_args_by_ref[1]; +#else /* NETWARE */ extern struct _zend_arg_info first_arg_force_ref[2]; extern struct _zend_arg_info second_arg_force_ref[3]; extern struct _zend_arg_info third_arg_force_ref[4]; extern struct _zend_arg_info fourth_arg_force_ref[5]; extern struct _zend_arg_info all_args_by_ref[1]; +#endif #define ZEND_MODULE_API_NO 20020429 #ifdef ZTS Index: Zend/zend_static_allocator.c =================================================================== RCS file: /repository/ZendEngine2/zend_static_allocator.c,v retrieving revision 1.12 diff -u -r1.12 zend_static_allocator.c --- Zend/zend_static_allocator.c 8 Jan 2004 17:31:48 -0000 1.12 +++ Zend/zend_static_allocator.c 3 Feb 2004 07:26:36 -0000 @@ -20,6 +20,11 @@ #include "zend_static_allocator.h" +#ifdef NETWARE +/* Anantha Kesari 7 Jan 2004 */ +#include <stddef.h> /* To define NULL */ +#endif + /* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ inline static void block_init(Block *block, zend_uint block_size) Index: ext/ldap/ldap.c =================================================================== RCS file: /repository/php-src/ext/ldap/ldap.c,v retrieving revision 1.150 diff -u -r1.150 ldap.c --- ext/ldap/ldap.c 8 Jan 2004 08:15:55 -0000 1.150 +++ ext/ldap/ldap.c 3 Feb 2004 07:26:40 -0000 @@ -477,7 +477,14 @@ ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); +#ifdef NETWARE + /* The function ldap_bind_s has been deprecated on NetWare. If used on NetWare, + * it gives the result, but also displays warning messages. + */ + if ((rc = ldap_simple_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw)) != LDAP_SUCCESS) { +#else if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) { +#endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); RETURN_FALSE; } else { Index: ext/ldap/ldap.mak =================================================================== RCS file: /repository/php-src/ext/ldap/ldap.mak,v retrieving revision 1.4 diff -u -r1.4 ldap.mak --- ext/ldap/ldap.mak 17 Jan 2004 12:59:30 -0000 1.4 +++ ext/ldap/ldap.mak 3 Feb 2004 07:26:41 -0000 @@ -5,7 +5,7 @@ # Module details MODULE_NAME = php_ldap MODULE_DESC = "PHP 5 - LDAP Extension" -VMAJ = 3 +VMAJ = 1 VMIN = 0 VREV = 0 @@ -53,6 +53,7 @@ C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) C_FLAGS += -I$(LDAP_DIR)/inc +C_FLAGS += -I$(SDK_DIR)/include/winsock C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include ifndef STACK_SIZE @@ -62,12 +63,12 @@ # Extra stuff based on debug / release builds ifeq '$(BUILD)' 'debug' SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON + C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON C_FLAGS += -exc cw -DZEND_DEBUG=1 LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off C_FLAGS += -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off @@ -76,12 +77,12 @@ # Dependencies MODULE = LibC \ - ldapsdk \ + lldapsdk \ phplib IMPORT = @$(SDK_DIR)/imports/libc.imp \ @$(SDK_DIR)/imports/ws2nlm.imp \ @$(MPK_DIR)/import/mpkOrg.imp \ - @$(LDAP_DIR)/lib/nlm/Ldapsdk.imp \ + @$(LDAP_DIR)/imports/lldapsdk.imp \ @$(PROJECT_ROOT)/netware/phplib.imp EXPORT = ($(MODULE_NAME)) get_module API = OutputToScreen Index: ext/mysql/mysql.mak =================================================================== RCS file: /repository/php-src/ext/mysql/mysql.mak,v retrieving revision 1.4 diff -u -r1.4 mysql.mak --- ext/mysql/mysql.mak 6 Jan 2003 09:05:59 -0000 1.4 +++ ext/mysql/mysql.mak 3 Feb 2004 07:26:42 -0000 @@ -4,8 +4,8 @@ # Module details MODULE_NAME = phpmysql -MODULE_DESC = "PHP 4.3 - MySQL Extension" -VMAJ = 3 +MODULE_DESC = "PHP 5 - MySQL Extension" +VMAJ = 1 VMIN = 0 VREV = 0 @@ -47,7 +47,7 @@ endif # Compile flags -C_FLAGS = -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium +C_FLAGS += -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium C_FLAGS += -nostdinc -nosyspath C_FLAGS += -relax_pointers # To remove type-casting errors C_FLAGS += -DNETWARE -DZTS -DNEW_LIBC -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_MYSQL=1 @@ -67,7 +67,7 @@ LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib Index: ext/pgsql/pgsql.mak =================================================================== RCS file: /repository/php-src/ext/pgsql/pgsql.mak,v retrieving revision 1.2 diff -u -r1.2 pgsql.mak --- ext/pgsql/pgsql.mak 6 Jan 2003 09:05:03 -0000 1.2 +++ ext/pgsql/pgsql.mak 3 Feb 2004 07:26:42 -0000 @@ -4,8 +4,8 @@ # Module details MODULE_NAME = phppgsql -MODULE_DESC = "PHP 4.3 - PostgreSQL Extension" -VMAJ = 3 +MODULE_DESC = "PHP 5 - PostgreSQL Extension" +VMAJ = 1 VMIN = 0 VREV = 0 @@ -64,7 +64,7 @@ LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib Index: ext/session/mod_files.c =================================================================== RCS file: /repository/php-src/ext/session/mod_files.c,v retrieving revision 1.94 diff -u -r1.94 mod_files.c --- ext/session/mod_files.c 8 Jan 2004 08:17:23 -0000 1.94 +++ ext/session/mod_files.c 3 Feb 2004 07:26:43 -0000 @@ -181,7 +181,11 @@ DIR *dir; char dentry[sizeof(struct dirent) + MAXPATHLEN]; struct dirent *entry = (struct dirent *) &dentry; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc sbuf; +#else struct stat sbuf; +#endif char buf[MAXPATHLEN]; time_t now; int nrdels = 0; @@ -215,7 +219,11 @@ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ if (VCWD_STAT(buf, &sbuf) == 0 && +#if (defined(NETWARE) && defined(NEW_LIBC)) + (now - sbuf.st_mtime.tv_sec) > maxlifetime) { +#else (now - sbuf.st_mtime) > maxlifetime) { +#endif VCWD_UNLINK(buf); nrdels++; } @@ -303,7 +311,11 @@ PS_READ_FUNC(files) { long n; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc sbuf; +#else struct stat sbuf; +#endif PS_FILES_DATA; ps_files_open(data, key TSRMLS_CC); Index: ext/session/session.c =================================================================== RCS file: /repository/php-src/ext/session/session.c,v retrieving revision 1.382 diff -u -r1.382 session.c --- ext/session/session.c 9 Jan 2004 15:30:07 -0000 1.382 +++ ext/session/session.c 3 Feb 2004 07:26:44 -0000 @@ -844,7 +844,11 @@ static void last_modified(TSRMLS_D) { const char *path; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc sb; +#else struct stat sb; +#endif char buf[MAX_STR + 1]; path = SG(request_info).path_translated; @@ -855,7 +859,11 @@ #define LAST_MODIFIED "Last-Modified: " memcpy(buf, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1); +#if (defined(NETWARE) && defined(NEW_LIBC)) + strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &(sb.st_mtime.tv_sec)); +#else strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime); +#endif ADD_HEADER(buf); } } Index: ext/snmp/snmp.c =================================================================== RCS file: /repository/php-src/ext/snmp/snmp.c,v retrieving revision 1.90 diff -u -r1.90 snmp.c --- ext/snmp/snmp.c 8 Jan 2004 08:17:26 -0000 1.90 +++ ext/snmp/snmp.c 3 Feb 2004 07:26:45 -0000 @@ -40,13 +40,11 @@ #include "win32/time.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <sys/socket.h> #endif #include <errno.h> -/*#include <process.h>*/ #ifdef NEW_LIBC #include <sys/timeval.h> #else Index: ext/standard/basic_functions.c =================================================================== RCS file: /repository/php-src/ext/standard/basic_functions.c,v retrieving revision 1.653 diff -u -r1.653 basic_functions.c --- ext/standard/basic_functions.c 19 Jan 2004 19:01:17 -0000 1.653 +++ ext/standard/basic_functions.c 3 Feb 2004 07:26:48 -0000 @@ -50,10 +50,8 @@ #ifndef NETWARE #include <netdb.h> #else -/*#include "netware/env.h"*/ /* Temporary */ #ifdef NEW_LIBC /* Same headers hold good for Winsock and Berkeley sockets */ #include <netinet/in.h> -/*#include <arpa/inet.h>*/ #include <netdb.h> #else #include <sys/socket.h> Index: ext/standard/dl.c =================================================================== RCS file: /repository/php-src/ext/standard/dl.c,v retrieving revision 1.86 diff -u -r1.86 dl.c --- ext/standard/dl.c 8 Jan 2004 08:17:31 -0000 1.86 +++ ext/standard/dl.c 3 Feb 2004 07:26:48 -0000 @@ -173,8 +173,9 @@ get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, symbol_name); } - /* NetWare doesn't prepend '_' to symbol names; so the corresponding portion of code is also - not required for NetWare */ + /* NetWare doesn't prepend '_' to symbol names. So the corresponding portion of code is also + * not required for NetWare + */ #endif if (!get_module) { Index: ext/standard/exec.c =================================================================== RCS file: /repository/php-src/ext/standard/exec.c,v retrieving revision 1.109 diff -u -r1.109 exec.c --- ext/standard/exec.c 21 Jan 2004 16:57:13 -0000 1.109 +++ ext/standard/exec.c 3 Feb 2004 07:26:49 -0000 @@ -69,6 +69,29 @@ void (*sig_handler)(); #endif +#ifdef NETWARE + /* Anantha Kesari 16 July 2003 + * + * 1. system() and exec() functions were abending when unitialised / + * NULL value was passed to them like: + * system($notdefindedvar); OR exec($notdefindedvar); + * + * 2. system() and exec() functions were not returning proper error when + * empty string was passed to them like: + * system(""); OR exec(""); + * + * These are fixed below. + */ + if(!cmd) { + php_error(E_WARNING, "Uninitialised / NULL value passed to system() or exec() function"); + return -1; + } + if(*cmd==NULL) { + php_error(E_WARNING, "Empty string passed to system() or exec() function"); + return -1; + } +#endif + if (PG(safe_mode)) { if ((c = strchr(cmd, ' '))) { *c = '\0'; Index: ext/standard/file.c =================================================================== RCS file: /repository/php-src/ext/standard/file.c,v retrieving revision 1.378 diff -u -r1.378 file.c --- ext/standard/file.c 19 Jan 2004 18:40:39 -0000 1.378 +++ ext/standard/file.c 3 Feb 2004 07:26:50 -0000 @@ -48,7 +48,6 @@ #include "win32/param.h" #include "win32/winutil.h" #elif defined(NETWARE) && !defined(NEW_LIBC) -/*#include <ws2nlm.h>*/ #include <sys/socket.h> #include "netware/param.h" #else @@ -1518,7 +1517,7 @@ 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) +#if defined(NETWARE) && defined(NEW_LIBC) 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); Index: ext/standard/filestat.c =================================================================== RCS file: /repository/php-src/ext/standard/filestat.c,v retrieving revision 1.130 diff -u -r1.130 filestat.c --- ext/standard/filestat.c 8 Jan 2004 08:17:31 -0000 1.130 +++ ext/standard/filestat.c 3 Feb 2004 07:26:51 -0000 @@ -323,7 +323,7 @@ Change file group */ PHP_FUNCTION(chgrp) { -#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chgrp' won't be available on NetWare */ +#if !defined(WINDOWS) && !defined(NETWARE) /* 'chgrp' is not available on NetWare */ pval **filename, **group; gid_t gid; struct group *gr=NULL; @@ -371,7 +371,7 @@ Change file owner */ PHP_FUNCTION(chown) { -#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chown' won't be available on NetWare */ +#if !defined(WINDOWS) && !defined(NETWARE) /* 'chown' is not available on NetWare */ pval **filename, **user; int ret; uid_t uid; @@ -627,11 +627,26 @@ } #endif + /* Comments for NetWare. + * Anantha Kesari 2 Feb 2004 + * + * In the many calls below, the LibC's stat structure is used. + * This is to avoid problems in STAT functions like filesize, is_file, + * is_dir, is_readable, is_writable etc. + */ switch (type) { case FS_PERMS: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_LONG((long)(stat_sb->st_mode)); +#else RETURN_LONG((long)ssb.sb.st_mode); +#endif case FS_INODE: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_LONG((long)(stat_sb->st_ino)); +#else RETURN_LONG((long)ssb.sb.st_ino); +#endif case FS_SIZE: #if defined(NETWARE) && defined(NEW_LIBC) RETURN_LONG((long)(stat_sb->st_size)); @@ -639,9 +654,17 @@ RETURN_LONG((long)ssb.sb.st_size); #endif case FS_OWNER: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_LONG((long)(stat_sb->st_uid)); +#else RETURN_LONG((long)ssb.sb.st_uid); +#endif case FS_GROUP: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_LONG((long)(stat_sb->st_gid)); +#else RETURN_LONG((long)ssb.sb.st_gid); +#endif case FS_ATIME: #if defined(NETWARE) && defined(NEW_LIBC) RETURN_LONG((long)((stat_sb->st_atime).tv_sec)); @@ -661,10 +684,18 @@ RETURN_LONG((long)ssb.sb.st_ctime); #endif case FS_TYPE: +#if (defined(NETWARE) && defined(NEW_LIBC)) + if (S_ISLNK(stat_sb->st_mode)) { +#else if (S_ISLNK(ssb.sb.st_mode)) { +#endif RETURN_STRING("link", 1); } +#if (defined(NETWARE) && defined(NEW_LIBC)) + switch((stat_sb->st_mode) & S_IFMT) { +#else switch(ssb.sb.st_mode & S_IFMT) { +#endif case S_IFIFO: RETURN_STRING("fifo", 1); case S_IFCHR: RETURN_STRING("char", 1); case S_IFDIR: RETURN_STRING("dir", 1); @@ -677,17 +708,41 @@ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT); RETURN_STRING("unknown", 1); case FS_IS_W: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL(((stat_sb->st_mode) & wmask) != 0); +#else RETURN_BOOL((ssb.sb.st_mode & wmask) != 0); +#endif case FS_IS_R: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL(((stat_sb->st_mode) & rmask) != 0); +#else RETURN_BOOL((ssb.sb.st_mode&rmask)!=0); +#endif case FS_IS_X: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL((((stat_sb->st_mode) & xmask) != 0) && (!S_ISDIR(stat_sb->st_mode))); +#else RETURN_BOOL((ssb.sb.st_mode&xmask)!=0 && !S_ISDIR(ssb.sb.st_mode)); +#endif case FS_IS_FILE: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL(S_ISREG(stat_sb->st_mode)); +#else RETURN_BOOL(S_ISREG(ssb.sb.st_mode)); +#endif case FS_IS_DIR: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL(S_ISDIR(stat_sb->st_mode)); +#else RETURN_BOOL(S_ISDIR(ssb.sb.st_mode)); +#endif case FS_IS_LINK: +#if (defined(NETWARE) && defined(NEW_LIBC)) + RETURN_BOOL(S_ISLNK(stat_sb->st_mode)); +#else RETURN_BOOL(S_ISLNK(ssb.sb.st_mode)); +#endif case FS_EXISTS: RETURN_TRUE; /* the false case was done earlier */ case FS_LSTAT: Index: ext/standard/ftp_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/ftp_fopen_wrapper.c,v retrieving revision 1.71 diff -u -r1.71 ftp_fopen_wrapper.c --- ext/standard/ftp_fopen_wrapper.c 8 Jan 2004 08:17:32 -0000 1.71 +++ ext/standard/ftp_fopen_wrapper.c 3 Feb 2004 07:26:51 -0000 @@ -36,8 +36,6 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include <ws2nlm.h>*/ -/*#include <sys/socket.h>*/ #ifdef NEW_LIBC #include <sys/param.h> #else @@ -57,7 +55,6 @@ #ifdef PHP_WIN32 #include <winsock2.h> #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <netinet/in.h> Index: ext/standard/http_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/http_fopen_wrapper.c,v retrieving revision 1.80 diff -u -r1.80 http_fopen_wrapper.c --- ext/standard/http_fopen_wrapper.c 8 Jan 2004 08:17:32 -0000 1.80 +++ ext/standard/http_fopen_wrapper.c 3 Feb 2004 07:26:52 -0000 @@ -38,8 +38,6 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include <ws2nlm.h>*/ -/*#include <sys/socket.h>*/ #ifdef NEW_LIBC #include <sys/param.h> #else @@ -59,7 +57,6 @@ #ifdef PHP_WIN32 #include <winsock2.h> #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <netinet/in.h> Index: ext/standard/iptc.c =================================================================== RCS file: /repository/php-src/ext/standard/iptc.c,v retrieving revision 1.45 diff -u -r1.45 iptc.c --- ext/standard/iptc.c 8 Jan 2004 08:17:33 -0000 1.45 +++ ext/standard/iptc.c 3 Feb 2004 07:26:52 -0000 @@ -182,7 +182,11 @@ unsigned int marker; unsigned int spool = 0, done = 0, inx, len; unsigned char *spoolbuf=0, *poi=0; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc sb; +#else struct stat sb; +#endif switch(ZEND_NUM_ARGS()){ case 3: Index: ext/standard/microtime.c =================================================================== RCS file: /repository/php-src/ext/standard/microtime.c,v retrieving revision 1.44 diff -u -r1.44 microtime.c --- ext/standard/microtime.c 8 Jan 2004 08:17:33 -0000 1.44 +++ ext/standard/microtime.c 3 Feb 2004 07:26:53 -0000 @@ -28,6 +28,7 @@ #elif defined(NETWARE) #ifdef NEW_LIBC #include <sys/timeval.h> +#include <sys/time.h> #else #include "netware/time_nw.h" #endif Index: ext/standard/pack.c =================================================================== RCS file: /repository/php-src/ext/standard/pack.c,v retrieving revision 1.51 diff -u -r1.51 pack.c --- ext/standard/pack.c 8 Jan 2004 08:17:33 -0000 1.51 +++ ext/standard/pack.c 3 Feb 2004 07:26:53 -0000 @@ -30,7 +30,6 @@ #include "win32/param.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <sys/socket.h> Index: ext/standard/pageinfo.c =================================================================== RCS file: /repository/php-src/ext/standard/pageinfo.c,v retrieving revision 1.37 diff -u -r1.37 pageinfo.c --- ext/standard/pageinfo.c 8 Jan 2004 08:17:33 -0000 1.37 +++ ext/standard/pageinfo.c 3 Feb 2004 07:26:53 -0000 @@ -78,7 +78,7 @@ BG(page_gid) = pstat->st_gid; BG(page_inode) = pstat->st_ino; #if defined(NETWARE) && defined(NEW_LIBC) - BG(page_mtime) = (pstat->st_mtime).tv_nsec; + BG(page_mtime) = (pstat->st_mtime).tv_sec; #else BG(page_mtime) = pstat->st_mtime; #endif Index: ext/standard/streamsfuncs.c =================================================================== RCS file: /repository/php-src/ext/standard/streamsfuncs.c,v retrieving revision 1.32 diff -u -r1.32 streamsfuncs.c --- ext/standard/streamsfuncs.c 8 Jan 2004 08:17:34 -0000 1.32 +++ ext/standard/streamsfuncs.c 3 Feb 2004 07:26:54 -0000 @@ -31,6 +31,11 @@ #include "php_network.h" #include "php_string.h" +/* Additional headers for NetWare */ +#if defined(NETWARE) && defined(NEW_LIBC) && !defined(USE_WINSOCK) +#include <sys/select.h> +#endif + #ifndef PHP_WIN32 #define php_select(m, r, w, e, t) select(m, r, w, e, t) #else Index: ext/xml/xml.mak =================================================================== RCS file: /repository/php-src/ext/xml/xml.mak,v retrieving revision 1.3 diff -u -r1.3 xml.mak --- ext/xml/xml.mak 17 Jan 2004 12:59:55 -0000 1.3 +++ ext/xml/xml.mak 3 Feb 2004 07:26:55 -0000 @@ -5,7 +5,7 @@ # Module details MODULE_NAME = php_xml MODULE_DESC = "PHP 5 - XML Extension" -VMAJ = 3 +VMAJ = 1 VMIN = 0 VREV = 0 @@ -61,12 +61,12 @@ # Extra stuff based on debug / release builds ifeq '$(BUILD)' 'debug' SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON + C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON C_FLAGS += -exc cw -DZEND_DEBUG=1 LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off C_FLAGS += -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off Index: main/SAPI.c =================================================================== RCS file: /repository/php-src/main/SAPI.c,v retrieving revision 1.182 diff -u -r1.182 SAPI.c --- main/SAPI.c 8 Jan 2004 08:17:53 -0000 1.182 +++ main/SAPI.c 3 Feb 2004 07:26:56 -0000 @@ -847,10 +847,18 @@ } } +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) +SAPI_API struct stat_libc *sapi_get_stat(TSRMLS_D) +#else SAPI_API struct stat *sapi_get_stat(TSRMLS_D) +#endif { if (sapi_module.get_stat) { +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + return ((struct stat_libc*)sapi_module.get_stat(TSRMLS_C)); +#else return sapi_module.get_stat(TSRMLS_C); +#endif } else { if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat)) == -1)) { return NULL; Index: main/SAPI.h =================================================================== RCS file: /repository/php-src/main/SAPI.h,v retrieving revision 1.108 diff -u -r1.108 SAPI.h --- main/SAPI.h 8 Jan 2004 17:33:04 -0000 1.108 +++ main/SAPI.h 3 Feb 2004 07:26:57 -0000 @@ -115,7 +115,11 @@ sapi_headers_struct sapi_headers; int read_post_bytes; unsigned char headers_sent; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc global_stat; +#else struct stat global_stat; +#endif char *default_mimetype; char *default_charset; HashTable *rfc1867_uploaded_files; @@ -184,7 +188,11 @@ SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)); SAPI_API int sapi_flush(TSRMLS_D); +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) +SAPI_API struct stat_libc *sapi_get_stat(TSRMLS_D); +#else SAPI_API struct stat *sapi_get_stat(TSRMLS_D); +#endif SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC); SAPI_API char *sapi_get_default_content_type(TSRMLS_D); @@ -211,7 +219,11 @@ int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); void (*flush)(void *server_context); +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc *(*get_stat)(TSRMLS_D); +#else struct stat *(*get_stat)(TSRMLS_D); +#endif char *(*getenv)(char *name, size_t name_len TSRMLS_DC); void (*sapi_error)(int type, const char *error_msg, ...); Index: main/config.nw.h =================================================================== RCS file: /repository/php-src/main/config.nw.h,v retrieving revision 1.6 diff -u -r1.6 config.nw.h --- main/config.nw.h 8 Jan 2004 17:33:04 -0000 1.6 +++ main/config.nw.h 3 Feb 2004 07:26:57 -0000 @@ -25,17 +25,18 @@ #define PHP_SIGCHILD 0 /* dns functions found in resolv.lib */ -#define HAVE_LIBBIND 1 +/*#define HAVE_LIBBIND 1*/ +#undef HAVE_LIBBIND /* This is Win32 stuff and so commented for NetWare */ #define HAVE_GETSERVBYNAME 1 #define HAVE_GETSERVBYPORT 1 #define HAVE_GETPROTOBYNAME 1 #define HAVE_GETPROTOBYNUMBER 1 -/* set to enable bcmath */ +/* set to enable BCMATH */ #define HAVE_BCMATH 1 -/* set to enable mysql */ +/* set to enable MySQL */ #define HAVE_MYSQL 1 /* set to enable FTP support */ @@ -44,6 +45,9 @@ /* set to enable SNMP */ /*#define HAVE_SNMP 1*/ +/* set to enable OpenSSL */ +/*#define HAVE_OPENSSL_EXT 1*/ + /* defines for PostgreSQL extension */ #define HAVE_PGSQL 1 #define PHP_PGSQL_PRIVATE 1 @@ -52,12 +56,15 @@ #define HAVE_PQCMDTUPLES 1 #define HAVE_PQOIDVALUE 1 +/* set to enable FTP support */ +#define HAVE_FTP 1 + /* set to enable bundled PCRE library */ #define HAVE_BUNDLED_PCRE 1 /* set to enable bundled expat library */ -/* #define HAVE_LIBEXPAT 1 */ /* For now */ -#define HAVE_WDDX 0 +/*#define HAVE_LIBEXPAT 1*/ /* Commented for now */ +#define HAVE_WDDX 0 /* Instead of 1 */ /* set to enable the crypt command */ /* #define HAVE_CRYPT 1 */ @@ -73,6 +80,9 @@ #define STDOUT_FILENO 1 #define STDERR_FILENO 2 +/* set to enable XML support */ +#define HAVE_XML 1 + /* ---------------------------------------------------------------- The following are defaults for run-time configuration ---------------------------------------------------------------*/ @@ -98,7 +108,7 @@ /* ---------------------------------------------------------------- The following may or may not be (or need to be) ported to the - windows environment. + NetWare environment. ---------------------------------------------------------------*/ /* Define if you have the link function. */ @@ -146,20 +156,22 @@ #undef HAVE_FLOCK /* Define if you have alloca, as a function or macro. */ -/* Though we have alloca(), this seems to be causing some problem with the stack pointer -- hence not using it */ +/* Though we have alloca(), this seems to be causing some problem with the stack pointer + * -- hence not using it + */ /* #define HAVE_ALLOCA 1 */ /* Define if you have <sys/time.h> */ -#undef HAVE_SYS_TIME_H +#define HAVE_SYS_TIME_H 1 /* Define if you have <signal.h> */ #define HAVE_SIGNAL_H 1 /* Define if your struct stat has st_blksize. */ -#define HAVE_ST_BLKSIZE +#define HAVE_ST_BLKSIZE 1 /* Define if your struct stat has st_blocks. */ -#define HAVE_ST_BLOCKS +#define HAVE_ST_BLOCKS 1 /* Define if your struct stat has st_rdev. */ #define HAVE_ST_RDEV 1 @@ -197,7 +209,7 @@ #define HAVE_REGCOMP 1 /* Define if you have the setlocale function. */ -/* #define HAVE_SETLOCALE 1 */ /* LibC doesn't seem to be supporting fully -- hence commenting for now */ +#define HAVE_SETLOCALE 1 #define HAVE_LOCALECONV 1 @@ -279,9 +291,9 @@ /* Defined since unsetenv function is defined in LibC. * This is used to destroy env values in the function php_putenv_destructor. - * If we do not use unsetenv, then the environment variables are directlt manipulated. - * This will then result in LibC not being able to do the maintenance - * that is required for NetWare. + * If we do not use unsetenv, then the environment variables are directlt + * manipulated. This will then result in LibC not being able to do + * the maintenance that is required for NetWare. */ #define HAVE_UNSETENV 1 @@ -295,7 +307,11 @@ /* This is the default configuration file to read */ #define CONFIGURATION_FILE_PATH "php.ini" +#ifdef APACHE_2_BUILD +#define APACHE_MODULE_DIR "sys:/apache2/modules" +#else #define APACHE_MODULE_DIR "sys:/apache/modules" +#endif #define PHP_BINDIR "sys:/php" #define PHP_LIBDIR PHP_BINDIR #define PHP_DATADIR PHP_BINDIR @@ -304,10 +320,12 @@ #define PHP_CONFIG_FILE_PATH "sys:/php" #define PEAR_INSTALLDIR "sys:/php/pear" -#define PHP_CONFIG_FILE_SCAN_DIR NULL +//#define PHP_CONFIG_FILE_SCAN_DIR NULL +#define PHP_CONFIG_FILE_SCAN_DIR "" #define PHP_EXTENSION_DIR "sys:/php/ext" -#define PHP_INCLUDE_PATH NULL +//#define PHP_INCLUDE_PATH NULL +#define PHP_INCLUDE_PATH ".;sys:/php/includes" #define PHP_PREFIX "sys:/php" #define PHP_SHLIB_SUFFIX "nlm" Index: main/fopen_wrappers.c =================================================================== RCS file: /repository/php-src/main/fopen_wrappers.c,v retrieving revision 1.168 diff -u -r1.168 fopen_wrappers.c --- main/fopen_wrappers.c 8 Jan 2004 08:17:53 -0000 1.168 +++ main/fopen_wrappers.c 3 Feb 2004 07:26:57 -0000 @@ -36,8 +36,6 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include <ws2nlm.h>*/ -/*#include <sys/socket.h>*/ #ifdef NEW_LIBC #include <sys/param.h> #else @@ -75,7 +73,6 @@ #ifdef PHP_WIN32 #include <winsock2.h> #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <netinet/in.h> @@ -281,7 +278,11 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) { FILE *fp; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc st; +#else struct stat st; +#endif char *path_info, *filename; int length; @@ -383,7 +384,11 @@ char *pathbuf, *ptr, *end; char *exec_fname; char trypath[MAXPATHLEN]; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc sb; +#else struct stat sb; +#endif FILE *fp; int path_length; int filename_length; Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.585 diff -u -r1.585 main.c --- main/main.c 8 Jan 2004 08:17:53 -0000 1.585 +++ main/main.c 3 Feb 2004 07:26:58 -0000 @@ -37,9 +37,6 @@ #else #include "netware/time_nw.h" #endif -/*#include "netware/signal_nw.h"*/ -/*#include "netware/env.h"*/ /* Temporary */ -/*#include <process.h>*/ #ifdef USE_WINSOCK #include <novsock2.h> #endif @@ -394,6 +391,15 @@ int size; TSRMLS_FETCH(); +#ifdef NETWARE + /* KMurugan 13 Nov 2003 + * While calling the php_printf function recursively, the stack_limit + * flag will be set, if stack is about to be overflowed. + */ + if (stackavail() <= 2048) { + EG(nw_stack_limit)=1; + } +#endif va_start(args, format); size = vspprintf(&buffer, 0, format, args); if (buffer) { Index: main/mergesort.c =================================================================== RCS file: /repository/php-src/main/mergesort.c,v retrieving revision 1.14 diff -u -r1.14 mergesort.c --- main/mergesort.c 19 Feb 2003 08:40:18 -0000 1.14 +++ main/mergesort.c 3 Feb 2004 07:26:59 -0000 @@ -67,7 +67,6 @@ #endif #if defined(NETWARE) && !defined(NEW_LIBC) -/*#include <ws2nlm.h>*/ #include <sys/socket.h> #endif Index: main/network.c =================================================================== RCS file: /repository/php-src/main/network.c,v retrieving revision 1.108 diff -u -r1.108 network.c --- main/network.c 8 Jan 2004 08:17:53 -0000 1.108 +++ main/network.c 3 Feb 2004 07:26:59 -0000 @@ -57,7 +57,6 @@ #if defined(NETWARE) #ifdef USE_WINSOCK -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else /* New headers for socket stuff */ Index: main/php.h =================================================================== RCS file: /repository/php-src/main/php.h,v retrieving revision 1.203 diff -u -r1.203 php.h --- main/php.h 12 Jan 2004 00:19:40 -0000 1.203 +++ main/php.h 3 Feb 2004 07:27:00 -0000 @@ -70,9 +70,9 @@ #ifdef NETWARE /* For php_get_uname() function */ #define PHP_UNAME "NetWare" -/* - * This is obtained using uname(2) on Unix and assigned in the case of Windows; - * we'll do it this way at least for now. + +/* The below is obtained using uname(2) on Unix and assigned in the case + * of Windows. On NetWare, we'll do it this way at least for now. */ #define PHP_OS PHP_UNAME #endif Index: main/php_open_temporary_file.c =================================================================== RCS file: /repository/php-src/main/php_open_temporary_file.c,v retrieving revision 1.29 diff -u -r1.29 php_open_temporary_file.c --- main/php_open_temporary_file.c 8 Jan 2004 08:17:54 -0000 1.29 +++ main/php_open_temporary_file.c 3 Feb 2004 07:27:00 -0000 @@ -31,7 +31,6 @@ #include "win32/winutil.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include <ws2nlm.h>*/ #include <novsock2.h> #else #include <sys/socket.h> Index: main/php_scandir.c =================================================================== RCS file: /repository/php-src/main/php_scandir.c,v retrieving revision 1.9 diff -u -r1.9 php_scandir.c --- main/php_scandir.c 8 Jan 2004 08:17:54 -0000 1.9 +++ main/php_scandir.c 3 Feb 2004 07:27:00 -0000 @@ -21,6 +21,8 @@ #ifdef PHP_WIN32 #include "config.w32.h" +#elif NETWARE +#include "config.nw.h" #else #include "php_config.h" #endif @@ -42,7 +44,9 @@ #endif #include <stdlib.h> +#ifndef NETWARE #include <search.h> +#endif #endif /* HAVE_SCANDIR */ Index: main/php_scandir.h =================================================================== RCS file: /repository/php-src/main/php_scandir.h,v retrieving revision 1.8 diff -u -r1.8 php_scandir.h --- main/php_scandir.h 8 Jan 2004 17:33:04 -0000 1.8 +++ main/php_scandir.h 3 Feb 2004 07:27:00 -0000 @@ -31,6 +31,8 @@ #ifdef PHP_WIN32 #include "config.w32.h" #include "win32/readdir.h" +#elif NETWARE +#include "config.nw.h" #else #include "php_config.h" #endif Index: main/reentrancy.c =================================================================== RCS file: /repository/php-src/main/reentrancy.c,v retrieving revision 1.40 diff -u -r1.40 reentrancy.c --- main/reentrancy.c 8 Jan 2004 08:17:54 -0000 1.40 +++ main/reentrancy.c 3 Feb 2004 07:27:01 -0000 @@ -29,8 +29,7 @@ #include "win32/readdir.h" #endif -#if defined(NETWARE) && !(NEW_LIBC) -/*#include <ws2nlm.h>*/ +#if defined(NETWARE) && !defined(NEW_LIBC) #include <sys/socket.h> #endif @@ -121,10 +120,10 @@ #endif #if defined(NETWARE) -/* - Re-entrant versions of functions seem to be better for loading NLMs in different address space. - Since we have them now in LibC, we might as well make use of them. -*/ +/* Re-entrant versions of functions seem to be better for loading NLMs + * in different address space. Since we have them now in LibC, we might + * as well make use of them. + */ #define HAVE_LOCALTIME_R 1 #define HAVE_CTIME_R 1 Index: main/safe_mode.c =================================================================== RCS file: /repository/php-src/main/safe_mode.c,v retrieving revision 1.58 diff -u -r1.58 safe_mode.c --- main/safe_mode.c 8 Jan 2004 08:17:54 -0000 1.58 +++ main/safe_mode.c 3 Feb 2004 07:27:01 -0000 @@ -187,13 +187,21 @@ } PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) { +#ifdef NETWARE /* uid is not implemented for NetWare */ + return 1; /* For NetWare, always return TRUE or Valid */ +#else /* NETWARE */ return php_checkuid_ex(filename, fopen_mode, mode, 0); +#endif } PHPAPI char *php_get_current_user() { struct passwd *pwd; +#if (defined(NETWARE) && defined(CLIB_STAT_PATCH)) + struct stat_libc *pstat; +#else struct stat *pstat; +#endif TSRMLS_FETCH(); if (SG(request_info).current_user) { Index: main/streams/php_stream_transport.h =================================================================== RCS file: /repository/php-src/main/streams/php_stream_transport.h,v retrieving revision 1.8 diff -u -r1.8 php_stream_transport.h --- main/streams/php_stream_transport.h 8 Jan 2004 17:33:06 -0000 1.8 +++ main/streams/php_stream_transport.h 3 Feb 2004 07:27:01 -0000 @@ -18,9 +18,17 @@ /* $Id: php_stream_transport.h,v 1.8 2004/01/08 17:33:06 sniper Exp $ */ +#ifndef NETWARE +/* Excluding the below lines for NetWare to avoid compilation errors + * while compiling Apache2filter. This happens since apache_config.c file + * includes this header file and path to Winsock headers are given there + * since Apache 2.0 headers look for them. Including the below would thus + * clash with the already defined Winsock headers. + */ #if HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif +#endif typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long protolen, char *resourcename, long resourcenamelen, Index: main/streams/userspace.c =================================================================== RCS file: /repository/php-src/main/streams/userspace.c,v retrieving revision 1.19 diff -u -r1.19 userspace.c --- main/streams/userspace.c 21 Jan 2004 10:17:12 -0000 1.19 +++ main/streams/userspace.c 3 Feb 2004 07:27:02 -0000 @@ -707,7 +707,7 @@ STAT_PROP_ENTRY(rdev); #endif STAT_PROP_ENTRY(size); -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) +#if defined(NETWARE) && defined(NEW_LIBC) STAT_PROP_ENTRY_EX(atime, atime.tv_sec); STAT_PROP_ENTRY_EX(mtime, mtime.tv_sec); STAT_PROP_ENTRY_EX(ctime, ctime.tv_sec); Index: main/streams/xp_socket.c =================================================================== RCS file: /repository/php-src/main/streams/xp_socket.c,v retrieving revision 1.21 diff -u -r1.21 xp_socket.c --- main/streams/xp_socket.c 8 Jan 2004 08:17:59 -0000 1.21 +++ main/streams/xp_socket.c 3 Feb 2004 07:27:02 -0000 @@ -31,6 +31,11 @@ #include <sys/un.h> #endif +/* Additional headers for NetWare */ +#if defined(NETWARE) && defined(NEW_LIBC) && !defined(USE_WINSOCK) +#include <sys/select.h> +#endif + php_stream_ops php_stream_generic_socket_ops; PHPAPI php_stream_ops php_stream_socket_ops; php_stream_ops php_stream_udp_socket_ops;
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php