Patch #: 55 Type: operational change Priority: none Modification: Add support for Amdahl UTS Modification: Add support for System V lp Submitted: Mark Haynie Archived: munnari.OZ.AU mac/cap.patches/cap60.patch055 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch055' Summary: add Configure support and minor code changes Summary: add USESYSVLP flag (in sysvcompat.h) for lp File: cap60/Configure File: cap60/netat/sysvcompat.h File: cap60/samples/lwpr.c File: cap60/applications/lwsrv/lwsrv.c File: cap60/applications/lwsrv/procset.c File: cap60/applications/aufs/afpos.c File: cap60/applications/aufs/afposenum.c File: cap60/contrib/cvt2apple.c File: cap60/contrib/lwrename.c File: cap60/contrib/printqueue.c *** Configure.orig Sat Aug 31 22:12:04 1991 --- Configure Sat Aug 31 22:30:15 1991 *************** *** 1,7 **** #!/bin/sh ! # $Author: djh $ $Date: 1991/08/31 02:33:23 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.16 1991/08/31 02:33:23 djh Rel djh $ ! # $Revision: 2.16 $ # CAP configuration shell script. This ain't perfect, but it's a start. # Execute with /bin/sh Configure if your system won't run it (ksh is okay too) # --- 1,7 ---- #!/bin/sh ! # $Author: djh $ $Date: 1991/08/31 12:30:09 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.23 1991/08/31 12:30:09 djh Rel djh $ ! # $Revision: 2.23 $ # CAP configuration shell script. This ain't perfect, but it's a start. # Execute with /bin/sh Configure if your system won't run it (ksh is okay too) # *************** *** 121,126 **** --- 121,139 ---- fi fi fi + #Amdahl + if [ -z "${osdefault}" ]; then + echo "Checking for UTS" + if [ -f /bin/uts ]; then + /bin/uts + rc=$? + if [ $rc -eq 0 ]; then + echo "uts" + osdefault="uts" + lpd="lp" + fi + fi + fi useauxappletalk=0 # A/UX, hpux, SCO Xenix System V if [ -z "${osdefault}" ]; then *************** *** 221,226 **** --- 234,240 ---- "aux") valid=1;; "xenix5") valid=1;; "aix") valid=1;; + "uts") valid=1;; "pyr") valid=1;; "sunos") valid=1;; "encore") valid=1;; *************** *** 237,242 **** --- 251,257 ---- echo " ultrix40 - Ultrix 4.0 or later"; echo " hpux - HP-UX for series 9000"; echo " aux - A/UX"; + echo " uts - Amdahl UTS"; echo " xenix5 - SCO Xenix System V"; echo " aix - IBM AIX System V"; echo " pyr - pyramid"; *************** *** 778,783 **** --- 793,799 ---- # "ultrix40" - Ultrix 4.0 or greater # "hpux" - HP/UX # "aux" - A/UX + # "uts" - Amdahl UTS # "xenix5" - SCO Xenix System V # "aix" - IBM AIX System V # "pyr" - pyramid (in BSD universe) *************** *** 888,893 **** --- 904,911 ---- define([libspecial],concat(libspecial,[ -lauth]))]) ifelse(os,[xenix5],[ define([libspecial],concat(libspecial,[ -lsocket]))]) + ifelse(os,[uts],[ + define([libspecial],concat(libspecial,[ -lsocket -lbsd -la]))]) ifelse(os,[dynix],[ define([libspecial],concat(libspecial,[ -lseq]))]) ifelse(os,[irix],[ *************** *** 1008,1029 **** # You should only edit past here if you are "porting" # Automatics ! define([osname], ! ifelse( os,[ultrix12],[Ultrix 1.2], ! os,[ultrix20],[Ultrix 2.0], ! os,[ultrix40],[Ultrix 4.0], ! os,[aux],[A/UX], ! os,[sunos],[SunOS], ! os,[encore],[Encore Umax], ! os,[hpux],[HP-UX (for 9000 series)], ! os,[bsd],[Standard BSD], ! os,[pyr],[Pyramid in BSD universe], ! os,[xenix5],[SCO Xenix System V], ! os,[aix],[IBM AIX System V], ! os,[next],[NeXT/MACH], ! os,[dynix],[Sequent Balance], ! os,[irix],[Silicon Graphics IRIS/IRIX], ! [Unknown])) define([cflags],ifdef([selfdefinetypes],[-D_TYPES],[])) define([cflags],concat(cflags,ifdef([usebyteswap],[ -DBYTESWAPPED],[]))) define([cflags],concat(cflags,ifdef([usephase2],[ -DPHASE2],[]))) --- 1026,1048 ---- # You should only edit past here if you are "porting" # Automatics ! define([osname],[Unknown]) ! ifelse(os,[ultrix12],[define([osname],[Ultrix 1.2])]) ! ifelse(os,[ultrix20],[define([osname],[Ultrix 2.0])]) ! ifelse(os,[ultrix40],[define([osname],[Ultrix 4.0])]) ! ifelse(os,[aux],[define([osname],[A/UX])]) ! ifelse(os,[sunos],[define([osname],[SunOS])]) ! ifelse(os,[encore],[define([osname],[Encore Umax])]) ! ifelse(os,[hpux],[define([osname],[HP-UX (for 9000 series)])]) ! ifelse(os,[uts],[define([osname],[Amdahl UTS])]) ! ifelse(os,[bsd],[define([osname],[Standard BSD])]) ! ifelse(os,[pyr],[define([osname],[Pyramid in BSD universe])]) ! ifelse(os,[xenix5],[define([osname],[SCO Xenix System V])]) ! ifelse(os,[aix],[define([osname],[IBM AIX System V])]) ! ifelse(os,[next],[define([osname],[NeXT/MACH])]) ! ifelse(os,[dynix],[define([osname],[Sequent Balance])]) ! ifelse(os,[irix],[define([osname],[Silicon Graphics IRIS/IRIX])]) ! # define([cflags],ifdef([selfdefinetypes],[-D_TYPES],[])) define([cflags],concat(cflags,ifdef([usebyteswap],[ -DBYTESWAPPED],[]))) define([cflags],concat(cflags,ifdef([usephase2],[ -DPHASE2],[]))) *************** *** 1039,1044 **** --- 1058,1065 ---- define([cflags],concat(cflags,[ -Dxenix5 -I$I -DLAI_TCP -Di386]))]) ifelse(os,[aix],[ define([cflags],concat(cflags,[ -DAIX -DUSETIMES -DNOWAIT3 -DUSEDIRENT]))]) + ifelse(os,[uts],[ + define([cflags],concat(cflags,[ -eft ]))]) ifelse(os,[irix],[ define([cflags],concat(cflags,[ -D_BSD_COMPAT]))]) *************** *** 1096,1101 **** --- 1117,1123 ---- # if no ranlib (or fakeout like hpux) and need to order libaries ifelse(os,[dummy],[define(uselordertsort,[1])], os,[aux], [define(uselordertsort,[1])], + os,[uts], [define(uselordertsort,[1])], os,[irix], [define(uselordertsort,[1])]) # lw config *** netat/sysvcompat.h.orig Thu Feb 28 23:43:44 1991 --- netat/sysvcompat.h Sat Aug 31 15:40:30 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 91/02/15 22:59:27 $ ! * $Header: sysvcompat.h,v 2.1 91/02/15 22:59:27 djh Rel $ ! * $Revision: 2.1 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/08/31 05:40:17 $ ! * $Header: /mac/src/cap60/netat/RCS/sysvcompat.h,v 2.2 1991/08/31 05:40:17 djh Rel djh $ ! * $Revision: 2.2 $ */ /* *************** *** 50,55 **** --- 50,72 ---- # define USERAND /* use srand, rand */ # define NOVFORK /* no vfork in system */ #endif + + #ifdef uts + # define USETIMES /* getrusage - "use times not rusage" */ + # define NOWAIT3 /* wait3 - "no wait3, use wait" */ + # define USERAND /* random - "use rand,srand not random" */ + # define USEGETCWD /* getwd - "use getcwd not getwd" */ + # define NOUTIMES /* utimes - "use utime not utimes" */ + # define NOPGRP /* killpg - "missing setpgrp or killpg" */ + # define NOVFORK /* vfork - "novfork, use fork" */ + # define NEEDFCNTLDOTH /* if need fcntl.h for O_... */ + # define USECHOWN /* sysv allows us */ + # define NORUSAGE /* getrusage() is in resource.h, but not supported */ + # define NOSIGMASK /* sigblock() doesn't exist */ + # define USEDIRENT /* use struct dirent */ + # define USESTRINGDOTH /* use system V string.h */ + # define USESYSVLP /* use system V lp command instead of lpr */ + #endif uts #ifdef xenix5 # define B2S_STRING_MAPON /* map strings */ *** samples/lwpr.c.orig Sat Jul 27 23:16:19 1991 --- samples/lwpr.c Sat Aug 31 15:42:10 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/07/27 13:15:54 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/samples/RCS/lwpr.c,v 2.2 1991/07/27 13:15:54 djh Rel djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * lwpr - UNIX AppleTalk test program: print a ps file to appletalk LaserWriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/31 05:41:59 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/samples/RCS/lwpr.c,v 2.3 1991/08/31 05:41:59 djh Rel djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * lwpr - UNIX AppleTalk test program: print a ps file to appletalk LaserWriter *************** *** 91,96 **** --- 91,97 ---- nbpInit(); PAPInit(); /* init PAP printer routines */ + LWNAME = NULL; while ((c = getopt(argc, argv, "d:p:")) != EOF) { switch (c) { case 'd': *** applications/lwsrv/lwsrv.c.orig Wed Aug 28 01:45:03 1991 --- applications/lwsrv/lwsrv.c Sat Aug 31 16:22:34 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/27 15:44:30 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.9 1991/08/27 15:44:30 djh Rel djh $"; ! static char revision[] = "$Revision: 2.9 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/31 06:22:15 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.10 1991/08/31 06:22:15 djh Rel djh $"; ! static char revision[] = "$Revision: 2.10 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 586,591 **** --- 586,597 ---- fprintf(stderr,"lwsrv: Printing job: %s; user %s; on %s\n", jobname,username,ctime(&t)); + #ifdef USESYSVLP + # ifndef LPRCMD + # define LPRCMD "/usr/bin/lp" + # endif LPRCMD + #endif USESYSVLP + #ifndef LPRCMD # ifdef xenix5 # define LPRCMD "/usr/bin/lpr" *************** *** 599,605 **** --- 605,615 ---- */ argc = 0; + #ifdef USESYSVLP + childargv[argc++]="lp"; + #else USESYSVLP childargv[argc++]="lpr"; + #endif USESYSVLP #ifdef MELBOURNE childargv[argc++]="-v"; #endif MELBOURNE *************** *** 608,616 **** --- 618,637 ---- sprintf(pbuf,"-d%s",unixpname); /* name of the printer */ childargv[argc++]=pbuf; #else xenix5 + #ifdef USESYSVLP + sprintf(pbuf,"-d%s",unixpname); /* name of the printer */ + #else USESYSVLP sprintf(pbuf,"-P%s",unixpname); /* name of the printer */ + #endif USESYSVLP childargv[argc++]=pbuf; if (hflag) { /* want a burst page */ + #ifdef USESYSVLP + #ifdef DOCNAME + sprintf(jbuf,"-tMacUser: %s Job: %s",username,jobname); /* job name */ + #else DOCNAME + sprintf(jbuf,"-tMacUser: %s",username); /* job name */ + #endif DOCNAME + #else USESYSVLP childargv[argc++]="-J"; #ifdef DOCNAME sprintf(jbuf,"MacUser: %s Job: %s",username,jobname); /* job name */ *************** *** 617,622 **** --- 638,644 ---- #else DOCNAME sprintf(jbuf,"MacUser: %s",username); /* job name */ #endif DOCNAME + #endif USESYSVLP #ifdef PAGECOUNT if (pagecount >= 0) { if (pcopies <= 0) *************** *** 626,632 **** --- 648,658 ---- #endif PAGECOUNT childargv[argc++]=jbuf; } else + #ifdef USESYSVLP + childargv[argc++]="-o-h"; /* suppress burst page */ + #else USESYSVLP childargv[argc++]="-h"; /* suppress burst page */ + #endif USESYSVLP #endif xenix5 #ifdef LWSRV_AUFS_SECURITY if (aufsdb && bin != NULL) { *************** *** 652,658 **** --- 678,686 ---- #endif xenix5 if (rhbuf[1] != '\0') childargv[argc++]=rhbuf; /* include h and/or r flags */ + #ifndef USESYSVLP childargv[argc++]="-s"; /* better for > 1M files */ + #endif USESYSVLP childargv[argc++]=tname; /* our temporary file name */ childargv[argc]=(char *) 0; /* end of argument list */ *************** *** 737,744 **** --- 765,776 ---- { int status, retval, exitval; retval = wait(&status); if (retval == -1 ) { + #ifdef UTS + status = 0; /* wait can return early */ + #else UTS perror("wait"); exit(-1); + #endif UTS } status &= 0x0000ffff; if ( !(status & 0x000000ff) ) { *** applications/lwsrv/procset.c.orig Tue May 7 19:19:58 1991 --- applications/lwsrv/procset.c Sat Aug 31 15:43:36 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/07 09:19:15 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.3 1991/05/07 09:19:15 djh Exp djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/31 05:43:24 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.4 1991/08/31 05:43:24 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 40,45 **** --- 40,48 ---- #else USESTRINGDOTH # include #endif USESTRINGDOTH + #ifdef USEDIRENT + # include + #endif USEDIRENT #ifdef xenix5 # include #endif xenix5 *************** *** 88,94 **** struct stat stb; if (stat(fn, &stb) < 0) return(FALSE); ! if (!S_ISREG(stb.st_mode)) /* make sure regular file */ return(FALSE); if (access(fn, R_OK) < 0) return(FALSE); --- 91,102 ---- struct stat stb; if (stat(fn, &stb) < 0) return(FALSE); ! #ifdef USEDIRENT ! /* sysv follows xpg standards */ ! if (S_ISREG(&stb) == 0) /* make sure regular file */ ! #else USEDIRENT ! if (S_ISREG(stb.st_mode) == 0) /* make sure regular file */ ! #endif USEDIRENT return(FALSE); if (access(fn, R_OK) < 0) return(FALSE); *************** *** 97,103 **** --- 105,115 ---- private boolean dictselect(d) + #ifdef USEDIRENT + struct dirent *d; + #else USEDIRENT struct direct *d; + #endif USEDIRENT { return(checkfile(d->d_name)); } *************** *** 111,118 **** --- 123,135 ---- char *dfn; { DictList *dl; + #ifdef USEDIRENT + struct dirent **namelist; + register struct dirent *dp; + #else USEDIRENT struct direct **namelist; register struct direct *dp; + #endif USEDIRENT struct stat stb; int i, j,nlst; char path[MAXPATHLEN]; *** applications/aufs/afpos.c.orig Wed Jul 10 21:33:41 1991 --- applications/aufs/afpos.c Sat Aug 31 15:45:13 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1991/07/10 11:33:07 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.11 1991/07/10 11:33:07 djh Rel djh $ ! * $Revision: 2.11 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/08/31 05:45:00 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.12 1991/08/31 05:45:00 djh Rel djh $ ! * $Revision: 2.12 $ */ /* *************** *** 89,94 **** --- 89,97 ---- #ifdef aux # include #endif + #ifdef USEDIRENT + #include + #endif USEDIRENT #ifdef gould # define USESUNQUOTA *************** *** 705,713 **** for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { ! if (dp->d_namlen <= 2 && ! dp->d_name[0] == '.' && ! (dp->d_name[1] == '.' || dp->d_name[1] == '\0')) continue; /* skip dot and dot dot */ strcpy(dpath+dpl,dp->d_name); /* compose name in data dir */ --- 708,715 ---- for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { ! if ((dp->d_name[0] == '.' && dp->d_name[1] == '\0') || ! (dp->d_name[1] == '.' && dp->d_name[1] == '.' && dp->d_name[2] == '\0')) continue; /* skip dot and dot dot */ strcpy(dpath+dpl,dp->d_name); /* compose name in data dir */ *** applications/aufs/afposenum.c.orig Sat Jul 27 23:14:18 1991 --- applications/aufs/afposenum.c Sat Aug 31 15:46:46 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1991/07/27 13:13:55 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afposenum.c,v 2.4 1991/07/27 13:13:55 djh Rel djh $ ! * $Revision: 2.4 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/08/31 05:46:37 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afposenum.c,v 2.5 1991/08/31 05:46:37 djh Rel djh $ ! * $Revision: 2.5 $ */ /* *************** *** 135,144 **** return(FALSE); /* sorry this name is too long */ if (d->d_name[0] != '.') /* all special dirs begin with dot */ return(TRUE); ! if (d->d_namlen == 1) /* check for dot */ return(FALSE); ! if (d->d_namlen == 2 && /* check for dot dot */ ! d->d_name[1] == '.') return(FALSE); if (strcmp(d->d_name,RFDIRFN) == 0) /* resource fork directory? */ return(FALSE); /* yes... don't include */ --- 135,144 ---- return(FALSE); /* sorry this name is too long */ if (d->d_name[0] != '.') /* all special dirs begin with dot */ return(TRUE); ! if (d->d_name[1] == '\0') /* check for dot */ return(FALSE); ! if (d->d_name[1] == '.' && /* check for dot dot */ ! d->d_name[2] == '\0') return(FALSE); if (strcmp(d->d_name,RFDIRFN) == 0) /* resource fork directory? */ return(FALSE); /* yes... don't include */ *** contrib/cvt2apple.c.orig Thu Jul 4 19:08:32 1991 --- contrib/cvt2apple.c Sat Aug 31 15:48:27 1991 *************** *** 40,45 **** --- 40,48 ---- #include #include #include + #ifdef USEDIRENT + #include + #endif USEDIRENT char *prog; *** contrib/lwrename.c.orig Thu Feb 28 23:45:21 1991 --- contrib/lwrename.c Sat Aug 31 15:49:33 1991 *************** *** 18,24 **** --- 18,28 ---- #include #include + #ifdef USESTRINGDOTH + #include + #else USESTRINGDOTH #include + #endif USESTRINGDOTH #define ATPRESPONSETIMEOUT sectotick(60*2); #define MINUTES * 60 *************** *** 148,157 **** --- 152,163 ---- (void)open("/",0); (void)dup2(0,1); (void)dup2(0,2); + #ifdef TIOCNOTTY if ((i = open("/dev/tty",2)) > 0) { (void)ioctl(i, TIOCNOTTY, (caddr_t)0); (void)close(i); } + #endif TIOCNOTTY } writeit(cno, str) *** contrib/printqueue.c.orig Thu Feb 28 23:45:25 1991 --- contrib/printqueue.c Sat Aug 31 15:50:48 1991 *************** *** 11,30 **** * without express or implied warranty. */ #include #include #include #include #include #include #include #include #include #include #include #include - #include #define ASYNC 1 #define BDSSIZE 512 --- 11,40 ---- * without express or implied warranty. */ + #include + #ifdef NEEDFCNTLDOTH + #include + #endif NEEDFCNTLDOTH #include #include #include + #ifdef USEDIRENT + #include + #endif USEDIRENT #include #include #include #include #include + #ifdef USESTRINGDOTH + #include + #else USESTRINGDOTH #include + #endif USESTRINGDOTH #include #include #include #define ASYNC 1 #define BDSSIZE 512 *************** *** 197,206 **** --- 207,218 ---- (void)open("/",0); (void)dup2(0,1); (void)dup2(0,2); + #ifdef TIOCNOTTY if ((i = open("/dev/tty",2)) > 0) { (void)ioctl(i, TIOCNOTTY, (caddr_t)0); (void)close(i); } + #endif TIOCNOTTY } void *** README.orig Sat Aug 31 16:23:14 1991 --- README Sat Aug 31 16:23:53 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 54, August 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 55, August 1991 Introduction ------------