]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Various TPF platform-specific changes:
authorDavid McCreedy <mccreedy@apache.org>
Wed, 15 Sep 2004 23:45:18 +0000 (23:45 +0000)
committerDavid McCreedy <mccreedy@apache.org>
Wed, 15 Sep 2004 23:45:18 +0000 (23:45 +0000)
   provide cleaner shutdown on fatal child exit,
   expand address size handling, and clean up some warnings

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@105167 13f79535-47bb-0310-9956-ffa450edef68

19 files changed:
src/Configure
src/helpers/GuessOS
src/include/ap_config.h
src/include/scoreboard.h
src/main/http_log.c
src/main/http_main.c
src/main/http_protocol.c
src/modules/proxy/mod_proxy.h
src/modules/standard/mod_usertrack.c
src/os/tpf/TPFExport
src/os/tpf/cgetop.c
src/os/tpf/os.c
src/os/tpf/os.h
src/os/tpf/samples/linkhttp.jcl
src/os/tpf/samples/loadset.jcl
src/os/tpf/samples/sample_env.txt [new file with mode: 0644]
src/os/tpf/samples/sample_mak.txt [new file with mode: 0644]
src/os/tpf/samples/test_char.txt [new file with mode: 0644]
src/os/tpf/samples/uri_delims.txt [new file with mode: 0644]

index 3df526abc6987633d46dbad683bd50a23364f782..ac2f0bc079168cab5ad3637d4eabc4710d70eb69 100755 (executable)
@@ -611,14 +611,18 @@ case "$PLAT" in
        CFLAGS_SHLIB='-Zpic'
        ;;
     TPF)
-       OS='TPF'
-       OSDIR='os/tpf'
-       CC='c89'
-       CFLAGS="$CFLAGS -DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE"
-       DEF_WANTHSREGEX=yes
-       LIBS="$LIBS"
-       SUBTARGET="target_compile_only"
-       ;;
+       OS='TPF'
+       OSDIR='os/tpf'
+       CC='c89'
+       CFLAGS="$CFLAGS -DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE"
+       if [ "x$TPF64BIT" = "xYES" ] ; then
+               DEF_WANTHSREGEX=no
+       else
+               DEF_WANTHSREGEX=yes
+       fi
+       LIBS="$LIBS"
+       SUBTARGET="target_compile_only"
+       ;;
     BS2000*-siemens-sysv4*)
        OS='BS2000'
        OSDIR='os/bs2000'
