From: skinner@LPMI.POLYTECHNIQUE.FR (Darrell A. Skinner) Newsgroups: comp.sys.apollo Subject: CAP patch for Domain BSD 4.3 (version 10.4) Date: 21 Oct 93 19:11:56 GMT We have used CAP (Columbia Appletalk Package) on our Apollos for some time. As I compiled the latest version and got a new feature working, I finally decided to make a real patch. Here it is. I will submit it to the person now handling CAP, as well. [SUMMARY: CAP contains 3 main programs, permitting Macintosh users mount Unix directories as AppleTalk volumes (aufs), to use the Unix machines to spool Mac print jobs (lwsrv), and Unix users to print on AppleTalk Laser Writers (papif/papof). You would have to have a Fastpath, GatorBox or other gateway on the Apollos--the latest means of linking Macs and Unix boxes on Ethernet, Unix-Appletalk Router, doesn't support Apollos. The principal ftp site is munnari.OZ.AU, correspondence to cap@munnari.OZ.AU, managed by David Hornsby ] We have only been using aufs and lwsrv since Domain 10.1. All I did was get the current distribution to build, and fix aufs so that the syntax //node/path doesn't make aufs croak (this isn't handled correctly, but you can use an alternative syntax like /../node/path as a work-around). I haven't even tried papif/papof yet with this distribution, although I don't expect any problems. In the patch I indicated that CAP won't build under System V. If you know otherwise (or if you've fixed the //node/path problem better than I, or if you really understand the implications of mixing lockf, flock and hidden System V fcntl lock calls that I enabled), now's the time to say something. Darrell Skinner / skinner@lpmi.polytechnique.fr / Ecole Polytechnique Here's the patch: --------------------------------------------------------------------------- Patch #: ???? Type: new OS support Priority: none Modification: introduce support for HP/Apollo Domain OS under BSD 4.3 environment Submitted: Darrell Skinner Archived: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Application: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Summary: this patch prepared at CAP 6 PL 162 Summary: Build "out of the box" under HP/Apollo Domain OS 10.4 BSD 4.3. Summary: Print info message if Configured under System V. Summary: Read applications/aufs/fcntldomv.h for notes on file locking. Summary: Read Notes about avoiding Domain OS//node/path syntax in afpvols. File: cap60/applications/aufs/afpos.c File: cap60/applications/aufs/afpvols.c File: cap60/lib/afp/afposlock.c File: cap60/netat/fcntldomv.h ???????? Put it here ??????? File: cap60/netat/Makefile.m4 File: cap60/netat/Makefile ???????? Carry this along ??????? File: cap60/contrib/AppManager/aufsmon.c File: cap60/contrib/AppManager/aufslock.c File: cap60/conf.func.lst File: cap60/NOTES File: cap60/README File: cap60/CAP60.README File: cap60/Configure *** applications/aufs/afpos.c.orig Thu Oct 14 17:13:35 1993 --- applications/aufs/afpos.c Thu Oct 21 16:23:55 1993 *************** *** 113,118 **** --- 113,121 ---- #ifdef NEEDFCNTLDOTH # include + # ifdef apollo + # include + # endif apollo #endif NEEDFCNTLDOTH #ifdef USESTRINGDOTH # include *************** *** 129,139 **** # include # include # else /* __BSD_4_4__ */ ! # ifdef sgi # include ! # else sgi # include ! # endif sgi # endif /* __BSD_4_4__ */ #endif USESTATFS --- 132,142 ---- # include # include # else /* __BSD_4_4__ */ ! # if defined (sgi) | defined (apollo) # include ! # else sgi|apollo # include ! # endif sgi|apollo # endif /* __BSD_4_4__ */ #endif USESTATFS *************** *** 2346,2352 **** } #endif #ifdef USESTATFS ! # ifdef sgi if (statfs(path, &fsbuf, sizeof(fsbuf), 0) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; /* limiting factor: cannot report on overutilization of a volume */ --- 2349,2355 ---- } #endif #ifdef USESTATFS ! # if defined (sgi) | defined (apollo) if (statfs(path, &fsbuf, sizeof(fsbuf), 0) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; /* limiting factor: cannot report on overutilization of a volume */ *************** *** 2353,2359 **** v->v_free = (fsbuf.f_bfree < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bfree; return(noErr); } ! # else sgi if (statfs(path, &fsbuf) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; /* limiting factor: cannot report on overutilization of a volume */ --- 2356,2362 ---- v->v_free = (fsbuf.f_bfree < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bfree; return(noErr); } ! # else sgi|apollo if (statfs(path, &fsbuf) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; /* limiting factor: cannot report on overutilization of a volume */ *************** *** 2360,2366 **** v->v_free = (fsbuf.f_bavail < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bavail; return(noErr); } ! # endif sgi #endif USESTATFS #ifdef SIZESERVER getvolsize(path, &v->v_size, &v->v_free); --- 2363,2369 ---- v->v_free = (fsbuf.f_bavail < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bavail; return(noErr); } ! # endif sgi|apollo #endif USESTATFS #ifdef SIZESERVER getvolsize(path, &v->v_size, &v->v_free); *** applications/aufs/afpvols.c.orig Thu Oct 14 17:13:08 1993 --- applications/aufs/afpvols.c Thu Oct 21 14:15:48 1993 *************** *** 117,127 **** /* This is deferred because I'm not sure how to deallocate :-) */ /* and isn't needed until we have validated the entry anyway */ vp->v_rootd = Idirid(path); /* create directory handle */ ! InitDIDVol(vp->v_rootd, VolCnt); /* initialize volume info for list */ /* Okay, stick it into the table */ ! VolTbl[VolCnt++] = vp; /* set volume record */ } private char * --- 117,134 ---- /* This is deferred because I'm not sure how to deallocate :-) */ /* and isn't needed until we have validated the entry anyway */ + /* Note: When the HP/Apollo Domain automagical network file */ + /* syntax //node/path is used in afpvols, we arrive here with */ + /* a null pointer vp->v_rootd. The if tests do not actually */ + /* fix the problem and correctly handle this syntax, but do at */ + /* least keep aufs from dying here. */ vp->v_rootd = Idirid(path); /* create directory handle */ ! if (vp->v_rootd != NILDIR) /* Don't bomb on //node/path syntax */ ! InitDIDVol(vp->v_rootd, VolCnt); /* initialize volume info for list */ /* Okay, stick it into the table */ ! if (vp->v_rootd != NILDIR) /* Don't bomb on //node/path syntax */ ! VolTbl[VolCnt++] = vp; /* set volume record */ } private char * *** lib/afp/afposlock.c.orig Thu Oct 14 17:13:24 1993 --- lib/afp/afposlock.c Thu Oct 21 17:35:35 1993 *************** *** 48,54 **** --- 48,62 ---- #ifndef NOLOCKF /* on convex, lockf requires fcntl.h */ # ifndef LOCKFUSESFCNTL + # ifdef apollo + /* include F_LOCK and associates in unistd.h definitions */ + # define _INCLUDE_SYS5_SOURCE + # endif apollo # include + # ifdef apollo + # include + # include + # endif apollo /* unistd defines these unnecessarily (and problematically) */ # ifdef ultrix # undef R_OK *** CAP60.README.orig Thu Oct 14 17:13:36 1993 --- CAP60.README Thu Oct 21 18:04:46 1993 *************** *** 47,52 **** --- 47,53 ---- SCO Xenix System V Chip Salzenberg Sequent Balance William Roberts ICL DRS6000 Michael Brown + HP/Apollo Domain BSD 4.3 Darrell Skinner The features file ("m4.features") can be edited from within Configure by answering yes to the question "Do you wish to customise the feature list ?". *************** *** 414,419 **** --- 415,432 ---- under ULTRIX V4.3 you may need to obtain a patched version of /etc/lockd to use DENYREADWRITE code. A possible workaround is to 'nfssetlock off' ... this will impact NFS mounted volumes. + + HP/Apollo Domain BSD 4.3 + Avoid using the //node/path syntax in afpvols, either + explicitly or from expansion of ~. If such a definition + appears in afpvols, the volume corresponding to it may + be visible in the Chooser but be unmountable or may not + appear in the Chooser. Other volumes defined after such + a line also may not show up in the Chooser. You may use + directories mounted on other nodes using soft links or + a path such as /../node/path. It is not clear how much of + the file locking carries over directories on other nodes. + See NOTES for avoiding the //node/path construction. NFS In some circumstances, CAP AUFS using NFS mounted *** Configure.orig Thu Oct 14 17:13:33 1993 --- Configure Thu Oct 21 19:09:05 1993 *************** *** 202,207 **** --- 202,215 ---- lpd="lp" break ;; + "DomainOS") + osdefault="domainossysv" + echo "HP/Apollo Domain OS System V" + echo "Sorry, I do not build under Sys 5.3 environment." + echo "Try building aufs, at least under BSD 4.3 environment." + exit + break + ;; esac fi fi *************** *** 245,250 **** --- 253,282 ---- fi fi fi + # HP/Apollo Domain + if [ -z "${osdefault}" ]; then + echo "Checking for HP/Apollo Domain 10.4" + if [ -f /lib/clib -a -f /lib/libc ]; then + if [ "${SYSTYPE}" = "bsd4.3" ]; then + domainvers=none + domainvers=`/usr/apollo/bin/bldt | { read ln; read ln; read d1 d2 d3 ver ln; echo $ver; }` + case "$domainvers" in + 10.0, | 10.0.1, ) domainvers=10.0;; + 10.1, ) domainvers=10.1;; + 10.2, | 10.2.[0-9]*, ) domainvers=10.2;; + 10.3, | 10.3.[0-9]*, ) domainvers=10.3;; + 10.4, | 10.4.[0-9]*, ) domainvers=10.4;; + esac + echo "HP/Apollo Domain Version ${domainvers} under BSD 4.3 environment." + osdefault="domainosbsd" + echo "IMPORTANT: Read NOTES about avoiding //node/path syntax in afpvols file." + if [ "${domainvers}" != "10.4" ]; then + echo "Warning: untested under Domain OS versions earlier than 10.4" + fi + + fi + fi + fi # Default if [ -z "${osdefault}" ]; then echo "Establishing default as BSD" *************** *** 289,294 **** --- 321,327 ---- "newsos") valid=1;; "drsnx") valid=1;; "epix") valid=1;; + "domainosbsd") valid=1;; "?"|*) if [ "${os}" != "?" ]; then echo "unknown type ${os}, valid are:" *************** *** 312,317 **** --- 345,351 ---- echo " newsos - Sony NEWS" echo " drsnx - ICL DRS/NX V4.0" echo " epix - Control Data EP/IX" + echo " domainosbsd - HP/Apollo Domain BSD 4.3" ;; esac done *************** *** 1056,1061 **** --- 1090,1100 ---- echo "Getting name list from /bsd43/usr/lib/libc.a" ${PNM} /bsd43/usr/lib/libc.a > /tmp/cx$$ ;; + "domainosbsd") + echo "Getting name list from /lib/clib /lib/libc..." + ${PNM} /lib/clib > /tmp/cx$$ + ${PNM} /lib/libc >> /tmp/cx$$ + ;; *) if [ -f /lib/libc.a ]; then echo "Getting name list from /lib/libc.a..." *************** *** 1139,1144 **** --- 1178,1184 ---- # "newsos" - Sony NEWS # "drsnx" - ICL DRS/NX V4.0 # "epix" - Control Data EP/IX + # "domainosbsd" - HP/Apollo Domain BSD 4.3 # Warning: hpux, pyr are hardcoded in some of the makefiles (sorry) # MAJOR CONFIGURATION *************** *** 1411,1416 **** --- 1451,1457 ---- ifelse(os,[newsos],[define([osname],[Sony NEWS])]) ifelse(os,[drsnx],[define([osname],[ICL DRS])]) ifelse(os,[epix],[define([osname],[Control Data EP/IX])]) + ifelse(os,[domainosbsd],[define([osname],[HP/Apollo Domain BSD 4.3])]) # define([cflags],ifdef([selfdefinetypes],[-D_TYPES],[])) define([cflags],concat(cflags,ifdef([usebyteswap],[ -DBYTESWAPPED],[]))) *** NOTES.orig Thu Mar 14 07:14:25 1991 --- NOTES Thu Oct 21 18:32:54 1993 *************** *** 141,146 **** --- 141,168 ---- future versions of aux will probably require slightly different handling. + On HP/Apollo Domain OS, CAP builds under the BSD 4.3 environment, + for Domain OS version 10.4. The main applications (aufs and + papif tested, lwsrv not tested) work on both 68K and 88K/PRISM + machines. The Domain OS syntax //node/path must be avoided in the + afpvol file. Note that this may result from the expansion of ~ if + home directories are defined using the full network syntax. The + problem is purely one of syntax, directories on other nodes may be + mounted using soft links or alternative syntax such as /../node/path. + You may want to modify the aufs man page to communicate this. + [Note: it is better for aufs (and other Unix software) if home + directories are defined without reference to //node and soft links + used between different nodes, so that ~ will never expand to the + unusual Apollo syntax.] Both flock, lockf and (if either the + APPLICATION_MANAGER or DENYREADWRITE options are chosen, see + netat/fcntldomv.h) undocumented fcntl range locking is used. Since + the underlying Domain file system handles locking, one hopes this + may all work -- but, from restrictions in the Domain file sytem, + perhaps not as well on files on remote nodes. If you primarily use + the System V environment but installed the BSD 4.3 environment, you + could probably build aufs, at least, under the BSD environment and + use it under System V. + ********* LIBRARIES ********* *** README.orig Thu Oct 14 17:13:41 1993 --- README Thu Oct 21 19:28:18 1993 *************** *** 84,92 **** o baseline host system: Ultrix 2.0-1. Most will work under BSD 4.2, BSD 4.3, Ultrix 1.0-1.2, Sun OS 3.2 or higher, ACIS 4.2, A/UX, IBM ! RISC 6000, IRIS/IRIX and other systems with BSD like networking ! facilities with varying levels of functionality. Under certain ! systems, only portions will work. Information ----------- --- 84,92 ---- o baseline host system: Ultrix 2.0-1. Most will work under BSD 4.2, BSD 4.3, Ultrix 1.0-1.2, Sun OS 3.2 or higher, ACIS 4.2, A/UX, IBM ! RISC 6000, IRIS/IRIX, HP/Apollo Domain OS under BSD 4.3 environment, ! and other systems with BSD like networking facilities with varying ! levels of functionality. Under certain systems, only portions will work. Information ----------- *************** *** 159,165 **** 4.3, Ultrix 1.0, 1.1, 1.2, 2.2, Sun OS 3.2 or higher, Pyramid's Unix under the BSD universe, ACIS 4.2 or 4.3 for the IBM RT PC, A/UX, HP-UX for the series 9000 (release 6.0), Convex Unix V6.1, Sequents, IBM AIX ! on the RISC 6000, Silicon Graphics IRIS/IRIX and the Encore Multimax. LAP - will probably never be implemented DDP - don't try to use it directly --- 159,166 ---- 4.3, Ultrix 1.0, 1.1, 1.2, 2.2, Sun OS 3.2 or higher, Pyramid's Unix under the BSD universe, ACIS 4.2 or 4.3 for the IBM RT PC, A/UX, HP-UX for the series 9000 (release 6.0), Convex Unix V6.1, Sequents, IBM AIX ! on the RISC 6000, Silicon Graphics IRIS/IRIX, HP/Apollo Domain OS ! (under BSD environment, release 10.4) and the Encore Multimax. LAP - will probably never be implemented DDP - don't try to use it directly *** conf.func.lst.orig Thu Oct 14 17:13:26 1993 --- conf.func.lst Thu Oct 21 11:19:54 1993 *************** *** 9,15 **** E,GETOPT,x,x,"cap: will use public domain getopt" N+-,GETMNT,/usr/include/sys/mount.h,getmnt,"aufs: info on file systems (dec)" N+-,STATFS,/usr/include/sys/vfs.h,statfs,"aufs: info on file systems (sun nfs)" ! N+-,STATFS,/usr/include/sys/statfs.h,statfs,"aufs: info on file systems (irix)" N+-,STATFS,/usr/include/sys/mount.h,statfs,"aufs: info on file systems (bsd44)" E,GETOPT,x,x,"aufs: no space information on volumes will be available" N+-,QUOTA,/usr/include/sys/quota.h,quota,"aufs: info on user quota" --- 9,15 ---- E,GETOPT,x,x,"cap: will use public domain getopt" N+-,GETMNT,/usr/include/sys/mount.h,getmnt,"aufs: info on file systems (dec)" N+-,STATFS,/usr/include/sys/vfs.h,statfs,"aufs: info on file systems (sun nfs)" ! N+-,STATFS,/usr/include/sys/statfs.h,statfs,"aufs: info on file systems (irix, domainos)" N+-,STATFS,/usr/include/sys/mount.h,statfs,"aufs: info on file systems (bsd44)" E,GETOPT,x,x,"aufs: no space information on volumes will be available" N+-,QUOTA,/usr/include/sys/quota.h,quota,"aufs: info on user quota" *** contrib/AppManager/aufslock.c.orig Thu Oct 14 17:13:25 1993 --- contrib/AppManager/aufslock.c Thu Oct 21 16:30:34 1993 *************** *** 22,27 **** --- 22,31 ---- #include #include + #ifdef apollo + # include + #endif apollo + main(argc, argv) int argc; char *argv[]; *** contrib/AppManager/aufsmon.c.orig Thu Oct 14 17:13:25 1993 --- contrib/AppManager/aufsmon.c Thu Oct 21 16:29:58 1993 *************** *** 30,35 **** --- 30,38 ---- #include #include + #ifdef apollo + # include + #endif apollo struct flist { char *filename; *** netat/Makefile.orig Thu Feb 28 13:43:35 1991 --- netat/Makefile Thu Oct 21 15:44:30 1993 *************** *** 1,5 **** HFILES = aberrors.h abqueue.h appletalk.h afp.h afpcmd.h afpc.h \ ! compat.h sysvcompat.h macfile.h abnbp.h install: $(HFILES) -mkdir /usr/include/netat --- 1,5 ---- HFILES = aberrors.h abqueue.h appletalk.h afp.h afpcmd.h afpc.h \ ! compat.h sysvcompat.h macfile.h abnbp.h fcntldomv.h install: $(HFILES) -mkdir /usr/include/netat *** netat/Makefile.m4.orig Sun Mar 8 14:46:20 1992 --- netat/Makefile.m4 Thu Oct 21 15:46:23 1993 *************** *** 1,6 **** I=includedir() HFILES = aberrors.h abqueue.h appletalk.h afp.h afpcmd.h afpc.h \ ! compat.h sysvcompat.h macfile.h abnbp.h install: $(HFILES) -mkdir $I/netat --- 1,6 ---- I=includedir() HFILES = aberrors.h abqueue.h appletalk.h afp.h afpcmd.h afpc.h \ ! compat.h sysvcompat.h macfile.h abnbp.h fcntldomv.h install: $(HFILES) -mkdir $I/netat From: skinner@LPMI.POLYTECHNIQUE.FR (Darrell A. Skinner) Newsgroups: comp.sys.apollo Subject: Re: CAP patch for Domain BSD 4.3 (version 10.4) Date: 21 Oct 93 20:28:50 GMT Whoops, I already see that I left out a piece of the patch I just posted for CAP. ------------------------ Append this to CAP patch ----------------------- *** netat/fcntldomv.h.orig Thu Oct 21 14:17:59 1993 --- netat/fcntldomv.h Thu Oct 21 21:23:00 1993 *************** *** 0 **** --- 1,34 ---- + + /* + * fcntldomv.h - Definitions for hidden fcntl calls in HP/Apollo Domain BSD 4.3. + * + * The F_SETLK and F_GETLK fcntl calls are not documented for HP/Apollo Domain + * BSD 4.3 environment, but apparently exist and work. Below are the + * necessary definitions as defined in the SysV environment. + * + * These lock calls are only needed if the APPLICATION_MANAGER and/or + * DENYREADWRITE options are enabled in m4.features. The APPLICATION_MANAGER's + * features (inihibiting finder copying and limiting the number of simultaneous + * executions of applications) appear to work with these hidden calls. + * Interestingly enough, these features appear to work even when the managed + * applications reside on another node's disk, even though the Domain Sys V + * documentation for fcntl says that record locking works only on the + * station local to the call. + * + * Darrell Skinner Oct 1993 + * + */ + + #define F_GETLK 7 /* Get file lock */ + #define F_SETLK 8 /* Set file lock */ + #define F_RDLCK 01 /* Shared or Read lock. */ + #define F_WRLCK 02 /* Exclusive or Write lock. */ + #define F_UNLCK 03 /* Unlock. */ + struct flock { + short l_type; /* Type of lock. */ + short l_whence; /* Flag for starting offset. */ + off_t l_start; /* Relative offset in bytes. */ + off_t l_len; /* Size; if 0 then until EOF. */ + short l_sysid; + short l_pid; /* Process ID of the lock owner. */ + };