Patch #: 193 Type: operational change Priority: none Modification: add support for Solaris 2.N Native EtherTalk Submitted: Andy Polyakov Submitted: Rakesh Patel Submitted: Robert Montjoy Submitted: John Jorgensen Submitted: David Hornsby Archived: munnari.OZ.AU mac/cap.patches/cap60.patch193 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch193' WARNING: WARNING: If you have already applied solaris-pl192-beta-diffs then WARNING: you should re-apply the diffs using the patch -R option WARNING: AND THEN remove the following files manually WARNING: rm lib/cap/scandir.c WARNING: rm etc/S99appletalk WARNING: rm applications/papif/papif.interface.template WARNING: rm applications/papif/add_at_printer WARNING: rm support/ethertalk/sdlpi.c WARNING: rm README.solaris2 WARNING: rm contrib/Messages/Makefile.sol2 WARNING: rm contrib/Timelord/Makefile.sol2 WARNING: BEFORE you apply patch 193 WARNING: File: cap60/Configure File: cap60/conf.func.lst File: cap60/conf.func.sh File: cap60/conf.sysv.sh File: cap60/support/ethertalk/senetp.c File: cap60/support/ethertalk/ethertalk.c File: cap60/support/ethertalk/aarpd_svc.c File: cap60/support/ethertalk/aarpd_clnt.c File: cap60/support/ethertalk/aarpd.c File: cap60/support/ethertalk/sdlpi.c File: cap60/support/ethertalk/Makefile.m4 File: cap60/support/uab/aarp_defs.h File: cap60/support/uab/hash.c File: cap60/lib/cap/scandir.c File: cap60/lib/cap/atalkdbm.c File: cap60/lib/cap/Makefile.m4 File: cap60/lib/cap/authenticate.c File: cap60/lib/afp/afposlock.c File: cap60/netat/sysvcompat.h File: cap60/samples/lwpr.c File: cap60/applications/papif/papif.c File: cap60/applications/papif/papof.c File: cap60/applications/lwsrv/lwsrv.c File: cap60/applications/lwsrv/procset.c File: cap60/applications/aufs/Makefile.m4 File: cap60/applications/aufs/aufs.c File: cap60/applications/aufs/afpdid.c File: cap60/applications/aufs/afpdt.c File: cap60/applications/aufs/afpdt.h File: cap60/applications/aufs/afpos.c File: cap60/applications/aufs/afposenum.c File: cap60/applications/aufs/afpspd.c File: cap60/applications/aufs/afps.h File: cap60/etc/S99appletalk File: cap60/contrib/cvt2apple.c File: cap60/contrib/snitch.c File: cap60/contrib/AufsTools/binhex/Makefile File: cap60/contrib/AufsTools/binhex/aufs.h File: cap60/contrib/AufsTools/binhex/binhex.c File: cap60/contrib/AufsTools/capit/capit.c File: cap60/contrib/AufsTools/mcvert/Makefile File: cap60/contrib/AufsTools/mcvert/mactypes.h File: cap60/contrib/AufsTools/stuffit/sit.h File: cap60/contrib/AufsTools/stuffit/sit.c File: cap60/contrib/AufsTools/unstuffit/unsit.c File: cap60/contrib/AppManager/aufsmon.c File: cap60/contrib/printqueue.c File: cap60/contrib/DeskTop/dt.h File: cap60/contrib/DeskTop/builddt.c File: cap60/README *** Configure.orig Tue Dec 7 03:39:46 1993 --- Configure Mon Oct 10 18:54:20 1994 *************** *** 1,7 **** #!/bin/sh ! # $Author: djh $ $Date: 1993/12/06 16:39:28 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.72 1993/12/06 16:39:28 djh Rel djh $ ! # $Revision: 2.72 $ # 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: 1994/10/10 08:54:05 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.73 1994/10/10 08:54:05 djh Rel djh $ ! # $Revision: 2.73 $ # 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) # *************** *** 9,16 **** # fastether="define([fastether],1) # For papif and samples" needselfdef="define([selfdefinetypes],1)" - ccompiler=cc # ccompiler="define([thecompiler],[cc])" # lpd system "bsd" or sys v "lp" lpd="bsd" mydir=`pwd` --- 9,21 ---- # fastether="define([fastether],1) # For papif and samples" needselfdef="define([selfdefinetypes],1)" # ccompiler="define([thecompiler],[cc])" + if [ -z "${CC}" ]; then + ccompiler=cc + else + ccompiler=${CC} + fi + export ccompiler # lpd system "bsd" or sys v "lp" lpd="bsd" mydir=`pwd` *************** *** 304,318 **** fi echo valid=0 - newl="" echo -n test | ${PGREP} n > /dev/null rc=$? if [ $rc -ne 0 ]; then ! newl="-n" fi while [ ${valid} -eq 0 ]; do ! echo $newl "Operating System type? (default ${osdefault}, ? for valid items) " read os arg1 if [ -z "${os}" ]; then os=${osdefault} --- 309,326 ---- fi echo valid=0 echo -n test | ${PGREP} n > /dev/null rc=$? if [ $rc -ne 0 ]; then ! PROMPT="echo -n" ! elif [ -x /usr/ucb/echo ]; then ! PROMPT="/usr/ucb/echo -n" ! else ! PROMPT="echo" fi while [ ${valid} -eq 0 ]; do ! ${PROMPT} "Operating System type? (default ${osdefault}, ? for valid items) " read os arg1 if [ -z "${os}" ]; then os=${osdefault} *************** *** 399,405 **** ;; "solaris") uarsupport=1 ! # no other support yet ... ;; "aix") uarsupport=1 --- 407,413 ---- ;; "solaris") uarsupport=1 ! ethersupport=1 ;; "aix") uarsupport=1 *************** *** 463,469 **** result=0 while : do ! echo $newl "Do you wish to use UAB (Unix AppleTalk Bridge) (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 471,477 ---- result=0 while : do ! ${PROMPT} "Do you wish to use UAB (Unix AppleTalk Bridge) (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 509,516 **** "386bsd") echo "OK, setting things up for UAB." uabpobjs="define([uabpobjs],[bpfiltp.o])";; "sunos") ! echo $newl "Have you installed the 'enet' driver (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 517,527 ---- "386bsd") echo "OK, setting things up for UAB." uabpobjs="define([uabpobjs],[bpfiltp.o])";; + "solaris") + echo "OK, setting things up for UAB." + uabpobjs="define([uabpobjs],[sdlpi.o])";; "sunos") ! ${PROMPT} "Have you installed the 'enet' driver (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 535,541 **** result=0 while : do ! echo $newl "Do you wish to use UAR (Unix AppleTalk Router)(default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 546,552 ---- result=0 while : do ! ${PROMPT} "Do you wish to use UAR (Unix AppleTalk Router)(default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 557,563 **** uabplibs="define([uabplibs],[])" uabpobjs="define([uabpobjs],[])" lapobj="define([lapobj],[abmkip.o abddp.o abnbp.o atalkdbm.o])" ! echo $newl "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 568,574 ---- uabplibs="define([uabplibs],[])" uabpobjs="define([uabpobjs],[])" lapobj="define([lapobj],[abmkip.o abddp.o abnbp.o atalkdbm.o])" ! ${PROMPT} "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 580,586 **** result=0 while : do ! echo $newl "Do you wish to use Native EtherTalk (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 591,597 ---- result=0 while : do ! ${PROMPT} "Do you wish to use Native EtherTalk (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 604,610 **** echo "OK, setting things up for Native EtherTalk." etherpobjs="define([etherpobjs],[dlip.o])";; "osf1"|"ultrix40") ! echo $newl "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 615,621 ---- echo "OK, setting things up for Native EtherTalk." etherpobjs="define([etherpobjs],[dlip.o])";; "osf1"|"ultrix40") ! ${PROMPT} "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 633,640 **** "386bsd") echo "OK, setting things up for Native EtherTalk." etherpobjs="define([etherpobjs],[bpfiltp.o])";; "sunos") ! echo $newl "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 644,671 ---- "386bsd") echo "OK, setting things up for Native EtherTalk." etherpobjs="define([etherpobjs],[bpfiltp.o])";; + "solaris") + ${PROMPT} "Do you want Phase 2 compatibility (no) ? " + read ans + if [ -z "${ans}" ]; then + ans="no" + fi + case ${ans} in + "yes"|"y") + usephase2=1 + ;; + *) + ;; + esac + ${PROMPT} "OK, using the Streams ethernet interface " + if [ $usephase2 -eq 1 ]; then + echo "for Phase 2 support." + else + echo "for Phase 1 support." + fi + etherpobjs="define([etherpobjs],[sdlpi.o])";; "sunos") ! ${PROMPT} "Do you want Phase 2 compatibility (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 646,652 **** *) ;; esac ! echo $newl "Have you installed the 'enet' driver (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 677,683 ---- *) ;; esac ! ${PROMPT} "Have you installed the 'enet' driver (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 656,665 **** *) aresult=0;; esac if [ $aresult -eq 0 ]; then ! echo $newl "OK, using the NIT ethernet interface" etherpobjs="define([etherpobjs],[snitp.o])" else ! echo $newl "OK, using the 'enet' ethernet interface" etherpobjs="define([etherpobjs],[senetp.o])" fi if [ $usephase2 -eq 1 ]; then --- 687,696 ---- *) aresult=0;; esac if [ $aresult -eq 0 ]; then ! ${PROMPT} "OK, using the NIT ethernet interface" etherpobjs="define([etherpobjs],[snitp.o])" else ! ${PROMPT} "OK, using the 'enet' ethernet interface" etherpobjs="define([etherpobjs],[senetp.o])" fi if [ $usephase2 -eq 1 ]; then *************** *** 678,684 **** result=0 while : do ! echo $newl "Do you wish to use Kernel AppleTalk (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 709,715 ---- result=0 while : do ! ${PROMPT} "Do you wish to use Kernel AppleTalk (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 716,722 **** result=0 while : do ! echo $newl "Do you wish to restrict CAP to this subdirectory (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 747,753 ---- result=0 while : do ! ${PROMPT} "Do you wish to restrict CAP to this subdirectory (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 728,733 **** --- 759,773 ---- esac done if [ $result -ne 0 ]; then + ${PROMPT} "Which directory (" `pwd` ") ? " + read ans + if [ ! -z "${ans}" ]; then + if [ -d "${ans}" ]; then + mydir=${ans} + else + echo "Warning: the directory" ${ans} "doesn't exist." + fi + fi echo "OK, using" ${mydir} "as the CAP root directory." singletree="define([debug],1)" else *************** *** 735,741 **** result=0 while : do ! echo $newl "Look for my include files in other than /usr/include (no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 775,781 ---- result=0 while : do ! ${PROMPT} "Look for my include files in other than /usr/include (no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 747,753 **** esac done if [ $result -ne 0 ]; then ! echo $newl "Include file location (" ${mydir} ") ? " read ans if [ -n "${ans}" ]; then mydir="${ans}" --- 787,793 ---- esac done if [ $result -ne 0 ]; then ! ${PROMPT} "Include file location (" ${mydir} ") ? " read ans if [ -n "${ans}" ]; then mydir="${ans}" *************** *** 846,851 **** --- 886,894 ---- # + PASS_THRU pass through LWSRV jobs with no adobe preprocessing (for PCs) # define(`specialcflags',concat(specialcflags,` -DPASS_THRU')) # + # + DONT_PARSE pass through LWSRV jobs with no adobe preprocessing at all + # define(`specialcflags',concat(specialcflags,` -DDONT_PARSE')) + # # + XDEV_RENAME allow files to be moved over cross device links # define(`specialcflags',concat(specialcflags,` -DXDEV_RENAME')) # *************** *** 901,906 **** --- 944,954 ---- # + LOGIN_AUTH_PROG AUFS -L option specifies external authorization program # define(`aufsosflags',concat(aufsosflags,` -DLOGIN_AUTH_PROG')) # + # + USEQUOTA forces usage of ufs quotas [Solaris 2.x only] + # note: check if you applied ufs quota patch: + # 100833-xx for Solaris 2.1 + # 101039-xx for Solaris 2.2 + # define(`aufsosflags',concat(aufsosflags,` -DUSEQUOTA')) # # # LWSRV definable options (previously required editing m4.setup) *************** *** 956,962 **** echo "You appear to have a locally customised version of m4.features." while : do ! echo $newl "I assume that you want to use it rather than the default (y) ? " read ans if [ -z "${ans}" ]; then ans="yes" --- 1004,1010 ---- echo "You appear to have a locally customised version of m4.features." while : do ! ${PROMPT} "I assume that you want to use it rather than the default (y) ? " read ans if [ -z "${ans}" ]; then ans="yes" *************** *** 987,993 **** result=0 while : do ! echo $newl "Do you wish to customise the feature list (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" --- 1035,1041 ---- result=0 while : do ! ${PROMPT} "Do you wish to customise the feature list (default no) ? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 1024,1030 **** result=0 while : do ! echo $newl "Do you want to throttle output for a Kinetics box (default no)? " read ans if [ -z "${ans}" ]; then ans="no" --- 1072,1078 ---- result=0 while : do ! ${PROMPT} "Do you want to throttle output for a Kinetics box (default no)? " read ans if [ -z "${ans}" ]; then ans="no" *************** *** 1083,1089 **** echo "Assuming that your C compiler returns error codes." echo " Temporary files: /tmp/cx$$.c, cx$$.o" echo ! echo $newl "[Hit carriage return to continue] " read ans trap " echo Exiting... Wait... --- 1131,1137 ---- echo "Assuming that your C compiler returns error codes." echo " Temporary files: /tmp/cx$$.c, cx$$.o" echo ! ${PROMPT} "[Hit carriage return to continue] " read ans trap " echo Exiting... Wait... *************** *** 1106,1112 **** echo " #endif" echo "can be made to work by define _TYPES everywhere" echo ! echo $newl "[Hit carriage return to continue] " read ans ${ccompiler} -c -D_TYPES /tmp/cx$$.c > /dev/null 2>/dev/null rc=$? --- 1154,1160 ---- echo " #endif" echo "can be made to work by define _TYPES everywhere" echo ! ${PROMPT} "[Hit carriage return to continue] " read ans ${ccompiler} -c -D_TYPES /tmp/cx$$.c > /dev/null 2>/dev/null rc=$? *************** *** 1131,1142 **** echo "Checking for various system calls. (But not the list of system" echo "call for system V compatibility). Temp files: m4.tmp, /tmp/cx$$" echo ! echo $newl "[Hit carriage return to continue] " read ans echo trap " echo Exiting... Wait... if [ -f /tmp/cx$$ ]; then rm -f /tmp/cx$$; fi; exit 255" 2 case "${osdefault}" in "xenix5") echo "Getting name list from /lib/386/Slib{[cx],socket}.a..." --- 1179,1191 ---- echo "Checking for various system calls. (But not the list of system" echo "call for system V compatibility). Temp files: m4.tmp, /tmp/cx$$" echo ! ${PROMPT} "[Hit carriage return to continue] " read ans echo trap " echo Exiting... Wait... if [ -f /tmp/cx$$ ]; then rm -f /tmp/cx$$; fi; exit 255" 2 + libs="" case "${osdefault}" in "xenix5") echo "Getting name list from /lib/386/Slib{[cx],socket}.a..." *************** *** 1145,1154 **** ${PNM} /lib/386/Slibsocket.a >> /tmp/cx$$ ;; "solaris") ! echo "Getting name list from /lib/libc.a /usr/ucblib/libucb.a..." ${PNM} /lib/libc.a > /tmp/cx$$ ! ${PNM} /usr/ucblib/libucb.a >> /tmp/cx$$ ${PNM} /lib/libsocket.a >> /tmp/cx$$ ;; "drsnx") echo "Getting name list from /usr/ccs/libc.a /usr/ucblib/libucb.a..." --- 1194,1206 ---- ${PNM} /lib/386/Slibsocket.a >> /tmp/cx$$ ;; "solaris") ! echo "Getting name list from /lib/libc.a ..." ${PNM} /lib/libc.a > /tmp/cx$$ ! echo "Getting name list from /lib/libsocket.a ..." ${PNM} /lib/libsocket.a >> /tmp/cx$$ + echo "Getting name list from /lib/libnsl.a ..." + ${PNM} /lib/libnsl.a >> /tmp/cx$$ + libs="-lsocket -lnsl" ;; "drsnx") echo "Getting name list from /usr/ccs/libc.a /usr/ucblib/libucb.a..." *************** *** 1194,1200 **** echo "Couldn't get the name list!" else echo "Done, running function configuration" ! confos=${os}; export confos; export ccompiler ${USESH} ./conf.func.sh /tmp/cx$$ conf.func.lst m4 m4.tmp rc=$? if [ $rc -eq 1 ]; then --- 1246,1252 ---- echo "Couldn't get the name list!" else echo "Done, running function configuration" ! confos=${os}; export confos; export ccompiler; export libs ${USESH} ./conf.func.sh /tmp/cx$$ conf.func.lst m4 m4.tmp rc=$? if [ $rc -eq 1 ]; then *************** *** 1214,1220 **** of=$1 fi echo ! echo $newl "[Hit carriage return to continue] " read ans echo if [ -f ${of} ]; then --- 1266,1272 ---- of=$1 fi echo ! ${PROMPT} "[Hit carriage return to continue] " read ans echo if [ -f ${of} ]; then *************** *** 1223,1229 **** echo "Getting ready to create ${of}" fi echo ! echo $newl "[Hit carriage return to continue] " read ans echo "Creating ${of}" rm -f ${of} --- 1275,1281 ---- echo "Getting ready to create ${of}" fi echo ! ${PROMPT} "[Hit carriage return to continue] " read ans echo "Creating ${of}" rm -f ${of} *************** *** 1328,1334 **** # MINOR CONFIGURATION: configure various programs #define([columbia],1) # so columbia can do things quickly ! #define([rutgers],1) # so rutgers can do things quickly # location of include files define([includedir],[[/usr/include]]) --- 1380,1386 ---- # MINOR CONFIGURATION: configure various programs #define([columbia],1) # so columbia can do things quickly ! #define([rutgersdef],1) # so rutgers can do things quickly # location of include files define([includedir],[[/usr/include]]) *************** *** 1344,1350 **** define([capsrvrdestdir],[[/usr/local/cap]]) # location of some cap data files define([caplibdestdir],[[/usr/local/lib/cap]]) ! ifdef([rutgers],[define([caplibdestdir],[[/usr/local/cap/lib]])]) # location of cap libraries define([libdestdir],[[/usr/local/lib]]) # override for aux (doesn't search /usr/local/lib) --- 1396,1402 ---- define([capsrvrdestdir],[[/usr/local/cap]]) # location of some cap data files define([caplibdestdir],[[/usr/local/lib/cap]]) ! ifdef([rutgersdef],[define([caplibdestdir],[[/usr/local/cap/lib]])]) # location of cap libraries define([libdestdir],[[/usr/local/lib]]) # override for aux (doesn't search /usr/local/lib) *************** *** 1381,1386 **** --- 1433,1444 ---- [define([libafp],concat([-L],libdestdir,[ ],libafp))]) ifelse(os,[epix], [define([libafpc],concat([-L],libdestdir,[ ],libafpc))]) + ifelse(os,[solaris], + [define([libcap],concat([-L],libdestdir,[ ],libcap))]) + ifelse(os,[solaris], + [define([libafp],concat([-L],libdestdir,[ ],libafp))]) + ifelse(os,[solaris], + [define([libafpc],concat([-L],libdestdir,[ ],libafpc))]) # any special libraries define([libspecial],[]) ifelse(os,[ultrix40],[ *************** *** 1405,1410 **** --- 1463,1476 ---- define([libspecial],concat(libspecial,[ -lc -lsec]))]) ifelse(os,[386bsd],[ define([libspecial],concat(libspecial,[ -lrpc]))]) + ifelse(os,[solaris],[ + define([libspecial],concat(libspecial,[ -lsocket -lnsl ]))]) + # rutgers specific + define([libru],[]) + ifdef([rutgersdef], [ + ifelse(os,[solaris],[ + define([libru],concat(libru,[ -L/usr/local/lib -R/usr/local/lib -lru ]))],[ + define([libru],concat(libru,[ -lru ]))])]) # # special configurations for individual source files *************** *** 1520,1526 **** ifelse(os,[osf1],[define([osname],[OSF/1])]) ifelse(os,[aux],[define([osname],[A/UX])]) ifelse(os,[sunos],[define([osname],[SunOS])]) ! ifelse(os,[solaris],[define([osname],[Solaris in BSD universe])]) ifelse(os,[encore],[define([osname],[Encore Umax])]) ifelse(os,[hpux],[define([osname],[HP-UX (for 9000 series)])]) ifelse(os,[uts],[define([osname],[Amdahl UTS])]) --- 1586,1592 ---- ifelse(os,[osf1],[define([osname],[OSF/1])]) ifelse(os,[aux],[define([osname],[A/UX])]) ifelse(os,[sunos],[define([osname],[SunOS])]) ! ifelse(os,[solaris],[define([osname],[Solaris 2.x in native SVR4 mode])]) ifelse(os,[encore],[define([osname],[Encore Umax])]) ifelse(os,[hpux],[define([osname],[HP-UX (for 9000 series)])]) ifelse(os,[uts],[define([osname],[Amdahl UTS])]) *************** *** 1569,1578 **** define([nbpflags],[]) define([lflags],[]) define([mflags],[]) - - # solaris ld does not search /usr/local/lib, so: - ifelse(os,[solaris],[ - define([lflags],concat(lflags,concat([-L],libdestdir)))]) # aux's c compiler isn't nice - it doesn't have a preprocessor # definition for aux. So, let's invent one. Also turn on -n --- 1635,1640 ---- *** conf.func.lst.orig Wed Aug 17 07:25:58 1994 --- conf.func.lst Mon Oct 10 18:54:22 1994 *************** *** 1,6 **** ! # $Author: djh $ $Date: 1993/11/23 08:48:48 $ ! # $Header: /mac/src/cap60/RCS/conf.func.lst,v 2.7 1993/11/23 08:48:48 djh Rel djh $ ! # $Revision: 2.7 $ # # see Conf.func.sh for format of file # --- 1,6 ---- ! # $Author: djh $ $Date: 1994/10/10 08:54:05 $ ! # $Header: /mac/src/cap60/RCS/conf.func.lst,v 2.8 1994/10/10 08:54:05 djh Rel djh $ ! # $Revision: 2.8 $ # # see Conf.func.sh for format of file # *************** *** 8,13 **** --- 8,14 ---- N+-,GETOPT,x,getopt,"cap: argument processing" 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/statvfs.h,statvfs,"aufs: info on file systems (solaris)" 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)" *** conf.func.sh.orig Mon Oct 10 18:32:11 1994 --- conf.func.sh Mon Oct 10 18:54:23 1994 *************** *** 1,7 **** #!/bin/sh ! # $Author: djh $ $Date: 1993/11/30 09:31:49 $ ! # $Header: /mac/src/cap60/RCS/conf.func.sh,v 2.5 1993/11/30 09:31:49 djh Rel djh $ ! # $Revision: 2.5 $ # # CAP function configuration 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 --- 1,7 ---- #!/bin/sh ! # $Author: djh $ $Date: 1994/10/10 08:54:05 $ ! # $Header: /mac/src/cap60/RCS/conf.func.sh,v 2.6 1994/10/10 08:54:05 djh Rel djh $ ! # $Revision: 2.6 $ # # CAP function configuration 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 *************** *** 234,240 **** if [ $fullcheck -eq 1 ]; then if [ $good -eq 0 ]; then echo "main(){$call();}" > /tmp/cfs$$.c ! ${ccompiler} -o /tmp/cfs$$ /tmp/cfs$$.c >/dev/null 2>/dev/null good=$? else echo "$call not found in namelist" --- 234,240 ---- if [ $fullcheck -eq 1 ]; then if [ $good -eq 0 ]; then echo "main(){$call();}" > /tmp/cfs$$.c ! ${ccompiler} -o /tmp/cfs$$ /tmp/cfs$$.c ${libs} >/dev/null 2>/dev/null good=$? else echo "$call not found in namelist" *** conf.sysv.sh.orig Thu Feb 28 23:45:49 1991 --- conf.sysv.sh Mon Oct 10 18:54:25 1994 *************** *** 1,7 **** #!/bin/sh ! # $Author: djh $ $Date: 91/02/15 20:46:06 $ ! # $Header: conf.sysv.sh,v 2.1 91/02/15 20:46:06 djh Rel $ ! # $Revision: 2.1 $ # CAP System V configuration aid shell script. This ain't perfect, # but it's a start # --- 1,7 ---- #!/bin/sh ! # $Author: djh $ $Date: 1994/10/10 08:54:05 $ ! # $Header: /mac/src/cap60/RCS/conf.sysv.sh,v 2.2 1994/10/10 08:54:05 djh Rel djh $ ! # $Revision: 2.2 $ # CAP System V configuration aid shell script. This ain't perfect, # but it's a start # *************** *** 13,19 **** mydir=`pwd` PCAT=/bin/cat PGREP=grep ! PNM=/bin/nm ccompiler=cc export PGREP # define to sh or /bin/sh if shell scripts can't be "executed" for some reason --- 13,23 ---- mydir=`pwd` PCAT=/bin/cat PGREP=grep ! if [ -f /usr/ccs/bin/nm ]; then ! PNM="/usr/ccs/bin/nm -p" ! else ! PNM=/bin/nm ! fi ccompiler=cc export PGREP # define to sh or /bin/sh if shell scripts can't be "executed" for some reason *** support/ethertalk/senetp.c.orig Sun Jul 26 00:17:18 1992 --- support/ethertalk/senetp.c Mon Oct 10 18:55:15 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1992/07/25 14:16:37 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/senetp.c,v 2.8 1992/07/25 14:16:37 djh Rel djh $"; ! static char revision[] = "$Revision: 2.8 $"; /* * senetp.c - Simple "protocol" level interface to enet --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 08:55:05 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/senetp.c,v 2.9 1994/10/10 08:55:05 djh Rel djh $"; ! static char revision[] = "$Revision: 2.9 $"; /* * senetp.c - Simple "protocol" level interface to enet *************** *** 227,233 **** --- 227,235 ---- #endif NOBUF /* flush read queue */ + #ifdef EIOCFLUSH ioctl(s, EIOCFLUSH, 0); + #endif EIOCFLUSH return(s); } *** support/ethertalk/ethertalk.c.orig Tue Aug 27 20:58:12 1991 --- support/ethertalk/ethertalk.c Mon Oct 10 18:55:17 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/27 10:58:03 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/ethertalk.c,v 2.5 1991/08/27 10:58:03 djh Rel djh $"; ! static char revision[] = "$Revision: 2.5 $"; /* * ethertalk.c - ethertalk interface --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 08:55:05 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/ethertalk.c,v 2.6 1994/10/10 08:55:05 djh Rel djh $"; ! static char revision[] = "$Revision: 2.6 $"; /* * ethertalk.c - ethertalk interface *************** *** 503,505 **** --- 503,519 ---- aarp_dump_tables(fd, eh->eh_ah); putc('\n', fd); } + + #ifdef SOLARIS + #include + + int + gethostid() + { + char buf[32]; + + sysinfo(SI_HW_SERIAL, buf, sizeof(buf)-2); + + return(atoi(buf)); + } + #endif SOLARIS *** support/ethertalk/aarpd_svc.c.orig Wed May 29 22:36:29 1991 --- support/ethertalk/aarpd_svc.c Mon Oct 10 18:55:18 1994 *************** *** 9,15 **** --- 9,19 ---- */ #include + #ifdef SOLARIS + #define PORTMAP + #endif SOLARIS #include + #include #include "aarpd.h" bool_t xdr_etheraddr(); *************** *** 70,84 **** return; } bzero((char *)&argument, sizeof(argument)); ! if (!svc_getargs(transp, xdr_argument, &argument)) { svcerr_decode(transp); return; } result = (*local)(&argument, rqstp); ! if (result != NULL && !svc_sendreply(transp, xdr_result, result)) { svcerr_systemerr(transp); } ! if (!svc_freeargs(transp, xdr_argument, &argument)) { (void)fprintf(stderr, "unable to free arguments\n"); exit(1); } --- 74,89 ---- return; } bzero((char *)&argument, sizeof(argument)); ! if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) { svcerr_decode(transp); return; } result = (*local)(&argument, rqstp); ! if (result != NULL ! && !svc_sendreply(transp, xdr_result, (caddr_t)result)) { svcerr_systemerr(transp); } ! if (!svc_freeargs(transp, xdr_argument, (caddr_t)&argument)) { (void)fprintf(stderr, "unable to free arguments\n"); exit(1); } *** support/ethertalk/aarpd_clnt.c.orig Wed Aug 17 07:57:43 1994 --- support/ethertalk/aarpd_clnt.c Mon Oct 10 18:55:19 1994 *************** *** 7,14 **** --- 7,18 ---- * 28/04/91: add range_set_clnt() */ + #ifdef SOLARIS + #define PORTMAP + #endif SOLARIS #include #include + #include #include "aarpd.h" bool_t xdr_etheraddr(); *************** *** 28,35 **** { static etheraddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, AARP_RESOLVE, xdr_int, argp, xdr_etheraddr, ! res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); --- 32,39 ---- { static etheraddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, AARP_RESOLVE, xdr_int, (caddr_t)argp, ! xdr_etheraddr, res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); *************** *** 46,53 **** { static bridgeaddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, RTMP_GETBADDR, xdr_int, argp, xdr_bridgeaddr, ! res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); --- 50,57 ---- { static bridgeaddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, RTMP_GETBADDR, xdr_int, (caddr_t)argp, ! xdr_bridgeaddr, res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); *************** *** 64,71 **** { static bridgeaddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, RTMP_SETBADDR, xdr_int, argp, xdr_bridgeaddr, ! res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); --- 68,75 ---- { static bridgeaddr res; bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, RTMP_SETBADDR, xdr_int, (caddr_t)argp, ! xdr_bridgeaddr, res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); *************** *** 83,90 **** { static bridgeaddr res; /* convenient size */ bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, NET_RANGE_SET, xdr_int, argp, xdr_bridgeaddr, ! res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); --- 87,94 ---- { static bridgeaddr res; /* convenient size */ bzero((char *)res, sizeof(res)); ! if (clnt_call(clnt, NET_RANGE_SET, xdr_int, (caddr_t)argp, ! xdr_bridgeaddr, res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (res); *** support/ethertalk/aarpd.c.orig Mon Nov 22 20:47:01 1993 --- support/ethertalk/aarpd.c Mon Oct 10 18:55:21 1994 *************** *** 24,33 **** #include #include #include ! #ifdef __386BSD__ #include #include ! #else /* __386BSD__ */ #include #include #include --- 24,36 ---- #include #include #include ! #if defined(__386BSD__) || defined(SOLARIS) ! #ifdef SOLARIS ! #define PORTMAP ! #endif SOLARIS #include #include ! #else /* __386BSD__ or SOLARIS */ #include #include #include *************** *** 281,286 **** --- 284,292 ---- /* disassociate */ if (fork()) _exit(0); /* kill parent */ + #ifdef POSIX + (void)setsid(); + #endif POSIX for (i=0; i < 3; i++) close(i); /* kill */ (void)open("/",0); #ifdef NODUP2 *************** *** 440,446 **** void set_svc_listen() { ! int i, svc_listener(); #ifdef ultrix for(i = 0 ; i < 32 ; i++) --- 446,453 ---- void set_svc_listen() { ! int i; ! private int svc_listener(); #ifdef ultrix for(i = 0 ; i < 32 ; i++) *** support/ethertalk/sdlpi.c.orig Wed Sep 7 12:28:50 1994 --- support/ethertalk/sdlpi.c Mon Oct 10 18:55:51 1994 *************** *** 0 **** --- 1,985 ---- + /* + * sdlpi.c - Simple "protocol" level interface to Streams based DLPI + * (SunOS 5.x) (derived from snitp.c SunOS 4.x module) + * + * Provides ability to read/write packets at ethernet level + * + * + * Copyright (c) 1988 by The Trustees of Columbia University + * in the City of New York. + * + * Permission is granted to any individual or institution to use, + * copy, or redistribute this software so long as it is not sold for + * profit, provided that this notice and the original copyright + * notices are retained. Columbia University nor the author make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * Edit History: + * + * July 1988 CCKim Created + * April '91 djh Add Phase 2 support + * May-June 93 montjoy@thor.ece.uc.EDU, + * appro@fy.chalmers.se SunOS 5.x support + * + */ + + static char columbia_copyright[] = "Copyright (c) 1988 by The Trustees of \ + Columbia University in the City of New York"; + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + #include + + #include + #include + #include "../uab/proto_intf.h" + + #define IEEE802_2 16 /* IEEE 802.2 SAP field */ + /* actually 0 < any_number < 1500 */ + + private int init_nit(); + private int stream_readv (); + + typedef struct ephandle { /* ethernet protocol driver handle */ + int inuse; /* true if inuse */ + int fd; /* file descriptor of socket */ + struct ifreq ifr; + int protocol; /* ethernet protocol */ + int socket; /* ddp socket */ + } EPHANDLE; + + private inited = FALSE; + + private EPHANDLE ephlist[MAXOPENPROT]; + private int setup_pf(); + + extern char interface[50]; + + #ifdef PHASE2 + extern char this_zone[34]; + private u_char *zone_mcast(); + private int zip_toupper(); + private u_short chkSum(); + #endif + + /* + * setup for particular device devno + * all pi_open's will go this device + * + */ + + export + pi_setup() + { + int i; + + if (!inited) { + for (i = 0 ; i < MAXOPENPROT; i++) + ephlist[i].inuse = FALSE; + (void)init_fdlistening(); + inited = TRUE; /* don't forget now */ + } + return(FALSE); + } + + /* + * Open up a protocol handle: + * user level data: + * file descriptor + * protocol + * + * returns -1 and ephandle == NULL if memory allocation problems + * returns -1 for other errors + * return edx > 0 for okay + * + */ + + export int + pi_open(protocol, socket, dev, devno) + int protocol; + int socket; + char *dev; + int devno; + { + int s, i; + struct ephandle *eph; + + for (i = 0; i < MAXOPENPROT; i++) { + if (!ephlist[i].inuse) + break; + } + if (i == MAXOPENPROT) + return(0); /* nothing */ + eph = &ephlist[i]; /* find handle */ + + strncpy(eph->ifr.ifr_name, interface, sizeof eph->ifr.ifr_name); + + if ((s = init_nit(1024, protocol, socket, &eph->ifr)) < 0) + return(-1); + + eph->inuse = TRUE; + eph->fd = s; + eph->protocol = protocol; + eph->socket = socket; + return(i+1); /* skip zero */ + } + + /* + * returns TRUE if machine will see own broadcasts + * + */ + + export int + pi_delivers_self_broadcasts() + { + return(FALSE); + } + + export int + pi_close(edx) + int edx; + { + if (edx < 1 || edx > MAXOPENPROT || !ephlist[edx-1].inuse) + return(-1); + fdunlisten(ephlist[edx-1].fd); /* toss listener */ + close(ephlist[edx-1].fd); + ephlist[edx-1].inuse = 0; + return(0); + } + + /* + * Initialize nit on a particular protocol type + * + * Return: socket if no error, < 0 o.w. + * + */ + + private int + init_nit(chunksize, protocol, socket, ifr) + u_long chunksize; + u_short protocol; + int socket; + struct ifreq *ifr; + { + int s,devno = 0; + char *p; + char device[64]; + #ifdef PHASE2 + u_char e_broad[6] = {0x09, 0x00, 0x07, 0xff, 0xff, 0xff}; + u_char *zmulti; + #endif PHASE2 + + sprintf(device, "/dev/%s", interface); + for (p = device; *p != '\0'; p++) { + if (*p >= '0' && *p <= '9') { + devno = atoi(p); + *p = '\0'; + break; + } + } + + if ((s = open(device, O_RDWR)) < 0) { + perror(device); + return(-1); + } + + + if(!AttachDevice(s,devno)) + return(-1); + #ifdef PHASE2 + if(!BindProtocol(s,IEEE802_2,0,DL_CLDLS, 0, 0 )) + return(-1); + #else PHASE2 + if(!BindProtocol(s,protocol,0,DL_CLDLS, 0, 0 )) + return(-1); + #endif PHASE2 + + /*if(!PromMode(s,DL_PROMISC_MULTI)) + return(-1);*/ + + #ifdef PHASE2 + if((zmulti = zone_mcast(this_zone, strlen(this_zone))) == NULL) + { + fprintf(stderr, "Unable to get Zone Multicast Address\n"); + return(-1); + } + if(!AddMultiAddress(e_broad,s)) + return(-1); + if(!AddMultiAddress(zmulti,s)) + return(-1); + #endif PHASE2 + /* warning: Sun specific */ + if (strioctl (s, DLIOCRAW, -1, 0, NULL) < 0) { + perror("DLIORAW"); + return(-1); + } + + /* set up messages */ + if (ioctl(s, I_SRDOPT, (char *)RMSGD) < 0) { /* want messages */ + perror("ioctl: discretem"); + return(-1); + } + + + if (setup_pf(s, protocol, socket) < 0) + return(-1); + #define NOBUF + #ifndef NOBUF + if( setup_buf(s, chunksize) < 0) + return(-1); + #endif NOBUF + + /* flush read queue */ + ioctl(s, I_FLUSH, (char *)FLUSHR); + + return(s); + } + + #ifdef PHASE2 + /* + * add a multicast address to the interface + * + */ + + int + pi_addmulti(multi, ifr) + u_char *multi; + struct ifreq *ifr; + { + /* + * multicast addresses are per-stream now + * so just a NO OP + * + */ + + return(0); + } + + #endif PHASE2 + + + #ifndef NOBUF + /* + * setup buffering + * + */ + + setup_buf(s, chunksize) + int s; + u_long chunksize; + { + struct timeval timeout; + + /* Push and configure the buffering module. */ + if (ioctl(s, I_PUSH, "bufmod") < 0) { + perror("ioctl: nbuf"); + return(-1); + } + timeout.tv_sec = 1; + timeout.tv_usec = 0; + if(strioctl (s, SBIOCSTIME, INFTIM, sizeof(timeout), (char *)&timeout) < 0){ + perror("ioctl: timeout"); + return(-1); + } + + if(strioctl (s,SBIOCSCHUNK,INFTIM,sizeof(chunksize),(char *)&chunksize) < 0){ + perror("ioctl: chunk size"); + return(-1); + } + return(0); + } + #endif + + /* + * establish protocol filter + * + * + */ + + private int + setup_pf(s, prot, sock) + int s; + u_short prot; + int sock; + { + u_short offset; + struct ether_header eh; + struct packetfilt pf; + register u_short *fwp = pf.Pf_Filter; + + #define s_offset(structp, element) (&(((structp)0)->element)) + offset = ((int)s_offset(struct ether_header *, ether_type))/sizeof(u_short); + #ifdef PHASE2 + offset += 4; /* shorts: 2 bytes length + 6 bytes of 802.2 and SNAP */ + #endif PHASE2 + *fwp++ = ENF_PUSHWORD + offset; + *fwp++ = ENF_PUSHLIT | (sock >= 0 ? ENF_CAND : ENF_EQ); + *fwp++ = htons(prot); + pf.Pf_FilterLen = 3; + if (sock >= 0) { + #ifdef PHASE2 + *fwp++ = ENF_PUSHWORD + offset + 6; + *fwp++ = ENF_PUSHLIT | ENF_AND; + *fwp++ = htons(0xff00); /* now have dest socket */ + *fwp++ = ENF_PUSHLIT | ENF_COR; + *fwp++ = htons((sock & 0xff) << 8); + /* if not wanted, fail it */ + *fwp++ = ENF_PUSHLIT ; + *fwp++ = 0; + pf.Pf_FilterLen += 7; + #else PHASE2 + /* short form */ + *fwp++ = ENF_PUSHWORD + offset + 2; + *fwp++ = ENF_PUSHLIT | ENF_AND; + *fwp++ = htons(0xff00); /* now have lap type in LH */ + *fwp++ = ENF_PUSHWORD + offset + 3; + *fwp++ = ENF_PUSHLIT | ENF_AND; + *fwp++ = htons(0x00ff); /* now have dest in RH */ + *fwp++ = ENF_NOPUSH | ENF_OR; /* now have lap,,dest */ + *fwp++ = ENF_PUSHLIT | ENF_COR; + *fwp++ = htons((1 << 8) | (sock & 0xff)); + /* long form */ + *fwp++ = ENF_PUSHWORD + offset + 2; + *fwp++ = ENF_PUSHLIT | ENF_AND; + *fwp++ = htons(0xff00); /* now have lap type in LH */ + *fwp++ = ENF_PUSHWORD + offset + 7; + *fwp++ = ENF_PUSHLIT | ENF_AND; + *fwp++ = htons(0x00ff); /* now have dest in RH */ + *fwp++ = ENF_NOPUSH | ENF_OR; /* now have lap,,dest */ + *fwp++ = ENF_PUSHLIT | ENF_COR; + *fwp++ = htons((2 << 8) | (sock & 0xff)); + /* if neither, fail it */ + *fwp++ = ENF_PUSHLIT ; + *fwp++ = 0; + pf.Pf_FilterLen += 20; + #endif PHASE2 + } + + if (ioctl(s, I_PUSH, "pfmod") < 0) { + perror("ioctl: push protocol filter"); + return(-1); + } + if(strioctl (s, PFIOCSETF, 10, sizeof(pf), (char *)&pf) < 0) { + perror("ioctl: protocol filter"); + return(-1); + } + return(0); + } + + private u_char my_eaddr [EHRD]; + private int my_eaddr_valid = 0; + + export int + pi_get_ethernet_address(edx,ea) + int edx; + u_char *ea; + { + char buffer[120]; + struct ephandle *eph; + + if (edx < 1 || edx > MAXOPENPROT || !ephlist[edx-1].inuse) + return(-1); + + if (!my_eaddr_valid) { /* take it once */ + eph = &ephlist[edx-1]; + if((GetEthernetAddress(buffer,eph->fd)) < 0) + return(-1); + + my_eaddr_valid = 1; + memcpy(my_eaddr, buffer, EHRD); + } + if (ea) memcpy(ea, buffer, EHRD); + return(1); + } + + export + pi_listener(edx, listener, arg) + int edx; + int (*listener)(); + caddr_t arg; + { + if (edx < 1 || edx > MAXOPENPROT || !ephlist[edx-1].inuse) + return(-1); + + fdlistener(ephlist[edx-1].fd, listener, arg, edx); + } + + export + pi_listener_2(edx, listener, arg1, arg2) + int edx; + int (*listener)(); + caddr_t arg1; + int arg2; + { + if (edx < 1 || edx > MAXOPENPROT || !ephlist[edx-1].inuse) + return(-1); + + fdlistener(ephlist[edx-1].fd, listener, arg1, arg2); + } + + + /* + * cheat - iov[0] == struct etherheader + * + * + */ + + export int + pi_readv(edx, iov, iovlen) + int edx; + struct iovec *iov; + int iovlen; + { + struct ephandle *eph ; + int cc; + + if (edx < 1 || edx > MAXOPENPROT) + return(-1); + eph = &ephlist[edx-1]; + if (!eph->inuse) + return(-1); + if ((cc=stream_readv(eph->fd, iov, iovlen)) < 0) + perror ("pi_readv"); + return (cc); + } + + export int + pi_read(edx, buf, bufsiz) + int edx; + caddr_t buf; + int bufsiz; + { + struct iovec iov[3]; + struct ethernet_addresses ea; + #ifdef PHASE2 + char header[8]; + #endif PHASE2 + int cc; + + #ifdef PHASE2 + iov[0].iov_base = (caddr_t)&ea; + iov[0].iov_len = sizeof(ea); + iov[1].iov_base = (caddr_t)header; /* consume 802.2 hdr & SNAP */ + iov[1].iov_len = sizeof(header); + iov[2].iov_base = (caddr_t)buf; + iov[2].iov_len = bufsiz; + cc = pi_readv(edx, iov, 3); + return(cc - sizeof(ea) - sizeof(header)); + #else PHASE2 + iov[0].iov_base = (caddr_t)&ea; + iov[0].iov_len = sizeof(ea); + iov[1].iov_base = (caddr_t)buf; + iov[1].iov_len = bufsiz; + cc = pi_readv(edx, iov, 2); + return(cc - sizeof(ea)); + #endif PHASE2 + } + + pi_reada(fd, buf, bufsiz, eaddr) + int fd; + caddr_t buf; + int bufsiz; + char *eaddr; + { + struct iovec iov[3]; + #ifdef PHASE2 + char header[5]; /* must be 5! */ + #endif PHASE2 + int cc; + + #ifdef PHASE2 + iov[0].iov_base = (caddr_t)eaddr; + iov[0].iov_len = 14; + iov[1].iov_base = (caddr_t)header; /* consume 802.2 hdr & SNAP but */ + iov[1].iov_len = sizeof(header); /* make room for our fake LAP header */ + iov[2].iov_base = (caddr_t)buf; + iov[2].iov_len = bufsiz; + #else PHASE2 + iov[0].iov_base = (caddr_t)eaddr; + iov[0].iov_len = 14; + iov[1].iov_base = (caddr_t)buf; + iov[1].iov_len = bufsiz; + #endif PHASE2 + + #ifdef PHASE2 + if ((cc = stream_readv(fd, iov, 3)) < 0) { + #else PHASE2 + if ((cc = stream_readv(fd, iov, 2)) < 0) { + #endif PHASE2 + perror("pi_reada"); + return(cc); + } + #ifdef PHASE2 + /* make a fake LAP header to fool the higher levels */ + buf[0] = buf[11]; /* destination node ID */ + buf[1] = buf[12]; /* source node ID */ + buf[2] = 0x02; /* always long DDP */ + return(cc - 14 - sizeof(header)); + #else PHASE2 + return(cc - 14); + #endif PHASE2 + } + + private u_char buf[2048]; + + export int + pi_writev(edx, iov, iovlen, eaddr) + int edx; + struct iovec *iov; + int iovlen; + unsigned char eaddr[6]; + { + int ret,len; + struct ephandle *eph; + struct strbuf dbuf; + u_char *bufp; + struct ether_header *eh; + + if (edx < 1 || edx > MAXOPENPROT || eaddr == NULL) + return(-1); + eph = &ephlist[edx-1]; + if (!eph->inuse) + return(-1); + + if (!my_eaddr_valid) pi_get_ethernet_address (edx,NULL); + + eh = (struct ether_header *)buf; + bufp = buf + sizeof (struct ether_header); + memcpy (&eh->ether_dhost, eaddr, sizeof(eh->ether_dhost)); + memcpy (&eh->ether_shost, my_eaddr, sizeof(eh->ether_shost)); + #ifndef PHASE2 + eh->ether_type = htons(eph->protocol); + #else PHASE2 + /* + * Fill in the remainder of the 802.2 and SNAP header bytes. + */ + *bufp++ = 0xaa; /* destination SAP */ + *bufp++ = 0xaa; /* source SAP */ + *bufp++ = 0x03; /* control byte */ + *bufp++ = (eph->protocol == 0x809b) ? 0x08 : 0x00; + *bufp++ = 0x00; /* always zero */ + *bufp++ = (eph->protocol == 0x809b) ? 0x07 : 0x00; + *bufp++ = (eph->protocol >> 8) & 0xff; + *bufp++ = (eph->protocol & 0xff); + #endif PHASE2 + /* assemble a packet */ + for (ret=0,len=bufp-buf;iovlen;iovlen--,iov++) + if (iov->iov_base && iov->iov_len >= 0) { + memcpy(bufp, iov->iov_base, iov->iov_len); + bufp += iov->iov_len; + len += iov->iov_len; + ret += iov->iov_len; + } + #ifdef PHASE2 + eh->ether_type = htons(ret+8); /* see below */ + #endif + dbuf.len = len; + dbuf.buf = (caddr_t)buf; + + if (putmsg(eph->fd, NULL, &dbuf, 0) < 0) { + return(-1); + } + return(ret); + } + + export int + pi_write(edx, buf, buflen, eaddr) + int edx; + caddr_t buf; + int buflen; + char *eaddr; + { + struct iovec iov; + + iov.iov_base = buf; + iov.iov_len = buflen; + #ifdef PHASE2 + iov.iov_base += 8; /* what a bad design */ + iov.iov_len -= 8; /* but not my fault anyway */ + #endif PHASE2 + return (pi_writev (edx,&iov,1,eaddr)); + } + + /* handy functions */ + + private int + stream_readv (fd, iov, iovlen) + int fd; + struct iovec *iov; + int iovlen; + { + int cc,flag=0,left,bytes; + char *bufp,buf [2048]; + struct strbuf dat_ctl; + + dat_ctl.maxlen = sizeof (buf); + dat_ctl.buf = buf; + if ((cc=getmsg (fd,NULL,&dat_ctl,&flag)) >= 0) + for (cc=0,bufp=dat_ctl.buf,left=dat_ctl.len; + iovlen && left>0;iovlen--,iov++) + { bytes = (iov->iov_leniov_len : left; + memcpy (iov->iov_base,bufp,bytes); + cc += bytes; /* bytes read */ + bufp += bytes; + left -= bytes; /* bytes left */ + } + return(cc); + } + + strioctl(fd, cmd, timout, len, dp) + int fd; + int cmd; + int timout; + int len; + char *dp; + { + struct strioctl sioc; + int rc; + + sioc.ic_cmd = cmd; + sioc.ic_timout = timout; + sioc.ic_len = len; + sioc.ic_dp = dp; + rc = ioctl (fd, I_STR, &sioc); + + if (rc < 0) + return (rc); + else + return (sioc.ic_len); + } + + /* + * DLPI Support Routines + * + */ + + Acknoledge (dlp_p,ack,msg) + union DL_primitives *dlp_p; + int ack; + char *msg; + { + if (dlp_p->dl_primitive != ack) { + fprintf(stderr,"dlpi: %s is nacked.\n",msg); + if (dlp_p->dl_primitive == DL_ERROR_ACK) + fprintf(stderr, "dlpi: dlpi_errno %d\n" + "dlpi: unix_errno %d\n", + dlp_p->error_ack.dl_errno, + dlp_p->error_ack.dl_unix_errno); + else + fprintf(stderr,"dlpi: spiritual primitive %d.\n", + dlp_p->dl_primitive); + return(0); + } + return(1); + } + + AttachDevice(fd,devno) + int fd,devno; + { + int retval; + int flags = RS_HIPRI; + struct strbuf ctlbuf; + union DL_primitives rcvbuf; + dl_attach_req_t Request; + + + /* bind to underlying interface */ + Request.dl_primitive = DL_ATTACH_REQ; + Request.dl_ppa = devno; + ctlbuf.len = sizeof(Request); + ctlbuf.buf = (caddr_t)&Request; + + if (putmsg(fd, &ctlbuf ,NULL,0) < 0) { + perror("Attach Device:"); + return(0); + } + + ctlbuf.maxlen = sizeof(union DL_primitives); + ctlbuf.len = 0; + ctlbuf.buf = (char *)&rcvbuf; + if ((retval = getmsg(fd, &ctlbuf ,NULL, &flags)) < 0) { + perror("Attach Device ack!"); + return(0); + } + + return (Acknoledge(&rcvbuf,DL_OK_ACK,"DL_ATTACH_REQ")); + } + + BindProtocol(fd,sap,max_conind,service_mode, conn_mgmt, xidtest_flg ) + int fd,sap,max_conind,service_mode, conn_mgmt, xidtest_flg ; + { + int retval; + int flags = RS_HIPRI; + struct strbuf ctlbuf; + union DL_primitives rcvbuf; + dl_bind_req_t BindRequest; + + + BindRequest.dl_primitive = DL_BIND_REQ; + BindRequest.dl_sap = sap; + BindRequest.dl_max_conind = max_conind; + BindRequest.dl_service_mode = service_mode; + BindRequest.dl_conn_mgmt = conn_mgmt; + BindRequest.dl_xidtest_flg = xidtest_flg; + + ctlbuf.len = sizeof(BindRequest); + ctlbuf.buf = (caddr_t)&BindRequest; + + if (putmsg(fd, &ctlbuf ,NULL,0) < 0) { + perror("Bind Protocol:"); + return(0); + } + + ctlbuf.maxlen = sizeof(union DL_primitives); + ctlbuf.len = 0; + ctlbuf.buf = (char *)&rcvbuf; + if ((retval = getmsg(fd, &ctlbuf ,NULL, &flags)) < 0) { + perror("Bind Protocol ACK!"); + return(0); + } + + return (Acknoledge(&rcvbuf,DL_BIND_ACK,"DL_BIND_REQ")); + } + + PromMode(fd,level) + int fd,level; + { + int retval; + int flags = RS_HIPRI; + struct strbuf ctlbuf; + union DL_primitives rcvbuf; + dl_promiscon_req_t PromRequest; + + + PromRequest.dl_primitive = DL_PROMISCON_REQ; + PromRequest.dl_level = level; + + ctlbuf.len = sizeof(PromRequest); + ctlbuf.buf = (caddr_t)&PromRequest; + + if (putmsg(fd, &ctlbuf ,NULL,0) < 0) { + perror("Prom Mode:"); + return(0); + } + + ctlbuf.maxlen = sizeof(union DL_primitives); + ctlbuf.len = 0; + ctlbuf.buf = (char *)&rcvbuf; + if ((retval = getmsg(fd, &ctlbuf ,NULL, &flags)) < 0) { + perror("Prom Mode ack!"); + return(0); + } + + return (Acknoledge(&rcvbuf,DL_OK_ACK,"DL_PROMISCON_REQ")); + } + + GetEthernetAddress(EtherBuf,fd) + u_char *EtherBuf; + int fd; + { + int retval; + int flags = RS_HIPRI; + char buf[80]; + union DL_primitives rcvbuf; + dl_phys_addr_req_t PRequest; + struct strbuf ctlbuf; + + + PRequest.dl_primitive = DL_PHYS_ADDR_REQ; + PRequest.dl_addr_type = DL_CURR_PHYS_ADDR; + ctlbuf.len = sizeof(PRequest); + ctlbuf.buf = (caddr_t)&PRequest; + + if (putmsg(fd, &ctlbuf ,NULL,0) < 0) + { + perror("Ethernet Address:"); + return(-1); + } + + ctlbuf.maxlen = sizeof(union DL_primitives); + ctlbuf.len = 0; + ctlbuf.buf = (char *)&rcvbuf; + if ((retval = getmsg(fd, &ctlbuf ,NULL, &flags)) < 0) + { + perror("Ethernet Address ack!"); + return(-1); + } + + if (Acknoledge(&rcvbuf,DL_PHYS_ADDR_ACK,"DL_PHYS_ADDR_REQ")) { + memcpy( EtherBuf, + &ctlbuf.buf[rcvbuf.physaddr_ack.dl_addr_offset], + EHRD); + return(1); + } + return(0); + } + + int + AddMultiAddress(multi,fd) + u_char *multi; + int fd; + { + int retval; + int flags = RS_HIPRI; + u_char buf[512]; + union DL_primitives rcvbuf; + struct strbuf databuf; + struct strbuf ctlbuf; + dl_enabmulti_req_t *MultiRequest = (dl_enabmulti_req_t *)buf; + + + MultiRequest->dl_primitive = DL_ENABMULTI_REQ; + MultiRequest->dl_addr_length = EHRD; + MultiRequest->dl_addr_offset = DL_ENABMULTI_REQ_SIZE; + + memcpy(&buf[DL_ENABMULTI_REQ_SIZE],multi,EHRD); + + ctlbuf.maxlen = 0; + ctlbuf.len = DL_ENABMULTI_REQ_SIZE + EHRD; + ctlbuf.buf = (caddr_t)buf; + + if ((retval = putmsg(fd, &ctlbuf ,NULL, flags)) < 0) { + perror("bogus2"); + return(0); + } + + + ctlbuf.maxlen = sizeof(rcvbuf); + ctlbuf.len = 0; + ctlbuf.buf = (char *)&rcvbuf; + + databuf.maxlen = 512; + databuf.len = 0; + databuf.buf = buf; + + if ((retval = getmsg(fd, &ctlbuf, &databuf, &flags)) < 0) { + perror("bogus!"); + return(0); + } + + return (Acknoledge(&rcvbuf,DL_OK_ACK,"DL_ENABMULTI_REQ")); + } + + #ifdef PHASE2 + /* + * return pointer to zone multicast address + * + */ + + private u_char * + zone_mcast(znam, zlen) + u_char *znam; + short zlen; + { + u_char zone[34]; + u_short i, chkSum(); + static u_char zmcaddr[7] = {0x09,0x00,0x07,0x00,0x00,0x00}; + + if (zlen > sizeof(zone)) + return(NULL); + + for (i = 0; i < zlen; i++) + zone[i] = (u_char)zip_toupper(znam[i]); + + zmcaddr[5] = (u_char)(chkSum(zone, zlen) % 253); + + return(zmcaddr); + } + + /* + * DDP checksum calculator + * + */ + + private + u_short chkSum(pkt, len) + u_char *pkt; + int len; + { + int sum = 0; + + while (len-- > 0) { + sum = ((sum&0xffff)+*pkt++) << 1; + if (sum&0x10000) + sum++; + } + sum &= 0xffff; + + return((sum == 0) ? 0xffff : sum); + } + + /* + * convert lowercase to uppercase + * + */ + + private int + zip_toupper(c) + int c; + { + if (!(c & 0x80)) + return(toupper(c)); + + switch (c) { + case 0x88: + return(0xcb); + break; + case 0x8a: + return(0x80); + break; + case 0x8b: + return(0xcc); + break; + case 0x8c: + return(0x81); + break; + case 0x8d: + return(0x82); + break; + case 0x8e: + return(0x83); + break; + case 0x96: + return(0x84); + break; + case 0x9a: + return(0x85); + break; + case 0x9b: + return(0xcd); + break; + case 0x9f: + return(0x86); + break; + case 0xbe: + return(0xae); + break; + case 0xbf: + return(0xaf); + break; + case 0xcf: + return(0xce); + break; + } + return(c); + } + + #endif PHASE2 *** support/ethertalk/Makefile.m4.orig Mon Nov 22 20:34:52 1993 --- support/ethertalk/Makefile.m4 Mon Oct 10 18:55:22 1994 *************** *** 4,10 **** POBJS=etherpobjs() ETCDIR=etcdest() CAPLIB=libcap() - # for other libraries (like BSD on hpux) SLIB=libspecial() LIBABSRCS=abelap.c ethertalk.c ../uab/aarp.c ../uab/hash.c --- 4,9 ---- *************** *** 22,34 **** ${CC} ${LFLAGS} -o aarpd aarpd.o aarpd_svc.o ${CAPLIB} ${SLIB} aarptest: aarptest.o aarpd.h ! ${CC} ${LFLAGS} -o aarptest aarptest.o ${CAPLIB} rtmptest: rtmptest.o aarpd.h ! ${CC} ${LFLAGS} -o rtmptest rtmptest.o ${CAPLIB} rangetest: rangetest.o aarpd.h ! ${CC} ${LFLAGS} -o rangetest rangetest.o ${CAPLIB} aarpd.o: aarpd.c aarpd.h --- 21,33 ---- ${CC} ${LFLAGS} -o aarpd aarpd.o aarpd_svc.o ${CAPLIB} ${SLIB} aarptest: aarptest.o aarpd.h ! ${CC} ${LFLAGS} -o aarptest aarptest.o ${CAPLIB} ${SLIB} rtmptest: rtmptest.o aarpd.h ! ${CC} ${LFLAGS} -o rtmptest rtmptest.o ${CAPLIB} ${SLIB} rangetest: rangetest.o aarpd.h ! ${CC} ${LFLAGS} -o rangetest rangetest.o ${CAPLIB} ${SLIB} aarpd.o: aarpd.c aarpd.h *************** *** 37,42 **** --- 36,43 ---- ethertalk.o: ethertalk.c ../uab/ethertalk.h snitp.o: snitp.c ../uab/proto_intf.h + + sdlpi.o.o: sdlpi.o.c ../uab/proto_intf.h # explict command because on pyramid we don't want -q for this senetp.o: senetp.c ../uab/proto_intf.h *** support/uab/aarp_defs.h.orig Thu Feb 28 23:45:52 1991 --- support/uab/aarp_defs.h Mon Oct 10 18:56:20 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 91/02/15 23:07:12 $ ! * $Header: aarp_defs.h,v 2.1 91/02/15 23:07:12 djh Rel $ ! * $Revision: 2.1 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 08:56:13 $ ! * $Header: /mac/src/cap60/support/uab/RCS/aarp_defs.h,v 2.2 1994/10/10 08:56:13 djh Rel djh $ ! * $Revision: 2.2 $ */ /* *************** *** 33,39 **** * AARP Ethernet type * */ ! #ifndef ETHERTYPE_AARP 0x80f3 # define ETHERTYPE_AARP 0x80f3 #endif --- 33,39 ---- * AARP Ethernet type * */ ! #ifndef ETHERTYPE_AARP # define ETHERTYPE_AARP 0x80f3 #endif *** support/uab/hash.c.orig Mon Nov 8 16:38:41 1993 --- support/uab/hash.c Mon Oct 10 18:56:22 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/11/08 05:38:23 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/hash.c,v 2.3 1993/11/08 05:38:23 djh Rel djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * hash.h - external definitions for hash.c - generalized hashing function --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 08:56:13 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/hash.c,v 2.4 1994/10/10 08:56:13 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * hash.h - external definitions for hash.c - generalized hashing function *************** *** 36,41 **** --- 36,42 ---- #include #include + #include #include "hash.h" #ifndef FALSE *************** *** 680,686 **** int logM; u_int idx; { ! return(((u_int)((u_int)idx*A_MULTIPLIER)>>(8*sizeof(int)-logM))); } /* the r more bits -- should be indepdent of the first r bits */ --- 681,687 ---- int logM; u_int idx; { ! return(((u_int)((u_int)idx*(u_int)A_MULTIPLIER)>>(8*sizeof(int)-logM))); } /* the r more bits -- should be indepdent of the first r bits */ *************** *** 692,698 **** u_int hidx; u_int idx; { ! return(((u_int)((u_int)idx*A_MULTIPLIER)>>(8*sizeof(int)-logM-logM)|1) ); } #ifdef TESTIT --- 693,699 ---- u_int hidx; u_int idx; { ! return(((u_int)((u_int)idx*(u_int)A_MULTIPLIER)>>(8*sizeof(int)-logM-logM)|1) ); } #ifdef TESTIT *** lib/cap/scandir.c.orig Sun Aug 28 06:11:58 1994 --- lib/cap/scandir.c Mon Oct 10 18:59:05 1994 *************** *** 0 **** --- 1,139 ---- + /* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + + #ifdef SOLARIS + #if defined(LIBC_SCCS) && !defined(lint) + static char sccsid[] = "@(#)scandir.c 5.3 (Berkeley) 6/18/88"; + #endif /* LIBC_SCCS and not lint */ + + /* + * Scan the directory dirname calling select to make a list of selected + * directory entries then sort using qsort and compare routine dcomp. + * Returns the number of entries and a pointer to a list of pointers to + * struct direct (through namelist). Returns -1 if there were any errors. + */ + #include + #include + #include + #include + + struct dirent *GetNextDir(buf,nbytes) + char buf[]; + int *nbytes; + { + struct dirent *p,*d; + + p = (struct dirent *) buf; + + *nbytes = *nbytes - p->d_reclen; + if(*nbytes == 0) + return(NULL); + + d = (struct dirent *) &buf[p->d_reclen]; + return(d); + } + + scandir(dirname, namelist, select, dcomp) + char *dirname; + struct dirent *(*namelist[]); + int (*select)(), (*dcomp)(); + { + int dir_fd; + int nbytes; + int nitems,done; + char buf[8192]; + char *cp1, *cp2; + struct stat stb; + struct dirent *d, *p, **names,*bp; + long arraysz; + + if ((dir_fd = open(dirname,O_RDONLY))== -1) + return(-1); + if (fstat(dir_fd, &stb) < 0) + return(-1); + + /* + * estimate the array size by taking the size of the directory file + * and dividing it by a multiple of the minimum size entry. + */ + arraysz = (stb.st_size / 24); + names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + + nitems = 0; + d = (struct dirent *) buf; + while ((nbytes = getdents(dir_fd, d, 8192)) > 0) + { + + while(d != NULL) + { + if (select != NULL && !(*select)(d)) + { + d = GetNextDir(d,&nbytes); + continue; /* just selected names */ + } + /* + * Make a minimum size copy of the data + */ + p = (struct dirent *)malloc(d->d_reclen + 1); + if (p == NULL) + return(-1); + p->d_ino = d->d_ino; + p->d_off = d->d_off; + p->d_reclen = d->d_reclen; + for (cp1 = p->d_name, cp2 = d->d_name; + *cp1++ = *cp2++; ); + /* + * Check to make sure the array has space left and + * realloc the maximum size. + */ + if (++nitems >= arraysz) + { + + /* just might have grown */ + if (fstat(dir_fd, &stb) < 0) + return(-1); + arraysz = stb.st_size / 12; + names = (struct dirent **)realloc((char *)names, + arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + } + names[nitems-1] = p; + d = GetNextDir(d,&nbytes); + } + d = (struct dirent *) buf; + } + close(dir_fd); + if (nitems && dcomp != NULL) + qsort(names, nitems, sizeof(struct dirent *), dcomp); + *namelist = names; + return(nitems); + } + + /* + * Alphabetic order comparison routine for those who want it. + */ + alphasort(d1, d2) + struct dirent **d1, **d2; + { + return(strcmp((*d1)->d_name, (*d2)->d_name)); + } + #else SOLARIS + int scan_dummy_for_ld; /* keep the loader and ranlib happy */ + #endif SOLARIS *** lib/cap/atalkdbm.c.orig Wed Aug 4 02:15:59 1993 --- lib/cap/atalkdbm.c Mon Oct 10 18:57:26 1994 *************** *** 1,18 **** /* ! * $Date: 1993/08/03 16:15:37 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/atalkdbm.c,v 2.10 1993/08/03 16:15:37 djh Rel djh $ ! * $Revision: 2.10 $ * * mods for async appletalk support, /etc/etalk.local for EtherTalk and * changes for quoted zone names: djh@munnari.OZ.AU, 27/11/90 * Phase 2 support: djh@munnari.OZ.AU, 28/04/91 * ! */ - /* PATCH: Moy@Berkeley/atalkdbm.c.diff, djh@munnari.OZ.AU, 17/11/90 */ - #include #include #include #include #include --- 1,19 ---- /* ! * $Date: 1994/10/10 08:57:18 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/atalkdbm.c,v 2.11 1994/10/10 08:57:18 djh Rel djh $ ! * $Revision: 2.11 $ * * mods for async appletalk support, /etc/etalk.local for EtherTalk and * changes for quoted zone names: djh@munnari.OZ.AU, 27/11/90 * Phase 2 support: djh@munnari.OZ.AU, 28/04/91 * ! */ #include #include + #ifdef SOLARIS + #include + #endif SOLARIS #include #include #include *************** *** 20,28 **** #include #ifdef USESTRINGDOTH # include ! #else # include ! #endif #include #include "atalkdbm.h" --- 21,29 ---- #include #ifdef USESTRINGDOTH # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH #include #include "atalkdbm.h" *************** *** 34,40 **** #endif ETAB #ifndef CONFIGDIR # define CONFIGDIR "/etc" ! #endif #include --- 35,41 ---- #endif ETAB #ifndef CONFIGDIR # define CONFIGDIR "/etc" ! #endif CONFIGDIR #include *** lib/cap/Makefile.m4.orig Sun Mar 8 17:46:03 1992 --- lib/cap/Makefile.m4 Mon Oct 10 19:12:54 1994 *************** *** 8,17 **** LIBABSRCS=abatp.c abddp.c abmisc.c abnbp.c abauxddp.c abauxnbp.c \ abpap.c abpapc.c abpaps.c abpp.c abqueue.c abasp.c \ abzip.c abversion.c atalkdbm.c absched.c abkip.c \ ! authenticate.c ablog.c LIBABOBJS=abatp.o abmisc.o abzip.o abversion.o absched.o \ abpap.o abpapc.o abpaps.o abpp.o abqueue.o abasp.o \ ! authenticate.o ablog.o # LABOBJ defines the various low level delivery mechanisms # default: abkip.o abddp.o abnbp.o atalkdbm.o --- 8,17 ---- LIBABSRCS=abatp.c abddp.c abmisc.c abnbp.c abauxddp.c abauxnbp.c \ abpap.c abpapc.c abpaps.c abpp.c abqueue.c abasp.c \ abzip.c abversion.c atalkdbm.c absched.c abkip.c \ ! authenticate.c ablog.c scandir.c LIBABOBJS=abatp.o abmisc.o abzip.o abversion.o absched.o \ abpap.o abpapc.o abpaps.o abpp.o abqueue.o abasp.o \ ! authenticate.o ablog.o scandir.o # LABOBJ defines the various low level delivery mechanisms # default: abkip.o abddp.o abnbp.o atalkdbm.o *** lib/cap/authenticate.c.orig Tue Apr 13 15:56:53 1993 --- lib/cap/authenticate.c Mon Oct 10 18:57:33 1994 *************** *** 14,20 **** #ifdef AUTHENTICATE #include #include - #include #include #include #include /* include appletalk definitions */ --- 14,19 ---- *************** *** 21,29 **** #ifdef USESTRINGDOTH # include ! #else # include ! #endif #define ANYNBPNAME (1 << 1) #define ANYPROGNAME (1 << 0) --- 20,28 ---- #ifdef USESTRINGDOTH # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH #define ANYNBPNAME (1 << 1) #define ANYPROGNAME (1 << 0) *** lib/afp/afposlock.c.orig Tue Nov 23 19:31:20 1993 --- lib/afp/afposlock.c Mon Oct 10 18:59:36 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/11/23 08:31:06 $ ! * $Header: /mac/src/cap60/lib/afp/RCS/afposlock.c,v 2.9 1993/11/23 08:31:06 djh Rel djh $ ! * $Revision: 2.9 $ * */ --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 08:59:24 $ ! * $Header: /mac/src/cap60/lib/afp/RCS/afposlock.c,v 2.10 1994/10/10 08:59:24 djh Rel djh $ ! * $Revision: 2.10 $ * */ *************** *** 45,55 **** # endif NOFLOCK #endif AIX #ifndef NOLOCKF /* on convex, lockf requires fcntl.h */ ! # ifndef LOCKFUSESFCNTL # ifdef apollo ! # define _INCLUDE_SYS5_SOURCE /* include F_LOCK etc. in unistd.h defns. */ # endif apollo # include # ifdef apollo --- 45,62 ---- # endif NOFLOCK #endif AIX + #ifdef SOLARIS + #define USEFCNTLLOCK + #endif SOLARIS + #ifndef NOLOCKF /* on convex, lockf requires fcntl.h */ ! # if defined(LOCKFUSESFCNTL) || defined(USEFCNTLLOCK) ! # include ! # else /* LOCKFUSESFCNTL || USEFCNTLLOCK */ # ifdef apollo ! /* include F_LOCK etc. in unistd.h defns. */ ! # define _INCLUDE_SYS5_SOURCE # endif apollo # include # ifdef apollo *************** *** 56,81 **** # include # include # endif apollo ! /* unistd defines these unnecessarily (and problematically) */ # ifdef ultrix # undef R_OK # undef W_OK # undef X_OK # undef F_OK ! # endif # ifdef pyr # undef R_OK # undef W_OK # undef X_OK # undef F_OK ! # endif ! # else ! # include ! # endif ! #endif #ifdef gould #include #endif gould #include #include #include --- 63,92 ---- # include # include # endif apollo ! /* ! * unistd defines these unnecessarily ! * (and problematically) ! * ! */ # ifdef ultrix # undef R_OK # undef W_OK # undef X_OK # undef F_OK ! # endif ultrix # ifdef pyr # undef R_OK # undef W_OK # undef X_OK # undef F_OK ! # endif pyr ! # endif /* LOCKFUSESFCNTL || USEFCNTLLOCK */ ! #endif NOLOCKF ! #ifdef gould #include #endif gould + #include #include #include *************** *** 87,100 **** # ifndef NOLOCKF # ifndef LOCKF_ONLY # define LOCKF_ONLY ! # endif ! # endif ! #endif #ifdef xenix5 # include # define XENIX_LOCKING ! #endif /* * The following routines define Byte Range Locking --- 98,111 ---- # ifndef NOLOCKF # ifndef LOCKF_ONLY # define LOCKF_ONLY ! # endif LOCKF_ONLY ! # endif NOLOCKF ! #endif NOFLOCK #ifdef xenix5 # include # define XENIX_LOCKING ! #endif xenix5 /* * The following routines define Byte Range Locking *************** *** 168,173 **** --- 179,211 ---- if (length < 0) /* can only be -1 */ length = 0; /* length zero means entire file! */ + #ifdef USEFCNTLLOCK + { struct flock flck; + flck.l_type = unlockflag ? F_UNLCK : F_WRLCK; + flck.l_whence = startendflag ? L_XTND : L_SET; + #ifdef DENYREADWRITE + flck.l_start = offset+4; + #else DENYREADWRITE + flck.l_start = offset; + #endif DENYREADWRITE + flck.l_len = length; + + if (fcntl(fd, F_SETLK, &flck) < 0) { + switch (errno) { + case EAGAIN: + case EBADF: + case EDEADLK: + case EINVAL: + case ENOLCK: + return(aeNoMoreLocks); + break; + default: + return(aeParamErr); + break; + } + } + } + #else USEFCNTLLOCK if ((pos = lseek(fd, (off_t)offset, (startendflag ? L_XTND : L_SET))) < 0) { *fpos = -1; /* unknown */ return(aeParamErr); *************** *** 225,230 **** --- 263,269 ---- return(aeParamErr); /* specially for System 7.0 */ } } + #endif USEFCNTLLOCK return(noErr); } *************** *** 241,269 **** { int n; extern int errno; - #ifdef DENYREADWRITE - struct flock flck; - #endif DENYREADWRITE #ifdef XENIX_LOCKING if ((n = locking(fd, LK_NBRLCK, length)) >= 0) n = locking(fd, LK_UNLCK, length); #else XENIX_LOCKING #ifdef DENYREADWRITE ! n = 0; ! flck.l_type = F_RDLCK; ! flck.l_whence = 1; /* SEEK_CUR */ ! flck.l_start = 4; ! flck.l_len = length; ! if (fcntl(fd, F_GETLK, &flck) != -1) { ! if (flck.l_type == F_WRLCK) { ! errno = EAGAIN; ! n = -1; } } ! #else DENYREADWRITE n = lockf(fd, F_TEST, length); ! #endif DENYREADWRITE #endif XENIX_LOCKING if (n < 0) { --- 280,312 ---- { int n; extern int errno; #ifdef XENIX_LOCKING if ((n = locking(fd, LK_NBRLCK, length)) >= 0) n = locking(fd, LK_UNLCK, length); #else XENIX_LOCKING + #if defined(DENYREADWRITE) || defined(USEFCNTLLOCK) + { struct flock flck; + + n = 0; + flck.l_type = F_RDLCK; + flck.l_whence = L_INCR; /* SEEK_CUR */ #ifdef DENYREADWRITE ! flck.l_start = 4; ! #else DENYREADWRITE ! flck.l_start = 0; ! #endif DENYREADWRITE ! flck.l_len = length; ! if (fcntl(fd, F_GETLK, &flck) != -1) { ! if (flck.l_type == F_WRLCK) { ! errno = EAGAIN; ! n = -1; ! } } } ! #else /* DENYREADWRITE || USEFCNTLLOCK */ n = lockf(fd, F_TEST, length); ! #endif /* DENYREADWRITE || USEFCNTLLOCK */ #endif XENIX_LOCKING if (n < 0) { *************** *** 320,330 **** * okay, but reads can get "out of date" or "bad" data * * ! */ boolean OSLockFileforRead(fd) int fd; { #ifdef hpux off_t saveoffs; #endif hpux --- 363,394 ---- * okay, but reads can get "out of date" or "bad" data * * ! */ ! boolean OSLockFileforRead(fd) int fd; { + #ifdef USEFCNTLLOCK + { struct flock flck; + + flck.l_type = F_RDLCK; + flck.l_whence = L_SET; + flck.l_start = 0; + flck.l_len = 0; + + if (fcntl(fd, F_SETLKW, &flck) < 0) { + switch (errno) { + case EBADF: /* pass read-only files */ + return(TRUE); + break; + default: + return(FALSE); + break; + } + } + } + #else USEFCNTLLOCK #ifdef hpux off_t saveoffs; #endif hpux *************** *** 366,371 **** --- 430,436 ---- # endif # endif #endif XENIX_LOCKING + #endif USEFCNTLLOCK return(TRUE); } *************** *** 373,378 **** --- 438,462 ---- OSLockFileforWrite(fd) int fd; { + #ifdef USEFCNTLLOCK + { struct flock flck; + + flck.l_type = F_WRLCK; + flck.l_whence = L_SET; + flck.l_start = 0; + flck.l_len = 0; + + if (fcntl(fd, F_SETLKW, &flck) < 0) { + switch (errno) { + case EAGAIN: + case EBADF: + default: + return(FALSE); + break; + } + } + } + #else USEFCNTLLOCK #ifdef hpux off_t saveoffs; #endif hpux *************** *** 413,418 **** --- 497,503 ---- # endif /* LOCKF ONLY */ # endif NOFLOCK #endif XENIX_LOCKING + #endif USEFCNTLLOCK return(TRUE); } *************** *** 420,426 **** * This implements an exclusive lock on the file. It differs from * OSLockFileforRead in that it doesn't block * ! */ #ifdef notdef /* not used */ boolean OSMaybeLockFile(fd) --- 505,512 ---- * This implements an exclusive lock on the file. It differs from * OSLockFileforRead in that it doesn't block * ! */ ! #ifdef notdef /* not used */ boolean OSMaybeLockFile(fd) *************** *** 460,465 **** --- 546,563 ---- OSUnlockFile(fd) int fd; { + #ifdef USEFCNTLLOCK + { struct flock flck; + + flck.l_type = F_UNLCK; + flck.l_whence = L_SET; + flck.l_start = 0; + flck.l_len = 0; + + if (fcntl(fd, F_SETLKW, &flck) < 0) + return(FALSE); + } + #else USEFCNTLLOCK #ifdef hpux off_t saveoffs; #endif hpux *************** *** 499,504 **** --- 597,603 ---- # endif /* LOCKF_ONLY */ # endif /* end else NOFLOCK */ #endif XENIX_LOCKING + #endif USEFCNTLLOCK return(TRUE); } *** netat/sysvcompat.h.orig Tue Nov 30 20:36:21 1993 --- netat/sysvcompat.h Mon Oct 10 19:00:03 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/11/30 09:36:08 $ ! * $Header: /mac/src/cap60/netat/RCS/sysvcompat.h,v 2.10 1993/11/30 09:36:08 djh Rel djh $ ! * $Revision: 2.10 $ * */ --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 08:59:49 $ ! * $Header: /mac/src/cap60/netat/RCS/sysvcompat.h,v 2.11 1994/10/10 08:59:49 djh Rel djh $ ! * $Revision: 2.11 $ * */ *************** *** 28,34 **** * Mappings from bsd to sysv string and bytestring function * */ ! #ifdef hpux # define B2S_STRING_MAPON /* map strings */ # define B2S_BSTRING_MAPON /* map byte string instructions */ --- 28,57 ---- * Mappings from bsd to sysv string and bytestring function * */ ! ! #ifdef SOLARIS ! # define B2S_STRING_MAPON /* map strings */ ! # define B2S_BSTRING_MAPON /* map byte string instructions */ ! # define USETIMES /* use times instead of getrusage */ ! # define NOWAIT3 /* no wait3 */ ! # define NOSIGMASK /* sigblock() doesn't exist */ ! # define USERAND /* use srand, rand */ ! # define USEGETCWD /* use getcwd instead of bsd getwd */ ! # define NOPGRP /* no process groups (setpgrp, killpg) */ ! # define NOVFORK /* no vfork in system */ ! # define NEEDFCNTLDOTH /* if need fcntl.h for O_... */ ! # define USESYSVLP /* use system V lp command instead of lpr */ ! # define USEDIRENT /* use struct dirent */ ! # define SHADOW_PASSWD ! /* Hopefully, this is safe */ ! # define L_SET 0 /* absolute offset */ ! # define L_INCR 1 /* relative to current offset */ ! # define L_XTND 2 /* relative to end of file */ ! # define LB_SET 3 /* abs. block offset */ ! # define LB_INCR 4 /* rel. block offset */ ! # define LB_XTND 5 /* block offset rel. to eof */ ! #endif SOLARIS ! #ifdef hpux # define B2S_STRING_MAPON /* map strings */ # define B2S_BSTRING_MAPON /* map byte string instructions */ *************** *** 134,140 **** #endif B2S_STRING_MAPON #ifdef B2S_BSTRING_MAPON ! # define bcopy(s,d,l) memcpy((char *)(d),(char *)(s),(l)) # define bcmp(b1,b2,l) memcmp((char *)(b1),(char *)(b2),(l)) # define bzero(b,l) memset((char *)(b),0,(l)) #endif B2S_BSTRING_MAPON --- 157,167 ---- #endif B2S_STRING_MAPON #ifdef B2S_BSTRING_MAPON ! # ifdef SOLARIS ! # define bcopy(s,d,l) memmove((char *)(d),(char *)(s),(l)) ! # else SOLARIS ! # define bcopy(s,d,l) memcpy((char *)(d),(char *)(s),(l)) ! # endif SOLARIS # define bcmp(b1,b2,l) memcmp((char *)(b1),(char *)(b2),(l)) # define bzero(b,l) memset((char *)(b),0,(l)) #endif B2S_BSTRING_MAPON *** samples/lwpr.c.orig Sat Aug 31 15:42:10 1991 --- samples/lwpr.c Mon Oct 10 19:00:24 1994 *************** *** 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 --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 09:00:16 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/samples/RCS/lwpr.c,v 2.4 1994/10/10 09:00:16 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * lwpr - UNIX AppleTalk test program: print a ps file to appletalk LaserWriter *************** *** 34,42 **** #else # include #endif ! #ifdef xenix5 # include ! #endif xenix5 #ifndef CAPPRINTERS # define CAPPRINTERS "/etc/cap.printers" --- 34,42 ---- #else # include #endif ! #if defined(xenix5) || defined(SOLARIS) # include ! #endif /* xenix5 || SOLARIS */ #ifndef CAPPRINTERS # define CAPPRINTERS "/etc/cap.printers" *** applications/papif/papif.c.orig Mon Nov 29 23:38:16 1993 --- applications/papif/papif.c Mon Oct 10 19:00:52 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/11/29 12:37:33 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/papif/RCS/papif.c,v 2.16 1993/11/29 12:37:33 djh Rel djh $"; ! static char revision[] = "$Revision: 2.16 $"; /* * papif - UNIX AppleTalk test program: simple line printer input filter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 09:00:44 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/papif/RCS/papif.c,v 2.17 1994/10/10 09:00:44 djh Rel djh $"; ! static char revision[] = "$Revision: 2.17 $"; /* * papif - UNIX AppleTalk test program: simple line printer input filter *************** *** 49,54 **** --- 49,57 ---- #ifdef xenix5 # include #endif xenix5 + #ifdef SOLARIS + # include + #endif SOLARIS /* Configuration options */ *************** *** 491,496 **** --- 494,507 ---- strcpy(account,argv[++i]); break; #endif RUTGERS + #ifdef SOLARIS + case 'U': + strcpy(host, argv[++i]); + p = strchr(host, '!'); + strcpy(user, p+1); + *p = '\0'; + break; + #endif SOLARIS default: log_e("papif: Unknown argument %c\n",p[1]); } *************** *** 1342,1351 **** * Keeps around status until we have written out the status file again * so looks for status aren't there are minimized * ! */ pstatus(s) char *s; { int fd; int okay = TRUE; --- 1353,1364 ---- * Keeps around status until we have written out the status file again * so looks for status aren't there are minimized * ! */ ! pstatus(s) char *s; { + #ifndef SOLARIS int fd; int okay = TRUE; *************** *** 1361,1366 **** --- 1374,1387 ---- link("newstatus","status"); unlink("newstatus"); } + #else SOLARIS + static char status[256]; + + if (strncmp(status, s+1, *s) != 0) { + strncpy(status, s+1, *s); + log_e("%s\r", status); + } + #endif SOLARIS } /* *************** *** 1479,1485 **** --- 1500,1510 ---- for (i = 0 ; i < NSIG ; i++) signal(i, SIG_IGN); #ifdef sun + # ifdef SOLARIS + sprintf(retry, "(/usr/bin/sleep 2;/usr/bin/disable %s;/usr/bin/sleep 2;/usr/bin/enable %s)&", + # else SOLARIS sprintf(retry, "(/usr/bin/sleep 2;/usr/etc/lpc abort %s;/usr/bin/sleep 2;/usr/etc/lpc start %s)&", + # endif SOLARIS #else sun # ifdef pyr sprintf(retry, "(/usr/bin/sleep 2;/usr/etc/lpc abort %s;/usr/bin/sleep 2;/usr/etc/lpc start %s)&", *** applications/papif/papof.c.orig Wed Jul 15 19:16:32 1992 --- applications/papif/papof.c Mon Oct 10 19:00:54 1994 *************** *** 11,23 **** * of New York * * Author: Charlie C. Kim ! */ - /* PATCH: Moy@Berkeley/papof.c.diff, djh@munnari.OZ.AU, 17/11/90 */ - /* PATCH: XENIX/file.3, djh@munnari.OZ.AU, 20/11/90 */ - #include #include #ifdef BANNERFIRST # ifndef BANNER --- 11,22 ---- * of New York * * Author: Charlie C. Kim ! * ! */ #include #include + #include #ifdef BANNERFIRST # ifndef BANNER *************** *** 49,60 **** #ifdef BANNER #ifdef PSBANNER char bannerpro[] = ".banner.pro"; - char *index(); - char *rindex(); #endif PSBANNER #endif BANNER FILE *bannerfile; char buf[BUFSIZ]; --- 48,58 ---- #ifdef BANNER #ifdef PSBANNER char bannerpro[] = ".banner.pro"; #endif PSBANNER #endif BANNER FILE *bannerfile; + char *bannerfname; char buf[BUFSIZ]; *************** *** 63,68 **** --- 61,67 ---- int c, cl, i; int dosusp; #ifdef BANNER + char *getenv(); #ifdef PSBANNER int psstart, dopsbanner; #endif PSBANNER *************** *** 70,76 **** while (1) { #ifdef BANNER ! if ((bannerfile = fopen(BANNERFILE, "w")) == NULL) { perror("Can't open .banner"); exit(8); } --- 69,77 ---- while (1) { #ifdef BANNER ! if ((bannerfname = getenv("BANNER")) == NULL) ! bannerfname = BANNERFILE; ! if ((bannerfile = fopen(bannerfname, "w")) == NULL) { perror("Can't open .banner"); exit(8); } *** applications/lwsrv/lwsrv.c.orig Mon Sep 6 12:40:58 1993 --- applications/lwsrv/lwsrv.c Mon Oct 10 19:01:20 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/09/06 02:40:41 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.32 1993/09/06 02:40:41 djh Rel djh $"; ! static char revision[] = "$Revision: 2.32 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 09:01:11 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.33 1994/10/10 09:01:11 djh Rel djh $"; ! static char revision[] = "$Revision: 2.33 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 24,32 **** * */ - /* PATCH: Rutgers1/lwsrv.c.diffs, djh@munnari.OZ.AU, 16/11/90 */ - /* PATCH: XENIX/file.3, *UNTESTED* djh@munnari.OZ.AU, 20/11/90 */ - char copyright[] = "Copyright (c) 1986, 1987, 1988 by The Trustees of Columbia University in the City of New York"; #include --- 24,29 ---- *************** *** 39,49 **** #endif _TYPES #include #include - #ifdef xenix5 - #include - #else xenix5 - #include - #endif xenix5 #include #include --- 36,41 ---- *************** *** 52,57 **** --- 44,59 ---- #include #include "../../lib/cap/abpap.h" /* urk, puke, etc */ + #ifdef USEDIRENT + #include + #else USEDIRENT + #ifdef xenix5 + #include + #else xenix5 + #include + #endif xenix5 + #endif USEDIRENT + #ifdef USESTRINGDOTH # include #else USESTRINGDOTH *************** *** 788,794 **** char *file; /* name of file containing table */ { FILE *f; - char *index(); char *m, *nl; if ((f = fopen(file, "r")) == NULL) --- 790,795 ---- *************** *** 1054,1062 **** #ifndef hpux else #ifdef USESYSVLP ! childargv[argc++]="-o-h"; /* suppress burst page */ #else USESYSVLP ! childargv[argc++]="-h"; /* suppress burst page */ #endif USESYSVLP #endif hpux #endif xenix5 --- 1055,1067 ---- #ifndef hpux else #ifdef USESYSVLP ! # ifdef SOLARIS ! childargv[argc++]="-onobanner"; /* suppress burst page */ ! # else SOLARIS ! childargv[argc++]="-o-h"; /* suppress burst page */ ! # endif SOLARIS #else USESYSVLP ! childargv[argc++]="-h"; /* suppress burst page */ #endif USESYSVLP #endif hpux #endif xenix5 *************** *** 1080,1090 **** /* will this work ... ? */ sprintf(rhbuf,"-%s%s",rflag ? "" : "r",hflag ? "" : "ob"); #else xenix5 ! #ifdef __hpux sprintf(rhbuf,"-c"); ! #else __hpux sprintf(rhbuf,"-%s",rflag ? "" : "r"); ! #endif __hpux #endif xenix5 if (rhbuf[1] != '\0') childargv[argc++]=rhbuf; /* include h and/or r flags */ --- 1085,1095 ---- /* will this work ... ? */ sprintf(rhbuf,"-%s%s",rflag ? "" : "r",hflag ? "" : "ob"); #else xenix5 ! #if defined(__hpux) || defined(SOLARIS) sprintf(rhbuf,"-c"); ! #else /* __hpux || SOLARIS */ sprintf(rhbuf,"-%s",rflag ? "" : "r"); ! #endif /* __hpux || SOLARIS */ #endif xenix5 if (rhbuf[1] != '\0') childargv[argc++]=rhbuf; /* include h and/or r flags */ *************** *** 1180,1189 **** #endif UTS } ! #ifdef hpux if (!rflag) unlink(tname); ! #else hpux if (WIFEXITED(waitstatus)) { if (W_RETCODE(waitstatus) != 0 ) { fprintf(stderr,"lpr exited with status %d, %sremoving %s\n", --- 1185,1194 ---- #endif UTS } ! #if defined(hpux) || defined(SOLARIS) if (!rflag) unlink(tname); ! #else /* hpux || SOLARIS */ if (WIFEXITED(waitstatus)) { if (W_RETCODE(waitstatus) != 0 ) { fprintf(stderr,"lpr exited with status %d, %sremoving %s\n", *************** *** 1192,1198 **** unlink(tname); } } ! #endif hpux break; } } --- 1197,1203 ---- unlink(tname); } } ! #endif /* hpux || SOLARIS */ break; } } *** applications/lwsrv/procset.c.orig Tue Sep 28 18:25:19 1993 --- applications/lwsrv/procset.c Mon Oct 10 19:01:22 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/09/28 08:24:19 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.8 1993/09/28 08:24:19 djh Rel djh $"; ! static char revision[] = "$Revision: 2.8 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/10 09:01:11 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.9 1994/10/10 09:01:11 djh Rel djh $"; ! static char revision[] = "$Revision: 2.9 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 17,53 **** * */ - /* PATCH: procset.c.looping, djh@munnari.OZ.AU, 12/11/90 */ - /* PATCH: XENIX/file.3, djh@munnari.OZ.AU, 20/11/90 */ - #include #include #ifndef _TYPES # include /* assume included by param.h */ ! #endif #include - #ifdef xenix5 - #include - #else xenix5 - # ifndef drsnx - # include - # endif drsnx - #endif xenix5 #include #include #include #include #ifdef USESTRINGDOTH # include #else USESTRINGDOTH # include #endif USESTRINGDOTH #ifdef USEDIRENT # include #endif USEDIRENT ! #ifdef xenix5 # include #endif xenix5 #include "procset.h" #include "spmisc.h" --- 17,53 ---- * */ #include #include #ifndef _TYPES # include /* assume included by param.h */ ! #endif _TYPES #include #include #include #include #include + #ifdef USESTRINGDOTH # include #else USESTRINGDOTH # include #endif USESTRINGDOTH + #ifdef USEDIRENT # include + #else USEDIRENT + # ifdef xenix5 + # include + # else xenix5 + # include + # endif xenix5 #endif USEDIRENT ! ! #if defined(xenix5) || defined(SOLARIS) # include #endif xenix5 + #include "procset.h" #include "spmisc.h" *************** *** 96,102 **** if (stat(fn, &stb) < 0) return(FALSE); #ifdef USEDIRENT ! #if defined (AIX) || defined (drsnx) || defined(__osf__) if (S_ISREG(stb.st_mode) == 0) /* make sure regular file */ return(FALSE); #else AIX || drsnx || __osf__ --- 96,102 ---- if (stat(fn, &stb) < 0) return(FALSE); #ifdef USEDIRENT ! #if defined (AIX) || defined (drsnx) || defined(__osf__) || defined(SOLARIS) if (S_ISREG(stb.st_mode) == 0) /* make sure regular file */ return(FALSE); #else AIX || drsnx || __osf__ *** applications/aufs/Makefile.m4.orig Wed Sep 15 13:38:59 1993 --- applications/aufs/Makefile.m4 Tue Oct 11 16:56:05 1994 *************** *** 15,20 **** --- 15,23 ---- # for other libraries (like BSD on hpux) SLIB=libspecial() + # for Rutgers + RULIB=libru() + # used mainly for debugging CAPFILES= *************** *** 57,66 **** aufs: aufs.o $(OBJS) $(CAPFILES) ${RENAME} $(GETOPT) ${CC} $(LFLAGS) -o aufs aufs.o $(OBJS) $(CAPFILES) ${RENAME} \ ! $(GETOPT) ${AFPLIB} ${CAPLIB} ${SLIB} sizeserver: sizeserver.o ! ${CC} ${LFLAGS} -o sizeserver sizeserver.o ${SLIB} sizeserver.o: sizeserver.c sizeserver.h ${CC} ${OSDEFS} ${CFLAGS} -c sizeserver.c --- 60,69 ---- aufs: aufs.o $(OBJS) $(CAPFILES) ${RENAME} $(GETOPT) ${CC} $(LFLAGS) -o aufs aufs.o $(OBJS) $(CAPFILES) ${RENAME} \ ! $(GETOPT) ${AFPLIB} ${CAPLIB} ${SLIB} ${RULIB} sizeserver: sizeserver.o ! ${CC} ${LFLAGS} -o sizeserver sizeserver.o ${SLIB} ${RULIB} sizeserver.o: sizeserver.c sizeserver.h ${CC} ${OSDEFS} ${CFLAGS} -c sizeserver.c *************** *** 103,116 **** afposncs.o: afposncs.c ${CC} ${OSDEFS} ${CFLAGS} -c afposncs.c - afpserver.o: afpserver.c - ${CC} ${OSDEFS} ${CFLAGS} -c afpserver.c - afpudb.o: afpudb.c ${CC} ${CFLAGS} ${AFPUDB} -c afpudb.c aufs.o: aufs.c ${CC} ${OSDEFS} ${CFLAGS} ${AUFSDEFS} -c aufs.c # Dependencies afpos.o: afpos.c $I/netat/appletalk.h \ --- 106,119 ---- afposncs.o: afposncs.c ${CC} ${OSDEFS} ${CFLAGS} -c afposncs.c afpudb.o: afpudb.c ${CC} ${CFLAGS} ${AFPUDB} -c afpudb.c aufs.o: aufs.c ${CC} ${OSDEFS} ${CFLAGS} ${AUFSDEFS} -c aufs.c + + afpserver.o: afpserver.c + ${CC} ${OSDEFS} ${CFLAGS} ${AUFSDEFS} -c afpserver.c # Dependencies afpos.o: afpos.c $I/netat/appletalk.h \ *** applications/aufs/aufs.c.orig Mon Jan 31 09:26:35 1994 --- applications/aufs/aufs.c Mon Oct 10 19:02:12 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1994/01/30 22:26:14 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.23 1994/01/30 22:26:14 djh Rel djh $ ! * $Revision: 2.23 $ * */ --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.24 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.24 $ * */ *************** *** 27,33 **** #ifndef _TYPES /* assume included by param.h */ #include ! #endif #include #include #include --- 27,33 ---- #ifndef _TYPES /* assume included by param.h */ #include ! #endif _TYPES #include #include #include *************** *** 39,44 **** --- 39,48 ---- #include #include #include "afps.h" /* server includes */ + + #ifdef NEEDFCNTLDOTH + #include + #endif NEEDFCNTLDOTH #ifdef USESTRINGDOTH # include *** applications/aufs/afpdid.c.orig Thu Aug 26 22:08:35 1993 --- applications/aufs/afpdid.c Mon Oct 10 19:02:14 1994 *************** *** 1,8 **** /* ! * $Author: djh $ $Date: 1993/08/26 12:08:20 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdid.c,v 2.10 1993/08/26 12:08:20 djh Rel djh $ ! * $Revision: 2.10 $ ! */ /* * afpdid.c - Directory id routines --- 1,9 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdid.c,v 2.11 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.11 $ ! * ! */ /* * afpdid.c - Directory id routines *************** *** 25,45 **** #ifndef _TYPES /* assume included by param.h */ # include ! #endif ! #ifdef xenix5 ! #include ! #else xenix5 ! #include ! #endif xenix5 #include #include #include #include "afps.h" #ifdef USESTRINGDOTH # include ! #else # include ! #endif /* * --- 26,52 ---- #ifndef _TYPES /* assume included by param.h */ # include ! #endif _TYPES #include #include #include #include "afps.h" + + #ifdef USEDIRENT + # include + #else USEDIRENT + # ifdef xenix5 + # include + # else xenix5 + # include + # endif xenix5 + #endif USEDIRENT + #ifdef USESTRINGDOTH # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH /* * *** applications/aufs/afpdt.c.orig Mon Aug 2 21:47:50 1993 --- applications/aufs/afpdt.c Mon Oct 10 19:02:16 1994 *************** *** 1,8 **** /* ! * $Author: djh $ $Date: 1993/08/02 11:47:19 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdt.c,v 2.7 1993/08/02 11:47:19 djh Rel djh $ ! * $Revision: 2.7 $ ! */ /* * afpdt.c - Appletalk Filing Protocol Desktop Interface --- 1,9 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdt.c,v 2.8 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.8 $ ! * ! */ /* * afpdt.c - Appletalk Filing Protocol Desktop Interface *************** *** 19,27 **** * */ - /* PATCH: Dan@lth.se/stat.cache.patches, djh@munnari.OZ.AU, 16/11/90 */ - /* PATCH: Moy@Berkeley/afpdt.c.diff, djh@munnari.OZ.AU, 17/11/90 */ - /* * Desktop management routines: * --- 20,25 ---- *************** *** 45,51 **** #ifndef _TYPES /* assume included by param.h */ # include ! #endif #include #include #include --- 43,49 ---- #ifndef _TYPES /* assume included by param.h */ # include ! #endif _TYPES #include #include #include *************** *** 53,59 **** #include #ifdef NEEDFCNTLDOTH # include ! #endif #include #include #include "afpntoh.h" --- 51,60 ---- #include #ifdef NEEDFCNTLDOTH # include ! #endif NEEDFCNTLDOTH ! #ifdef SOLARIS ! #include ! #endif SOLARIS #include #include #include "afpntoh.h" *** applications/aufs/afpdt.h.orig Thu Feb 28 23:44:23 1991 --- applications/aufs/afpdt.h Mon Oct 10 19:02:17 1994 *************** *** 1,8 **** /* ! * $Author: djh $ $Date: 91/02/15 21:06:47 $ ! * $Header: afpdt.h,v 2.1 91/02/15 21:06:47 djh Rel $ ! * $Revision: 2.1 $ ! */ /* * afpdt.h - Appletalk Filing Protocol Desktop definitions --- 1,9 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdt.h,v 2.2 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.2 $ ! * ! */ /* * afpdt.h - Appletalk Filing Protocol Desktop definitions *************** *** 110,118 **** #define NILDT ((DeskTop *) 0) ! DeskTop *VolGetDesk(); ! void VolSetDesk(); ! void VolClrDesk(); typedef struct { IconNode *ib_node; /* pointer to owner node */ --- 111,119 ---- #define NILDT ((DeskTop *) 0) ! private DeskTop *VolGetDesk(); ! private void VolSetDesk(); ! private void VolClrDesk(); typedef struct { IconNode *ib_node; /* pointer to owner node */ *** applications/aufs/afpos.c.orig Wed Feb 16 16:09:29 1994 --- applications/aufs/afpos.c Mon Oct 10 19:02:22 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1994/02/16 05:09:02 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.50 1994/02/16 05:09:02 djh Rel djh $ ! * $Revision: 2.50 $ * */ --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.51 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.51 $ * */ *************** *** 84,106 **** # include /* assume included by param.h */ #endif _TYPES #include - #ifdef xenix5 - #include - #else xenix5 - # ifndef drsnx - # include - # endif drsnx - #endif xenix5 #include #include #include #include #ifdef aux # include #endif aux #ifdef USEDIRENT #include #endif USEDIRENT #ifdef SHADOW_PASSWD #include #endif SHADOW_PASSWD --- 84,110 ---- # include /* assume included by param.h */ #endif _TYPES #include #include #include #include #include + #ifdef aux # include #endif aux + #ifdef USEDIRENT #include + #else USEDIRENT + # ifdef xenix5 + # include + # else xenix5 + # ifndef drsnx + # include + # endif drsnx + # endif xenix5 #endif USEDIRENT + #ifdef SHADOW_PASSWD #include #endif SHADOW_PASSWD *************** *** 115,121 **** # endif USEQUOTA #endif USESUNQUOTA ! #if defined (APPLICATION_MANAGER) | defined (DENYREADWRITE) # define NEEDFCNTLDOTH #endif APPLICATION_MANAGER|DENYREADWRITE --- 119,125 ---- # endif USEQUOTA #endif USESUNQUOTA ! #if defined (APPLICATION_MANAGER) || defined (DENYREADWRITE) # define NEEDFCNTLDOTH #endif APPLICATION_MANAGER|DENYREADWRITE *************** *** 125,130 **** --- 129,135 ---- # include # endif apollo #endif NEEDFCNTLDOTH + #ifdef USESTRINGDOTH # include #else USESTRINGDOTH *************** *** 136,152 **** #endif USEUSTAT #ifdef USESTATFS ! # if defined(__BSD_4_4__) || defined(__osf__) ! # include ! # include ! # else /* __BSD_4_4__ || __osf__ */ ! # if defined(sgi) || defined(apollo) ! # include ! # else /* sgi || apollo */ ! # include ! # endif /* sgi || apollo */ ! # endif /* __BSD_4_4__ || __osf__ */ ! #endif USESTATFS #ifdef AIX #include --- 141,161 ---- #endif USEUSTAT #ifdef USESTATFS ! # ifdef SOLARIS ! # include ! # else /* SOLARIS */ ! # if defined(__BSD_4_4__) || defined(__osf__) ! # include ! # include ! # else /* __BSD_4_4__ || __osf__ */ ! # if defined(sgi) || defined(apollo) ! # include ! # else /* sgi || apollo */ ! # include ! # endif /* sgi || apollo */ ! # endif /* __BSD_4_4__ || __osf__ */ ! # endif /* SOLARIS */ ! #endif /* USESTATFS */ #ifdef AIX #include *************** *** 167,186 **** #endif USEBSDQUOTA #ifdef USEQUOTA ! # ifndef USESUNQUOTA ! # include ! /* NOTE: If there is not sys/quota.h and there is a ufs/quota.h */ ! /* then you should probably define SUN_QUOTA -- especially if your */ ! /* NFS is based on the sun model */ ! # else USESUNQUOTA ! # include ! # include ! # endif USESUNQUOTA # ifndef Q_GETDLIM # ifdef Q_GETQUOTA # define Q_GETDLIM Q_GETQUOTA # else Q_GETQUOTA ! /* You have turned on quotas and aren't using the bsd or sun quota system */ # endif Q_GETQUOTA # endif Q_GETDLIM #endif USEQUOTA --- 176,207 ---- #endif USEBSDQUOTA #ifdef USEQUOTA ! # ifdef SOLARIS ! # undef USESUNQUOTA ! # include ! # else SOLARIS ! # ifndef USESUNQUOTA ! # include ! /* ! * NOTE: If there is not sys/quota.h and there is a ufs/quota.h ! * then you should probably define SUN_QUOTA -- especially if your ! * NFS is based on the sun model ! * ! */ ! # else USESUNQUOTA ! # include ! # include ! # endif USESUNQUOTA ! # endif SOLARIS # ifndef Q_GETDLIM # ifdef Q_GETQUOTA # define Q_GETDLIM Q_GETQUOTA # else Q_GETQUOTA ! /* ! * Error: You have turned on quotas and aren't using the ! * bsd or sun quota system. ! * ! */ # endif Q_GETQUOTA # endif Q_GETDLIM #endif USEQUOTA *************** *** 202,207 **** --- 223,233 ---- # endif USESTATFS #endif drsnx + #ifdef SOLARIS + # include + # define NGROUPS NGROUPS_MAX_DEFAULT + #endif SOLARIS + #include #include /* flags should be in misc */ #include "afps.h" /* common includes */ *************** *** 281,290 **** private int usruid; private int usrgid; private int ngroups; #ifndef GGTYPE ! # define GGTYPE int #endif GGTYPE private GGTYPE groups[NGROUPS+1]; #ifdef USEGETMNT # ifndef NOSTAT_ONE /* no big deal if this changes, it just means you can't compile under */ --- 307,323 ---- private int usruid; private int usrgid; private int ngroups; + #ifndef GGTYPE ! # ifdef SOLARIS ! # define GGTYPE gid_t ! # else SOLARIS ! # define GGTYPE int ! # endif SOLARIS #endif GGTYPE + private GGTYPE groups[NGROUPS+1]; + #ifdef USEGETMNT # ifndef NOSTAT_ONE /* no big deal if this changes, it just means you can't compile under */ *************** *** 466,472 **** logit(0," Configured: Volume space information: ustat"); #endif USEUSTAT #ifdef USESTATFS ! logit(0," Configured: Volume space information: statfs"); #endif USESTATFS #ifdef USEGETMNT logit(0," Configured: Volume space information: getmnt"); --- 499,505 ---- logit(0," Configured: Volume space information: ustat"); #endif USEUSTAT #ifdef USESTATFS ! logit(0," Configured: Volume space information: stat[v]fs"); #endif USESTATFS #ifdef USEGETMNT logit(0," Configured: Volume space information: getmnt"); *************** *** 473,490 **** if (oldgetmnt) logit(0," using old style (Ultrix 1.2, 2.0) getmnt"); #endif USEGETMNT ! #ifdef USESUNQUOTA logit(0," Configured: SUN quota system"); ! #endif USESUNQUOTA ! #ifndef USESUNQUOTA ! /* sunquota turns on usequota */ ! # ifdef USEQUOTA ! logit(0," Configured: Melbourne (BSD) quota system"); ! # endif USEQUOTA ! #endif USESUNQUOTA ! #ifdef USEBSDQUOTA logit(0," Configured: New BSD quota system"); ! #endif USEBSDQUOTA #ifdef USECHOWN logit(0," Configured: chown: system allows one to give away ownership of files"); #endif USECHOWN --- 506,524 ---- if (oldgetmnt) logit(0," using old style (Ultrix 1.2, 2.0) getmnt"); #endif USEGETMNT ! ! #ifdef USEQUOTA ! # if defined(USESUNQUOTA) || defined(SOLARIS) logit(0," Configured: SUN quota system"); ! # else /* USESUNQUOTA || SOLARIS */ ! # ifdef USEBSDQUOTA logit(0," Configured: New BSD quota system"); ! # else /* USEBSDQUOTA */ ! logit(0," Configured: Melbourne (BSD) quota system"); ! # endif /* USEBSDQUOTA */ ! # endif /* USESUNQUOTA || SOLARIS */ ! #endif /* USEQUOTA */ ! #ifdef USECHOWN logit(0," Configured: chown: system allows one to give away ownership of files"); #endif USECHOWN *************** *** 2359,2365 **** --- 2393,2403 ---- struct ustat ubuf; #endif USEUSTAT #ifdef USESTATFS + # ifdef SOLARIS + struct statvfs fsbuf; + # else SOLARIS struct statfs fsbuf; + # endif SOLARIS #endif USESTATFS time_t sometime; void scaleVolSize(); *************** *** 2418,2432 **** /* careful on the ordering - these must go last and if you can possibly */ /* define more than one then you must define in order you wish */ #ifdef USEQUOTA ! #ifdef gould if (gquota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #else gould ! #ifdef encore if (equota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #else encore if (quota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #endif encore ! #endif gould dqblk.dqb_bhardlimit != 0) { /* make sure not unlimited */ v->v_size = dqblk.dqb_bhardlimit*512; v->v_free = (dqblk.dqb_bhardlimit-dqblk.dqb_curblocks)*512; --- 2456,2470 ---- /* careful on the ordering - these must go last and if you can possibly */ /* define more than one then you must define in order you wish */ #ifdef USEQUOTA ! #if defined(gould) if (gquota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #elif defined(encore) if (equota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #elif defined(SOLARIS) ! if (solaris_quota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #else /* gould || encore || SOLARIS */ if (quota(Q_GETDLIM, usruid, buf.st_dev, &dqblk) == 0 && ! #endif /* gould || encore || SOLARIS */ dqblk.dqb_bhardlimit != 0) { /* make sure not unlimited */ v->v_size = dqblk.dqb_bhardlimit*512; v->v_free = (dqblk.dqb_bhardlimit-dqblk.dqb_curblocks)*512; *************** *** 2466,2471 **** --- 2504,2518 ---- } #endif USEUSTAT #ifdef USESTATFS + #ifdef SOLARIS + if (statvfs(path, &fsbuf) >= 0) { + v->v_size = fsbuf.f_frsize * fsbuf.f_blocks; + /* limiting factor: cannot report on overutilization of a volume */ + v->v_free = (fsbuf.f_bavail < 0) ? 0 : fsbuf.f_frsize * fsbuf.f_bavail; + scaleVolSize(v); + return(noErr); + } + #else /* SOLARIS */ # if defined(sgi) || defined(apollo) if (statfs(path, &fsbuf, sizeof(fsbuf), 0) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; *************** *** 2494,2499 **** --- 2541,2547 ---- return(noErr); } # endif /* sgi || apollo */ + #endif /* SOLARIS */ #endif USESTATFS #ifdef SIZESERVER getvolsize(path, &v->v_size, &v->v_free); *************** *** 2631,2636 **** --- 2679,2715 ---- } #endif /* GETMNT */ + #if defined(USEQUOTA) && defined(SOLARIS) + int + solaris_quota(cmd, uid, path, dq) + int cmd, uid; + char *path; + struct dqblk *dq; + { + int fd, res; + struct quotactl qctl; + + switch (cmd) { + case Q_GETQUOTA: /* let it be "read-only" */ + break; + default: + errno = EINVAL; + return(-1); + } + + if ((fd = open(path, O_RDONLY)) < 0) + return(-1); + + qctl.op = cmd; + qctl.uid = uid; + qctl.addr = (caddr_t)dq; + res = ioctl(fd, Q_QUOTACTL, &qctl); + close(fd); + + return(res); + } + #endif /* USEQUOTA && SOLARIS */ + #if defined(USESUNQUOTA) || defined(USEBSDQUOTA) #ifndef MAXUFSMOUNTED *************** *** 4013,4022 **** *tend++ = '/'; for (dinfp = readdir(dptr); dinfp != NULL; dinfp = readdir(dptr)) { ! if (*dinfp->d_name == '.') ! if ((dinfp->d_namlen == 1) || ! ((dinfp->d_namlen == 2) && (*(dinfp->d_name+1) == '.'))) continue; *fend = *tend = '\0'; strcat(fname,dinfp->d_name); strcat(tname,dinfp->d_name); --- 4092,4108 ---- *tend++ = '/'; for (dinfp = readdir(dptr); dinfp != NULL; dinfp = readdir(dptr)) { ! if (*dinfp->d_name == '.') { ! int namlen; ! #ifdef USEDIRENT ! namlen = dinfp->d_namlen; ! #else /* USEDIRENT */ ! namlen = strlen(dinfp->d_name); ! #endif /* USEDIRENT */ ! if ((namlen == 1) || ! ((namlen == 2) && (*(dinfp->d_name+1) == '.'))) continue; + } *fend = *tend = '\0'; strcat(fname,dinfp->d_name); strcat(tname,dinfp->d_name); *** applications/aufs/afposenum.c.orig Mon Nov 8 16:16:14 1993 --- applications/aufs/afposenum.c Mon Oct 10 19:02:23 1994 *************** *** 1,8 **** /* ! * $Author: djh $ $Date: 1993/11/08 05:15:59 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afposenum.c,v 2.12 1993/11/08 05:15:59 djh Rel djh $ ! * $Revision: 2.12 $ ! */ /* * afposenum.c - Appletalk Filing Protocol OS enumeration. --- 1,9 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afposenum.c,v 2.13 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.13 $ ! * ! */ /* * afposenum.c - Appletalk Filing Protocol OS enumeration. *************** *** 18,45 **** * */ - /* PATCH: PC.aufs/afposenum.c.diffs, djh@munnari.OZ.AU, 15/11/90 */ - /* PATCH: Dan@lth.se/stat.cache.patches, djh@munnari.OZ.AU, 16/11/90 */ - /* PATCH: Moy@Berkeley/afposenum.c.diff, djh@munnari.OZ.AU, 17/11/90 */ - /* PATCH: XENIX/file.3, djh@munnari.OZ.AU, 20/11/90 */ - #include #include #ifndef _TYPES /* assume included by param.h */ # include ! #endif ! #ifdef xenix5 ! #include ! #else xenix5 ! # ifndef drsnx ! # include ! # endif drsnx ! #endif xenix5 #include #include #include #include #ifdef USESTRINGDOTH #include #else USESTRINGDOTH --- 19,37 ---- * */ #include #include + #ifndef _TYPES /* assume included by param.h */ # include ! #endif /* _TYPES */ ! #include #include #include #include + #ifdef USESTRINGDOTH #include #else USESTRINGDOTH *************** *** 52,57 **** --- 44,62 ---- #include #include #endif NOCASEMATCH + #ifdef USEDIRENT + # include + #else /* USEDIRENT */ + # ifdef xenix5 + # include + # else xenix5 + # include + # endif xenix5 + #endif /* USEDIRENT */ + #ifdef SOLARIS + # include + #endif /* SOLARIS */ + #include "afps.h" #include "afpdt.h" #include "afpgc.h" *************** *** 503,509 **** --- 508,518 ---- ec->s_namearray = (s_entry*)malloc (ec->ece_cnt*sizeof(s_entry)); ast = FALSE; for (i = 0; iece_cnt; i++) { + #ifdef USEDIRENT + name_toupper(strlen(ec->ece_nlst[i]->d_name),ec->ece_nlst[i]->d_name, + #else /* USEDIRENT */ name_toupper(ec->ece_nlst[i]->d_namlen, ec->ece_nlst[i]->d_name, + #endif /* USEDIRENT */ ec->s_namearray[i].s_name); if (i>0) { if ((strcmp(ec->s_namearray[i].s_name, *************** *** 530,542 **** --- 539,559 ---- char tempx[MAXNAMLEN],tempy[MAXNAMLEN]; int i = 0; + #ifdef USEDIRENT + while (i < strlen((*x)->d_name)) { + #else /* USEDIRENT */ while (i < (*x)->d_namlen) { + #endif /* USEDIRENT */ tempx[i] = toupper((*x)->d_name[i]); i++; } tempx[i] = '\0'; i = 0; + #ifdef USEDIRENT + while (i < strlen((*y)->d_name)) { + #else /* USEDIRENT */ while (i < (*y)->d_namlen) { + #endif /* USEDIRENT */ tempy[i] = toupper((*y)->d_name[i]); i++; } *************** *** 817,823 **** } *tp = 0; while(d = readdir(dp)) { ! if(d->d_namlen != len) continue; for(fp = d->d_name, tp = dname ; *fp ; fp++) *tp++ = isupper(*fp) ? tolower(*fp) : *fp; --- 834,844 ---- } *tp = 0; while(d = readdir(dp)) { ! #ifdef USEDIRENT ! if (strlen(d->d_name) != len) ! #else /* USEDIRENT */ ! if (d->d_namlen != len) ! #endif /* USEDIRENT */ continue; for(fp = d->d_name, tp = dname ; *fp ; fp++) *tp++ = isupper(*fp) ? tolower(*fp) : *fp; *** applications/aufs/afpspd.c.orig Mon Dec 6 21:07:35 1993 --- applications/aufs/afpspd.c Mon Oct 10 19:02:24 1994 *************** *** 18,24 **** #ifdef STAT_CACHE ! private struct statobj { char * NAME; struct stat STAT; int FN,RS; --- 18,24 ---- #ifdef STAT_CACHE ! struct statobj { char * NAME; struct stat STAT; int FN,RS; *** applications/aufs/afps.h.orig Mon Jan 31 09:26:41 1994 --- applications/aufs/afps.h Mon Oct 10 19:02:25 1994 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1994/01/30 22:26:14 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afps.h,v 2.7 1994/01/30 22:26:14 djh Rel djh $ ! * $Revision: 2.7 $ * */ --- 1,7 ---- /* ! * $Author: djh $ $Date: 1994/10/10 09:02:04 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afps.h,v 2.8 1994/10/10 09:02:04 djh Rel djh $ ! * $Revision: 2.8 $ * */ *************** *** 118,124 **** IDirP Ipdirid(); /* return parent of dirid given dirid */ char *pathstr(); /* return path given dirid */ void InitDID(); /* initialize directory id mechanism */ - void printtree(); /* debugging routine */ OSErr EtoIfile(); /* convert file names */ void Idmove(); /* rename a directory */ byte *ItoEName(); /* unix to mac name */ --- 118,123 ---- *** etc/S99appletalk.orig Tue Sep 20 17:53:47 1994 --- etc/S99appletalk Mon Oct 10 19:02:58 1994 *************** *** 0 **** --- 1,59 ---- + #!/bin/sh + #(@)/etc/rc3.d/S99appletalk + # startup script for CAP60 servers + + CAPHOME=/usr/local/cap; export CAPHOME + CAPLIBS=/usr/local/lib/cap; export CAPLIBS + + killproc () + { pid=`/bin/ps -e | grep $1 | awk '{ print $1 }'` + [ "pid" != "" ] && kill $pid + } + + case "$1" in + 'start') + echo "Starting Columbia AppleTalk package ..." + + # edit for required zone name + ${CAPHOME}/aarpd le0 Fysik + + ${CAPHOME}/atis > /dev/null 2>&1; sleep 5 + + #${CAPHOME}/snitch -S -f "SPARCserver MP670" + + # mkdir -m 0700 /tmp/at.auth + + # AppleShare for Unix + # ${CAPHOME}/aufs \ + # -U 8 \ + # -l /tmp/CAPShare.log \ + # -n "`uname -n`" \ + # -X /tmp/at.auth \ + # -V /etc/CAP60/afpvols + + # LaserWriter print spooler + # ${CAPHOME}/lwsrv \ + # -N \ + # -a ${CAPLIBS}/ProcSets \ + # -f ${CAPLIBS}/LWFonts \ + # -X /tmp/at.auth + + # check integrity + FILES="/etc/rc0.d/K02appletalk \ + /etc/rc1.d/K02appletalk \ + /etc/rc2.d/K02appletalk \ + /etc/init.d/CAP60" + for FILE in $FILES; do + if [ ! -f $FILE ]; then + ln /etc/rc3.d/S99appletalk $FILE + fi + done + echo "... done." + ;; + 'stop') + # killproc lwsr + # killproc aufs + ${CAPHOME}/atis exit > /dev/null 2>&1 + killproc aarpd + ;; + esac *** contrib/cvt2apple.c.orig Sat Aug 31 15:48:27 1991 --- contrib/cvt2apple.c Mon Oct 10 19:06:30 1994 *************** *** 36,47 **** #include #include #include - #include #include #include #include #ifdef USEDIRENT ! #include #endif USEDIRENT char *prog; --- 36,53 ---- #include #include #include #include #include #include + #ifdef USEDIRENT ! # include ! #else USEDIRENT ! # ifdef xenix5 ! # include ! # else xenix5 ! # include ! # endif xenix5 #endif USEDIRENT char *prog; *** contrib/snitch.c.orig Thu Jul 30 19:46:57 1992 --- contrib/snitch.c Mon Oct 10 19:06:32 1994 *************** *** 32,39 **** * */ - /* PATCH: snitch.c.stringlength, djh@munnari.OZ.AU, 12/11/90 */ - #include #include #include --- 32,37 ---- *************** *** 46,54 **** #ifdef USESTRINGDOTH /* based on sysvcompat.h in appletalk.h */ # include ! #else # include ! #endif #define MAXNBPSTRING 32 --- 44,52 ---- #ifdef USESTRINGDOTH /* based on sysvcompat.h in appletalk.h */ # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH #define MAXNBPSTRING 32 *************** *** 89,94 **** --- 87,93 ---- /* forward */ void snitch_handler(); + void cleanup() { int err; *************** *** 255,262 **** } } ! signal(SIGQUIT,cleanup); ! signal(SIGTERM,cleanup); ap = &req_abr.proto.atp; do { --- 254,261 ---- } } ! signal(SIGQUIT, cleanup); ! signal(SIGTERM, cleanup); ap = &req_abr.proto.atp; do { *** contrib/AufsTools/binhex/Makefile.orig Thu Feb 28 13:30:39 1991 --- contrib/AufsTools/binhex/Makefile Thu Sep 29 16:15:38 1994 *************** *** 1,3 **** --- 1,6 ---- + # for Solaris 2.X + # CFLAGS= -O + # CFLAGS= -O -Dstrrchr=rindex LFLAGS= CFILES= binhex.c gethead.c crc.c run.c 8to6.c *** contrib/AufsTools/binhex/aufs.h.orig Thu Feb 28 14:15:07 1991 --- contrib/AufsTools/binhex/aufs.h Thu Oct 6 17:36:47 1994 *************** *** 1,12 **** --- 1,20 ---- /********************************************************************************/ /* added for aufs, nicked from various places... */ + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + /* following from mcvert program */ /* Useful, though not particularly Mac related, values */ typedef unsigned char byte; /* one byte, obviously */ typedef unsigned short word; /* must be 2 bytes */ + #ifndef SOLARIS typedef unsigned long ulong; /* 4 bytes */ + #endif SOLARIS #define NAMELEN 63 /* maximum legal Mac file name length */ *** contrib/AufsTools/binhex/binhex.c.orig Thu Jul 30 14:57:03 1992 --- contrib/AufsTools/binhex/binhex.c Thu Oct 6 17:37:09 1994 *************** *** 26,35 **** * created dbg 09/10/85 -- Version 1.0 */ #include ! #ifdef hpux #include ! #endif hpux #include "aufs.h" #ifdef VMS --- 26,43 ---- * created dbg 09/10/85 -- Version 1.0 */ + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + #include ! #if defined(hpux) || defined(SOLARIS) #include ! #include ! #endif /* hpux || SOLARIS */ ! #include "aufs.h" #ifdef VMS *************** *** 39,47 **** # define MAXNAMLEN 127 # define MAXBASENAME 63 # endif ! #else # include ! # include # define PROGRAMNAME (argv[0]) # define AUFSNAME "binhex" # define EXIT_ERROR 1 --- 47,59 ---- # define MAXNAMLEN 127 # define MAXBASENAME 63 # endif ! #else VMS # include ! # ifdef SOLARIS ! # include ! # else SOLARIS ! # include ! # endif SOLARIS # define PROGRAMNAME (argv[0]) # define AUFSNAME "binhex" # define EXIT_ERROR 1 *************** *** 53,63 **** # endif # endif # define MAXBASENAME (MAXNAMLEN - 2) ! #endif ! #ifndef hpux extern char *sprintf(), *strrchr(); ! #endif hpux extern void aufs_gethead(), gethead(), fakehead(), make_buffer_crc(), make_file_crc(), putchar_run(); --- 65,76 ---- # endif # endif # define MAXBASENAME (MAXNAMLEN - 2) ! #endif VMS ! #if !defined(hpux) && !defined(SOLARIS) extern char *sprintf(), *strrchr(); ! #endif /* !hpux && !SOLARIS */ ! extern void aufs_gethead(), gethead(), fakehead(), make_buffer_crc(), make_file_crc(), putchar_run(); *** contrib/AufsTools/capit/capit.c.orig Thu May 9 00:17:18 1991 --- contrib/AufsTools/capit/capit.c Thu Oct 6 17:37:30 1994 *************** *** 18,28 **** np@doc.ic.ac.uk */ #include #include #include #include ! #include #define BSIZE (128) /* size of blocks in MacBinary file */ typedef long int4; --- 18,41 ---- np@doc.ic.ac.uk */ + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + #include #include + #include + + #ifdef SOLARIS + #include + #include + #include + #else SOLARIS #include #include ! #endif SOLARIS #define BSIZE (128) /* size of blocks in MacBinary file */ typedef long int4; *************** *** 33,39 **** --- 46,54 ---- /* Useful, though not particularly Mac related, values */ typedef unsigned char byte; /* one byte, obviously */ typedef unsigned short word; /* must be 2 bytes */ + #ifndef SOLARIS typedef unsigned long ulong; /* 4 bytes */ + #endif SOLARIS #define NAMELEN 63 /* maximum legal Mac file name length */ *** contrib/AufsTools/mcvert/Makefile.orig Tue Feb 26 18:07:03 1991 --- contrib/AufsTools/mcvert/Makefile Thu Sep 29 16:29:48 1994 *************** *** 2,7 **** --- 2,10 ---- SOURCES = mcvert.c hqxify.c unpack.c mactypes.h Makefile OBJECTS = mcvert.o hqxify.o unpack.o BIN = . + # for Solaris 2.X + # CFLAGS = -O + # CFLAGS = -O -DBSD DESTDIR = /usr/local/cap *** contrib/AufsTools/mcvert/mactypes.h.orig Thu May 9 00:16:13 1991 --- contrib/AufsTools/mcvert/mactypes.h Thu Oct 6 17:37:53 1994 *************** *** 1,14 **** #include #include - #include #include - #include #include /* Useful, though not particularly Mac related, values */ typedef unsigned char byte; /* one byte, obviously */ typedef unsigned short word; /* must be 2 bytes */ typedef unsigned long ulong; /* 4 bytes */ #define TRUE 1 #define FALSE 0 #define CR 0x0d --- 1,29 ---- + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + #include #include #include #include + #ifdef SOLARIS + #include + #include + #include + #else SOLARIS + #include + #include + #endif SOLARIS + /* Useful, though not particularly Mac related, values */ typedef unsigned char byte; /* one byte, obviously */ typedef unsigned short word; /* must be 2 bytes */ + #ifndef SOLARIS typedef unsigned long ulong; /* 4 bytes */ + #endif SOLARIS #define TRUE 1 #define FALSE 0 #define CR 0x0d *** contrib/AufsTools/stuffit/sit.h.orig Fri Feb 22 12:43:51 1991 --- contrib/AufsTools/stuffit/sit.h Thu Oct 6 13:36:35 1994 *************** *** 1,7 **** /* sit.h: contains declarations for SIT headers */ ! typedef struct sitHdr { /* 22 bytes */ u_char sig1[4]; /* = 'SIT!' -- for verification */ u_char numFiles[2]; /* number of files in archive */ u_char arcLen[4]; /* length of entire archive incl. */ --- 1,7 ---- /* sit.h: contains declarations for SIT headers */ ! struct sitHdr { /* 22 bytes */ u_char sig1[4]; /* = 'SIT!' -- for verification */ u_char numFiles[2]; /* number of files in archive */ u_char arcLen[4]; /* length of entire archive incl. */ *************** *** 10,16 **** char reserved[7]; }; ! typedef struct fileHdr { /* 112 bytes */ u_char compRMethod; /* rsrc fork compression method */ u_char compDMethod; /* data fork compression method */ u_char fName[64]; /* a STR63 */ --- 10,16 ---- char reserved[7]; }; ! struct fileHdr { /* 112 bytes */ u_char compRMethod; /* rsrc fork compression method */ u_char compDMethod; /* data fork compression method */ u_char fName[64]; /* a STR63 */ *** contrib/AufsTools/stuffit/sit.c.orig Thu Feb 28 13:56:08 1991 --- contrib/AufsTools/stuffit/sit.c Thu Oct 6 17:38:12 1994 *************** *** 24,31 **** --- 24,39 ---- * Aug 90. Nigel Perry, np@doc.ic.ac.uk * */ + #define BSD + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #undef BSD + #endif __svr4__ + #endif sun + #include #include #include *************** *** 33,43 **** #ifdef BSD #include #include ! #else #include extern long timezone; ! #endif #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) #endif --- 41,55 ---- #ifdef BSD #include #include ! #else BSD #include extern long timezone; ! #endif BSD + #ifdef SOLARIS + #include + #endif SOLARIS + #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) #endif *************** *** 73,79 **** --- 85,93 ---- /* Useful, though not particularly Mac related, values */ typedef unsigned char byte; /* one byte, obviously */ typedef unsigned short word; /* must be 2 bytes */ + #ifndef SOLARIS typedef unsigned long ulong; /* 4 bytes */ + #endif SOLARIS #define NAMELEN 63 /* maximum legal Mac file name length */ *** contrib/AufsTools/unstuffit/unsit.c.orig Sun Feb 16 20:37:35 1992 --- contrib/AufsTools/unstuffit/unsit.c Thu Oct 6 17:38:32 1994 *************** *** 88,96 **** --- 88,107 ---- */ + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + #include #include #include + + #ifdef SOLARIS + #include + #include + #endif SOLARIS typedef long OSType; *** contrib/AppManager/aufsmon.c.orig Tue Nov 23 20:01:38 1993 --- contrib/AppManager/aufsmon.c Tue Oct 11 17:28:15 1994 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/11/23 09:01:24 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/contrib/AppManager/RCS/aufsmon.c,v 2.3 1993/11/23 09:01:24 djh Rel djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * aufsmon [-fpv] [-s N] --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1994/10/11 07:28:06 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/contrib/AppManager/RCS/aufsmon.c,v 2.4 1994/10/11 07:28:06 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * aufsmon [-fpv] [-s N] *************** *** 28,33 **** --- 28,39 ---- #include #include #include + + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun #include *** contrib/printqueue.c.orig Sun Feb 16 21:37:18 1992 --- contrib/printqueue.c Mon Oct 10 19:06:34 1994 *************** *** 20,28 **** # include /* sometimes needed for sys/file.h */ #endif _TYPES #include - #include #ifdef USEDIRENT #include #endif USEDIRENT #include #include --- 20,29 ---- # include /* sometimes needed for sys/file.h */ #endif _TYPES #include #ifdef USEDIRENT #include + #else USEDIRENT + #include #endif USEDIRENT #include #include *************** *** 51,57 **** #define NUSERBITS 32 #define SYNC 0 ! struct queue { time_t q_time; /* modification time */ char q_name[MAXNAMLEN+1]; /* control file name */ }; --- 52,58 ---- #define NUSERBITS 32 #define SYNC 0 ! struct Queue { time_t q_time; /* modification time */ char q_name[MAXNAMLEN+1]; /* control file name */ }; *************** *** 283,297 **** */ displayq() { ! register struct queue *q; register int i, nitems, fd; ! struct queue **queue; FILE *fp; rank = -1; for(i = 0 ; i < (NFIELDS - 1) ; i++) colwidth[i] = 0; ! if ((nitems = getq(&queue)) < 0) fatal("cannot examine spooling area\n"); if (stat(lock, &statbuf) >= 0) { if (statbuf.st_mode & 0100) { --- 284,298 ---- */ displayq() { ! register struct Queue *q; register int i, nitems, fd; ! struct Queue **Queue; FILE *fp; rank = -1; for(i = 0 ; i < (NFIELDS - 1) ; i++) colwidth[i] = 0; ! if ((nitems = Getq(&Queue)) < 0) fatal("cannot examine spooling area\n"); if (stat(lock, &statbuf) >= 0) { if (statbuf.st_mode & 0100) { *************** *** 298,304 **** --- 299,307 ---- tobds("Warning: \"%s\" is down: ", printer); fd = open(status, O_RDONLY); if (fd >= 0) { + #ifndef SOLARIS (void) flock(fd, LOCK_SH); + #endif SOLARIS while ((i = read(fd, line, BUFSIZ)) > 0) writebds(line, i); (void) close(fd); /* unlocks as well */ *************** *** 335,341 **** --- 338,346 ---- */ fd = open(status, O_RDONLY); if (fd >= 0) { + #ifndef SOLARIS (void) flock(fd, LOCK_SH); + #endif SOLARIS while ((i = read(fd, line, BUFSIZ)) > 0) writebds(line, i); (void) close(fd); /* unlocks as well */ *************** *** 349,359 **** * be done for each user. */ for (i = 0; i < nitems; i++) { ! q = queue[i]; inform(q); free(q); } ! free(queue); } else if (nitems == 0) tobds("no entries\n"); } --- 354,364 ---- * be done for each user. */ for (i = 0; i < nitems; i++) { ! q = Queue[i]; inform(q); free(q); } ! free(Queue); } else if (nitems == 0) tobds("no entries\n"); } *************** *** 368,374 **** } inform(q) ! register struct queue *q; { register int copies, pc; register char *cp; --- 373,379 ---- } inform(q) ! register struct Queue *q; { register int copies, pc; register char *cp; *************** *** 609,616 **** * creation time. * Return the number of entries and a pointer to the list. */ ! getq(namelist) ! struct queue *(*namelist[]); { #ifdef USEDIRENT register struct dirent *d; --- 614,621 ---- * creation time. * Return the number of entries and a pointer to the list. */ ! Getq(namelist) ! struct Queue *(*namelist[]); { #ifdef USEDIRENT register struct dirent *d; *************** *** 617,623 **** #else USEDIRENT register struct direct *d; #endif USEDIRENT ! register struct queue *q, **queue; register int nitems; int arraysz, compar(); DIR *dirp; --- 622,628 ---- #else USEDIRENT register struct direct *d; #endif USEDIRENT ! register struct Queue *q, **Queue; register int nitems; int arraysz, compar(); DIR *dirp; *************** *** 632,639 **** * and dividing it by a multiple of the minimum size entry. */ arraysz = (statbuf.st_size / 24); ! queue = (struct queue **)malloc(arraysz * sizeof(struct queue *)); ! if (queue == NULL) goto errdone; nitems = 0; --- 637,644 ---- * and dividing it by a multiple of the minimum size entry. */ arraysz = (statbuf.st_size / 24); ! Queue = (struct Queue **)malloc(arraysz * sizeof(struct Queue *)); ! if (Queue == NULL) goto errdone; nitems = 0; *************** *** 642,648 **** continue; /* daemon control files only */ if (stat(d->d_name, &statbuf) < 0) continue; /* Doesn't exist */ ! q = (struct queue *)malloc(sizeof(time_t)+strlen(d->d_name)+1); if (q == NULL) goto errdone; q->q_time = statbuf.st_mtime; --- 647,653 ---- continue; /* daemon control files only */ if (stat(d->d_name, &statbuf) < 0) continue; /* Doesn't exist */ ! q = (struct Queue *)malloc(sizeof(time_t)+strlen(d->d_name)+1); if (q == NULL) goto errdone; q->q_time = statbuf.st_mtime; *************** *** 652,668 **** * realloc the maximum size. */ if (++nitems > arraysz) { ! queue = (struct queue **)realloc((char *)queue, ! (statbuf.st_size/12) * sizeof(struct queue *)); ! if (queue == NULL) goto errdone; } ! queue[nitems-1] = q; } closedir(dirp); if (nitems) ! qsort(queue, nitems, sizeof(struct queue *), compar); ! *namelist = queue; return(nitems); errdone: --- 657,673 ---- * realloc the maximum size. */ if (++nitems > arraysz) { ! Queue = (struct Queue **)realloc((char *)Queue, ! (statbuf.st_size/12) * sizeof(struct Queue *)); ! if (Queue == NULL) goto errdone; } ! Queue[nitems-1] = q; } closedir(dirp); if (nitems) ! qsort(Queue, nitems, sizeof(struct Queue *), compar); ! *namelist = Queue; return(nitems); errdone: *************** *** 674,680 **** * Compare modification times. */ compar(p1, p2) ! register struct queue **p1, **p2; { if ((*p1)->q_time < (*p2)->q_time) return(-1); --- 679,685 ---- * Compare modification times. */ compar(p1, p2) ! register struct Queue **p1, **p2; { if ((*p1)->q_time < (*p2)->q_time) return(-1); *** contrib/DeskTop/dt.h.orig Sat Feb 5 14:23:11 1994 --- contrib/DeskTop/dt.h Mon Oct 10 19:07:23 1994 *************** *** 15,36 **** * Refer: "Inside Macintosh", Volume 1, page I-128 "Format of a Resource File" * * $Author: djh $ ! * $Revision: 2.1 $ * */ #include #include #include - #include #include #include #include #include ! #ifdef hpux # include ! #endif hpux /* * header for .ADeskTop --- 15,48 ---- * Refer: "Inside Macintosh", Volume 1, page I-128 "Format of a Resource File" * * $Author: djh $ ! * $Revision: 2.2 $ * */ + #ifdef sun + #ifdef __svr4__ + #define SOLARIS + #endif __svr4__ + #endif sun + #include #include #include #include #include #include #include ! #ifdef SOLARIS ! #include ! #include ! #else SOLARIS ! #include ! #endif SOLARIS ! ! #if defined(hpux) || defined(SOLARIS) # include ! #endif /* hpux || SOLARIS */ /* * header for .ADeskTop *** contrib/DeskTop/builddt.c.orig Sat Feb 5 14:23:11 1994 --- contrib/DeskTop/builddt.c Mon Oct 10 19:07:24 1994 *************** *** 15,21 **** * Refer: "Inside Macintosh", Volume 1, page I-128 "Format of a Resource File" * * $Author: djh $ ! * $Revision: 2.1 $ * */ --- 15,21 ---- * Refer: "Inside Macintosh", Volume 1, page I-128 "Format of a Resource File" * * $Author: djh $ ! * $Revision: 2.2 $ * */ *************** *** 135,141 **** --- 135,145 ---- char path[MAXPATHLEN]; char resource[MAXPATHLEN]; char finderinfo[MAXPATHLEN]; + #ifdef SOLARIS + struct dirent *dp, *readdir(); + #else SOLARIS struct direct *dp, *readdir(); + #endif SOLARIS void makeEntry(); if ((dirp = opendir(dir)) == NULL) { *** README.orig Wed Feb 16 18:22:06 1994 --- README Mon Oct 10 18:54:16 1994 *************** *** 2,8 **** CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 192, February 1994 Notice ------ --- 2,8 ---- CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 193, October 1994 Notice ------