@@ -1778,6 +1782,10 @@ MODDIRS_NO_SO=`awk < $tmpfile '
 # Use tmpfile2 for the module definition file, and tmpfile3 for the
 # shell commands to be executed for this module.
 
+if [ "x$OS" = "xTPF" -a "x$TPF64BIT" = "xYES" ]; then
+   rm -f apache.modules
+fi
+
 for modfile in $MODFILES ; do
        rm -f $tmpfile2 $tmpfile3
        modname=''
@@ -1841,6 +1849,10 @@ for modfile in $MODFILES ; do
        if [ "x$ext" = "x$SHMOD_SUFFIX_NAME" -a "x$SHLIB_EXPORT_FILES" = "xyes" ]; then
                echo "$modname" >$modbase.exp
        fi
+       if [ "x$OS" = "xTPF" -a "x$TPF64BIT" = "xYES" ] ; then
+                # output a list of modules for TPF's 64BIT build process
+               `echo $modfile | sed 's/.*\/\([_a-zA-Z]*\.\)o$/\1c/' >> apache.modules`
+       fi
 done
 # $tmpfile now contains Module lines for all the modules we want
 
index 4c18d52dbc4de8908be0c68f2b169bb4b935d267..94c354440cf780c73082caabca8bb903736fcb54 100755 (executable)
 # Be as similar to the output of config.guess/config.sub
 # as possible.
 
-# Handle TPF before handling other OSes.  This
-# is being done because TPF is sometimes compiled
-# on OS/390.  When that is the case, if we don't
-# handle TPF ahead of the other OSes, TPF will
-# fall into the OS/390 case and this script would
-# return an incorrect value for the platform.
-#
-# Apache is not compiled on the TPF platform
-# therefore an environment variable is used
+# Handle TPF before the other operating systems
+# since it's compiled on non-TPF platforms.
+# This keeps GuessOS from returning incorrect
+# uname values for TPF:
 if [ "x$TPF" = "xYES" ]; then
     echo "TPF"
     exit 0     
index d546a45036b7808a0d2432961be4740639d0a203..6fc8b07fead0c6bee94c388d8aa78c963299df21 100644 (file)
@@ -30,9 +30,11 @@ extern "C" {
 /*
  * Support for platform dependent autogenerated defines
  */
-#if !defined(WIN32) && !defined(NETWARE)
+#if !defined(WIN32) && !defined(NETWARE) && !defined(TPF)
 #include "ap_config_auto.h"
-#else
+#endif
+
+#if defined(WIN32) || defined(NETWARE)
 /* not available under WIN32, so provide important entries manually */
 #undef HAVE_UNISTD_H
 #endif
@@ -904,47 +906,7 @@ typedef int rlim_t;
 
 #elif defined(TPF) /* IBM Transaction Processing Facility operating system */
 
-#include <tpfeq.h>
-#include <tpfio.h>
-#include <sysapi.h>
-#include <sysgtime.h>
-#define PRIMECRAS 0x010000
-#define JMP_BUF jmp_buf
-#define HAVE_SHMGET
-#undef  HAVE_SYS_RESOURCE_H
-#define NEED_INITGROUPS
-#define NEED_SIGNAL_INTERRUPT
-#include <strings.h>
-#ifndef __strings_h
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#endif
-#define NEED_STRDUP
-#define NO_DBM_REWRITEMAP
-#define NO_GETTIMEOFDAY
-#define NO_LINGCLOSE
-#define NO_MMAP
-#define NO_OTHER_CHILD
-#define NO_PIPED_LOGS
-#define NO_RELIABLE_PIPED_LOGS
-#define NO_SETSID
-#define NO_SLACK
-#define NO_TIMES
-#ifndef TPF_HAVE_SIGACTION
-#define NO_USE_SIGACTION
-#endif
-#define USE_LONGJMP
-#define USE_SHMGET_SCOREBOARD
-#define USE_TPF_ACCEPT
-#define HAVE_TPF_CORE_SERIALIZED_ACCEPT
-#define USE_TPF_SELECT
-#define S_IREAD S_IRUSR
-#define S_IWRITE S_IWUSR
-#define S_IEXEC S_IXUSR
-#include <unistd.h>
-#define crypt(buf,salt) ((char *)buf)
-#undef  offsetof
-#define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field))
+/* All TPF definitions are now in os/tpf/os.h */
 
 #elif defined(__TANDEM)
 #define NO_WRITEV
@@ -1095,7 +1057,7 @@ typedef int rlim_t;
 #include <strings.h>
 #endif
 #include "ap_ctype.h"
-#if !defined(MPE) && !defined(WIN32) && !defined(TPF) && !defined(__TANDEM) && !defined(NETWARE)
+#if !defined(MPE) && !defined(WIN32) && !defined(TPF41) && !defined(__TANDEM) && !defined(NETWARE)
 #include <sys/file.h>
 #endif
 #if !defined(WIN32) && !defined(NETWARE)
@@ -1103,15 +1065,15 @@ typedef int rlim_t;
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif /* HAVE_SYS_SELECT_H */
-#ifndef TPF
+#ifndef TPF41
 #include <netinet/in.h>
-#endif /* TPF */
+#endif /* ndef TPF41 */
 #if defined(OS390) && !defined(NO_ADDRESS)
 #define NO_ADDRESS NO_DATA  /* Not defined properly by OS/390 v1r2 */
 #endif
 #include <netdb.h>
 #include <sys/ioctl.h>
-#if !defined(MPE) && !defined(BEOS) && !defined(TPF)
+#if !defined(MPE) && !defined(BEOS) && !defined(TPF41)
 #include <arpa/inet.h>         /* for inet_ntoa */
 #endif
 #include <sys/wait.h>
@@ -1151,11 +1113,11 @@ typedef int rlim_t;
 #undef SIG_SETMASK
 #undef SIG_UNBLOCK
 #endif
-#if defined(TPF) && defined(NSIG)
+#if defined(TPF41) && defined(NSIG)
 #undef NSIG
 #endif
 #include <errno.h>
-#if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT) && !defined(TPF) && !defined(NETWARE) && !defined(MPE)
+#if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT) && !defined(TPF41) && !defined(NETWARE) && !defined(MPE)
 #include <memory.h>
 #endif
 
index 30e5722b445c7c03c4f4c4ee6b61d9902dfe080c..eaa79d213cfbc45dd2fb3e522197e02c82a8d2f4 100644 (file)
@@ -21,11 +21,11 @@ extern "C" {
 #endif
 
 #ifndef WIN32
-#if defined(TPF) || defined(NETWARE)
+#if defined(TPF41) || defined(NETWARE)
 #include <time.h>
 #else
 #include <sys/times.h>
-#endif /* TPF */
+#endif /* TPF41 || NETWARE */
 #endif
 
 
index e786dcfd829758750dd46baf76cb74acc2aab19f..0e87ccca6518514d042041cb732e8cbace624fdc 100644 (file)
@@ -318,7 +318,7 @@ static void log_error_core(const char *file, int line, int level,
     len += ap_snprintf(errstr + len, sizeof(errstr) - len,
            "[%s] ", priorities[level & APLOG_LEVELMASK].t_name);
 
-#ifndef TPF
+#ifndef TPF41
     if (file && (level & APLOG_LEVELMASK) == APLOG_DEBUG) {
 #ifdef _OSD_POSIX
        char tmp[256];
@@ -341,7 +341,7 @@ static void log_error_core(const char *file, int line, int level,
        len += ap_snprintf(errstr + len, sizeof(errstr) - len,
                "%s(%d): ", file, line);
     }
-#endif /* TPF */
+#endif /* TPF41 */
     if (r) {
        /* XXX: TODO: add a method of selecting whether logged client
         * addresses are in dotted quad or resolved form... dotted
index 88ac34f9b4334a5f948829c6dca1dda4a8f273d8..0f7bcb0c5e3cd0a27abb86d51e2a19fe88e5a1f9 100644 (file)
@@ -5167,6 +5167,16 @@ static void process_child_status(int pid, ap_wait_t status)
        WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
         /* cleanup pid file -- it is useless after our exiting */
         const char *pidfile = NULL;
+#ifdef TPF
+        /* safer on TPF to go through normal shutdown process */
+       if (!shutdown_pending) {
+               ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server_conf,
+                       "Child %d returned a Fatal error... \n"
+                       "Apache is shutting down!", pid);
+               shutdown_pending = 1;
+       }
+        return;
+#endif
         pidfile = ap_server_root_relative (pconf, ap_pid_fname);
         if ( pidfile != NULL && unlink(pidfile) == 0)
             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
@@ -5651,7 +5661,7 @@ int REALMAIN(int argc, char *argv[])
         memcpy(tpf_server_name, input_parms.parent.servname,
                INETD_SERVNAME_LENGTH);
         tpf_server_name[INETD_SERVNAME_LENGTH + 1] = '\0';
-        sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, getpid());
+        sprintf(tpf_mutex_key, "%.*x", (int) TPF_MUTEX_KEY_SIZE - 1, getpid());
         tpf_parent_pid = getppid();
         ap_open_logs(server_conf, plog);
         ap_tpf_zinet_checks(ap_standalone, tpf_server_name, server_conf);
index 9c86708573a1c0176d0244c90b22d065e5cef325..19a62cdd2725029ffdeda8f0a59e1733517a5411 100644 (file)
@@ -2412,7 +2412,7 @@ API_EXPORT(long) ap_send_fb_length(BUFF *fb, request_rec *r, long length)
     long total_bytes_sent = 0;
     register int n, w, o, len, fd;
     fd_set fds;
-#ifdef TPF
+#ifdef TPF_HAVE_NONSOCKET_SELECT
     struct timeval tv;
 #endif 
 
index 553174499fadd7c72ec01fe84e5d677ca56be4a0..a3fea0ce40a3dfacf68f59d7bb6b8e3032fc6d11 100644 (file)
@@ -213,7 +213,11 @@ typedef struct {
 
 struct per_thread_data {
     struct hostent hpbuf;
+#ifdef TPF
+    u_int  ipaddr;
+#else
     u_long ipaddr;
+#endif
     char *charpbuf[2];
 };
 /* Function prototypes */
index af031479dd918b47bbb3705f5ba02cb2db4222ad..0711ea5dc984b4b8b0b3655787e31237d8904ac5 100644 (file)
@@ -53,7 +53,7 @@
 #include "httpd.h"
 #include "http_config.h"
 #include "http_core.h"
-#if !defined(WIN32) && !defined(MPE) && !defined(TPF)
+#if !defined(WIN32) && !defined(MPE) && !defined(TPF41)
 #include <sys/time.h>
 #endif
 
index 6cc580e593fe0a60606b7cafb66ed6d1008e2c27..8453d02ee3c89357c014bb01d752cf6d8eb1724d 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
-echo " Setting TPF/c89 environment variables"
+echo " Setting TPF41/c89 environment variables"
 export _C89_CCMODE=1
-# replace the following with the location of your TPF include files
-export _C89_INCDIRS="/u/tpf41/currentmaint/include"
+# replace the following with the location of your TPF41 include files
+export _C89_INCDIRS="/u/tpf41/rlse/include"
 export TPF=YES
 export _C89_INCLIBS=""
 export _C89_CSYSLIB=""
index 90ffbce5f451f052678e7a1141e2da8f8b97ca2d..03356603d485217df04319373c1361f36e9c438b 100644 (file)
@@ -36,6 +36,8 @@
 /*                                                                    */
 /**********************************************************************/
 
+/* used only on TPF41 systems */
+
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)getopt.c  8.2 (Berkeley) 4/2/94";
 #endif /* LIBC_SCCS and not lint */
@@ -148,4 +150,4 @@ getopt(nargc, nargv, ostr)
     ++optind;
   }
   return (optopt);                  /* dump back option letter        */
-}
\ No newline at end of file
+}
index 4131eb4f6b23d7d17213cc8ce9121f5fefa4c490..9c79e0f5163a60047cafcfa6960f4091ddbefd38 100644 (file)
 #include "scoreboard.h"
 #include "http_log.h"
 #include "http_conf_globals.h"
+#ifdef TPF41
 #ifdef __PIPE_
 #include <ipc.h>
 #include <shm.h>
 static TPF_FD_LIST *tpf_fds = NULL;
-#endif
+#endif /* __PIPE_ */
+#else
+#include <sys/ipc.h>  
+#include <sys/shm.h>
+static TPF_FD_LIST *tpf_fds = NULL;
+#endif /* TPF41 */
 
 void *tpf_shm_static_ptr = NULL;
 unsigned short zinet_model;
@@ -162,13 +168,10 @@ int ap_tpf_spawn_child(pool *p, int (*func) (void *, child_info *),
                        int out_fds[], int in_fds[], int err_fds[])
 
 {
-
-   int                      i, temp_out, temp_in, temp_err, save_errno, pid, result=0;
-   int                      fd_flags_out, fd_flags_in, fd_flags_err;
+   int                      i, temp_out=0, temp_in=0, temp_err=0, save_errno, pid, result=0;
+   int                      fd_flags_out=0, fd_flags_in=0, fd_flags_err=0;
    struct tpf_fork_input    fork_input;
    TPF_FORK_CHILD           *cld = (TPF_FORK_CHILD *) data;
-   array_header             *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
-   table_entry              *elts = (table_entry *) env_arr->elts;
 #ifdef TPF_FORK_EXTENDED
 #define WHITE " \t\n"
 #define MAXARGC 49
@@ -178,11 +181,13 @@ int ap_tpf_spawn_child(pool *p, int (*func) (void *, child_info *),
    pool                     *subpool = NULL;
 
 #include "util_script.h"
-
+#else
+   array_header             *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
+   table_entry              *elts = (table_entry *) env_arr->elts;
 #endif /* TPF_FORK_EXTENDED */ 
 
    if (func) {
-      if (result=func(data, NULL)) {
+      if ((result=func(data, NULL))) {
           return 0;                    /* error from child function */
       }
    }
@@ -473,10 +478,10 @@ void os_tpf_child(APACHE_TPF_INPUT *input_parms) {
     tpf_fds = input_parms->tpf_fds;
     tpf_shm_static_ptr = input_parms->shm_static_ptr;
     tpf_parent_pid = getppid();
-    sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, tpf_parent_pid);
+    sprintf(tpf_mutex_key, "%.*x", (int) TPF_MUTEX_KEY_SIZE - 1, tpf_parent_pid);
 }
 
-#ifndef __PIPE_
+#if defined(TPF41) && !defined(__PIPE_)
 
 int pipe(int fildes[2])
 {
@@ -505,7 +510,7 @@ static void *ap_tpf_get_shared_mem(size_t size)
 {
     key_t shmkey = IPC_PRIVATE;
     int shmid = -1;
-    void *result;
+    static void *result;
 
     if ((shmid = shmget(shmkey, size, IPC_CREAT | SHM_R | SHM_W)) == -1) {
         perror("shmget failed in ap_tpf_get_shared_mem function");
@@ -565,7 +570,7 @@ void ap_tpf_add_fd(pool *p, int fd, enum FILE_TYPE file_type, const char *fname)
         return; /* no kids allowed */
     }
     if (tpf_fds == NULL) {
-        /* get shared memory if necssary */
+        /* get shared memory if necessary */
         tpf_fds = ap_tpf_get_shared_mem((size_t)TPF_FD_LIST_SIZE);
         if (tpf_fds) {
             ap_register_cleanup(p, (void *)&tpf_fds,
@@ -636,7 +641,7 @@ API_EXPORT(piped_log *) ap_open_piped_log(pool *p, const char *program)
     return pl;
 }
 
-#endif /* __PIPE_ */
+#endif /* TPF41 && ndef __PIPE_ */
 
 /*   The following functions are used for the tpf specific module called
      mod_tpf_shm_static.  This module is a clone of Apache's mod_mmap_static.
@@ -768,7 +773,7 @@ int i;
    #error "is no longer supported."
    #error "Replace with USE_SHMGET_SCOREBOARD to use"
    #error "shared memory or remove entirely to use"
-   #error "scoreboard on file for pre-PUT10 systems"
+   #error "scoreboard on file for pre-TPF41 PUT10 systems"
 #endif
 
 #ifdef TPF_FORK_EXTENDED
index aee524fcec965f380f5294c68b668f0aa5c7e34a..34fdfcf0cfb0809768f44ce3fdf3a3989a38090d 100644 (file)
  */
 
 #define PLATFORM "TPF"
+#ifndef TPF
+#define TPF 1
+#endif
+#if !defined(TPF64BIT) && !defined(TPF41)
+#define TPF41
+#endif
+
+/*---------------------------------------------------------------------*/
+#ifdef TPF64BIT
+/*---------------------------------------------------------------------*/
+#define TPF_HAVE_NONSOCKET_SELECT
+#define TPF_HAVE_SAWNC
+#define HAVE_SYSLOG
+#define TPF_HAVE_SIGACTION
+#define HAVE_SYS_SELECT_H
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define TPF_FORK_EXTENDED
+#include <stdlib.h>
+#include <tpf/tpfeq.h>
+#include <tpf/tpfio.h>
+#include <tpf/sysapi.h>
+#include <time.h>
+#include <tpf/i_netd.h>
+#include <strings.h>
+#include <unistd.h>
+#endif /* TPF64BIT */
+
+/*---------------------------------------------------------------------*/
+#ifdef TPF41
+/*---------------------------------------------------------------------*/
 
 /************************************************************************
- *  PJ26895 provides support for non_socket_select.
+ *  TPF41 PJ26895 provides support for non_socket_select.
  *  You can determine if this apar is applied to your system by looking
  *  at i$pwbl.h.  If the function non_socket_select is defined,
  *  then add #define TPF_HAVE_NONSOCKET_SELECT
@@ -47,7 +78,7 @@
 #endif
 
 /************************************************************************
- *  PJ27387 or PJ26188 provides support for tpf_sawnc.
+ *  TPF41 PJ27387 or PJ26188 provides support for tpf_sawnc.
  *  You can determine if this apar is applied to your system by looking at
  *  tpfapi.h or i$fsdd.h.  If the function tpf_sawnc is defined,
  *  then add #define TPF_HAVE_SAWNC
 #include <errno.h>
 #endif
 
-/* If APAR PJ27277 (which shipped on PUT13) has been applied */
+/* If TPF41 APAR PJ27277 (which shipped on TPF41 PUT13) has been applied */
 /* then we want to #define TPF_FORK_EXTENDED so Perl CGIs will work. */
 /* Rather than hardcoding it we'll check for "environ" in stdlib.h, */
-/* which was also added by PJ27277. */
+/* which was also added by TPF41 PJ27277. */
 #include <stdlib.h>
 #if defined(environ) && !defined(TPF_FORK_EXTENDED)
 #define TPF_FORK_EXTENDED
 #endif
-
+#define WUNTRACED 0 /* TPF41's waitpid() doesn't support WUNTRACED */
+#include <tpfeq.h>
+#include <tpfio.h>
 #include <sysapi.h>  
-#include "ap_config.h"
+#include <sysgtime.h>
+#include <i$netd.h>
+#include <strings.h>
+#ifndef __strings_h
+#define NEED_STRCASECMP
+#define NEED_STRNCASECMP
+#endif
+#define NEED_STRDUP
+#define NO_GETTIMEOFDAY
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE 1
+#endif
+#ifndef USE_HSREGEX
+#define USE_HSREGEX 1
+#endif
+#include <unistd.h>
+#define crypt(buf,salt) ((char *)buf)
+#undef  offsetof
+#define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field))
+
+#endif /* TPF41 */
+
+/*---------------------------------------------------------------------*/
+/* common                                                              */
+/*---------------------------------------------------------------------*/
+#define AP_LONGEST_LONG long long
+/* byte order of machine (12: little endian, 21: big endian) */
+#define AP_BYTE_ORDER 21 /* TPF is big endian */
+#define CHARSET_EBCDIC 1
+#define PRIMECRAS 0x010000
+#define JMP_BUF jmp_buf
+#define HAVE_SHMGET
+#define HAVE_SYS_PARAM_H
+#define NEED_INITGROUPS
+#define NEED_SIGNAL_INTERRUPT
+#define NO_LINGCLOSE
+#define NO_MMAP
+#define NO_OTHER_CHILD
+#define NO_PIPED_LOGS
+#define NO_RELIABLE_PIPED_LOGS
+#define NO_SETSID
+#define NO_SLACK
+#define NO_TIMES
+#ifndef TPF_HAVE_SIGACTION
+#define NO_USE_SIGACTION
+#endif
+#define USE_LONGJMP
+#define USE_SHMGET_SCOREBOARD
+#define USE_TPF_ACCEPT
+#define HAVE_TPF_CORE_SERIALIZED_ACCEPT
+#define USE_TPF_SELECT
+#define S_IREAD S_IRUSR
+#define S_IWRITE S_IWUSR
+#define S_IEXEC S_IXUSR
+#define HAVE_UNISTD_H 1
+#ifndef NO_DL_NEEDED
+#define NO_DL_NEEDED 1
+#endif
 
-#define WUNTRACED 0 /* TPF's waitpid() doesn't support WUNTRACED */
+#include "ap_config.h"
 
 /* TPF_ACCEPT_SECS_TO_BLOCK is the number of seconds to block while
    waiting to accept a new request in the ap_accept/tpf_accept function */
 #define TPF_ACCEPT_SECS_TO_BLOCK 1
 #endif
 
-#ifdef HAVE_ISNAN
-#undef HAVE_ISNAN
-#endif
-
-#ifdef HAVE_ISINF
-#undef HAVE_ISINF
-#endif
-
 #if !defined(INLINE) && defined(USE_GNU_INLINE)
 /* Compiler supports inline, so include the inlineable functions as
  * part of the header
@@ -123,7 +205,9 @@ extern int ap_os_is_path_absolute(const char *f);
 #define ap_os_is_filename_valid(f)          (1)
 #define ap_os_kill(pid, sig)                kill(pid, sig)
 
-#include <strings.h>
+/*---------------------------------------------------------------------*/
+#ifdef TPF41
+/*---------------------------------------------------------------------*/
 #ifndef __strings_h
 
 #define FD_SETSIZE    2048 
@@ -140,14 +224,19 @@ typedef struct fd_set {
 
 #define FD_CLR(n, p)((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
 #define FD_ISSET(n, p)((p)->fds_bits[(n)/NFDBITS] & (1 <<((n) % NFDBITS)))
-#define  FD_ZERO(p)   memset((char *)(p), 0, sizeof(*(p)))
-#endif
+#define FD_ZERO(p)   memset((char *)(p), 0, sizeof(*(p)))
+#endif /* __strings_h */
     
 #ifdef FD_SET
 #undef FD_SET
 #define FD_SET(n, p) (0)
-#endif
+#endif /* FD_SET */
 
+#endif /* TPF41 */
+
+/*---------------------------------------------------------------------*/
+/* common                                                              */
+/*---------------------------------------------------------------------*/
 #define TPF_MUTEX_KEY_SIZE (sizeof(pid_t)*2+1)
 
 /* TPF doesn't have, or need, tzset (it is used in mod_expires.c) */
@@ -171,7 +260,6 @@ typedef struct tpf_fd_list {
     TPF_FD_ITEM    first_item;
 }TPF_FD_LIST;
 
-#include <i$netd.h>
 typedef struct apache_input {
     void                *scoreboard_heap;   /* scoreboard system heap address */
     int                 slot;               /* child number */
@@ -180,12 +268,12 @@ typedef struct apache_input {
     time_t              restart_time;
     TPF_FD_LIST         *tpf_fds;           /* fd inheritance table ptr */
     void                *shm_static_ptr;    /* shm ptr for static pages */
-}APACHE_TPF_INPUT;
+} APACHE_TPF_INPUT;
 
 typedef union ebw_area {
     INETD_SERVER_INPUT parent;
     APACHE_TPF_INPUT   child;
-}EBW_AREA;
+} EBW_AREA;
  
 extern void *tpf_shm_static_ptr;            /* mod_tpf_shm_static */
 #define TPF_SHM_STATIC_SIZE 200000
@@ -196,7 +284,7 @@ typedef struct tpf_fork_child {
      char  *filename;
      enum { FORK_NAME = 1, FORK_FILE = 2 } prog_type;
      void  *subprocess_env;
-}TPF_FORK_CHILD;
+} TPF_FORK_CHILD;
 
 int tpf_accept(int sockfd, struct sockaddr *peer, int *paddrlen);
 extern int tpf_child;
@@ -212,13 +300,19 @@ char *getpass(const char *prompt);
 int killpg(pid_t pgrp, int sig);
 extern char *ap_server_argv0;
 #include <signal.h>
-#ifndef SIGPIPE
+#if defined(TPF41) && !defined(SIGPIPE)
 #define SIGPIPE 14
 #endif
-#ifdef NSIG
+#if defined(TPF41) && defined(NSIG)
 #undef NSIG
 #endif
 void ap_tpf_save_argv(int argc, char **argv);
+int tpf_select(int maxfds, fd_set *reads, fd_set *writes, fd_set *excepts,
+               struct timeval *tv);
+void os_tpf_child(APACHE_TPF_INPUT *input_parms);
+#if defined(TPF64BIT) || defined(__PIPE_)
+static void *ap_tpf_get_shared_mem(size_t size);
+#endif
 
 /* various #defines for ServerType/ZINET model checks: */
 
index fa026c1318ebb039fb02d6892cf884b5e51bec9e..bafc62c1be3ae9de14f97af0b42794c45816b6cf 100644 (file)
@@ -1,4 +1,5 @@
 //LINKHTTP JOB MSGLEVEL=(1,1),CLASS=S,MSGCLASS=S
+//* SAMPLE JCL FOR LINKING APACHE ON TPF41
 /*ROUTE PRINT <your-id-here>
 /*ROUTE PUNCH <your-id-here>
 /*NOTIFY <your-id-here>
index ed84b7452b60c77bf107506a43a2bc222dcbb77c..ea74a2dfd01f49e598bbeaf1eff94fb30c733de0 100644 (file)
@@ -1,4 +1,5 @@
 //LOADSET  JOB MSGLEVEL=1,CLASS=S,MSGCLASS=S
+//* SAMPLE JCL TO BUILD AN APACHE LOADSET FOR TPF41
 /*ROUTE PRINT <your-id-here>
 /*ROUTE PUNCH <your-id-here>
 //TLDR   EXEC  PGM=TPFLDR40,REGION=8M,
diff --git a/src/os/tpf/samples/sample_env.txt b/src/os/tpf/samples/sample_env.txt
new file mode 100644 (file)
index 0000000..f3db0c9
--- /dev/null
@@ -0,0 +1,51 @@
+# Sample maketpf environment file for Apache
+
+#######################################################################
+# Define the directories where the shared objects reside              #
+#######################################################################
+ROOTLIBDIRS := $(foreach d,$(TPF_ROOT),$d/your_path/apache/lib)
+
+#######################################################################
+# Define directories where the loadables (XXXXVV) are to be written   #
+#######################################################################
+ROOTLOADDIRS := $(foreach d,$(TPF_ROOT),$d/your_path/load)
+
+#######################################################################
+# Define location of the export files used by the LD postprocessor    #
+# The .exp files will live in lib directory                           #
+#######################################################################
+ROOTEXPDIRS := $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/exp)
+
+#######################################################################
+# Define the object file directory name                               #
+#######################################################################
+ROOTOBJDIRS := $(foreach d,$(TPF_ROOT),$d/your_path/apache/obj)
+
+#######################################################################
+# Define the listing files directory name                             #
+#######################################################################
+ROOTLSTDIRS := $(foreach d,$(TPF_ROOT),$d/your_path/apache/lst)
+
+#######################################################################
+# Set the include/header file directories                             #
+#######################################################################
+ROOTINCDIRS := $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/include)
+ROOTINCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/proxy)
+ROOTINCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/standard)
+ROOTINCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/os/tpf)
+ROOTINCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/regex)
+
+#######################################################################
+# Set the C file directories                                          #
+#######################################################################
+ROOTCDIRS := $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/ap)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/main)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/example)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/extra)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/experimental)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/proxy)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/modules/standard)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/os/tpf)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/regex)
+ROOTCDIRS += $(foreach d,$(TPF_ROOT_LM),$d/your_path/apache/src/support)
diff --git a/src/os/tpf/samples/sample_mak.txt b/src/os/tpf/samples/sample_mak.txt
new file mode 100644 (file)
index 0000000..fe62c80
--- /dev/null
@@ -0,0 +1,72 @@
+# Sample .mak file for Apache
+
+#######################################################################
+# Define shared object name                                           #
+#######################################################################
+APP := CHTA
+APP_ENTRY := main
+
+#######################################################################
+# External LIB References                                             #
+#######################################################################
+# Apache needs the Internet Daemon / ZINET (CLTY)
+LIBS := CLTY
+
+#######################################################################
+# Environments needed for build                                       #
+#######################################################################
+maketpf_env := apache
+maketpf_env += base_rt
+maketpf_env += system
+
+CFLAGS_CHTA := -fPIC
+CFLAGS_CHTA += -w
+CFLAGS_CHTA += -DTPF
+CFLAGS_CHTA += -DTPF64BIT
+
+#######################################################################
+# C programs to be compiled                                           #
+#######################################################################
+C_SRC := buildmark.c
+C_SRC += modules.c
+C_SRC += ap_base64.c
+C_SRC += ap_checkpass.c
+C_SRC += ap_cpystrn.c
+C_SRC += ap_ebcdic.c
+C_SRC += ap_execve.c
+C_SRC += ap_fnmatch.c
+C_SRC += ap_getpass.c
+C_SRC += ap_md5c.c
+C_SRC += ap_sha1.c
+C_SRC += ap_signal.c
+C_SRC += ap_slack.c
+C_SRC += ap_snprintf.c
+C_SRC += ap_strtol.c
+C_SRC += alloc.c
+C_SRC += buff.c
+C_SRC += http_config.c
+C_SRC += http_core.c
+C_SRC += http_log.c
+C_SRC += http_main.c
+C_SRC += http_protocol.c
+C_SRC += http_request.c
+C_SRC += http_vhost.c
+C_SRC += rfc1413.c
+C_SRC += util.c
+C_SRC += util_date.c
+C_SRC += util_md5.c
+C_SRC += util_script.c
+C_SRC += util_uri.c
+C_SRC += os.c
+C_SRC += os-inline.c
+
+APACHE_MODULE_FILE := $(word 1,$(foreach d,$(TPF_ROOT),$(wildcard $d/your_path/apache/src/apache.modules)))
+ifeq ("$(APACHE_MODULE_FILE)","")
+$(error $(MTPF0045E))
+endif
+C_SRC += $(shell cat $(APACHE_MODULE_FILE))
+
+#######################################################################
+# Include maketpf build rules                                         #
+#######################################################################
+include maketpf.rules
diff --git a/src/os/tpf/samples/test_char.txt b/src/os/tpf/samples/test_char.txt
new file mode 100644 (file)
index 0000000..44b1344
--- /dev/null
@@ -0,0 +1,43 @@
+/* this file is automatically generated by gen_test_char, do not edit */\r
+#define T_ESCAPE_SHELL_CMD     0x01 /* chars with special meaning in the shell */\r
+#define T_ESCAPE_PATH_SEGMENT  0x02 /* find path segment, as defined in RFC1808 */\r
+#define T_OS_ESCAPE_PATH       0x04 /* escape characters in a path or uri */\r
+#define T_HTTP_TOKEN_STOP      0x08 /* find http tokens, as defined in RFC2616 */\r
+#define T_ESCAPE_LOGITEM       0x10 /* filter what should go in the log file */\r
+#define T_ESCAPE_FORENSIC      0x20 /* filter what should go in the forensic log */\r
+\r
+static const unsigned char test_char_table[256] = {\r
+    0x20, 0x3e, 0x3e, 0x3e, 0x36, 0x3e, 0x36, 0x3e,  /*0x00...0x07*/\r
+    0x36, 0x36, 0x36, 0x3e, 0x3e, 0x3e, 0x3e, 0x3e,  /*0x08...0x0f*/\r
+    0x3e, 0x3e, 0x3e, 0x3e, 0x36, 0x3f, 0x3e, 0x36,  /*0x10...0x17*/\r
+    0x3e, 0x3e, 0x36, 0x36, 0x3e, 0x3e, 0x3e, 0x3e,  /*0x18...0x1f*/\r
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3e, 0x3e,  /*0x20...0x27*/\r
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x3e, 0x3e, 0x3e,  /*0x28...0x2f*/\r
+    0x36, 0x36, 0x3e, 0x36, 0x36, 0x36, 0x36, 0x3e,  /*0x30...0x37*/\r
+    0x36, 0x36, 0x36, 0x36, 0x3e, 0x3e, 0x36, 0x3e,  /*0x38...0x3f*/\r
+    0x0e, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x40...0x47*/\r
+    0x36, 0x36, 0x36, 0x00, 0x0f, 0x09, 0x00, 0x27,  /*0x48...0x4f*/\r
+    0x01, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x50...0x57*/\r
+    0x36, 0x36, 0x00, 0x01, 0x01, 0x09, 0x0f, 0x07,  /*0x58...0x5f*/\r
+    0x00, 0x0a, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x60...0x67*/\r
+    0x36, 0x36, 0x36, 0x08, 0x26, 0x00, 0x0f, 0x0f,  /*0x68...0x6f*/\r
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x70...0x77*/\r
+    0x36, 0x07, 0x28, 0x06, 0x08, 0x01, 0x08, 0x17,  /*0x78...0x7f*/\r
+    0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0x80...0x87*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x88...0x8f*/\r
+    0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0x90...0x97*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0x98...0x9f*/\r
+    0x36, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0xa0...0xa7*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x0f, 0x36, 0x36,  /*0xa8...0xaf*/\r
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0xb0...0xb7*/\r
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x0f, 0x36, 0x36,  /*0xb8...0xbf*/\r
+    0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0xc0...0xc7*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0xc8...0xcf*/\r
+    0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0xd0...0xd7*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0xd8...0xdf*/\r
+    0x1f, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0xe0...0xe7*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,  /*0xe8...0xef*/\r
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*0xf0...0xf7*/\r
+    0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36   /*0xf8...0xff*/\r
+    \r
+};\r
diff --git a/src/os/tpf/samples/uri_delims.txt b/src/os/tpf/samples/uri_delims.txt
new file mode 100644 (file)
index 0000000..cadfef4
--- /dev/null
@@ -0,0 +1,16 @@
+/* this file is automatically generated by gen_uri_delims, do not edit */\r
+static const unsigned char uri_delims[256] = {\r
+    T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,T_SLASH,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,T_QUESTION,0,0,0,0,0,0,0,0,\r
+    0,0,T_COLON,T_HASH,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \r
+};\r