Return to BSD News archive
Newsgroups: comp.bugs.2bsd Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!insync!news.io.com!news.thenet.net!wlbr!moe.2bsd.com!sms From: sms@moe.2bsd.com (Steven M. Schultz) Subject: Standalone TM driver fix, u.u_nd not needed, more... (#362) Organization: 2BSD, Simi Valley CA USA Message-ID: <E4JrLI.L5p@moe.2bsd.com> Date: Sat, 25 Jan 1997 04:39:18 GMT Lines: 3285 Xref: euryale.cc.adfa.oz.au comp.bugs.2bsd:728 Subject: Standalone TM driver fix, u.u_nd not needed, more... (#362) Index: sys/{pdpuba,pdpstand,conf,h}/many 2.11BSD Description: 1. The standalone TM-11 (tm.c) driver's space forward/backward handling was broken. 2. An 18bit TM11 or RK11 controller in a 22bit Q-bus system crashes the kernel. 3. The 'u' structure ("struct user u") contains a 100 byte member ('u_nd') which unnecessarily makes the u struct bigger than need be. 4. sys/ufs_syscalls.c being a monolithic module causes problems when creating an overlay layout for the kernel. 5. The acc(4), css(4), imp(4), en(4) drivers would not compile. Repeat-By: 1. Boot a distribution tape on a TM-11 drive. Observe that loading a split I/D executable (file 3 is 'restor') via "tm(0,3)" crashes the standalone system. 2. Have an RK05 or TM11 present on a 22bit system without a Unibus Map (e.g an 11/73). Access the raw device (either '/dev/rrk0h' or '/dev/rmt0') and notice that the kernel panics or otherwise hangs/crashes. 3. Observation. Or by reading over the 4.4-Lite2 sources and noticing how a 'struct nameidata' structure was dynamically allocated on the stack. 4. This has been a problem for a long time. Whenever a change would be made or a new feature added to ufs_syscalls.c the object module ufs_syscalls.o would no longer fit in an exiting overlay structure. 5. Attempt to compile a networking kernel with the drivers acc, css, imp, or en. Fix: Items #1 and 2 were encountered when booting 2.11BSD under Bob Supnik's PDP11 emulator. Item #1: Loading 'tm(0,3)' would crash the emulated machine. The problem is that split I/D standalone programs ('restor' and 'icheck' - tm(0,3) and tm(0,4) respectively) require that the tapedriver be able to backspace the tape. The TM-11's reverse record spacing was broken because the space reverse change was made without access to a TM-11 for testing. Item #2: This is simply the inability of an 18bit controller to DMA above 256kb. The solution was to modify the RK05 and TM11 drivers to use the 'SOFUB_MAP' (software map) the same way that the RX driver does. Transfers from the raw device would overwrite the kernel resulting in a "panic" (if you were lucky) or the system would simply go dead. Item #3: While reading over a couple of the 4.4BSD kernel modules I happened across the 'NDINIT()' macro and noticed that 4.4 had no "u_nd" permanently allocated in the 'u' structure or proc structure. Since a 'u' area is allocated for every process in the system saving ~100 bytes can free up 4kb or more of physical memory. ALSO, since the 'u' structure has to be copied/replicated whenever a process forks saving 100 bytes can save a fair amount of time. Assuming two microseconds per instruction and a two instruction loop moving a word per iteration that's 2 * 2 * 50 = 200 microseconds saved on a 'fork', nothing to be sneezed at on a sub-1mips machine! Of course changing the 'u' area means that the kernel and a handful of applications need to be recompiled. The list of application programs is quite small. Item #4: In this case a couple of the smaller syscall routines were moved to ufs_syscalls2.c (which was created explicitly for this purpose some time back). Item #5: It is highly unlikely that anyone is still using any of the interfaces acc, css, imp, en (at one time the 'imp' and 'acc' drivers were known to work). It was easier to fix up the drivers to at least compile than it would have been to remove them from the system (or move them aside into an OLD/ directory). Drivers in the main source area should at least compile! NOTE: the 3mb/s ethernet driver ('en') is almost 100% guaranteed not to function. But I wager US$1 that no one has one in operable condition _and_ a network to plug it in to. The update kit below contains the following: 362.patch - a large patch file which updates the following files. /usr/src/sys/pdpuba/rk.c /usr/src/sys/pdpuba/tm.c /usr/src/sys/pdpuba/rl.c /usr/src/sys/pdpuba/dn.c /usr/src/sys/conf/GENERIC /usr/src/sys/conf/Make.sunix /usr/src/sys/sys/kern_sig.c /usr/src/sys/sys/init_main.c /usr/src/sys/sys/kern_acct.c /usr/src/sys/sys/ufs_syscalls.c /usr/src/sys/sys/ufs_syscalls2.c /usr/src/sys/sys/uipc_usrreq.c /usr/src/sys/sys/ufs_mount.c /usr/src/sys/sys/sys_kern.c /usr/src/sys/sys/quota_kern.c /usr/src/sys/sys/kern_exec.c /usr/src/sys/sys/kern_sysctl.c /usr/src/sys/sys/sys_pipe.c /usr/src/sys/sys/ufs_disksubr.c /usr/src/sys/h/namei.h /usr/src/sys/h/user.h /usr/src/sys/netimp/if_imphost.h /usr/src/sys/pdpstand/Makefile /usr/src/sys/pdpstand/makesimtape.c /usr/src/sys/pdpstand/tm.c /usr/src/sys/pdpstand/ht.c /usr/src/sys/pdpif/if_acc.c /usr/src/sys/pdpif/if_css.c /usr/src/sys/pdpif/if_en.c /usr/src/sys/GENERIC/rk.h /usr/src/sys/GENERIC/Makefile /usr/src/etc/dtab /usr/src/share/adb/u /usr/src/usr.sbin/pstat/pstat.c /VERSION 362.shar - a shar archive containing a new program being added to the system. The program being added is "makesimtape" and is used to create "tape files" for use with Bob Supnik's emulator. There is no manpage for 'makesimtape' but the usage is: makesimtape -i specfile -o tapefile where 'specfile' is in the same format as "maketape.data" in /sys/pdpstand. To install this update cut where indicated saving to a file (/tmp/362) and then: cd /tmp sh 362 patch -p0 < 362.patch sh 362.shar Next you will need to remake your kernel (and the GENERIC one too if you keep an emergency generic kernel in /genunix). You *MAY* need to adjust the overlay layout - be sure to watch for any "too big" messages from 'ld' and/or 'checksys': cd /sys/<YOURKERNEL> make clean make make install If you wish to recompile the GENERIC kernel (this can be put off but why not do it now?): cd /sys/GENERIC make clean make mv unix /genunix Recompile 'boot' and the standalone utilities: cd /sys/pdpstand make clean make cp boot /boot Then reboot the system: reboot The following applications have to be recompiled: adb, ps, gcore, w, fstat, identd, and pstat: cd /usr/src/bin/adb make make install make clean cd /usr/src/bin make ps install -s -m 2755 -g kmem ps /bin/ps cd /usr/src/ucb make gcore w install -s -m 2755 -g kmem gcore /usr/ucb/gcore install -s -m 2755 -g kmem w /usr/ucb/w cd /usr/src/usr.bin/fstat make make install make clean cd /usr/src/libexec/identd make make install make clean cd /usr/src/usr.sbin/pstat make make install make clean This would be a good time to create a bootable tape with the new boot and standalone drivers: cd /sys/pdpstand ./maketape /dev/nrmt0 maketape.data dump 0f /dev/rmt0 / will create a bootable tape with all the standalone utilities present along with a dump of the root filesystem. This is a VERY handy thing to have in the event of a disk failure or other disaster. As always this and previous updates to 2.11BSD are available via anonymous FTP to either FTP.IIPO.GTEGSC.COM or MOE.2BSD.COM in the directory /pub/2.11BSD. ============================cut here====================== #!/bin/sh # This is a shell archive (produced by GNU sharutils 4.1). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 1997-01-23 21:25 PST by <sms@moe.2bsd.com>. # Source directory was `/users/sms/KIT'. # # Existing files will *not* be overwritten unless `-c' is specified. # This format requires very little intelligence at unshar time. # "if test", "echo", and "sed" may be needed. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 71567 -rw-r----- /tmp/362.patch # 3677 -rw-r----- /tmp/362.shar # # ============= /tmp/362.patch ============== if test ! -d '/tmp'; then echo 'x - creating directory /tmp' mkdir '/tmp' fi if test -f '/tmp/362.patch' && test X"$1" != X"-c"; then echo 'x - skipping /tmp/362.patch (file already exists)' else echo 'x - extracting /tmp/362.patch (text)' sed 's/^X//' << 'SHAR_EOF' > '/tmp/362.patch' && X*** /usr/src/sys/pdpuba/rk.c.old Sat Jan 2 23:13:30 1993 X--- /usr/src/sys/pdpuba/rk.c Sat Jan 18 16:44:45 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)rk.c 1.4 (2.11BSD GTE) 1/2/93 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)rk.c 1.5 (2.11BSD GTE) 1997/1/18 X */ X X /* X*************** X*** 20,25 **** X--- 20,28 ---- X #include "user.h" X #include "dk.h" X #include "rkreg.h" X+ #include "syslog.h" X+ #include "map.h" X+ #include "uba.h" X X #define NRKBLK 4872 /* Number of blocks per drive */ X X*************** X*** 33,38 **** X--- 36,48 ---- X static int rk_dkn = -1; /* number for iostat */ X #endif X X+ #ifdef SOFUB_MAP X+ static int rksoftmap = -1; /* -1 = OK to check for softmap X+ * 0 = Never use softmap X+ * 1 = Always use softmap X+ */ X+ #endif X+ X rkattach(addr, unit) X struct rkdevice *addr; X { X*************** X*** 41,48 **** X dk_alloc(&rk_dkn, 1, "rk", 25L * 12L * 256L); X #endif X X! if (unit != 0) X return(0); X RKADDR = addr; X return(1); X } X--- 51,62 ---- X dk_alloc(&rk_dkn, 1, "rk", 25L * 12L * 256L); X #endif X X! if (unit != 0) X return(0); X+ #ifdef SOFUB_MAP X+ if (!ubmap && rksoftmap == -1) X+ rksoftmap = 1; X+ #endif X RKADDR = addr; X return(1); X } X*************** X*** 75,80 **** X--- 89,102 ---- X iodone(bp); X return; X } X+ #ifdef SOFUB_MAP X+ if (rksoftmap == 1) X+ { X+ if (sofub_alloc(bp) == 0) X+ return; X+ } X+ else X+ #endif X mapalloc(bp); X bp->av_forw = (struct buf *)NULL; X s = splbio(); X*************** X*** 143,153 **** X * Give up on write locked devices X * immediately. X */ X! printf("rk%d: write locked\n", minor(bp->b_dev)); X else X { X harderr(bp, "rk"); X! printf("er=%b ds=%b\n", rkaddr->rker, RKER_BITS, X rkaddr->rkds, RK_BITS); X rkaddr->rkcs = RKCS_RESET | RKCS_GO; X while((rkaddr->rkcs & RKCS_RDY) == 0) X--- 165,175 ---- X * Give up on write locked devices X * immediately. X */ X! uprintf("rk%d: write locked\n", minor(bp->b_dev)); X else X { X harderr(bp, "rk"); X! log(LOG_NOTICE,"er=%b ds=%b\n", rkaddr->rker, RKER_BITS, X rkaddr->rkds, RK_BITS); X rkaddr->rkcs = RKCS_RESET | RKCS_GO; X while((rkaddr->rkcs & RKCS_RDY) == 0) X*************** X*** 162,167 **** X--- 184,193 ---- X rktab.b_errcnt = 0; X rktab.b_actf = bp->av_forw; X bp->b_resid = -(rkaddr->rkwc << 1); X+ #ifdef SOFUB_MAP X+ if (rksoftmap == 1) X+ sofub_relse(bp, bp->b_bcount - bp->b_resid); X+ #endif X iodone(bp); X rkstart(); X } X*** /usr/src/sys/pdpuba/tm.c.old Sat Jan 2 23:29:04 1993 X--- /usr/src/sys/pdpuba/tm.c Sat Jan 18 16:44:57 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)tm.c 2.2 (2.11BSD GTE) 1/2/93 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)tm.c 2.3 (2.11BSD GTE) 1997/1/18 X */ X X /* X*************** X*** 23,28 **** X--- 23,31 ---- X #include "kernel.h" X #include "systm.h" X #include "tmreg.h" X+ #include "syslog.h" X+ #include "map.h" X+ #include "uba.h" X X struct tmdevice *TMADDR; X X*************** X*** 83,88 **** X--- 86,98 ---- X X int tmtimer (); X X+ #ifdef SOFUB_MAP X+ static int tmsoftmap = -1; /* -1 = OK to check for softmap X+ * 0 = Never use softmap X+ * 1 = Always use softmap X+ */ X+ #endif X+ X tmattach(addr, unit) X struct tmdevice *addr; X int unit; X*************** X*** 90,100 **** X /* X * This driver supports only one controller. X */ X! if (unit == 0) { X! TMADDR = addr; X! return(1); X! } X! return(0); X } X X /* X--- 100,113 ---- X /* X * This driver supports only one controller. X */ X! if (unit) X! return(0); X! #ifdef SOFUB_MAP X! if (!ubmap && tmsoftmap == -1) X! tmsoftmap = 1; X! #endif X! TMADDR = addr; X! return(1); X } X X /* X*************** X*** 240,246 **** X--- 253,277 ---- X register s; X register struct te_softc *sc = &te_softc[TEUNIT(bp->b_dev)]; X X+ #ifdef SOFUB_MAP X+ /* X+ * The 'soft' map must be allocated here because the transfer may be (although X+ * it very rarely is) going to the buffer cache rather than a user process. X+ * This has the side effect that a rewinding tape can keep the 'soft' map busy X+ * for a fairly long time. In practice this is not much of a problem since X+ * the main use of 18 bit TM controllers on a 22 bit system is with a PDP-11 X+ * simulator - in which case there's no tape to wait for. X+ */ X+ if (tmsoftmap == 1) X+ { X+ if (sofub_alloc(bp) == 0) X+ return; X+ } X+ #endif X if (bp->b_flags & B_PHYS) { X+ #ifdef SOFUB_MAP X+ if (tmsoftmap <= 0) X+ #endif X mapalloc(bp); X sc->sc_blkno = sc->sc_nxrec = dbtofsb(bp->b_blkno); X sc->sc_nxrec++; X*************** X*** 395,400 **** X--- 426,435 ---- X */ X tmtab.b_errcnt = 0; X tmtab.b_actf = bp->av_forw; X+ #ifdef SOFUB_MAP X+ if (tmsoftmap == 1) X+ sofub_relse(bp, bp->b_bcount - bp->b_resid); X+ #endif X iodone(bp); X goto loop; X } X*************** X*** 481,487 **** X /* X * Couldn't recover error X */ X! printf("te%d: hard error bn%D er=%b\n", X teunit, bp->b_blkno, sc->sc_erreg, TMER_BITS); X bp->b_flags |= B_ERROR; X goto opdone; X--- 516,522 ---- X /* X * Couldn't recover error X */ X! uprintf("te%d: hard error bn%D er=%b\n", X teunit, bp->b_blkno, sc->sc_erreg, TMER_BITS); X bp->b_flags |= B_ERROR; X goto opdone; X*************** X*** 525,530 **** X--- 560,569 ---- X tmtab.b_errcnt = 0; X tmtab.b_actf = bp->av_forw; X bp->b_resid = -tmaddr->tmbc; X+ #ifdef SOFUB_MAP X+ if (tmsoftmap == 1) X+ sofub_relse(bp, bp->b_bcount - bp->b_resid); X+ #endif X iodone(bp); X X opcont: X*************** X*** 538,544 **** X register struct te_softc *sc = &te_softc[TEUNIT(dev)]; X X if (sc->sc_timo != INF && (sc->sc_timo -= 5) < 0) { X! printf("te%d: lost interrupt\n", TEUNIT(dev)); X sc->sc_timo = INF; X s = splbio(); X tmintr(); X--- 577,583 ---- X register struct te_softc *sc = &te_softc[TEUNIT(dev)]; X X if (sc->sc_timo != INF && (sc->sc_timo -= 5) < 0) { X! log(LOG_NOTICE, "te%d: lost interrupt\n", TEUNIT(dev)); X sc->sc_timo = INF; X s = splbio(); X tmintr(); X*** /usr/src/sys/pdpuba/rl.c.old Mon Jan 8 20:15:34 1996 X--- /usr/src/sys/pdpuba/rl.c Sun Jan 19 11:21:01 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)rl.c 1.8 (2.11BSD GTE) 1996/1/8 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)rl.c 1.9 (2.11BSD GTE) 1997/1/19 X */ X X /* X*************** X*** 38,43 **** X--- 38,44 ---- X X #include "param.h" X #include "buf.h" X+ #include "machine/seg.h" X #include "user.h" X #include "systm.h" X #include "conf.h" X*** /usr/src/sys/pdpuba/dn.c.old Wed Nov 30 21:33:36 1994 X--- /usr/src/sys/pdpuba/dn.c Sun Jan 19 12:06:37 1997 X*************** X*** 1,5 **** X /* X! * SCCS id @(#)dn.c 2.2 (2.11BSD GTE) 11/29/94 X */ X X /* X--- 1,5 ---- X /* X! * SCCS id @(#)dn.c 2.3 (2.11BSD GTE) 1997/1/18 X */ X X /* X*************** X*** 11,16 **** X--- 11,17 ---- X #if NDN > 0 X #include "param.h" X #include "user.h" X+ #include "uio.h" X #include "kernel.h" X #include "dnreg.h" X X*** /usr/src/sys/conf/GENERIC.old Thu Dec 14 21:57:41 1995 X--- /usr/src/sys/conf/GENERIC Tue Jan 21 20:04:45 1997 X*************** X*** 1,3 **** X--- 1,4 ---- X+ # 1997/1/21 - RK added to GENERIC kernel (for use with Bob Supnik's emulator) X # 1995/12/14 - RX added to GENERIC kernel. X # 1995/07/21 - XP_PROBE removed. X # X*************** X*** 145,151 **** X NRAC 2 # NRAD controllers X NRAD 3 # RX50, RC25, RD51/52/53, RA60/80/81 X X! NRK 0 # RK05 X X NRL 2 # RL01/02 X X--- 146,152 ---- X NRAC 2 # NRAD controllers X NRAD 3 # RX50, RC25, RD51/52/53, RA60/80/81 X X! NRK 8 # RK05 X X NRL 2 # RL01/02 X X*** /usr/src/sys/conf/Make.sunix.old Sat Sep 21 22:44:08 1996 X--- /usr/src/sys/conf/Make.sunix Tue Jan 21 20:05:39 1997 X*************** X*** 9,15 **** X # software without specific prior written permission. This software X # is provided ``as is'' without express or implied warranty. X # X! # 2.7 (2.11BSD GTE) 1996/9/21 X # X ######################################################### X # Non-network, but separate I/D kernel # X--- 9,15 ---- X # software without specific prior written permission. This software X # is provided ``as is'' without express or implied warranty. X # X! # 2.8 (2.11BSD GTE) 1997/1/21 X # X ######################################################### X # Non-network, but separate I/D kernel # X*************** X*** 47,53 **** X X BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ X kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ X! kern_synch.o lp.o machdep.o ra.o ram.o rk.o si.o \ X subr_rmap.o subr_xxx.o sys_inode.o sys_pipe.o trap.o tty.o \ X tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ X ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ X--- 47,53 ---- X X BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ X kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ X! kern_synch.o lp.o machdep.o ra.o ram.o si.o \ X subr_rmap.o subr_xxx.o sys_inode.o sys_pipe.o trap.o tty.o \ X tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ X ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ X*************** X*** 63,69 **** X OV6= tmscp.o tmscpdump.o X OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o X OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o X! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o X X KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ X ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ X--- 63,69 ---- X OV6= tmscp.o tmscpdump.o X OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o X OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o X! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o rk.o X X KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ X ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ X*** /usr/src/sys/sys/kern_sig.c.old Mon Sep 16 21:06:27 1996 X--- /usr/src/sys/sys/kern_sig.c Sat Jan 18 22:57:29 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_sig.c 1.6 (2.11BSD GTE) 1996/9/13 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_sig.c 1.7 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 801,807 **** X core() X { X register struct inode *ip; X! register struct nameidata *ndp = &u.u_nd; X register char *np; X char *cp, name[MAXCOMLEN + 6]; X X--- 801,808 ---- X core() X { X register struct inode *ip; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X register char *np; X char *cp, name[MAXCOMLEN + 6]; X X*************** X*** 821,829 **** X while (*np++ = *cp++) X ; X u.u_error = 0; X! ndp->ni_nameiop = CREATE | FOLLOW; X! ndp->ni_segflg = UIO_SYSSPACE; X! ndp->ni_dirp = name; X ip = namei(ndp); X if (ip == NULL) { X if (u.u_error) X--- 822,828 ---- X while (*np++ = *cp++) X ; X u.u_error = 0; X! NDINIT(ndp, CREATE, FOLLOW, UIO_SYSSPACE, name); X ip = namei(ndp); X if (ip == NULL) { X if (u.u_error) X*** /usr/src/sys/sys/init_main.c.old Thu May 9 20:37:05 1996 X--- /usr/src/sys/sys/init_main.c Sat Jan 18 22:20:46 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)init_main.c 2.1 (2.11BSD GTE) 1996/5/9 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)init_main.c 2.2 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 77,84 **** X X u.u_procp = p; /* init user structure */ X u.u_ap = u.u_arg; X- u.u_nd.ni_iov = &u.u_nd.ni_iovec; X- u.u_nd.ni_iovcnt = 1; X u.u_cmask = cmask; X u.u_lastfile = -1; X for (i = 1; i < NGROUPS; i++) X--- 77,82 ---- X*************** X*** 339,350 **** X off_t off; X int initdata, netdsize, nettsize, ret, err, resid; X char oneclick[ctob(1)]; X! register struct nameidata *ndp = &u.u_nd; X X ret = 1; X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_SYSSPACE; X! ndp->ni_dirp = NETNIX; X if (!(ip = namei(ndp))) { X printf("%s not found\n", NETNIX); X goto leave; X--- 337,347 ---- X off_t off; X int initdata, netdsize, nettsize, ret, err, resid; X char oneclick[ctob(1)]; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X ret = 1; X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, NETNIX); X if (!(ip = namei(ndp))) { X printf("%s not found\n", NETNIX); X goto leave; X*************** X*** 356,362 **** X err = rdwri(UIO_READ, ip, &ex, sizeof (ex), (off_t)0, UIO_SYSSPACE, X IO_UNIT, &resid); X if (err || resid) { X! printf("%s header err %d\n", NETNIX, ret); X goto leave; X } X if (ex.a_magic != A_MAGIC3) { X--- 353,359 ---- X err = rdwri(UIO_READ, ip, &ex, sizeof (ex), (off_t)0, UIO_SYSSPACE, X IO_UNIT, &resid); X if (err || resid) { X! printf("%s header %d\n", NETNIX, ret); X goto leave; X } X if (ex.a_magic != A_MAGIC3) { X*************** X*** 365,371 **** X } X lsize = (long)ex.a_data + (long)ex.a_bss; X if (lsize > 48L * 1024L) { X! printf("%s too big %ld\n", NETNIX, lsize); X goto leave; X } X nettsize = btoc(ex.a_text); X--- 362,368 ---- X } X lsize = (long)ex.a_data + (long)ex.a_bss; X if (lsize > 48L * 1024L) { X! printf("%s 2big %ld\n", NETNIX, lsize); X goto leave; X } X nettsize = btoc(ex.a_text); X*************** X*** 426,440 **** X leave: if (ip) X iput(ip); X u.u_error = 0; X- ndp->ni_dirp = 0; X- ndp->ni_segflg = UIO_USERSPACE; X- ndp->ni_endoff = 0; X- bzero(&u.u_ncache, sizeof(u.u_ncache)); X- bzero(&ndp->ni_dent, sizeof(ndp->ni_dent)); X- if (ndp->ni_pdir) { X- iput(ndp->ni_pdir); X- ndp->ni_pdir = 0; X- } X return(ret); X } X #endif X--- 423,428 ---- X*** /usr/src/sys/sys/kern_acct.c.old Mon Sep 16 21:09:07 1996 X--- /usr/src/sys/sys/kern_acct.c Sat Jan 18 23:05:26 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_acct.c 2.3 (2.11BSD) 1996/9/13 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_acct.c 2.4 (2.11BSD) 1997/1/18 X */ X X #include "param.h" X*************** X*** 12,17 **** X--- 12,18 ---- X #include "dir.h" X #include "inode.h" X #include "user.h" X+ #include "namei.h" X #include "proc.h" X #include "acct.h" X #include "kernel.h" X*************** X*** 35,41 **** X register struct a { X char *fname; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X int acctwatch(); X X if (suser()) { X--- 36,43 ---- X register struct a { X char *fname; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int acctwatch(); X X if (suser()) { X*************** X*** 52,60 **** X } X return; X } X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 54,60 ---- X } X return; X } X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*** /usr/src/sys/sys/ufs_syscalls.c.old Sat Sep 28 20:39:56 1996 X--- /usr/src/sys/sys/ufs_syscalls.c Sun Jan 19 10:31:54 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ufs_syscalls.c 1.7 (2.11BSD GTE) 1996/9/13 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ufs_syscalls.c 1.8 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 76,86 **** X struct a { X char *fname; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 76,85 ---- X struct a { X char *fname; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 140,146 **** X { X register struct inode *ip; X register struct file *fp; X! register struct nameidata *ndp = &u.u_nd; X int indx, type; X X mode = FFLAGS(mode); /* convert from open to kernel flags */ X--- 139,146 ---- X { X register struct inode *ip; X register struct file *fp; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int indx, type; X X mode = FFLAGS(mode); /* convert from open to kernel flags */ X*************** X*** 148,155 **** X if (fp == NULL) X return; X indx = u.u_r.r_val1; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = fname; X if (mode & O_CREAT) { X if (mode & O_EXCL) X ndp->ni_nameiop = CREATE; X--- 148,154 ---- X if (fp == NULL) X return; X indx = u.u_r.r_val1; X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, fname); X if (mode & O_CREAT) { X if (mode & O_EXCL) X ndp->ni_nameiop = CREATE; X*************** X*** 248,260 **** X int fmode; X int dev; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X X if (!suser()) X return; X! ndp->ni_nameiop = CREATE; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip != NULL) { X u.u_error = EEXIST; X--- 247,258 ---- X int fmode; X int dev; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X if (!suser()) X return; X! NDINIT(ndp, CREATE, NOFOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip != NULL) { X u.u_error = EEXIST; X*************** X*** 294,304 **** X char *target; X char *linkname; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->target; X ip = namei(ndp); /* well, this routine is doomed anyhow */ X if (ip == NULL) X return; X--- 292,301 ---- X char *target; X char *linkname; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->target); X ip = namei(ndp); /* well, this routine is doomed anyhow */ X if (ip == NULL) X return; X*************** X*** 316,322 **** X iupdat(ip, &time, &time, 1); X iunlock(ip); X ndp->ni_nameiop = CREATE; X- ndp->ni_segflg = UIO_USERSPACE; X ndp->ni_dirp = (caddr_t)uap->linkname; X xp = namei(ndp); X if (xp != NULL) { X--- 313,318 ---- X*************** X*** 352,358 **** X register struct inode *ip; X char *tp; X int c, nc; X! register struct nameidata *ndp = &u.u_nd; X X tp = uap->target; X nc = 0; X--- 348,355 ---- X register struct inode *ip; X char *tp; X int c, nc; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X tp = uap->target; X nc = 0; X*************** X*** 364,372 **** X tp++; X nc++; X } X! ndp->ni_nameiop = CREATE; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->linkname; X ip = namei(ndp); X if (ip) { X iput(ip); X--- 361,367 ---- X tp++; X nc++; X } X! NDINIT(ndp, CREATE, NOFOLLOW, UIO_USERSPACE, uap->linkname); X ip = namei(ndp); X if (ip) { X iput(ip); X*************** X*** 395,405 **** X char *fname; X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = DELETE | LOCKPARENT; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 390,399 ---- X char *fname; X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, DELETE, LOCKPARENT, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 432,476 **** X } X X /* X- * Seek system call X- */ X- lseek() X- { X- register struct file *fp; X- register struct a { X- int fd; X- off_t off; X- int sbase; X- } *uap = (struct a *)u.u_ap; X- X- if ((fp = getf(uap->fd)) == NULL) X- return; X- if (fp->f_type != DTYPE_INODE) { X- u.u_error = ESPIPE; X- return; X- } X- switch (uap->sbase) { X- X- case L_INCR: X- fp->f_offset += uap->off; X- break; X- X- case L_XTND: X- fp->f_offset = uap->off + ((struct inode *)fp->f_data)->i_size; X- break; X- X- case L_SET: X- fp->f_offset = uap->off; X- break; X- X- default: X- u.u_error = EINVAL; X- return; X- } X- u.u_r.r_off = fp->f_offset; X- } X- X- /* X * Access system call X */ X saccess() X--- 426,431 ---- X*************** X*** 482,496 **** X char *fname; X int fmode; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X X svuid = u.u_uid; X svgid = u.u_gid; X u.u_uid = u.u_ruid; X u.u_gid = u.u_rgid; X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip != NULL) { X if ((uap->fmode&R_OK) && access(ip, IREAD)) X--- 437,450 ---- X char *fname; X int fmode; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X svuid = u.u_uid; X svgid = u.u_gid; X u.u_uid = u.u_ruid; X u.u_gid = u.u_rgid; X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip != NULL) { X if ((uap->fmode&R_OK) && access(ip, IREAD)) X*************** X*** 533,543 **** X struct stat *ub; X } *uap = (struct a *)u.u_ap; X struct stat sb; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = LOOKUP | follow; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 487,496 ---- X struct stat *ub; X } *uap = (struct a *)u.u_ap; X struct stat sb; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, LOOKUP, follow, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 557,568 **** X char *buf; X int count; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X int resid; X X! ndp->ni_nameiop = LOOKUP; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->name; X ip = namei(ndp); X if (ip == NULL) X return; X--- 510,520 ---- X char *buf; X int count; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int resid; X X! NDINIT(ndp, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->name); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 587,597 **** X char *fname; X u_short flags; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = LOOKUP|FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X if ((ip = namei(ndp)) == NULL) X return; X u.u_error = chflags1(ip, uap->flags); X--- 539,548 ---- X char *fname; X u_short flags; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X if ((ip = namei(ndp)) == NULL) X return; X u.u_error = chflags1(ip, uap->flags); X*************** X*** 638,648 **** X int fmode; X } *uap = (struct a *)u.u_ap; X struct vattr vattr; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = LOOKUP|FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (!ip) X return; X--- 589,598 ---- X int fmode; X } *uap = (struct a *)u.u_ap; X struct vattr vattr; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (!ip) X return; X*************** X*** 709,720 **** X int uid; X int gid; X } *uap = (struct a *)u.u_ap; X! register struct nameidata *ndp = &u.u_nd; X struct vattr vattr; X X! ndp->ni_nameiop = LOOKUP | NOFOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 659,669 ---- X int uid; X int gid; X } *uap = (struct a *)u.u_ap; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X struct vattr vattr; X X! NDINIT(ndp, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 810,816 **** X struct timeval *tptr; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! register struct nameidata *ndp = &u.u_nd; X struct timeval tv[2]; X struct vattr vattr; X X--- 759,766 ---- X struct timeval *tptr; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X struct timeval tv[2]; X struct vattr vattr; X X*************** X*** 820,828 **** X vattr.va_vaflags |= VA_UTIMES_NULL; X } else if (u.u_error = copyin((caddr_t)uap->tptr,(caddr_t)tv,sizeof(tv))) X return; X! ndp->ni_nameiop = LOOKUP|FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X if ((ip = namei(ndp)) == NULL) X return; X vattr.va_atime = tv[0].tv_sec; X--- 770,776 ---- X vattr.va_vaflags |= VA_UTIMES_NULL; X } else if (u.u_error = copyin((caddr_t)uap->tptr,(caddr_t)tv,sizeof(tv))) X return; X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X if ((ip = namei(ndp)) == NULL) X return; X vattr.va_atime = tv[0].tv_sec; X*************** X*** 841,852 **** X off_t length; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! register struct nameidata *ndp = &u.u_nd; X struct vattr vattr; X X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->fname; X ip = namei(ndp); X if (ip == NULL) X return; X--- 789,799 ---- X off_t length; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X struct vattr vattr; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 939,950 **** X register struct inode *ip, *xp, *dp; X struct dirtemplate dirbuf; X int doingdirectory = 0, oldparent = 0, newparent = 0; X! register struct nameidata *ndp = &u.u_nd; X int error = 0; X X! ndp->ni_nameiop = DELETE | LOCKPARENT; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->from; X ip = namei(ndp); X if (ip == NULL) X return; X--- 886,896 ---- X register struct inode *ip, *xp, *dp; X struct dirtemplate dirbuf; X int doingdirectory = 0, oldparent = 0, newparent = 0; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int error = 0; X X! NDINIT(ndp, DELETE, LOCKPARENT, UIO_USERSPACE, uap->from); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 1145,1153 **** X /* X * 3) Unlink the source. X */ X! ndp->ni_nameiop = DELETE | LOCKPARENT; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->from; X xp = namei(ndp); X if (xp != NULL) X dp = ndp->ni_pdir; X--- 1091,1097 ---- X /* X * 3) Unlink the source. X */ X! NDINIT(ndp, DELETE, LOCKPARENT, UIO_USERSPACE, uap->from); X xp = namei(ndp); X if (xp != NULL) X dp = ndp->ni_pdir; X*************** X*** 1302,1315 **** X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X struct dirtemplate dirtemplate; X! register struct nameidata *ndp = &u.u_nd; X #ifdef QUOTA X struct dquot **xdq; X #endif X X! ndp->ni_nameiop = CREATE; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->name; X ip = namei(ndp); X if (u.u_error) X return; X--- 1246,1258 ---- X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X struct dirtemplate dirtemplate; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X #ifdef QUOTA X struct dquot **xdq; X #endif X X! NDINIT(ndp, CREATE, NOFOLLOW, UIO_USERSPACE, uap->name); X ip = namei(ndp); X if (u.u_error) X return; X*************** X*** 1384,1392 **** X u.u_error = direnter(ip, ndp); X dp = NULL; X if (u.u_error) { X! ndp->ni_nameiop = LOOKUP | NOCACHE; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->name; X dp = namei(ndp); X if (dp) { X dp->i_nlink--; X--- 1327,1333 ---- X u.u_error = direnter(ip, ndp); X dp = NULL; X if (u.u_error) { X! NDINIT(ndp, LOOKUP, NOCACHE, UIO_USERSPACE, uap->name); X dp = namei(ndp); X if (dp) { X dp->i_nlink--; X*************** X*** 1417,1427 **** X char *name; X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X! register struct nameidata *ndp = &u.u_nd; X X! ndp->ni_nameiop = DELETE | LOCKPARENT; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->name; X ip = namei(ndp); X if (ip == NULL) X return; X--- 1358,1367 ---- X char *name; X } *uap = (struct a *)u.u_ap; X register struct inode *ip, *dp; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X! NDINIT(ndp, DELETE, LOCKPARENT, UIO_USERSPACE, uap->name); X ip = namei(ndp); X if (ip == NULL) X return; X*************** X*** 1508,1524 **** X return ((struct inode *)0); X } X return((struct inode *)fp->f_data); X- } X- X- /* X- * mode mask for creation of files X- */ X- umask() X- { X- register struct a { X- int mask; X- } *uap = (struct a *)u.u_ap; X- X- u.u_r.r_val1 = u.u_cmask; X- u.u_cmask = uap->mask & 07777; X } X--- 1448,1451 ---- X*** /usr/src/sys/sys/ufs_syscalls2.c.old Sat Sep 28 20:39:58 1996 X--- /usr/src/sys/sys/ufs_syscalls2.c Sun Jan 19 10:02:26 1997 X*************** X*** 1,12 **** X /* X! * @(#) ufs_syscalls2.c 1.3 (2.11BSD) 1996/9/13 X * X! * ufs_syscalls was getting too large. New UFS related system calls are X! * placed in this file. X */ X X #include "param.h" X #include "../machine/seg.h" X #include "user.h" X #include "inode.h" X #include "buf.h" X--- 1,13 ---- X /* X! * @(#) ufs_syscalls2.c 1.4 (2.11BSD) 1997/1/18 X * X! * ufs_syscalls was getting too large. Various UFS related system calls were X! * relocated to this file. X */ X X #include "param.h" X #include "../machine/seg.h" X+ #include "sys/file.h" X #include "user.h" X #include "inode.h" X #include "buf.h" X*************** X*** 23,34 **** X struct statfs *buf; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! register struct nameidata *ndp = &u.u_nd; X struct mount *mp; X X! ndp->ni_nameiop = LOOKUP|FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = uap->path; X ip = namei(ndp); X if (!ip) X return(u.u_error); X--- 24,34 ---- X struct statfs *buf; X } *uap = (struct a *)u.u_ap; X register struct inode *ip; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X struct mount *mp; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path); X ip = namei(ndp); X if (!ip) X return(u.u_error); X*************** X*** 191,193 **** X--- 191,242 ---- X iput(ip); X } X } X+ X+ /* X+ * mode mask for creation of files X+ */ X+ umask() X+ { X+ register struct a { X+ int mask; X+ } *uap = (struct a *)u.u_ap; X+ X+ u.u_r.r_val1 = u.u_cmask; X+ u.u_cmask = uap->mask & 07777; X+ } X+ X+ /* X+ * Seek system call X+ */ X+ lseek() X+ { X+ register struct file *fp; X+ register struct a { X+ int fd; X+ off_t off; X+ int sbase; X+ } *uap = (struct a *)u.u_ap; X+ X+ if ((fp = getf(uap->fd)) == NULL) X+ return; X+ if (fp->f_type != DTYPE_INODE) { X+ u.u_error = ESPIPE; X+ return; X+ } X+ switch (uap->sbase) { X+ X+ case L_INCR: X+ fp->f_offset += uap->off; X+ break; X+ case L_XTND: X+ fp->f_offset = uap->off + ((struct inode *)fp->f_data)->i_size; X+ break; X+ case L_SET: X+ fp->f_offset = uap->off; X+ break; X+ default: X+ u.u_error = EINVAL; X+ return; X+ } X+ u.u_r.r_off = fp->f_offset; X+ } X*** /usr/src/sys/sys/uipc_usrreq.c.old Sat Feb 5 19:46:18 1994 X--- /usr/src/sys/sys/uipc_usrreq.c Sat Jan 18 22:28:07 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)uipc_usrreq.c 7.1.1 (2.11BSD GTE) 12/31/93 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)uipc_usrreq.c 7.1.2 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 13,19 **** X #include "protosw.h" X #include "socket.h" X #include "socketvar.h" X- #include "namei.h" X #include "unpcb.h" X #include "un.h" X #include "inode.h" X--- 13,18 ---- X*************** X*** 31,40 **** X struct sockaddr sun_noname = { AF_UNIX }; X ino_t unp_ino; /* prototype for fake inode numbers */ X X- #ifdef pdp11 X extern void unpdisc(), unpgc1(); X extern int fadjust(); X- #endif X X /*ARGSUSED*/ X uipc_usrreq(so, req, m, nam, rights) X--- 30,37 ---- X*************** X*** 314,325 **** X { X X if (unp->unp_inode) { X- #ifdef pdp11 X UNPDET(unp->unp_inode); X- #else X- unp->unp_inode->i_socket = 0; X- irele(unp->unp_inode); X- #endif X unp->unp_inode = 0; X } X if (unp->unp_conn) X--- 311,317 ---- X*************** X*** 345,351 **** X if (unp->unp_inode != NULL || nam->m_len >= MLEN) X return (EINVAL); X *(mtod(nam, caddr_t) + nam->m_len) = 0; X- #ifdef pdp11 X error = UNPBIND(soun->sun_path, nam->m_len, &ip, unp->unp_socket); X if (error) X return(error); X--- 337,342 ---- X*************** X*** 353,383 **** X panic("unp_bind"); X unp->unp_inode = ip; X unp->unp_addr = m_copy(nam, 0, M_COPYALL); X- #else X- ndp->ni_nameiop = CREATE | FOLLOW; X- ndp->ni_segflg = UIO_SYSSPACE; X- ndp->ni_dirp = soun->sun_path; X- ndp->ni_dirp[nam->m_len-2] = 0; X- ip = namei(ndp); X- if (ip) { X- iput(ip); X- return (EADDRINUSE); X- } X- if (error = u.u_error) { X- u.u_error = 0; /* XXX */ X- return (error); X- } X- ip = maknode(IFSOCK | 0777, ndp); X- if (ip == NULL) { X- error = u.u_error; /* XXX */ X- u.u_error = 0; /* XXX */ X- return (error); X- } X- ip->i_socket = unp->unp_socket; X- unp->unp_inode = ip; X- unp->unp_addr = m_copy(nam, 0, (int)M_COPYALL); X- iunlock(ip); /* but keep reference */ X- #endif X return (0); X } X X--- 344,349 ---- X*************** X*** 393,399 **** X if (nam->m_len + (nam->m_off - MMINOFF) == MLEN) X return (EMSGSIZE); X *(mtod(nam, caddr_t) + nam->m_len) = 0; X! #ifdef pdp11 X error = UNPCONN(soun->sun_path, nam->m_len, &so2, &ip); X if (error || !so2 || !ip) X goto bad; X--- 359,365 ---- X if (nam->m_len + (nam->m_off - MMINOFF) == MLEN) X return (EMSGSIZE); X *(mtod(nam, caddr_t) + nam->m_len) = 0; X! X error = UNPCONN(soun->sun_path, nam->m_len, &so2, &ip); X if (error || !so2 || !ip) X goto bad; X*************** X*** 411,455 **** X bad: X if (ip) X IPUT(ip); X- #else X- ndp->ni_nameiop = LOOKUP | FOLLOW; X- ndp->ni_segflg = UIO_SYSSPACE; X- ndp->ni_dirp = soun->sun_path; X- ndp->ni_dirp[nam->m_len-2] = 0; X- ip = namei(ndp); X- if (ip == 0) { X- error = u.u_error; X- u.u_error = 0; X- return (error); /* XXX */ X- } X- if (access(ip, IWRITE)) { X- error = u.u_error; X- u.u_error = 0; /* XXX */ X- goto bad; X- } X- if ((ip->i_mode&IFMT) != IFSOCK) { X- error = ENOTSOCK; X- goto bad; X- } X- so2 = ip->i_socket; X- if (so2 == 0) { X- error = ECONNREFUSED; X- goto bad; X- } X- if (so->so_type != so2->so_type) { X- error = EPROTOTYPE; X- goto bad; X- } X- if (so->so_proto->pr_flags & PR_CONNREQUIRED && X- ((so2->so_options&SO_ACCEPTCONN) == 0 || X- (so2 = sonewconn(so2)) == 0)) { X- error = ECONNREFUSED; X- goto bad; X- } X- error = unp_connect2(so, so2); X- bad: X- iput(ip); X- #endif X return (error); X } X X--- 377,382 ---- X*************** X*** 583,595 **** X panic("unp_externalize"); X fp = *rp; X u.u_ofile[f] = fp; X- #ifdef pdp11 X /* -1 added to msgcount, 0 to count */ X SKcall(fadjust, sizeof(fp) + sizeof(int) + sizeof(int), X fp, -1, 0); X- #else X- fp->f_msgcount--; X- #endif X unp_rights--; X *(int *)rp++ = f; X } X--- 510,518 ---- X*************** X*** 612,625 **** X for (i = 0; i < oldfds; i++) { X GETF(fp, *(int *)rp); X *rp++ = fp; X- #ifdef pdp11 X /* bump both the message count and reference count of fp */ X SKcall(fadjust, sizeof(fp) + sizeof(int) + sizeof(int), X fp, 1, 1); X- #else X- fp->f_count++; X- fp->f_msgcount++; X- #endif X unp_rights++; X } X return (0); X--- 535,543 ---- X*** /usr/src/sys/sys/ufs_mount.c.old Mon Sep 16 21:24:08 1996 X--- /usr/src/sys/sys/ufs_mount.c Sat Jan 18 23:01:05 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ufs_mount.c 1.9 (2.11BSD GTE) 1996/9/13 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ufs_mount.c 2.0 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 35,41 **** X dev_t dev; X register struct inode *ip; X register struct fs *fs; X! struct nameidata *ndp = &u.u_nd; X struct mount *mp; X u_int lenon, lenfrom; X int error = 0; X--- 35,42 ---- X dev_t dev; X register struct inode *ip; X register struct fs *fs; X! struct nameidata nd; X! struct nameidata *ndp = &nd; X struct mount *mp; X u_int lenon, lenfrom; X int error = 0; X*************** X*** 43,51 **** X X if (u.u_error = getmdev(&dev, uap->fspec)) X return; X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = (caddr_t)uap->freg; X if ((ip = namei(ndp)) == NULL) X return; X if ((ip->i_mode&IFMT) != IFDIR) { X--- 44,50 ---- X X if (u.u_error = getmdev(&dev, uap->fspec)) X return; X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->freg); X if ((ip = namei(ndp)) == NULL) X return; X if ((ip->i_mode&IFMT) != IFDIR) { X*************** X*** 326,338 **** X { X register dev_t dev; X register struct inode *ip; X! register struct nameidata *ndp = &u.u_nd; X X if (!suser()) X return (u.u_error); X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = fname; X ip = namei(ndp); X if (ip == NULL) { X if (u.u_error == ENOENT) X--- 325,336 ---- X { X register dev_t dev; X register struct inode *ip; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X if (!suser()) X return (u.u_error); X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, fname); X ip = namei(ndp); X if (ip == NULL) { X if (u.u_error == ENOENT) X*** /usr/src/sys/sys/sys_kern.c.old Sun Jan 3 00:55:30 1993 X--- /usr/src/sys/sys/sys_kern.c Sat Jan 18 22:59:45 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * %W% (Berkeley) %G% X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * sys_kern.c 1.1 (2.11BSD) 1997/1/18 X */ X X #include "param.h" X*************** X*** 100,111 **** X register struct inode *ip; X char pth[MLEN]; X int error; X! register struct nameidata *ndp = &u.u_nd; X X bcopy(path, pth, len); X! ndp->ni_nameiop = CREATE | FOLLOW; X! ndp->ni_segflg = UIO_SYSSPACE; X! ndp->ni_dirp = pth; X ndp->ni_dirp[len - 2] = 0; X *ipp = 0; X ip = namei(ndp); X--- 100,110 ---- X register struct inode *ip; X char pth[MLEN]; X int error; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X bcopy(path, pth, len); X! NDINIT(ndp, CREATE, FOLLOW, UIO_SYSSPACE, pth); X ndp->ni_dirp[len - 2] = 0; X *ipp = 0; X ip = namei(ndp); X*************** X*** 133,146 **** X register struct inode *ip; X char pth[MLEN]; X int error; X! register struct nameidata *ndp = &u.u_nd; X X bcopy(path, pth, len); X if (!len) X return(EINVAL); /* paranoia */ X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_SYSSPACE; X! ndp->ni_dirp = pth; X ndp->ni_dirp[len - 2] = 0; X ip = namei(ndp); X *ipp = ip; X--- 132,144 ---- X register struct inode *ip; X char pth[MLEN]; X int error; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X X bcopy(path, pth, len); X if (!len) X return(EINVAL); /* paranoia */ X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, pth); X ndp->ni_dirp[len - 2] = 0; X ip = namei(ndp); X *ipp = ip; X*** /usr/src/sys/sys/quota_kern.c.old Fri Dec 29 20:05:23 1995 X--- /usr/src/sys/sys/quota_kern.c Sat Jan 18 23:17:29 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)quota_kern.c 7.1.3 (2.11BSD GTE) 1995/12/29 X * X * I'll say it here and not every other place i've had to hack: X * Mike Karels was right - " just buy a vax...". i have traded cpu cycles X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)quota_kern.c 7.1.4 (2.11BSD GTE) 1997/1/18 X * X * I'll say it here and not every other place i've had to hack: X * Mike Karels was right - " just buy a vax...". i have traded cpu cycles X*************** X*** 31,37 **** X #include "quota.h" X #include "fs.h" X #include "mount.h" X! #include "uio.h" X X /* X * Quota cache - hash chain headers. X--- 31,37 ---- X #include "quota.h" X #include "fs.h" X #include "mount.h" X! #include "namei.h" X X /* X * Quota cache - hash chain headers. X*************** X*** 699,713 **** X register struct inode *ip; X register struct quota *q; X struct dquot *dq; X! register struct nameidata *ndp = &u.u_nd; X int i; X X if (mp->m_qinod) X closedq(mp); X QUOTAUNMAP(); /* paranoia */ X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = fname; X ip = namei(ndp); X QUOTAMAP(); X if (ip == NULL) X--- 699,712 ---- X register struct inode *ip; X register struct quota *q; X struct dquot *dq; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int i; X X if (mp->m_qinod) X closedq(mp); X QUOTAUNMAP(); /* paranoia */ X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, fname); X ip = namei(ndp); X QUOTAMAP(); X if (ip == NULL) X*** /usr/src/sys/sys/kern_exec.c.old Fri Jan 13 20:23:46 1995 X--- /usr/src/sys/sys/kern_exec.c Sat Jan 18 22:56:29 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_exec.c 1.4 (2.11BSD GTE) 1/13/95 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)kern_exec.c 1.5 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 43,49 **** X int nc; X register char *cp; X register struct buf *bp; X! struct execa *uap; X int na, ne, ucp, ap; X register int cc; X unsigned len; X--- 43,49 ---- X int nc; X register char *cp; X register struct buf *bp; X! struct execa *uap = (struct execa *)u.u_ap; X int na, ne, ucp, ap; X register int cc; X unsigned len; X*************** X*** 58,69 **** X char ex_shell[SHSIZE]; /* #! and name of interpreter */ X struct exec ex_exec; X } exdata; X! register struct nameidata *ndp = &u.u_nd; X int resid, error; X X! ndp->ni_nameiop = LOOKUP | FOLLOW; X! ndp->ni_segflg = UIO_USERSPACE; X! ndp->ni_dirp = ((struct execa *)u.u_ap)->fname; X if ((ip = namei(ndp)) == NULL) X return; X bno = 0; X--- 58,68 ---- X char ex_shell[SHSIZE]; /* #! and name of interpreter */ X struct exec ex_exec; X } exdata; X! struct nameidata nd; X! register struct nameidata *ndp = &nd; X int resid, error; X X! NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); X if ((ip = namei(ndp)) == NULL) X return; X bno = 0; X*************** X*** 184,190 **** X ne = 0; X nc = 0; X cc = 0; X- uap = (struct execa *)u.u_ap; X bno = malloc(swapmap, ctod((int)btoc(NCARGS + MAXBSIZE))); X if (bno == 0) { X swkill(u.u_procp, "exec"); X--- 183,188 ---- X*** /usr/src/sys/sys/kern_sysctl.c.old Fri Dec 13 22:44:26 1996 X--- /usr/src/sys/sys/kern_sysctl.c Sat Jan 18 23:13:27 1997 X*************** X*** 33,39 **** X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X! * @(#)kern_sysctl.c 8.4.4 (2.11BSD GTE) 1996/12/13 X */ X X /* X--- 33,39 ---- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X! * @(#)kern_sysctl.c 8.4.5 (2.11BSD GTE) 1997/1/18 X */ X X /* X*************** X*** 53,58 **** X--- 53,59 ---- X #include <sys/tty.h> X #include <sys/vm.h> X #include <sys/map.h> X+ #include <machine/seg.h> X #include <sys/sysctl.h> X #include <machine/cpu.h> X #include <conf.h> X*** /usr/src/sys/sys/sys_pipe.c.old Tue Nov 29 22:16:47 1994 X--- /usr/src/sys/sys/sys_pipe.c Sat Jan 18 23:23:47 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)sys_pipe.c 1.3 (2.11BSD GTE) 11/26/94 X */ X X #include "param.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)sys_pipe.c 1.3 (2.11BSD GTE) 1997/1/18 X */ X X #include "param.h" X*************** X*** 14,19 **** X--- 14,20 ---- X #include "file.h" X #include "fs.h" X #include "mount.h" X+ #include "uio.h" X X extern int ino_ioctl(), ino_close(); X int pipe_rw(), pipe_select(); X*** /usr/src/sys/sys/ufs_disksubr.c.old Fri Jun 16 20:28:33 1995 X--- /usr/src/sys/sys/ufs_disksubr.c Sat Jan 18 23:39:15 1997 X*************** X*** 35,41 **** X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X! * @(#)ufs_disksubr.c 8.5.3 (2.11BSD GTE) 1995/06/16 X */ X X #include <errno.h> X--- 35,41 ---- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X! * @(#)ufs_disksubr.c 8.5.4 (2.11BSD GTE) 1997/1/18 X */ X X #include <errno.h> X*************** X*** 43,48 **** X--- 43,49 ---- X #include <sys/param.h> X #include <sys/user.h> X #include <sys/systm.h> X+ #include <machine/seg.h> X #include <sys/buf.h> X #include <sys/file.h> X #include <sys/ioctl.h> X*** /usr/src/sys/h/namei.h.old Thu May 31 13:48:29 1990 X--- /usr/src/sys/h/namei.h Sun Jan 19 10:28:58 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)namei.h 1.2 (2.10BSD Berkeley) 1/26/90 X */ X X #ifndef _NAMEI_ X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)namei.h 1.3 (2.11BSD) 1997/1/18 X */ X X #ifndef _NAMEI_ X*************** X*** 26,44 **** X short ni_error; /* error return if any */ X off_t ni_endoff; /* end of useful stuff in directory */ X struct inode *ni_pdir; /* inode of parent directory of dirp */ X! struct iovec ni_iovec; /* MUST be pointed to by ni_iov */ X! struct uio ni_uio; /* directory I/O parameters */ X struct direct ni_dent; /* current directory entry */ X }; X X- #define ni_base ni_iovec.iov_base X- #define ni_count ni_iovec.iov_len X- #define ni_iov ni_uio.uio_iov X- #define ni_iovcnt ni_uio.uio_iovcnt X- #define ni_offset ni_uio.uio_offset X- #define ni_segflg ni_uio.uio_segflg X- #define ni_resid ni_uio.uio_resid X- X /* X * namei operations and modifiers X */ X--- 26,38 ---- X short ni_error; /* error return if any */ X off_t ni_endoff; /* end of useful stuff in directory */ X struct inode *ni_pdir; /* inode of parent directory of dirp */ X! struct inode *ni_ip; /* inode of dirp */ X! enum uio_seg ni_segflg; /* segment flag */ X! off_t ni_offset; /* offset in directory */ X! u_short ni_count; /* offset of open slot (off_t?) */ X struct direct ni_dent; /* current directory entry */ X }; X X /* X * namei operations and modifiers X */ X*************** X*** 49,54 **** X--- 43,54 ---- X #define NOCACHE 0x20 /* name must not be left in cache */ X #define FOLLOW 0x40 /* follow symbolic links */ X #define NOFOLLOW 0x0 /* don't follow symbolic links (pseudo) */ X+ X+ #define NDINIT(ndp,op,flags,segflg,namep) {\ X+ (ndp)->ni_nameiop = op | flags; \ X+ (ndp)->ni_segflg = segflg; \ X+ (ndp)->ni_dirp = namep; \ X+ } X X /* X * This structure describes the elements in the cache of recent X*** /usr/src/sys/h/user.h.old Thu Apr 5 21:41:25 1990 X--- /usr/src/sys/h/user.h Sat Jan 18 23:06:01 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)user.h 1.1 (2.10BSD Berkeley) 12/1/86 X */ X X #ifdef KERNEL X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)user.h 1.2 (2.11BSD) 1997/1/18 X */ X X #ifdef KERNEL X*************** X*** 12,18 **** X #include "exec.h" X #include "time.h" X #include "resource.h" X- #include "namei.h" X #else X #include <machine/fperr.h> X #include <sys/dir.h> X--- 12,17 ---- X*************** X*** 19,25 **** X #include <sys/exec.h> X #include <sys/time.h> X #include <sys/resource.h> X- #include <sys/namei.h> X #endif X X /* X--- 18,23 ---- X*************** X*** 140,147 **** X ino_t nc_inumber; /* inum of cached directory */ X dev_t nc_dev; /* dev of cached directory */ X } u_ncache; X- struct nameidata u_nd; X- X short u_stack[1]; /* kernel stack per user X * extends from u + USIZE*64 X * backward not to reach here X--- 138,143 ---- X*** /usr/src/sys/netimp/if_imphost.h.old Wed Apr 11 16:10:40 1990 X--- /usr/src/sys/netimp/if_imphost.h Sun Jan 19 12:31:58 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_imphost.h 1.1 (2.10BSD Berkeley) 12/1/86 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_imphost.h 1.2 (2.11BSD) 1997/1/19 X */ X X /* X*************** X*** 46,52 **** X * automatically at the time a structure is free'd. X */ X #define HPMBUF ((MLEN - sizeof(int)) / sizeof(struct host)) X! #define HOSTHASH(a) ((((a).s_addr>>8)+(a).s_net) % HPMBUF) X X /* X * In-line expansions for queuing operations on X--- 46,52 ---- X * automatically at the time a structure is free'd. X */ X #define HPMBUF ((MLEN - sizeof(int)) / sizeof(struct host)) X! #define HOSTHASH(a) (((a).s_addr>>8) % HPMBUF) X X /* X * In-line expansions for queuing operations on X*** /usr/src/sys/pdpstand/Makefile.old Sat Nov 16 20:56:09 1996 X--- /usr/src/sys/pdpstand/Makefile Sat Jan 18 15:41:57 1997 X*************** X*** 1,4 **** X! # Makefile (2.11BSD) 2.0 1996/11/16 X # X # The limitations on program size have been removed. The addition X # of disklabel support pushed 'restor' over the limit. Even with X--- 1,4 ---- X! # Makefile (2.11BSD) 2.1 1997/1/18 X # X # The limitations on program size have been removed. The addition X # of disklabel support pushed 'restor' over the limit. Even with X*************** X*** 45,51 **** X ht.o tm.o ts.o tmscp.o \ X xp.o rk.o rl.o rx.o br.o hk.o si.o ra.o X X! ALL= mtboot boot disklabel mkfs restor icheck maketape toyset X X all: ${ALL} X X--- 45,51 ---- X ht.o tm.o ts.o tmscp.o \ X xp.o rk.o rl.o rx.o br.o hk.o si.o ra.o X X! ALL= mtboot boot disklabel mkfs restor icheck maketape makesimtape toyset X X all: ${ALL} X X*************** X*** 142,147 **** X--- 142,150 ---- X X maketape: maketape.c X cc -o $@ maketape.c X+ X+ makesimtape: makesimtape.c X+ cc -o $@ makesimtape.c X X toyset: toyset.o srt0.o conf.o libsa.a X ld -X -o $@ srt0.o conf.o $@.o libsa.a -lc X*** /usr/src/sys/pdpstand/tm.c.old Fri Mar 8 16:39:15 1996 X--- /usr/src/sys/pdpstand/tm.c Mon Jan 20 20:13:37 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)tm.c 2.2 (2.11BSD) 1996/3/8 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)tm.c 2.3 (2.11BSD) 1997/1/19 X */ X X /* X*************** X*** 61,69 **** X tmstrategy(io, func) X register struct iob *io; X { X! register int com, unit = io->i_unit; X register struct tmdevice *tmaddr; X! int errcnt = 0, ctlr = io->i_ctlr, bae, lo16; X X tmaddr = TMcsr[ctlr]; X retry: X--- 61,69 ---- X tmstrategy(io, func) X register struct iob *io; X { X! int com, unit = io->i_unit; X register struct tmdevice *tmaddr; X! int errcnt = 0, ctlr = io->i_ctlr, bae, lo16, fnc; X X tmaddr = TMcsr[ctlr]; X retry: X*************** X*** 77,92 **** X com = (unit<<8)|(bae<<4) | tmdens[TMDENS(unit)]; X tmaddr->tmbc = -io->i_cc; X tmaddr->tmba = (caddr_t)lo16; X! if (func == READ) X! tmaddr->tmcs = com | TM_RCOM | TM_GO; X! else if (func == WRITE) X! tmaddr->tmcs = com | TM_WCOM | TM_GO; X! else if (func == TM_SREV) { X! tmaddr->tmbc = -1; X! tmaddr->tmcs = com | TM_SREV | TM_GO; X! return(0); X! } else X! tmaddr->tmcs = com | func | TM_GO; X while ((tmaddr->tmcs&TM_CUR) == 0) X continue; X if (tmaddr->tmer&TMER_EOF) { X--- 77,99 ---- X com = (unit<<8)|(bae<<4) | tmdens[TMDENS(unit)]; X tmaddr->tmbc = -io->i_cc; X tmaddr->tmba = (caddr_t)lo16; X! switch (func) X! { X! case READ: X! fnc = TM_RCOM; X! break; X! case WRITE: X! fnc = TM_WCOM; X! break; X! /* X! * Just pass all others thru - all other functions are TM_* opcodes and X! * had better be valid. X! */ X! default: X! fnc = func; X! break; X! } X! tmaddr->tmcs = com | fnc | TM_GO; X while ((tmaddr->tmcs&TM_CUR) == 0) X continue; X if (tmaddr->tmer&TMER_EOF) { X*************** X*** 120,126 **** X } X else X fnc = TM_SFORW; X! while (space--) X! tmstrategy(io, fnc); X return(0); X } X--- 127,133 ---- X } X else X fnc = TM_SFORW; X! io->i_cc = space; X! tmstrategy(io, fnc); X return(0); X } X*** /usr/src/sys/pdpstand/ht.c.old Fri Mar 8 16:34:12 1996 X--- /usr/src/sys/pdpstand/ht.c Mon Jan 20 20:50:54 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ht.c 2.3 (2.11BSD) 1996/3/8 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ht.c 2.4 (2.11BSD) 1997/1/20 X */ X X /* X*************** X*** 39,45 **** X htstrategy(io, HT_REW); X skip = io->i_part; X while (skip--) { X! io->i_cc = -1; X while (htstrategy(io, HT_SFORW)) X continue; X delay(30000); X--- 39,45 ---- X htstrategy(io, HT_REW); X skip = io->i_part; X while (skip--) { X! io->i_cc = 0; X while (htstrategy(io, HT_SFORW)) X continue; X delay(30000); X*************** X*** 72,96 **** X } X else X fnc = HT_SFORW; X! while (space--) X! { X! io->i_cc = -1; X! htstrategy(io, fnc); X! delay(30000); X! htstrategy(io, HT_SENSE); X! } X } X X /* X! * Returns 0 if no tape mark was seen. Returns 1 if a tape mark (or error) X! * has been encountered. X */ X X htstrategy(io, func) X register struct iob *io; X { X! register unit, com; X! int errcnt, ctlr, bae, lo16; X register struct htdevice *htaddr; X X unit = io->i_unit; X--- 72,93 ---- X } X else X fnc = HT_SFORW; X! io->i_cc = space; X! htstrategy(io, fnc); X! delay(30000); X! htstrategy(io, HT_SENSE); X } X X /* X! * Returns 0 (and sets 'tapemark') if tape mark was seen. Returns -1 on fatal X! * error. Otherwise the length of data tranferred is returned. X */ X X htstrategy(io, func) X register struct iob *io; X { X! int unit, com; X! int errcnt, ctlr, bae, lo16, fnc; X register struct htdevice *htaddr; X X unit = io->i_unit; X*************** X*** 111,126 **** X htaddr->htfc = -io->i_cc; X htaddr->htwc = -(io->i_cc >> 1); X com = (bae << 8) | HT_GO; X! if (func == READ) X! com |= HT_RCOM; X! else if (func == WRITE) X! com |= HT_WCOM; X! else if (func == HT_SREV) { X! htaddr->htfc = -1; X! htaddr->htcs1 = com | HT_SREV; X! return(0); X! } else X! com |= func; X htaddr->htcs1 = com; X while ((htaddr->htcs1 & HT_RDY) == 0) X continue; X--- 108,126 ---- X htaddr->htfc = -io->i_cc; X htaddr->htwc = -(io->i_cc >> 1); X com = (bae << 8) | HT_GO; X! switch (func) X! { X! case READ: X! fnc = HT_RCOM; X! break; X! case WRITE: X! fnc = HT_WCOM; X! break; X! default: X! fnc = func; X! break; X! } X! com |= fnc; X htaddr->htcs1 = com; X while ((htaddr->htcs1 & HT_RDY) == 0) X continue; X*** /usr/src/sys/pdpif/if_acc.c.old Mon Apr 30 15:27:07 1990 X--- /usr/src/sys/pdpif/if_acc.c Sun Jan 19 12:40:56 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_acc.c 1.1 (2.10BSD Berkeley) 12/1/86 X */ X X #include "acc.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_acc.c 1.2 (2.11BSD) 1997/1/19 X */ X X #include "acc.h" X*************** X*** 305,310 **** X--- 305,311 ---- X if (sc->acc_if->if_snd.ifq_head) X accstart(unit); X out: X+ return; X } X X /* X*************** X*** 384,388 **** X--- 385,390 ---- X addr->icsr = X IN_MRDY | ACC_IE | IN_WEN | ((info & 0x30000) >> 12) | ACC_GO; X out: X+ return; X } X #endif X*** /usr/src/sys/pdpif/if_css.c.old Mon Apr 30 15:26:48 1990 X--- /usr/src/sys/pdpif/if_css.c Sun Jan 19 12:43:55 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_css.c 1.1 (2.10BSD Berkeley) 12/1/86 X */ X X #include "css.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_css.c 1.2 (2.11BSD) 1997/1/18 X */ X X #include "css.h" X*************** X*** 324,329 **** X--- 324,330 ---- X if (sc->css_if->if_snd.ifq_head) X cssstart(unit); X out: X+ return; X } X X /* X*************** X*** 396,400 **** X--- 397,402 ---- X addr->css_icsr = X IN_HRDY | CSS_IE | IN_WEN | ((info & 0x30000) >> 12) | CSS_GO; X out: X+ return; X } X #endif NCSS X*** /usr/src/sys/pdpif/if_en.c.old Fri Dec 31 23:50:58 1993 X--- /usr/src/sys/pdpif/if_en.c Sun Jan 19 14:11:00 1997 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_en.c 1.2 (2.11BSD GTE) 12/31/93 X */ X X #include "en.h" X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)if_en.c 1.3 (2.11BSD GTE) 1997/1/19 X */ X X #include "en.h" X*************** X*** 21,36 **** X #include "protosw.h" X #include "socket.h" X #include "pdpuba/ubavar.h" X! #ifdef notdef X! #include "enreg.h" X! #endif notdef X #include "netinet/in.h" X #include "netinet/in_systm.h" X #include "net/if.h" X #include "pdpif/if_en.h" X #include "pdpif/if_uba.h" X #include "netinet/ip.h" X #include "netinet/ip_var.h" X #include "net/route.h" X #include "errno.h" X X--- 21,36 ---- X #include "protosw.h" X #include "socket.h" X #include "pdpuba/ubavar.h" X! #include "if_enreg.h" X #include "netinet/in.h" X #include "netinet/in_systm.h" X+ #include "net/netisr.h" X #include "net/if.h" X #include "pdpif/if_en.h" X #include "pdpif/if_uba.h" X #include "netinet/ip.h" X #include "netinet/ip_var.h" X+ #include "netinet/in_var.h" X #include "net/route.h" X #include "errno.h" X X*************** X*** 44,50 **** X { enprobe, 0, enattach, 0, enstd, "en", eninfo }; X #define ENUNIT(x) minor(x) X X! int eninit(),enoutput(),enreset(); X X /* X * Ethernet software status per interface. X--- 44,50 ---- X { enprobe, 0, enattach, 0, enstd, "en", eninfo }; X #define ENUNIT(x) minor(x) X X! int eninit(),enoutput(); X X /* X * Ethernet software status per interface. X*************** X*** 110,149 **** X es->es_if.if_unit = ui->ui_unit; X es->es_if.if_name = "en"; X es->es_if.if_mtu = ENMTU; X- es->es_if.if_net = ui->ui_flags; X- es->es_if.if_host[0] = X- (~(((struct endevice *)eninfo[ui->ui_unit]->ui_addr)->en_addr)) & 0xff; X- sin = (struct sockaddr_in *)&es->es_if.if_addr; X- sin->sin_family = AF_INET; X- sin->sin_addr = if_makeaddr(es->es_if.if_net, es->es_if.if_host[0]); X- sin = (struct sockaddr_in *)&es->es_if.if_broadaddr; X- sin->sin_family = AF_INET; X- sin->sin_addr = if_makeaddr(es->es_if.if_net, 0); X es->es_if.if_flags = IFF_BROADCAST; X es->es_if.if_init = eninit; X es->es_if.if_output = enoutput; X- es->es_if.if_ubareset = enreset; X es->es_ifuba.ifu_flags = UBA_NEEDBDP | UBA_NEED16 | UBA_CANTWAIT; X if_attach(&es->es_if); X } X X /* X- * Reset of interface after UNIBUS reset. X- * If interface is on specified uba, reset its state. X- */ X- enreset(unit, uban) X- int unit, uban; X- { X- register struct uba_device *ui; X- X- if (unit >= NEN || (ui = eninfo[unit]) == 0 || ui->ui_alive == 0 || X- ui->ui_ubanum != uban) X- return; X- printf(" en%d", unit); X- eninit(unit); X- } X- X- /* X * Initialization of interface; clear recorded pending X * operations, and reinitialize UNIBUS usage. X */ X--- 110,123 ---- X*************** X*** 305,321 **** X return; X } X /* X! * Another backoff. Restart with delay based on n low bits X! * of the interval timer. X */ X es->es_mask <<= 1; X! es->es_delay = mfpr(ICR) &~ es->es_mask; X enstart(unit); X } X X struct sockaddr_pup pupsrc = { AF_PUP }; X struct sockaddr_pup pupdst = { AF_PUP }; X struct sockproto pupproto = { PF_PUP }; X /* X * Ethernet interface receiver interrupt. X * If input error just drop packet. X--- 279,296 ---- X return; X } X /* X! * Another backoff. X */ X es->es_mask <<= 1; X! es->es_delay = ffs(es->es_mask); X enstart(unit); X } X X+ #ifdef notdef X struct sockaddr_pup pupsrc = { AF_PUP }; X struct sockaddr_pup pupdst = { AF_PUP }; X struct sockproto pupproto = { PF_PUP }; X+ #endif X /* X * Ethernet interface receiver interrupt. X * If input error just drop packet. X*************** X*** 357,363 **** X len -= sizeof (struct en_header); X if (len > ENMRU) X goto setup; /* sanity */ X! en = (struct en_header *)(es->es_ifuba.ifu_r.ifrw_addr); X #define endataaddr(en, off, type) ((type)(((caddr_t)((en)+1)+(off)))) X if (en->en_type >= ENPUP_TRAIL && X en->en_type < ENPUP_TRAIL+ENPUP_NTRAILER) { X--- 332,338 ---- X len -= sizeof (struct en_header); X if (len > ENMRU) X goto setup; /* sanity */ X! en = (struct en_header *)(es->es_ifuba.ifu_r.ifrw_info); X #define endataaddr(en, off, type) ((type)(((caddr_t)((en)+1)+(off)))) X if (en->en_type >= ENPUP_TRAIL && X en->en_type < ENPUP_TRAIL+ENPUP_NTRAILER) { X*************** X*** 513,521 **** X m->m_len += sizeof (struct en_header); X } X en = mtod(m, struct en_header *); X- en->en_shost = ifp->if_host[0]; X en->en_dhost = dest; X! en->en_type = type; X X /* X * Queue message on interface, and start output if interface X--- 488,495 ---- X m->m_len += sizeof (struct en_header); X } X en = mtod(m, struct en_header *); X en->en_dhost = dest; X! en->en_type = htons((u_short)type); X X /* X * Queue message on interface, and start output if interface X*** /usr/src/sys/GENERIC/rk.h.old Sat Jan 18 16:55:56 1997 X--- /usr/src/sys/GENERIC/rk.h Tue Jan 21 20:02:37 1997 X*************** X*** 1 **** X! #define NRK 0 X--- 1 ---- X! #define NRK 8 X*** /usr/src/sys/GENERIC/Makefile.old Sat Sep 21 22:33:57 1996 X--- /usr/src/sys/GENERIC/Makefile Tue Jan 21 20:03:29 1997 X*************** X*** 10,16 **** X # software without specific prior written permission. This software X # is provided ``as is'' without express or implied warranty. X # X! # 2.7 (2.11BSD GTE) 1996/9/21 X # X ######################################################### X # Non-network, but separate I/D kernel # X--- 10,16 ---- X # software without specific prior written permission. This software X # is provided ``as is'' without express or implied warranty. X # X! # 2.8 (2.11BSD GTE) 1997/1/21 X # X ######################################################### X # Non-network, but separate I/D kernel # X*************** X*** 48,54 **** X X BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ X kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ X! kern_synch.o lp.o machdep.o ra.o ram.o rk.o si.o \ X subr_rmap.o subr_xxx.o sys_inode.o sys_pipe.o trap.o tty.o \ X tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ X ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ X--- 48,54 ---- X X BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ X kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ X! kern_synch.o lp.o machdep.o ra.o ram.o si.o \ X subr_rmap.o subr_xxx.o sys_inode.o sys_pipe.o trap.o tty.o \ X tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ X ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ X*************** X*** 64,70 **** X OV6= tmscp.o tmscpdump.o X OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o X OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o X! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o X X KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ X ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ X--- 64,70 ---- X OV6= tmscp.o tmscpdump.o X OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o X OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o X! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o rk.o X X KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ X ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ X*** /usr/src/etc/dtab.old Sun Dec 22 16:20:35 1991 X--- /usr/src/etc/dtab Tue Jan 21 20:11:36 1997 X*************** X*** 16,22 **** X # vp ? 177500 174 4 vpintr # Versatec; should be before lp X # lp ? 177514 200 4 lpintr # lp-11 line printer X ra ? 172150 154 5 raintr # uda50, rqdx1/2/3 X! # rk ? 177400 220 5 rkintr # rk05 X rl ? 174400 160 5 rlintr # rl-01/02 X # rm ? 176700 254 5 rmintr # rjm02/rwm03, rm02/03/05 X # br ? 176710 254 5 brintr # Eaton br1537/br1711 X--- 16,22 ---- X # vp ? 177500 174 4 vpintr # Versatec; should be before lp X # lp ? 177514 200 4 lpintr # lp-11 line printer X ra ? 172150 154 5 raintr # uda50, rqdx1/2/3 X! rk ? 177400 220 5 rkintr # rk05 X rl ? 174400 160 5 rlintr # rl-01/02 X # rm ? 176700 254 5 rmintr # rjm02/rwm03, rm02/03/05 X # br ? 176710 254 5 brintr # Eaton br1537/br1711 X*** /usr/src/share/adb/u.old Fri Apr 6 09:11:11 1990 X--- /usr/src/share/adb/u Sat Jan 18 22:01:47 1997 X*************** X*** 32,40 **** X +/"rlimits"n12D X +/"quota"non X +/"nc_off"16t"nc_inum"8t"nc_dev"nDubbn X- +/"ni_dirp"8t"nameiop"8t"ni_error"nouun X- +/"ni_endoff"8t"ni_pdir"nDon X- +/"ni_base"8t"ni_count"noun X- +/"ni_iov"8t"ni_iovcnt"noun X- +/"ni_offset"8t"ni_segflg"8t"ni_resid"nDuun X- +/"d_inum"8t"d_name"nu14Cn X--- 32,34 ---- X*** /usr/src/usr.sbin/pstat/pstat.c.old Thu Dec 15 19:45:46 1994 X--- /usr/src/usr.sbin/pstat/pstat.c Sun Jan 19 17:16:14 1997 X*************** X*** 9,15 **** X "@(#) Copyright (c) 1980 Regents of the University of California.\n\ X All rights reserved.\n"; X X! static char sccsid[] = "@(#)pstat.c 5.8.2 (2.11BSD GTE) 12/7/94"; X #endif X X /* X--- 9,15 ---- X "@(#) Copyright (c) 1980 Regents of the University of California.\n\ X All rights reserved.\n"; X X! static char sccsid[] = "@(#)pstat.c 5.8.3 (2.11BSD GTE) 1997/1/19"; X #endif X X /* X*************** X*** 73,95 **** X { "_ninode" }, X #define SPTY 16 X { "_pt_tty" }, X! #define SDMF 17 X! { "_dmf_tty" }, X! #define SNDMF 18 X! { "_ndmf" }, X! #define SNPTY 19 X { "_npty" }, X! #define SDHU 20 X { "_dhu_tty" }, X! #define SNDHU 21 X { "_ndhu" }, X! #define SDMZ 22 X! { "_dmz_tty" }, X! #define SNDMZ 23 X! { "_ndmz" }, X! #define SDHV 24 X { "_dhv_tty" }, X! #define SNDHV 25 X { "_ndhv" }, X { "" } X }; X--- 73,87 ---- X { "_ninode" }, X #define SPTY 16 X { "_pt_tty" }, X! #define SNPTY 17 X { "_npty" }, X! #define SDHU 18 X { "_dhu_tty" }, X! #define SNDHU 19 X { "_ndhu" }, X! #define SDHV 20 X { "_dhv_tty" }, X! #define SNDHV 21 X { "_ndhv" }, X { "" } X }; X*************** X*** 438,449 **** X dottytype("dz", SDZ, SNDZ); X if (nl[SNDH].n_type != 0) X dottytype("dh", SDH, SNDH); X- if (nl[SNDMF].n_type != 0) X- dottytype("dmf", SDMF, SNDMF); X if (nl[SNDHU].n_type != 0) X dottytype("dhu", SDHU, SNDHU); X- if (nl[SNDMZ].n_type != 0) X- dottytype("dmz", SDMZ, SNDMZ); X if (nl[SNDHV].n_type != 0) X dottytype("dhv", SDHV, SNDHV); X if (nl[SNPTY].n_type != 0) X--- 430,437 ---- X*************** X*** 532,538 **** X struct user U; X long *ip; X register i, j; X- register struct nameidata *nd = &U.u_nd; X X lseek(fm, ubase << 6, 0); X read(fm, &U, sizeof(U)); X--- 520,525 ---- X*************** X*** 643,649 **** X printf("lastfile\t%d\n", U.u_lastfile); X printf("cdir\t%.1o\n", U.u_cdir); X printf("rdir\t%.1o\n", U.u_rdir); X- printf("pdir\t%.1o\n", nd->ni_pdir); X printf("ttyp\t%.1o\n", U.u_ttyp); X printf("ttyd\t%d,%d\n", major(U.u_ttyd), minor(U.u_ttyd)); X printf("cmask\t%.1o\n", U.u_cmask); X--- 630,635 ---- X*************** X*** 683,697 **** X } X printf("\n"); X printf("quota\t%.1o\n", U.u_quota); X- printf("base,count,offset\t%.1o %u %ld\n", nd->ni_base, X- nd->ni_count, nd->ni_offset); X- printf("segflg\t%d\n", nd->ni_segflg); X printf("ncache\t%ld %u %d,%d\n", U.u_ncache.nc_prevoffset, X U.u_ncache.nc_inumber, major(U.u_ncache.nc_dev), X minor(U.u_ncache.nc_dev)); X- printf("endoff\t%ld\n", nd->ni_endoff); X- printf("dirp\t%.1o\n", nd->ni_dirp); X- printf("dent\t%u %s\n", nd->ni_dent.d_ino, nd->ni_dent.d_name); X } X X oatoi(s) X--- 669,677 ---- X*** /VERSION.old Fri Jan 10 20:13:26 1997 X--- /VERSION Sun Jan 19 10:16:54 1997 X*************** X*** 1,4 **** X! Current Patch Level: 361 X X 2.11 BSD X ============ X--- 1,4 ---- X! Current Patch Level: 362 X X 2.11 BSD X ============ SHAR_EOF : || echo 'restore of /tmp/362.patch failed' fi # ============= /tmp/362.shar ============== if test -f '/tmp/362.shar' && test X"$1" != X"-c"; then echo 'x - skipping /tmp/362.shar (file already exists)' else echo 'x - extracting /tmp/362.shar (text)' sed 's/^X//' << 'SHAR_EOF' > '/tmp/362.shar' && X#! /bin/sh X# This is a shell archive, meaning: X# 1. Remove everything above the #! /bin/sh line. X# 2. Save the resulting text in a file. X# 3. Execute the file with /bin/sh (not csh) to create: X# /usr/src/sys/pdpstand/makesimtape.c X# This archive created: Tue Jan 21 21:24:55 1997 Xexport PATH; PATH=/bin:/usr/bin:$PATH Xif test -f '/usr/src/sys/pdpstand/makesimtape.c' Xthen X echo shar: "will not over-write existing file '/usr/src/sys/pdpstand/makesimtape.c'" Xelse Xsed 's/^Z//' << \SHAR_EOF > '/usr/src/sys/pdpstand/makesimtape.c' XZ/* XZ * @(#)makesimtape.c 1.0 (2.11BSD) 1997/1/17 XZ * Hacked 'maketape.c' to write a file in a format suitable for XZ * use with Bob Supnik's PDP-11 simulator's emulated tape driver. XZ */ XZ XZ#include <stdio.h> XZ#include <errno.h> XZ#include <fcntl.h> XZ#include <stdlib.h> XZ#include <sys/types.h> XZ#include <sys/stat.h> XZ#include <sys/uio.h> XZ XZ#define MAXB 30 XZ XZ char buf[MAXB * 512]; XZ char name[50]; XZ int blksz, recsz; XZ int mt, fd, cnt; XZ struct iovec iovec[2]; XZ void usage(); XZ XZmain(argc, argv) XZ int argc; XZ char *argv[]; XZ { XZ int i, j = 0, k = 0; XZ register char *outfile = NULL, *infile = NULL; XZ FILE *mf; XZ struct stat st; XZ XZ while ((i = getopt(argc, argv, "i:o:")) != EOF) XZ { XZ switch (i) XZ { XZ case 'o': XZ outfile = optarg; XZ break; XZ case 'i': XZ infile = optarg; XZ break; XZ default: XZ usage(); XZ /* NOTREACHED */ XZ } XZ } XZ if (!outfile || !infile) XZ usage(); XZ /* NOTREACHED */ XZ/* XZ * Stat the outfile and make sure it either 1) Does not exist, or XZ * 2) Exists but is a regular file. XZ*/ XZ if (stat(outfile, &st) != -1 && !(S_ISREG(st.st_mode))) XZ errx(1, "outfile must either not exist or be a regular file"); XZ /* NOTREACHED */ XZ XZ mt = open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0600); XZ if (mt < 0) XZ err(1, "Can not create %s", outfile); XZ /* NOTREACHED */ XZ XZ mf = fopen(infile, "r"); XZ if (!mf) XZ err(1, "Can not open %s", infile); XZ /* NOTREACHED*/ XZ XZ while (1) XZ { XZ if ((i = fscanf(mf, "%s %d", name, &blksz))== EOF) XZ exit(0); XZ if (i != 2) { XZ fprintf(stderr,"Help! Scanf didn't read 2 things (%d)\n", i); XZ exit(1); XZ } XZ if (blksz <= 0 || blksz > MAXB) XZ { XZ fprintf(stderr, "Block size %u is invalid\n", blksz); XZ exit(1); XZ } XZ recsz = blksz * 512; /* convert to bytes */ XZ iovec[0].iov_len = sizeof (int); XZ iovec[0].iov_base = (char *)&recsz; XZ iovec[1].iov_len = recsz; XZ iovec[1].iov_base = buf; XZ XZ if (strcmp(name, "*") == 0) XZ { XZ recsz = 0; XZ if (writev(mt, iovec, 1) < 0) XZ warn(1, "writev of pseudo tapemark failed"); XZ k++; XZ continue; XZ } XZ fd = open(name, 0); XZ if (fd < 0) XZ err(1, "Can't open %s for reading", name); XZ /* NOTREACHED */ XZ printf("%s: block %d, file %d\n", name, j, k); XZ XZ /* XZ * we pad the last record with nulls XZ * (instead of the bell std. of padding with trash). XZ * this allows you to access text files on the XZ * tape without garbage at the end of the file. XZ * (note that there is no record length associated XZ * with tape files) XZ */ XZ XZ while ((cnt=read(fd, buf, recsz)) == recsz) XZ { XZ j++; XZ if (writev(mt, iovec, 2) < 0) XZ err(1, "writev #1"); XZ /* NOTREACHED */ XZ } XZ if (cnt > 0) XZ { XZ j++; XZ bzero(buf + cnt, recsz - cnt); XZ if (writev(mt, iovec, 2) < 0) XZ err(1, "writev #2"); XZ /* NOTREACHED */ XZ } XZ close(fd); XZ } XZ/* XZ * Write two tape marks to simulate EOT XZ*/ XZ recsz = 0; XZ writev(mt, iovec, 1); XZ writev(mt, iovec, 1); XZ } XZ XZvoid XZusage() XZ { XZ fprintf(stderr, "usage: makesimtape -o outfilefile -i inputfile\n"); XZ exit(1); XZ } XSHAR_EOF Xchmod 644 '/usr/src/sys/pdpstand/makesimtape.c' Xfi Xexit 0 X# End of shell archive SHAR_EOF : || echo 'restore of /tmp/362.shar failed' fi exit 0