You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by dw...@ihgp.ih.lucent.com on 1998/01/21 23:35:05 UTC

Patches for Amdahl's UTS 2.1.2

I had to make the following changes to port apache 1.2.5 to Amdahl's
UTS 2.1.2 that we are running here at Bell Labs.  There was already
support for "UTS21", so I suspect that whoever contributed that used
a slightly newer point release than 2.1.2.  I think all of these patches
should probably work on a newer operating system too.

The first patch, to http_config.h, is quite mysterious.  Apparently there
is a bug in the compiler that I used which made it complain when the 
the pool typedef was used after there was also an element named pool
in the same structure.  I wouldn't blame you if you didn't want to
include that in the distribution.  The rest of the changes are 
specific to the UTS21 type.

I also had to make sure I was using a newer compiler that supported 
ANSI C, and to compile everything on a filesystem that was NFS-mounted
from a Sun to avoid the 14 character filename limit.

- Dave Dykstra

*** http_config.h.O	Thu Jun 26 21:07:34 1997
--- http_config.h	Wed Jan 21 16:31:11 1998
***************
*** 138,148 ****
      int config_line;		/* Line cmd read from */
      FILE *infile;		/* fd for more lines (not currently used) */
      
-     pool *pool;			/* Pool to allocate new storage in */
      pool *temp_pool;		/* Pool for scratch memory; persists during
  				 * configuration, but wiped before the first
  				 * request is served...
  				 */
      server_rec *server;		/* Server_rec being configured for */
      char *path;			/* If configuring for a directory,
  				 * pathname of that directory.
--- 138,151 ----
      int config_line;		/* Line cmd read from */
      FILE *infile;		/* fd for more lines (not currently used) */
      
      pool *temp_pool;		/* Pool for scratch memory; persists during
  				 * configuration, but wiped before the first
  				 * request is served...
  				 */
+     /* pool *pool has to be after other the other pool * in this
+      *  structure to work around a bug in one Amdahl UTS 2.1 compiler
+      */
+     pool *pool;			/* Pool to allocate new storage in */
      server_rec *server;		/* Server_rec being configured for */
      char *path;			/* If configuring for a directory,
  				 * pathname of that directory.
*** Configure.O	Thu Aug 21 17:56:20 1997
--- Configure	Wed Jan 21 11:16:33 1998
***************
*** 449,454 ****
--- 449,455 ----
  	OS='Amdahl UTS'
  	CFLAGS="$CFLAGS -Xa -eft -DUTS21"
  	LIBS="$LIBS -lsocket -lbsd -la"
+ 	DEF_WANTHSREGEX=yes
  	;;
      *-ultrix)
  	OS='ULTRIX'
*** conf.h.O	Fri Aug 15 12:29:49 1997
--- conf.h	Wed Jan 21 15:40:07 1998
***************
*** 386,393 ****
--- 386,401 ----
  #define STDIN_FILENO 0
  #define STDOUT_FILENO 1
  #define STDERR_FILENO 2
+ #define USE_LONGJMP
+ #define JMP_BUF jmp_buf
+ #define NO_USE_SIGACTION
+ #define NEED_STRERROR
+ #define NEED_STRSTR
+ #define NEED_MEMMOVE
+ #define NEED_POUND_BANG
  #define strftime(buf,bufsize,fmt,tm)    ascftime(buf,fmt,tm)
  #include <sys/types.h>
+ #include <sys/time.h>     
  
  #elif defined(APOLLO)
  #undef HAVE_GMTOFF
*** util.c.O	Mon Jan  5 14:57:24 1998
--- util.c	Wed Jan 21 11:16:33 1998
***************
*** 1025,1031 ****
--- 1025,1068 ----
  }
  #endif
  
+ /* The following routine was donated for UTS21 by Dave Dykstra */
+ #ifdef NEED_STRSTR
+ char *strstr(char *s1, char *s2)
+ {
+     char *p1, *p2;
+     if (*s2 == '\0') {
+ 	/* an empty s2 */
+         return(s1);
+     }
+     while((s1 = strchr(s1, *s2)) != NULL) {
+ 	/* found first character of s2, see if the rest matches */
+         p1 = s1;
+         p2 = s2;
+         while (*++p1 == *++p2) {
+             if (*p1 == '\0') {
+                 /* both strings ended together */
+                 return(s1);
+             }
+         }
+         if (*p2 == '\0') {
+             /* second string ended, a match */
+             break;
+         }
+ 	/* didn't find a match here, try starting at next character in s1 */
+         s1++;
+     }
+     return(s1);
+ }
+ #endif
  
+ /* The following routine was donated for UTS21 by Dave Dykstra */
+ /* It can't just be a macro in conf.h because it is used by the regex library */
+ #ifdef NEED_MEMMOVE
+ void *memmove(void *s1, void *s2, size_t n)
+ {
+     bcopy(s2, s1, n);
+ }
+ #endif
  
  #ifdef NEED_INITGROUPS
  int initgroups(const char *name, gid_t basegid)
*** util_script.c.O	Wed Jan 21 15:20:00 1998
--- util_script.c	Wed Jan 21 15:49:25 1998
***************
*** 629,637 ****
  	if (shellcmd) 
  	    execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env);
  	
! 	else if((!r->args) || (!r->args[0]) || (ind(r->args,'=') >= 0))
  	    execle(r->filename, argv0, NULL, env);
  
  	else
  	    execve(r->filename,
  	           create_argv(r->pool, NULL, NULL, NULL, argv0, r->args),
--- 629,655 ----
  	if (shellcmd) 
  	    execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env);
  	
! 	else if((!r->args) || (!r->args[0]) || (ind(r->args,'=') >= 0)) {
! #ifdef NEED_POUND_BANG
! 	    /* This was donated for UTS21 by Dave Dykstra */
! 	    /* #! is not supported by the OS, so do it ourselves */
! 	    int fd, n;
! 	    char bangbuf[256], *eol;
! 	    if ((fd = open(r->filename, O_RDONLY)) > 0) {
! 		n = read(fd, bangbuf, sizeof(bangbuf)-1);
! 		close(fd);
! 		if ((n > 2) && (bangbuf[0] == '#') && (bangbuf[1] == '!')) {
! 		    bangbuf[sizeof(bangbuf)-1] = '\0';
! 		    if ((eol = strchr(&bangbuf[2], '\n')) != NULL) {
! 			*eol = '\0';
! 		    }
! 		    execle(&bangbuf[2], argv0, r->filename, NULL, env);
! 		}
! 	    }
! #endif
  	    execle(r->filename, argv0, NULL, env);
  
+ 	}
  	else
  	    execve(r->filename,
  	           create_argv(r->pool, NULL, NULL, NULL, argv0, r->args),