jimke@uunet.uu.net (10/12/90)
Submitted-by: microsoft!jimke@uunet.uu.net Posting-number: Volume 9, Issue 98 Archive-name: sco.patches/part12 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 12 (of 12)." # Contents: fix-14.sco12 # Wrapped by jimke@kellman on Sat Oct 6 17:13:36 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'fix-14.sco12' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'fix-14.sco12'\" else echo shar: Extracting \"'fix-14.sco12'\" \(13299 characters\) sed "s/^X//" >'fix-14.sco12' <<'END_OF_FILE' X*** ./mit-orig/server/os/4.2bsd/Imakefile Thu Oct 4 16:53:04 1990 X--- ./mit/server/os/4.2bsd/Imakefile Mon Sep 17 18:11:02 1990 X*************** X*** 108,114 **** X--- 108,123 ---- X SpecialObjectRule(osinit.o, $(ICONFIGFILES), -DADMPATH=\"$(ADMDIR)/X\%smsgs\" $(DBM_DEFINES)) X SpecialObjectRule(WaitFor.o, $(ICONFIGFILES), $(EXT_DEFINES)) X SpecialObjectRule(fonttype.o, $(ICONFIGFILES), $(FONT_DEFINES)) X+ #if defined(i386Architecture) && HasGcc X+ /* X+ * gcc does not use the calling sequence as cc or rcc when returning X+ * struct types. X+ */ X+ oscolor.o: oscolor.c X+ rcc $(CFLAGS) -c oscolor.c X+ #else X SpecialObjectRule(oscolor.o, $(ICONFIGFILES), $(DBM_DEFINES)) X+ #endif X X #if HasSaberC X saber_src: X*** ./mit-orig/server/os/4.2bsd/access.c Thu Oct 4 16:53:10 1990 X--- ./mit/server/os/4.2bsd/access.c Sun Sep 16 22:26:35 1990 X*************** X*** 30,35 **** X--- 30,63 ---- X #include "misc.h" X #include "site.h" X #include <errno.h> X+ #ifdef STREAMSCONN X+ #include <sys/stream.h> X+ #include <sys/stropts.h> X+ /* #include "Xstreams.h" */ X+ #include <sys/utsname.h> X+ /* X+ * some things, normally defined in sys/socket.h X+ */ X+ #define AF_UNSPEC 0 X+ /* X+ * Structure used by kernel to store most X+ * addresses. X+ */ X+ struct sockaddr { X+ unsigned short sa_family; X+ char sa_data[14]; X+ }; X+ static int X+ getpeername(fd, from, fromlen) X+ int fd; X+ struct sockaddr *from; X+ int *fromlen; X+ { X+ from->sa_family = AF_UNSPEC; X+ *fromlen =0; X+ return 0; X+ } X+ #else X #include <sys/socket.h> X #include <sys/ioctl.h> X X*************** X*** 50,55 **** X--- 78,84 ---- X #include <netdnet/dn.h> X #include <netdnet/dnetdb.h> X #endif X+ #endif /* STREAMCONN */ X #undef NULL X #include <stdio.h> X #include "dixstruct.h" X*************** X*** 106,113 **** X #endif /* AF_CHAOS */ X #ifdef AF_INET X #ifdef TCPCONN X! {AF_INET, FamilyInternet} X #endif X #endif X }; X X--- 135,145 ---- X #endif /* AF_CHAOS */ X #ifdef AF_INET X #ifdef TCPCONN X! {AF_INET, FamilyInternet}, X! #endif X #endif X+ #if defined(STREAMSCONN) && !defined(_GNUC_) X+ { 0,0}, X #endif X }; X X*************** X*** 138,143 **** X--- 170,176 ---- X X #define FAMILIES ((sizeof familyMap)/(sizeof familyMap[0])) X X+ #ifndef LOCALCONN X #if defined (hpux) && ! defined (HAS_IFREQ) X /* Define this host for access control. Find all the hosts the OS knows about X * for this fd and add them to the selfhosts list. X*************** X*** 315,320 **** X--- 348,359 ---- X } X } X #endif /* hpux && !HAS_IFREQ */ X+ #else X+ DefineSelf() X+ { X+ /* noop, in case we also have TCPCONN */ X+ } X+ #endif /* LOCALCONN */ X X #ifdef XDMCP X void X*************** X*** 382,388 **** X--- 421,429 ---- X int family; X int len; X pointer addr; X+ #if defined(TCPCONN) || defined(DNETCONN) X register struct hostent *hp; X+ #endif X X AccessEnabled = DEFAULT_ACCESS_CONTROL; X LocalHostEnabled = FALSE; X*** ./mit-orig/server/os/4.2bsd/connection.c Thu Oct 4 16:53:07 1990 X--- ./mit/server/os/4.2bsd/connection.c Sun Sep 16 22:27:01 1990 X*************** X*** 46,55 **** X--- 46,83 ---- X #include <sys/param.h> X #include <errno.h> X #include "Xos.h" /* for strings, file, time */ X+ #ifndef STREAMSCONN X #include <sys/socket.h> X+ #else X+ static int STREAMSConnection = -1; X+ /* X+ * some things, normally defined in sys/socket.h X+ */ X+ #define AF_UNSPEC 0 X+ /* X+ * Structure used by kernel to store most X+ * addresses. X+ */ X+ struct sockaddr { X+ unsigned short sa_family; X+ char sa_data[14]; X+ }; X X+ static int X+ getpeername(fd, from, fromlen) X+ int fd; X+ struct sockaddr *from; X+ int *fromlen; X+ { X+ from->sa_family = AF_UNSPEC; X+ *fromlen =0; X+ return 0; X+ } X+ #endif X #include <signal.h> X+ #if !defined(ix386) && !defined(sco) X #include <fcntl.h> X+ #endif X #include <setjmp.h> X X #ifdef hpux X*************** X*** 80,86 **** X--- 108,121 ---- X #endif X X #include <stdio.h> X+ #if defined(ix386) || defined(sco) X+ struct iovec { X+ caddr_t iov_base; X+ int iov_len; X+ }; X+ #else X #include <sys/uio.h> X+ #endif X #include "osstruct.h" X #include "osdep.h" X #include "opaque.h" X*************** X*** 90,95 **** X--- 125,140 ---- X #include <netdnet/dn.h> X #endif /* DNETCONN */ X X+ #ifdef STREAMSCONN X+ #include <sys/stream.h> X+ #include <sys/stropts.h> X+ #include "Xstreams.h" X+ #include <sys/utsname.h> X+ #undef NAME_SERVER_NODE X+ #define NAME_SERVER_NODE "/dev/X/server.0" X+ #define SUCCESS "1" X+ static char *ptmx = "/dev/ptmx"; X+ #endif X typedef long CCID; /* mask of indices into client socket table */ X X #ifndef X_UNIX_PATH X*************** X*** 143,148 **** X--- 188,268 ---- X void XdmcpOpenDisplay(), XdmcpInit(), XdmcpReset(), XdmcpCloseDisplay(); X #endif X X+ #ifdef STREAMSCONN X+ /* Routines for handling local streams (streams-pipes) */ X+ static int X+ open_streams_listener() X+ { X+ int munix, sunix; X+ char * slave; X+ char buf[64]; X+ sprintf(buf, "%s", NAME_SERVER_NODE); X+ if(open(buf, O_RDWR) >= 0){ X+ fprintf(stderr, "Xpizza is already running\n"); X+ return(-1); X+ } X+ if( (munix = open(ptmx, O_RDWR)) < 0 ){ X+ fprintf(stderr,"Cannot open %s", ptmx); X+ perror(" "); X+ return(-1); X+ } X+ grantpt(munix); X+ unlockpt(munix); X+ if(unlink(buf) < 0 && errno != ENOENT){ X+ fprintf(stderr, "Cannot unlink %s", buf); X+ perror(" "); X+ return(-1); X+ } X+ slave = (char *) ptsname(munix); X+ if( link(slave, buf) <0 ){ X+ fprintf(stderr, "Cannot link %s to %s", slave, buf); X+ perror(" "); X+ return(-1); X+ } X+ if( chmod(buf, 0666) < 0){ X+ fprintf(stderr, "Cannot chmod %s", buf); X+ perror(" "); X+ return(-1); X+ } X+ sunix = open(buf, O_RDWR); X+ if(sunix < 0){ X+ fprintf(stderr, "Cannot open %s", buf); X+ perror(" "); X+ close(munix); X+ return(-1); X+ } X+ setpgrp(); X+ return(munix); X+ } X+ connect_new_clients(lfd) X+ int lfd; X+ { X+ int fd; X+ int read_in; X+ char length; X+ char buf[64]; X+ if( (read_in = read(lfd, &length, 1)) <= 0 ){ X+ if( !read_in ) /* client closed fd */ X+ perror("0 bytes read"); X+ else perror("Error in reading the local connection msg length"); X+ return(-1); X+ } X+ if( (read_in = read(lfd, buf, length)) <= 0 ){ X+ if( !read_in ) /* client closed fd */ X+ perror("0 bytes read"); X+ else perror("Error in reading the local connection slave name"); X+ return(-1); X+ } X+ buf[ length ] = '\0'; X+ if( (fd = open(buf,O_RDWR|O_SYNC)) < 0 ){ X+ strcat(buf," open fail, clientfd"); X+ perror(buf); X+ return(-1); X+ } X+ write(fd,SUCCESS,1); X+ return(fd); X+ } X+ #endif STREAMSCONN X #ifdef TCPCONN X static int X open_tcp_socket () X*************** X*** 168,174 **** X { X Error ("Creating TCP socket"); X return -1; X! } X #ifdef SO_REUSEADDR X /* Necesary to restart the server without a reboot */ X #ifdef hpux X--- 288,294 ---- X { X Error ("Creating TCP socket"); X return -1; X! } X #ifdef SO_REUSEADDR X /* Necesary to restart the server without a reboot */ X #ifdef hpux X*************** X*** 369,375 **** X--- 489,499 ---- X #ifdef hpux X lastfdesc = _NFILE - 1; X #else X+ #ifdef STREAMSCONN X+ lastfdesc = ulimit(4, (long)0) - 1; /* Returns total # of FDs available */ X+ #else X lastfdesc = getdtablesize() - 1; X+ #endif / STRAMSCONN X #endif /* hpux */ X X if (lastfdesc > MAXSOCKS) X*************** X*** 380,385 **** X--- 504,515 ---- X } X X WellKnownConnections = 0; X+ #ifdef STREAMSCONN X+ if ((request = open_streams_listener()) != -1) { X+ WellKnownConnections |= (1L<< request); X+ STREAMSConnection = request; X+ } X+ #endif STREAMSCONN X #ifdef TCPCONN X if ((request = open_tcp_socket ()) != -1) { X WellKnownConnections |= (1L << request); X*************** X*** 598,606 **** X--- 728,740 ---- X { X curconn = ffs (readyconnections) - 1; X readyconnections &= ~(1 << curconn); X+ #ifdef STREAMSCONN X+ if ((newconn = connect_new_clients(STREAMSConnection)) < 0) X+ #else X if ((newconn = accept (curconn, X (struct sockaddr *) NULL, X (int *)NULL)) < 0) X+ #endif X continue; X #ifdef TCP_NODELAY X fromlen = sizeof (from); X*** ./mit-orig/server/os/4.2bsd/fonttype.c Thu Oct 4 16:53:05 1990 X--- ./mit/server/os/4.2bsd/fonttype.c Sun Sep 16 22:26:35 1990 X*************** X*** 26,31 **** X--- 26,35 ---- X X #include "dixfont.h" X #include "fonttype.h" X+ #if defined(ix386) || defined(sco) X+ #define UNCOMPRESSFILT "/usr/local/bin/uncompress" X+ #define ZBDFTOSNFFILT "/usr/local/bin/uncompress | /usr/bin/X11/bdftosnf -t" X+ #endif X X #ifndef UNCOMPRESSFILT X #define UNCOMPRESSFILT "/usr/ucb/uncompress" X*** ./mit-orig/server/os/4.2bsd/io.c Thu Oct 4 16:53:07 1990 X--- ./mit/server/os/4.2bsd/io.c Sun Sep 16 22:26:35 1990 X*************** X*** 35,41 **** X--- 35,55 ---- X #include "Xmd.h" X #include <errno.h> X #include <sys/param.h> X+ #if !defined(ix386) && !defined(sco) X #include <sys/uio.h> X+ #else X+ #if !defined(sco) || !defined(TCPCONN) X+ /* X+ * SCO sockets will return EWOULDBLOCK as errno=90 X+ */ X+ #undef EWOULDBLOCK X+ #define EWOULDBLOCK EAGAIN X+ #endif X+ struct iovec { X+ caddr_t iov_base; X+ int iov_len; X+ }; X+ #endif X #include "X.h" X #include "Xproto.h" X #include "os.h" X*** ./mit-orig/server/os/4.2bsd/osdep.h Thu Oct 4 16:53:08 1990 X--- ./mit/server/os/4.2bsd/osdep.h Sun Sep 16 22:26:35 1990 X*************** X*** 31,41 **** X--- 31,49 ---- X #define BUFSIZE 4096 X #define BUFWATERMARK 8192 X #define MAXBUFSIZE (1 << 18) X+ #if defined(ix386) || defined(sco) X+ #if (NOFILES_MAX <= 128) /* 128 is value of MAXCLIENTS in dix layer */ X+ #define MAXSOCKS (NOFILES_MAX - 1) X+ #else X+ #define MAXSOCKS 128 X+ #endif X+ #else X #if (NOFILE <= 128) /* 128 is value of MAXCLIENTS in dix layer */ X #define MAXSOCKS (NOFILE - 1) X #else X #define MAXSOCKS 128 X #endif X+ #endif /* ix386 or sco */ X #define mskcnt ((MAXSOCKS + 31) / 32) /* size of bit array */ X X #if (mskcnt==1) X*** ./mit-orig/server/os/4.2bsd/osinit.c Thu Oct 4 16:53:06 1990 X--- ./mit/server/os/4.2bsd/osinit.c Mon Sep 17 17:02:16 1990 X*************** X*** 38,45 **** X--- 38,49 ---- X * just to get MAXPATHLEN. Define it elsewhere if you need to X * avoid these files. X */ X+ #ifdef sco X+ #define MAXPATHLEN 256 X+ #else X #include <sys/param.h> X #endif X+ #endif X X #ifndef SYSV X #include <sys/resource.h> X*************** X*** 77,83 **** X--- 81,89 ---- X long t; X char *ctime(); X FILE *err; X+ #if !defined(ix386) && !defined(sco) X fclose(stdin); X+ #endif X fclose(stdout); X sprintf (fname, ADMPATH, display); X /* X*** ./mit-orig/server/os/4.2bsd/utils.c Thu Oct 4 16:53:05 1990 X--- ./mit/server/os/4.2bsd/utils.c Sun Sep 16 22:26:36 1990 X*************** X*** 29,34 **** X--- 29,37 ---- X #include "input.h" X #include "opaque.h" X #include <sys/signal.h> X+ #if defined(ix386) || defined(sco) X+ #include <sys/times.h> X+ #endif X extern char *display; X X extern long defaultScreenSaverTime; /* for parsing command line */ X*************** X*** 82,87 **** X--- 85,91 ---- X #ifdef SYSV X signal (SIGHUP, AutoResetServer); X #endif X+ abort(); X } X X /* Force connections to close and then exit on SIGTERM, SIGINT */ X*************** X*** 120,129 **** X--- 124,138 ---- X long X GetTimeInMillis() X { X+ #if defined(ix386) || defined(sco) X+ struct tms buf; X+ return(10* times(&buf)); X+ #else X struct timeval tp; X X gettimeofday(&tp, 0); X return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); X+ #endif X } X #endif X X*** ./mit-orig/server/os/4.2bsd/xdmcp.c Thu Oct 4 16:53:10 1990 X--- ./mit/server/os/4.2bsd/xdmcp.c Sun Sep 16 22:26:36 1990 X*************** X*** 14,24 **** X--- 14,26 ---- X */ X X #include "Xos.h" X+ #if !defined(ix386) && !defined(sco) X #include <sys/param.h> X #include <sys/socket.h> X #include <netinet/in.h> X #include <netdb.h> X #include <stdio.h> X+ #endif X #include "X.h" X #include "Xmd.h" X #include "misc.h" X*** ./mit-orig/server/os/bsdemul/import.h Thu Oct 4 18:02:37 1990 X--- ./mit/server/os/bsdemul/import.h Mon Sep 17 18:27:56 1990 X*************** X*** 0 **** X--- 1,4 ---- X+ /* X+ * Berklib.c for the server does not need to be compiled with all of X+ * the shared library crap. This import.h is a noop. X+ */ X*** ./mit-orig/util/makedepend/main.c Thu Oct 4 17:08:09 1990 X--- ./mit/util/makedepend/main.c Sun Sep 16 22:05:52 1990 X*************** X*** 370,376 **** X return(file); X } X X! #if defined(USG) && !defined(CRAY) X int rename (from, to) X char *from, *to; X { X--- 370,376 ---- X return(file); X } X X! #if defined(USG) && !defined(CRAY) && !defined(sco) X int rename (from, to) X char *from, *to; X { X*** ./mit-orig/util/scripts/makeshlib Thu Oct 4 18:02:38 1990 X--- ./mit/util/scripts/makeshlib Wed Sep 19 12:35:52 1990 X*************** X*** 0 **** X--- 1,15 ---- X+ if [ ! -f shlib.defs ] X+ then X+ /bin/true $1 X+ exit X+ fi X+ # Get some important Definitions X+ SHLIBPATH=/shlib X+ TMP="/usr/tmp/shlib$$" X+ LIB=`sed -e '/MKSHLIB/,$d; /NAME/d; /MKSHLIB/d' shlib.defs | cut -f2` X+ # now set up the script for mkshlib X+ sed -e '1,/MKSHLIB/d; /EXTERN/,$d; /GNULIB/d; /MKSHLIB/d' shlib.defs >$TMP X+ mkshlib -q -L../X -s $TMP -t $LIB -h $LIB.a 2>&1 X+ cp $LIB $SHLIBPATH/${LIB}_s X+ cp $LIB.a /usr/lib/${LIB}_s.a X+ rm $TMP END_OF_FILE if test 13299 -ne `wc -c <'fix-14.sco12'`; then echo shar: \"'fix-14.sco12'\" unpacked with wrong size! fi # end of 'fix-14.sco12' fi echo shar: End of archive 12 \(of 12\). cp /dev/null ark12isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 12 archives. echo "instructions are in fix-14.sco01" rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 dan ---------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com Opinions expressed reflect those of the author only.