Return to BSD News archive
Newsgroups: comp.bugs.2bsd Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.erols.net!feed1.news.erols.com!insync!uunet!in2.uu.net!206.64.182.7!news.thenet.net!wlbr!moe.2bsd.com!sms From: sms@moe.2bsd.com (Steven M. Schultz) Subject: fd(4) missing from 2.11BSD (#363) Organization: 2BSD, Simi Valley CA USA Message-ID: <E57rx9.24H@moe.2bsd.com> Date: Fri, 7 Feb 1997 03:48:45 GMT Lines: 2586 Xref: euryale.cc.adfa.oz.au comp.bugs.2bsd:734 Subject: fd(4) missing from 2.11BSD (#363) Index: sys/ufs_syscalls.c,sys_inode.c,many-others 2.11BSD Description: 1) The file descriptor driver is not present in the system. 2) The setup documentation's estimate file sizes for the distribution (boot) tape is out of date. Repeat-By: 1) ls -l /dev/stdin /dev/stderr /dev/stdout /dev/fd Observe that a 'not found' error message is printed. Alternatively one can try to use /dev/fd/0: 2) Observation or have it pointed out by someone installing the system and wondering if the tape was successfully read. Fix: #2 was simply a matter of updating the record counts in one chapter of the documentation. It had been a long time since the estimated counts were generated by scanning a tape and the system has grown quite a bit since then. The growth had been to the point where the documentation's estimates were low enough to cause concern in some cases when reading the tape. #1 started out as "simply port the fdopen()" routine from the 4.4-Lite2 CD. The port did not stay simple for very long. Thankfully the "snowball factor" was not _too_ big but the number of files changed did grow from one or two to about 26. What is fd(4) and why would one use it? It is a pseudo-driver (no physical hardware is present) that clones currently open file descriptors. The pathname "/dev/fd/0" (/dev/stdin is another name for the same device) can be passed as an argument to programs that are not set up to read from 'stdin'. The assembler used to be a good example of this ('as' has since been rewritten but for now assume that 'as' does not read 'stdin'), a pipeline of the form: /lib/cpp -E foo.c | sed ... | as -o foo.o would not work because 'as' expected all files to be on the command line. With fd(4) present in the system the pipeline above would be rewritten as: /lib/cpp -E foo.c | sed ... | as -o foo.o /dev/fd/0 Or perhaps you want to interleave 'stdin' input with a data from other files as the data is sent to a program. This could be done with temp files: cp foo /tmp/xxxx inputfilter bar >> /tmp/xxxx cat baz >> /tmp/xxxx program /tmp/xxxx With fd(4) present you could simply: inputfilter bar | program foo /dev/stdin baz Some files (ufs_syscalls.c and ufs_syscalls2.c for example) underwent additional minor changes to relocate a couple functions. This was done because large monolithic modules are becoming increasingly hard to fit into 8kb overlays. The most drastic change was to the 'open' and 'close' handling of file descriptors. The "open()" routine was essentially ported from 4.4-Lite2 changing references to "vnodes" into references to "inodes". The "close()" function was modified so that pipes and inodes no longer share as much common logic. The two file types are different enough that attempting to share the ino_close routine added rather than reduced the complexity of the code. The code to actually implement the 'fd' driver is perhaps 60 lines in kern_descrip.c. All the other changes were "infrastructure" needed to support the new driver. Overall growth of the kernel is extremely small. The code space only grows by about 300 bytes. In fact the D space actually shrank by 2 bytes. This was possible because several error message strings were shortened and a couple diagnostic checks were removed (they were left over from debugging the file locking changes years ago). Even though the overall size of the kernel did not change greatly two of the Makefiles in the kernel build had to change for two reasons: the overlay layout needed to be changed and a new file (vfs_vnops.o) was added to the kernel. You will need to modify "Make.sys" for all locally built kernels. Also the overlay layout may need to be changed in local kernel build directories. The GENERIC kernel is taken care of by the provided patches. Use the changes in GENERIC/Makefile and GENERIC/Make.sys as guides. The attached shar file contains: /tmp/363.shar /tmp/363.patch The first contains the new files being added to the system and the second contains the changes to existing files. To install the update KIT cut where indicated saving to a file (/tmp/363). Then: cd /tmp sh 363 sh 363.shar patch -p0 < 363.patch Then for each locally configured kernel (NOT including GENERIC!) cp /sys/conf/Make.sys /sys/YOUR_KERNELS/Make.sys Next you need to adjust /sys/YOUR_KERNELS/Makefile and add the file 'vfs_vnops.o' to the list of object files. IF there is room you can add 'vfs_vnops.o' to the same overlay (or base segment) as the file 'ufs_syscalls.o'. Otherwise you need to find an overlay with about 500 bytes of space left (overlays can be 8192 bytes maximum). Now recompile the kernel(s): Recreating the GENERIC kernel is optional but is a good idea: cd /sys/GENERIC make clean make install -c -m 744 -o root unix /genunix cd /sys/YOUR_KERNEL make clean make make install The /dev/ entries are made next: cd /dev ./MAKEDEV fd reboot After the system comes back up the manpage for fd(4) is installed: cd /usr/src/man/man4 /usr/man/manroff fd.4 > fd.0 install -m 444 fd.0 /usr/man/cat4/fd.0 cd /usr/man/cat4 ln fd.0 stdin.0 ln fd.0 stderr.0 ln fd.0 stdout.0 Congratulations - you're done. 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, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # /tmp/363.shar # /tmp/363.patch # This archive created: Wed Feb 5 16:46:44 1997 export PATH; PATH=/bin:$PATH if test -f '/tmp/363.shar' then echo shar: will not over-write existing file "'/tmp/363.shar'" else sed 's/^Y//' << \SHAR_EOF > '/tmp/363.shar' Y#! /bin/sh Y# This is a shell archive, meaning: Y# 1. Remove everything above the #! /bin/sh line. Y# 2. Save the resulting text in a file. Y# 3. Execute the file with /bin/sh (not csh) to create: Y# /usr/src/sys/sys/vfs_vnops.c Y# /usr/src/man/man4/fd.4 Y# This archive created: Tue Feb 4 20:27:38 1997 Yexport PATH; PATH=/bin:/usr/bin:$PATH Yif test -f '/usr/src/sys/sys/vfs_vnops.c' Ythen Y echo shar: "will not over-write existing file '/usr/src/sys/sys/vfs_vnops.c'" Yelse Ysed 's/^X//' << \SHAR_EOF > '/usr/src/sys/sys/vfs_vnops.c' YX/* YX * Copyright (c) 1982, 1986, 1989, 1993 YX * The Regents of the University of California. All rights reserved. YX * (c) UNIX System Laboratories, Inc. YX * All or some portions of this file are derived from material licensed YX * to the University of California by American Telephone and Telegraph YX * Co. or Unix System Laboratories, Inc. and are reproduced herein with YX * the permission of UNIX System Laboratories, Inc. YX * YX * Redistribution and use in source and binary forms, with or without YX * modification, are permitted provided that the following conditions YX * are met: YX * 1. Redistributions of source code must retain the above copyright YX * notice, this list of conditions and the following disclaimer. YX * 2. Redistributions in binary form must reproduce the above copyright YX * notice, this list of conditions and the following disclaimer in the YX * documentation and/or other materials provided with the distribution. YX * 3. All advertising materials mentioning features or use of this software YX * must display the following acknowledgement: YX * This product includes software developed by the University of YX * California, Berkeley and its contributors. YX * 4. Neither the name of the University nor the names of its contributors YX * may be used to endorse or promote products derived from this software YX * without specific prior written permission. YX * YX * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND YX * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE YX * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE YX * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE YX * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL YX * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS YX * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) YX * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT YX * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY YX * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF YX * SUCH DAMAGE. YX * YX * @(#)vfs_vnops.c 8.14.1 (2.11BSD) 1997/2/4 YX */ YX YX#include <sys/param.h> YX#include <sys/file.h> YX#include <sys/user.h> YX#include <sys/namei.h> YX#include <sys/inode.h> YX#include <sys/stat.h> YX YX/* YX * 2.11BSD does not have "vnodes", having instead only old fashioned "inodes". YX * The routine names (i.e. vn_open) were retained since the functions them- YX * selves were ported over with minimal change. Retaining the 4.4 function YX * names also makes it easier to follow the logic flow when reading the 4.4 YX * sources. Also, changing the names from vn_* to in_* could have caused YX * confusion with the networking routines since 'in_' and 'ip_' are frequently YX * used in the networking code. YX * YX * The tab spacing has been altered to be (to me) more readable. YX*/ YX YX/* YX * Common code for vnode open operations. YX * Check permissions, and call the VOP_OPEN (openi for 2.11) or VOP_CREATE YX * (maknode) routine. YX */ YXvn_open(ndp, fmode, cmode) YX register struct nameidata *ndp; YX int fmode, cmode; YX { YX register struct inode *ip; YX register int error; YX YX if (fmode & O_CREAT) YX { YX if ((fmode & O_EXCL) == 0) YX ndp->ni_nameiop |= (CREATE|FOLLOW); YX else YX ndp->ni_nameiop= CREATE; YX ip = namei(ndp); YX if (ip == NULL) YX { YX if (u.u_error) YX goto retuerr; YX ip = maknode(cmode, ndp); YX if (ip == NULL) YX goto retuerr; YX fmode &= ~O_TRUNC; YX } YX else YX { YX if (fmode & O_EXCL) YX { YX error = EEXIST; YX goto bad; YX } YX fmode &= ~O_CREAT; YX } YX } YX else YX { YX ndp->ni_nameiop = LOOKUP | FOLLOW; YX ip = namei(ndp); YX if (ip == NULL) YX goto retuerr; YX } YX if ((ip->i_mode & IFMT) == IFSOCK) YX { YX error = EOPNOTSUPP; YX goto bad; YX } YX if ((ip->i_flags & APPEND) && (fmode&(FWRITE|O_APPEND)) == FWRITE) YX { YX error = EPERM; YX goto bad; YX } YX if ((fmode & O_CREAT) == 0) YX { YX if (fmode & FREAD) YX { YX if (access(ip, IREAD)) YX { YX error = u.u_error; /* XXX */ YX goto bad; YX } YX } YX if (fmode & (FWRITE | O_TRUNC)) YX { YX if ((ip->i_mode & IFMT) == IFDIR) YX { YX error = EISDIR; YX goto bad; YX } YX if (access(ip, IWRITE)) YX { YX error = u.u_error; YX goto bad; YX } YX } YX } YX if (fmode & O_TRUNC) YX itrunc(ip, (off_t)0, fmode & O_FSYNC ? IO_SYNC : 0); YX/* YX * 4.4 returns the vnode locked from vn_open which means that each caller YX * has to go and unlock it. YX * YX * 2.11 returns the inode unlocked (for now). YX*/ YX iunlock(ip); /* because namei returns a locked inode */ YX if (setjmp(&u.u_qsave)) YX { YX if ((error = u.u_error) == 0) YX error = EINTR; YX goto bad; YX } YX if (error = openi(ip, fmode)) YX goto bad; YX return(0); YXbad: YX ilock(ip); /* XXX - iput ignores locked status */ YX iput(ip); YX return(error); YXretuerr: YX return(u.u_error); /* XXX - Bletch */ YX } YX/* YX * Inode close call. Pipes and sockets do NOT enter here. This routine is YX * used by the kernel to close files it opened for itself (see kern_acct.c YX * for a good example of this). The kernel does not create sockets or pipes YX * on its own behalf. YX * YX * The difference between this routine and vn_closefile below is that vn_close YX * takes an "inode *" as a first argument and is passed the flags by the caller YX * while vn_closefile (called from the closef routine for DTYPE_INODE inodes) YX * takes a "file *" and extracts the flags from the file structure. YX */ YXvn_close(ip, flags) YX register struct inode *ip; YX int flags; YX { YX register int error; YX YX error = closei(ip, flags); YX irele(ip); /* assumes inode is unlocked */ YX return(error); YX } YX YX/* YX * File table inode close routine. This is called from 'closef()' via the YX * "Fops" table (the 'inodeops' entry). YX * YX * NOTE: pipes are a special case of inode and have their own 'pipe_close' YX * entry in the 'pipeops' table. See sys_pipe.c for pipe_close(). YX * YX * In 4.4BSD this routine called vn_close() but since 2.11 does not do the YX * writecheck counting we can skip the overhead of nesting another level down YX * and call closei() and irele() ourself. YX */ YXvn_closefile(fp) YX register struct file *fp; YX { YX register int error; YX register struct inode *ip = (struct inode *)fp->f_data; YX YX error = closei(ip, fp->f_flag); YX irele(ip); YX return(error); YX } YSHAR_EOF Ychmod 644 '/usr/src/sys/sys/vfs_vnops.c' Yfi Yif test -f '/usr/src/man/man4/fd.4' Ythen Y echo shar: "will not over-write existing file '/usr/src/man/man4/fd.4'" Yelse Ysed 's/^X//' << \SHAR_EOF > '/usr/src/man/man4/fd.4' YX.\" Copyright (c) 1990, 1991, 1993 YX.\" The Regents of the University of California. All rights reserved. YX.\" YX.\" Redistribution and use in source and binary forms, with or without YX.\" modification, are permitted provided that the following conditions YX.\" are met: YX.\" 1. Redistributions of source code must retain the above copyright YX.\" notice, this list of conditions and the following disclaimer. YX.\" 2. Redistributions in binary form must reproduce the above copyright YX.\" notice, this list of conditions and the following disclaimer in the YX.\" documentation and/or other materials provided with the distribution. YX.\" 3. All advertising materials mentioning features or use of this software YX.\" must display the following acknowledgement: YX.\" This product includes software developed by the University of YX.\" California, Berkeley and its contributors. YX.\" 4. Neither the name of the University nor the names of its contributors YX.\" may be used to endorse or promote products derived from this software YX.\" without specific prior written permission. YX.\" YX.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND YX.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE YX.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE YX.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE YX.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL YX.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS YX.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) YX.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT YX.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY YX.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF YX.\" SUCH DAMAGE. YX.\" YX.\" @(#)fd.4 8.1.1 (2.11BSD) 1997/2/4 YX.\" YX.TH FD 4 "February 4, 1997" YX.UC 4 YX.SH NAME YX.BR fd , YX.BR stdin , YX.BR stdout , YX.BR stderr YXfile descriptor files YX.SH DESCRIPTION YXThe files YX.I /dev/fd/0 YXthrough YX.I /dev/fd/# YXrefer to file descriptors which can be accessed through the file YXsystem. YXIf the file descriptor is open and the mode the file is being opened YXwith is a subset of the mode of the existing descriptor, the call: YX.sp YX.in +0.5i YXfd = open("/dev/fd/0", mode); YX.in -0.5i YX.PP YXand the call: YX.sp YX.in +0.5i YXfd = fcntl(0, F_DUPFD, 0); YX.in -0.5i YX.PP YXare equivalent. YX.PP YXOpening the files YX.IR /dev/stdin , YX.I /dev/stdout YXand YX.I /dev/stderr YXis equivalent to the following calls: YX.sp YX.in +0.5i YXfd = fcntl(STDIN_FILENO, F_DUPFD, 0); YX.br YXfd = fcntl(STDOUT_FILENO, F_DUPFD, 0); YX.br YXfd = fcntl(STDERR_FILENO, F_DUPFD, 0); YX.in -0.5i YX.PP YXFlags to the YXopen(2) YXcall other than O_RDONLY, O_WRONLY and O_RDWR YXare ignored. YX.SH FILES YX/dev/fd/# YX.br YX/dev/stdin YX.br YX/dev/stdout YX.br YX/dev/stderr YX.SH SEE ALSO YXtty(4) YSHAR_EOF Ychmod 444 '/usr/src/man/man4/fd.4' Yfi Yexit 0 Y# End of shell archive SHAR_EOF fi # end of overwriting check if test -f '/tmp/363.patch' then echo shar: will not over-write existing file "'/tmp/363.patch'" else sed 's/^Y//' << \SHAR_EOF > '/tmp/363.patch' Y*** /dev/MAKEDEV.old Sat Nov 16 13:30:30 1996 Y--- /dev/MAKEDEV Sat Feb 1 15:55:51 1997 Y*************** Y*** 4,14 **** Y # All rights reserved. The Berkeley software License Agreement Y # specifies the terms and conditions for redistribution. Y # Y! # @(#)MAKEDEV 4.27.4 (2.11BSD GTE) 1996/11/16 Y # Y # Device "make" file. Valid arguments: Y # std standard devices Y # local configuration specific devices Y # Tapes: Y # ht* unibus tu77 & te16 Y # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) Y--- 4,15 ---- Y # All rights reserved. The Berkeley software License Agreement Y # specifies the terms and conditions for redistribution. Y # Y! # @(#)MAKEDEV 4.27.5 (2.11BSD GTE) 1997/1/31 Y # Y # Device "make" file. Valid arguments: Y # std standard devices Y # local configuration specific devices Y+ # fd file descriptor driver Y # Tapes: Y # ht* unibus tu77 & te16 Y # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) Y*************** Y*** 59,64 **** Y--- 60,78 ---- Y mknod zero c 1 3 ; chmod 444 zero Y mknod tty c 9 0 ; chmod 666 tty Y mknod klog c 22 0 ; chmod 600 klog Y+ ;; Y+ Y+ fd) Y+ umask 0 Y+ rm -rf fd Y+ rm -f stdin stdout stderr Y+ mkdir fd Y+ chmod 755 fd Y+ mknod stdin c 26 0 Y+ mknod stdout c 26 1 Y+ mknod stderr c 26 2 Y+ eval `echo "" | awk '{ for (i = 0; i < 32; i++) Y+ printf("mknod fd/%d c 26 %d; ",i,i); }'` Y ;; Y Y ht*|tm*|ts*|tu*) Y*** /usr/src/man/man4/Makefile.old Fri Jan 26 00:48:32 1996 Y--- /usr/src/man/man4/Makefile Tue Feb 4 21:03:04 1997 Y*************** Y*** 14,29 **** Y # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED Y # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. Y # Y! # @(#)Makefile 5.4.1 (2.11BSD) 1996/1/26 Y # Y! MDIR= /usr/man/cat4 Y SRCS= acc.4 arp.4 bk.4 br.4 cons.4 css.4 de.4 dh.4 dhu.4 dmc.4 dr.4 dz.4 \ Y! ec.4 en.4 hk.4 ht.4 hy.4 icmp.4 idp.4 il.4 imp.4 impconf.4 inet.4 \ Y intro.4 ip.4 lo.4 lp.4 mem.4 mtio.4 networking.4 ns.4 nsip.4 \ Y null.4 pty.4 qe.4 ra.4 ram.4 rk.4 rl.4 rx.4 si.4 spp.4 sri.4 \ Y swap.4 tb.4 tcp.4 tm.4 tmscp.4 ts.4 tty.4 udp.4 vv.4 xp.4 Y OBJS= acc.0 arp.0 bk.0 br.0 cons.0 css.0 de.0 dh.0 dhu.0 dmc.0 dr.0 \ Y! dz.0 ec.0 en.0 hk.0 ht.0 hy.0 icmp.0 idp.0 il.0 imp.0 impconf.0 \ Y inet.0 intro.0 ip.0 lo.0 lp.0 mem.0 mtio.0 networking.0 ns.0 \ Y nsip.0 null.0 pty.0 qe.0 ra.0 ram.0 rk.0 rl.0 rx.0 si.0 spp.0 \ Y sri.0 swap.0 tb.0 tcp.0 tm.0 tmscp.0 ts.0 tty.0 udp.0 vv.0 xp.0 Y--- 14,30 ---- Y # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED Y # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. Y # Y! # @(#)Makefile 5.4.2 (2.11BSD) 1997/2/4 Y # Y! DESTDIR= Y! MDIR= ${DESTDIR}/usr/man/cat4 Y SRCS= acc.4 arp.4 bk.4 br.4 cons.4 css.4 de.4 dh.4 dhu.4 dmc.4 dr.4 dz.4 \ Y! ec.4 en.4 fd.4 hk.4 ht.4 hy.4 icmp.4 idp.4 il.4 imp.4 impconf.4 inet.4 \ Y intro.4 ip.4 lo.4 lp.4 mem.4 mtio.4 networking.4 ns.4 nsip.4 \ Y null.4 pty.4 qe.4 ra.4 ram.4 rk.4 rl.4 rx.4 si.4 spp.4 sri.4 \ Y swap.4 tb.4 tcp.4 tm.4 tmscp.4 ts.4 tty.4 udp.4 vv.4 xp.4 Y OBJS= acc.0 arp.0 bk.0 br.0 cons.0 css.0 de.0 dh.0 dhu.0 dmc.0 dr.0 \ Y! dz.0 ec.0 en.0 fd.0 hk.0 ht.0 hy.0 icmp.0 idp.0 il.0 imp.0 impconf.0 \ Y inet.0 intro.0 ip.0 lo.0 lp.0 mem.0 mtio.0 networking.0 ns.0 \ Y nsip.0 null.0 pty.0 qe.0 ra.0 ram.0 rk.0 rl.0 rx.0 si.0 spp.0 \ Y sri.0 swap.0 tb.0 tcp.0 tm.0 tmscp.0 ts.0 tty.0 udp.0 vv.0 xp.0 Y*************** Y*** 33,56 **** Y .4.0: Y ${DESTDIR}/usr/man/manroff $*.4 > $*.0 Y Y! all: _make_01 Y Y- _make_01: ${OBJS} Y- Y clean: FRC Y rm -f ${OBJS} Y Y! install: _make_01 Y! install -c -o bin -g bin -m 444 ${OBJS} ${DESTDIR}${MDIR} Y! rm -f ${DESTDIR}/${MDIR}/dvhp.0 Y! ln ${DESTDIR}${MDIR}/xp.0 ${DESTDIR}/${MDIR}/dvhp.0 Y! rm -f ${DESTDIR}/${MDIR}/hp.0 Y! ln ${DESTDIR}${MDIR}/xp.0 ${DESTDIR}/${MDIR}/hp.0 Y! rm -f ${DESTDIR}/${MDIR}/rm.0 Y! ln ${DESTDIR}${MDIR}/xp.0 ${DESTDIR}/${MDIR}/rm.0 Y! rm -f ${DESTDIR}/${MDIR}/rp.0 Y! ln ${DESTDIR}${MDIR}/xp.0 ${DESTDIR}/${MDIR}/rp.0 Y! rm -f ${DESTDIR}/${MDIR}/kmem.0 Y! ln ${DESTDIR}${MDIR}/mem.0 ${DESTDIR}/${MDIR}/kmem.0 Y Y FRC: Y--- 34,59 ---- Y .4.0: Y ${DESTDIR}/usr/man/manroff $*.4 > $*.0 Y Y! all: ${OBJS} Y Y clean: FRC Y rm -f ${OBJS} Y Y! install: all Y! install -c -o bin -g bin -m 444 ${OBJS} ${MDIR} Y! rm -f ${MDIR}/dvhp.0 Y! ln ${MDIR}/xp.0 ${MDIR}/dvhp.0 Y! rm -f ${MDIR}/hp.0 Y! ln ${MDIR}/xp.0 ${MDIR}/hp.0 Y! rm -f ${MDIR}/rm.0 Y! ln ${MDIR}/xp.0 ${MDIR}/rm.0 Y! rm -f ${MDIR}/rp.0 Y! ln ${MDIR}/xp.0 ${MDIR}/rp.0 Y! rm -f ${MDIR}/kmem.0 Y! ln ${MDIR}/mem.0 ${MDIR}/kmem.0 Y! rm -f ${MDIR}/stdin.0 rm -f ${MDIR}/stderr.0 rm -f ${MDIR}/stdout.0 Y! ln ${MDIR}/fd.0 ${MDIR}/stdin.0 Y! ln ${MDIR}/fd.0 ${MDIR}/stderr.0 Y! ln ${MDIR}/fd.0 ${MDIR}/stdout.0 Y Y FRC: Y*** /usr/doc/2.10/setup.2.11/1.t.old Mon Nov 27 23:32:43 1995 Y--- /usr/doc/2.10/setup.2.11/1.t Fri Jan 24 18:08:32 1997 Y*************** Y*** 2,8 **** Y .\" All rights reserved. The Berkeley software License Agreement Y .\" specifies the terms and conditions for redistribution. Y .\" Y! .\" @(#)1.t 2.4 (GTE) 1995/11/27 Y .\" Y .ds lq `` Y .ds rq '' Y--- 2,8 ---- Y .\" All rights reserved. The Berkeley software License Agreement Y .\" specifies the terms and conditions for redistribution. Y .\" Y! .\" @(#)1.t 2.5 (GTE) 1997/1/24 Y .\" Y .ds lq `` Y .ds rq '' Y*************** Y*** 180,193 **** Y _ Y 0 512 1 primary tape boot block Y 512 1 boot block (some tape boot ROMs go for this copy) Y! 512 14 standalone \fBboot\fP program Y! 1 1024 23 standalone \fBdisklabel\fP Y! 2 1024 28 standalone \fBmkfs\fP(8) Y! 3 1024 27 standalone \fBrestor\fP(8) Y! 4 1024 26 standalone \fBicheck\fP(8) Y! 5 10240 300 \fIdump\fP of ``root'' file system Y! 6 10240 2300 \fItar\fP dump of /usr, excepting /usr/src Y! 7 10240 500 \fItar\fP dump of /usr/src/include and /usr/src/sys Y .TE Y Y TAPE 2: Y--- 180,193 ---- Y _ Y 0 512 1 primary tape boot block Y 512 1 boot block (some tape boot ROMs go for this copy) Y! 512 69 standalone \fBboot\fP program Y! 1 1024 37 standalone \fBdisklabel\fP Y! 2 1024 33 standalone \fBmkfs\fP(8) Y! 3 1024 35 standalone \fBrestor\fP(8) Y! 4 1024 32 standalone \fBicheck\fP(8) Y! 5 10240 285 \fIdump\fP of ``root'' file system Y! 6 10240 3368 \fItar\fP dump of /usr, excepting /usr/src Y! 7 10240 519 \fItar\fP dump of /usr/src/include and /usr/src/sys Y .TE Y Y TAPE 2: Y*************** Y*** 195,201 **** Y n n n l. Y Tape file Record size Records\(ua Contents Y _ Y! 0 10240 4500 \fItar\fP dump of /usr/src, excepting include and sys Y .TE Y .DE Y .KE Y--- 195,201 ---- Y n n n l. Y Tape file Record size Records\(ua Contents Y _ Y! 0 10240 4092 \fItar\fP dump of /usr/src, excepting include and sys Y .TE Y .DE Y .KE Y*************** Y*** 216,221 **** Y--- 216,222 ---- Y l l. Y RK06, RK07 disks hk Y RL01, RL02 disks rl Y+ RK05 rk Y MSCP disks ra Y RM02/03/05 xp Y RP04/05/06 xp Y*** /usr/src/sys/conf/Make.nsunix.old Thu Jun 20 20:00:37 1996 Y--- /usr/src/sys/conf/Make.nsunix Fri Jan 31 08:42:41 1997 Y*************** Y*** 9,15 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.7 (2.11BSD GTE) 1996/6/8 Y # Y ######################################################### Y # Networking, separate I/D kernel # Y--- 9,15 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.8 (2.11BSD GTE) 1997/1/31 Y # Y ######################################################### Y # Networking, separate I/D kernel # Y*************** Y*** 63,69 **** Y tm.o ts.o tty.o tty_conf.o tty_subr.o tty_tb.o ufs_alloc.o \ Y ufs_bio.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y vm_proc.o vm_sched.o vm_swap.o xp.o quota_subr.o Y! OV1= sys_generic.o ufs_syscalls.o ufs_syscalls2.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= kern_time.o sys_process.o ufs_mount.o ufs_subr.o uipc_syscalls.o Y OV4= dkbad.o kern_sig.o mem.o subr_xxx.o trap.o tty_pty.o tty_tty.o Y--- 63,69 ---- Y tm.o ts.o tty.o tty_conf.o tty_subr.o tty_tb.o ufs_alloc.o \ Y ufs_bio.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y vm_proc.o vm_sched.o vm_swap.o xp.o quota_subr.o Y! OV1= sys_generic.o ufs_syscalls.o ufs_syscalls2.o vfs_vnops.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= kern_time.o sys_process.o ufs_mount.o ufs_subr.o uipc_syscalls.o Y OV4= dkbad.o kern_sig.o mem.o subr_xxx.o trap.o tty_pty.o tty_tty.o Y*** /usr/src/sys/conf/Make.sunix.old Fri Jan 24 14:53:19 1997 Y--- /usr/src/sys/conf/Make.sunix Fri Jan 31 08:33:06 1997 Y*************** Y*** 1,3 **** Y--- 1,4 ---- Y+ OPTS=-DGENERIC -DSOFUB_MAP Y # Y # Copyright (c) 1988 Regents of the University of California. Y # All rights reserved. Y*************** Y*** 9,15 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.8 (2.11BSD GTE) 1997/1/21 Y # Y ######################################################### Y # Non-network, but separate I/D kernel # Y--- 10,16 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.9 (2.11BSD GTE) 1997/1/31 Y # Y ######################################################### Y # Non-network, but separate I/D kernel # Y*************** Y*** 52,58 **** Y tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ Y ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y xp.o Y! OV1= sys_generic.o ufs_syscalls.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= clock.o cons.o kern_time.o \ Y machdep2.o quota_sys.o subr_prf.o sys_process.o \ Y--- 53,59 ---- Y tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ Y ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y xp.o Y! OV1= sys_generic.o ufs_syscalls.o vfs_vnops.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= clock.o cons.o kern_time.o \ Y machdep2.o quota_sys.o subr_prf.o sys_process.o \ Y*** /usr/src/sys/conf/Make.unix.old Thu Jun 20 20:00:48 1996 Y--- /usr/src/sys/conf/Make.unix Fri Jan 31 08:43:12 1997 Y*************** Y*** 9,15 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.6 (2.11BSD GTE) 1996/6/8 Y # Y ######################################################### Y # Non-networking, non-separate I/D kernel # Y--- 9,15 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.7 (2.11BSD GTE) 1997/1/31 Y # Y ######################################################### Y # Non-networking, non-separate I/D kernel # Y*************** Y*** 61,66 **** Y--- 61,67 ---- Y tty_conf.o tty_pty.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o \ Y ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \ Y ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o \ Y+ vfs_vnops.o \ Y vm_proc.o vm_sched.o vm_swap.o vm_swp.o vm_text.o xp.o subr_log.o \ Y kern_sysctl.o ingreslock.o ufs_disksubr.o Y Y*** /usr/src/sys/conf/Make.sys.old Mon Jun 17 20:04:02 1996 Y--- /usr/src/sys/conf/Make.sys Fri Jan 31 21:03:43 1997 Y*************** Y*** 9,15 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.3 (2.11BSD GTE) 1996/6/8 Y # Y S= ../sys Y VPATH= ../sys Y--- 9,15 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.4 (2.11BSD GTE) 1997/1/31 Y # Y S= ../sys Y VPATH= ../sys Y*************** Y*** 32,37 **** Y--- 32,38 ---- Y ${S}/ufs_mount.c ${S}/ufs_namei.c ${S}/ufs_subr.c \ Y ${S}/ufs_disksubr.c ${S}/ufs_syscalls2.c \ Y ${S}/ufs_syscalls.c ${S}/uipc_syscalls.c ${S}/vm_proc.c \ Y+ ${S}/vfs_vnops.c \ Y ${S}/vm_sched.c ${S}/vm_swap.c ${S}/vm_swp.c ${S}/vm_text.c Y OBJS= init_main.o init_sysent.o kern_acct.o kern_clock.o \ Y kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o \ Y*************** Y*** 45,50 **** Y--- 46,52 ---- Y ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o \ Y ufs_subr.o ufs_syscalls.o uipc_syscalls.o vm_proc.o vm_sched.o \ Y ufs_disksubr.o ufs_syscalls2.o \ Y+ vfs_vnops.o \ Y vm_swap.o vm_swp.o vm_text.o Y Y .c.o: Y*** /usr/src/sys/sys/kern_descrip.c.old Tue Dec 20 08:44:20 1994 Y--- /usr/src/sys/sys/kern_descrip.c Sat Feb 1 16:42:29 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_descrip.c 1.3 (2.11BSD GTE) 11/26/94 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_descrip.c 1.4 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 19,24 **** Y--- 19,25 ---- Y #include "socket.h" Y #include "socketvar.h" Y #endif Y+ #include <syslog.h> Y Y /* Y * Descriptor management. Y*************** Y*** 65,75 **** Y u.u_r.r_val1 = uap->j; Y if (uap->i == uap->j) Y return; Y! if (u.u_ofile[uap->j]) { Y! closef(u.u_ofile[uap->j]); Y! if (u.u_error) Y! return; Y! } Y dupit(uap->j, fp, u.u_pofile[uap->i] &~ UF_EXCLOSE); Y } Y Y--- 66,76 ---- Y u.u_r.r_val1 = uap->j; Y if (uap->i == uap->j) Y return; Y! if (u.u_ofile[uap->j]) Y! /* Y! * dup2 must succeed even if the close has an error. Y! */ Y! (void) closef(u.u_ofile[uap->j]); Y dupit(uap->j, fp, u.u_pofile[uap->i] &~ UF_EXCLOSE); Y } Y Y*************** Y*** 225,231 **** Y u.u_ofile[uap->i] = NULL; Y while (u.u_lastfile >= 0 && u.u_ofile[u.u_lastfile] == NULL) Y u.u_lastfile--; Y! closef(fp); Y /* WHAT IF u.u_error ? */ Y } Y Y--- 226,232 ---- Y u.u_ofile[uap->i] = NULL; Y while (u.u_lastfile >= 0 && u.u_ofile[u.u_lastfile] == NULL) Y u.u_lastfile--; Y! u.u_error = closef(fp); Y /* WHAT IF u.u_error ? */ Y } Y Y*************** Y*** 284,302 **** Y return (-1); Y } Y Y- /* moved, for supervisory networking, to sys_net.c */ Y- #ifdef notdef Y- ufavail() Y- { Y- register int i, avail = 0; Y- Y- for (i = 0; i < NOFILE; i++) Y- if (u.u_ofile[i] == NULL) Y- avail++; Y- return (avail); Y- } Y- #endif Y- Y struct file *lastf; Y /* Y * Allocate a user file descriptor Y--- 285,290 ---- Y*************** Y*** 359,373 **** Y closef(fp) Y register struct file *fp; Y { Y Y if (fp == NULL) Y! return; Y if (fp->f_count > 1) { Y fp->f_count--; Y! return; Y } Y! (*Fops[fp->f_type]->fo_close)(fp); Y fp->f_count = 0; Y } Y Y /* Y--- 347,367 ---- Y closef(fp) Y register struct file *fp; Y { Y+ int error; Y Y if (fp == NULL) Y! return(0); Y if (fp->f_count > 1) { Y fp->f_count--; Y! return(0); Y } Y! Y! if ((fp->f_flag & (FSHLOCK|FEXLOCK)) && fp->f_type == DTYPE_INODE) Y! ino_unlock(fp, FSHLOCK|FEXLOCK); Y! Y! error = (*Fops[fp->f_type]->fo_close)(fp); Y fp->f_count = 0; Y+ return(error); Y } Y Y /* Y*************** Y*** 400,403 **** Y--- 394,507 ---- Y (fp->f_flag & FSHLOCK) && (uap->how & LOCK_SH)) Y return; Y u.u_error = ino_lock(fp, uap->how); Y+ } Y+ Y+ /* Y+ * File Descriptor pseudo-device driver (/dev/fd/). Y+ * Y+ * Opening minor device N dup()s the file (if any) connected to file Y+ * descriptor N belonging to the calling process. Note that this driver Y+ * consists of only the ``open()'' routine, because all subsequent Y+ * references to this file will be direct to the other driver. Y+ */ Y+ /* ARGSUSED */ Y+ fdopen(dev, mode, type) Y+ dev_t dev; Y+ int mode, type; Y+ { Y+ Y+ /* Y+ * XXX Kludge: set u.u_dupfd to contain the value of the Y+ * the file descriptor being sought for duplication. The error Y+ * return ensures that the vnode for this device will be released Y+ * by vn_open. Open will detect this special error and take the Y+ * actions in dupfdopen below. Other callers of vn_open will Y+ * simply report the error. Y+ */ Y+ u.u_dupfd = minor(dev); Y+ return(ENODEV); Y+ } Y+ Y+ /* Y+ * Duplicate the specified descriptor to a free descriptor. Y+ */ Y+ dupfdopen(indx, dfd, mode, error) Y+ register int indx, dfd; Y+ int mode; Y+ int error; Y+ { Y+ register register struct file *wfp; Y+ struct file *fp; Y+ Y+ /* Y+ * If the to-be-dup'd fd number is greater than the allowed number Y+ * of file descriptors, or the fd to be dup'd has already been Y+ * closed, reject. Note, check for new == old is necessary as Y+ * falloc could allocate an already closed to-be-dup'd descriptor Y+ * as the new descriptor. Y+ */ Y+ fp = u.u_ofile[indx]; Y+ if (dfd >= NOFILE || (wfp = u.u_ofile[dfd]) == NULL || fp == wfp) Y+ return(EBADF); Y+ Y+ /* Y+ * There are two cases of interest here. Y+ * Y+ * For ENODEV simply dup (dfd) to file descriptor Y+ * (indx) and return. Y+ * Y+ * For ENXIO steal away the file structure from (dfd) and Y+ * store it in (indx). (dfd) is effectively closed by Y+ * this operation. Y+ * Y+ * NOTE: ENXIO only comes out of the 'portal fs' code of 4.4 - since Y+ * 2.11BSD does not implement the portal fs the code is ifdef'd out Y+ * and a short message output. Y+ * Y+ * Any other error code is just returned. Y+ */ Y+ switch (error) { Y+ case ENODEV: Y+ /* Y+ * Check that the mode the file is being opened for is a Y+ * subset of the mode of the existing descriptor. Y+ */ Y+ if (((mode & (FREAD|FWRITE)) | wfp->f_flag) != wfp->f_flag) Y+ return(EACCES); Y+ u.u_ofile[indx] = wfp; Y+ u.u_pofile[indx] = u.u_pofile[dfd]; Y+ wfp->f_count++; Y+ if (indx > u.u_lastfile) Y+ u.u_lastfile = indx; Y+ return(0); Y+ #ifdef haveportalfs Y+ case ENXIO: Y+ /* Y+ * Steal away the file pointer from dfd, and stuff it into indx. Y+ */ Y+ fdp->fd_ofiles[indx] = fdp->fd_ofiles[dfd]; Y+ fdp->fd_ofiles[dfd] = NULL; Y+ fdp->fd_ofileflags[indx] = fdp->fd_ofileflags[dfd]; Y+ fdp->fd_ofileflags[dfd] = 0; Y+ /* Y+ * Complete the clean up of the filedesc structure by Y+ * recomputing the various hints. Y+ */ Y+ if (indx > fdp->fd_lastfile) Y+ fdp->fd_lastfile = indx; Y+ else Y+ while (fdp->fd_lastfile > 0 && Y+ fdp->fd_ofiles[fdp->fd_lastfile] == NULL) Y+ fdp->fd_lastfile--; Y+ if (dfd < fdp->fd_freefile) Y+ fdp->fd_freefile = dfd; Y+ return (0); Y+ #else Y+ log(LOG_NOTICE, "dupfdopen"); Y+ /* FALLTHROUGH */ Y+ #endif Y+ default: Y+ return(error); Y+ } Y+ /* NOTREACHED */ Y } Y*** /usr/src/sys/sys/kern_exec.c.old Fri Jan 24 14:53:53 1997 Y--- /usr/src/sys/sys/kern_exec.c Thu Jan 30 14:02:35 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_exec.c 1.5 (2.11BSD GTE) 1997/1/18 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_exec.c 1.6 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 414,429 **** Y u.u_sigsp = 0; Y u.u_sigonstack = 0; Y Y- /* Y- * for (nc = u.u_lastfile; nc >= 0; --nc) { Y- * if (u.u_pofile[nc] & UF_EXCLOSE) { Y- * closef(u.u_ofile[nc]); Y- * u.u_ofile[nc] = NULL; Y- * u.u_pofile[nc] = 0; Y- * } Y- * u.u_pofile[nc] &= ~UF_MAPPED; Y- * } Y- */ Y { Y register int cnt; Y register struct file **ofilep = u.u_ofile; Y--- 414,419 ---- Y*************** Y*** 431,437 **** Y Y for (cnt = u.u_lastfile;cnt >= 0; cnt--, ofilep++, pofilep++) Y if (*pofilep & UF_EXCLOSE) { Y! closef(*ofilep); Y *ofilep = NULL; Y *pofilep = 0; Y } Y--- 421,427 ---- Y Y for (cnt = u.u_lastfile;cnt >= 0; cnt--, ofilep++, pofilep++) Y if (*pofilep & UF_EXCLOSE) { Y! (void) closef(*ofilep); Y *ofilep = NULL; Y *pofilep = 0; Y } Y*** /usr/src/sys/sys/kern_exit.c.old Fri Mar 17 21:01:33 1995 Y--- /usr/src/sys/sys/kern_exit.c Thu Jan 30 14:03:30 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_exit.c 2.1 (2.11BSD GTE) 2/14/95 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)kern_exit.c 2.2 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 63,69 **** Y f = u.u_ofile[i]; Y u.u_ofile[i] = NULL; Y u.u_pofile[i] = 0; Y! closef(f); Y } Y ilock(u.u_cdir); Y iput(u.u_cdir); Y--- 63,69 ---- Y f = u.u_ofile[i]; Y u.u_ofile[i] = NULL; Y u.u_pofile[i] = 0; Y! (void) closef(f); Y } Y ilock(u.u_cdir); Y iput(u.u_cdir); Y*** /usr/src/sys/sys/sys_generic.c.old Tue Dec 20 08:44:41 1994 Y--- /usr/src/sys/sys/sys_generic.c Thu Jan 30 14:49:22 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_generic.c 1.4 (2.11BSD GTE) 11/26/94 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_generic.c 1.5 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 512,520 **** Y socls(fp) Y register struct file *fp; Y { Y #ifdef INET Y! return (SOCLOSE((struct socket *)fp->f_socket)); Y #else Y! return (EOPNOTSUPP); Y #endif Y } Y--- 512,525 ---- Y socls(fp) Y register struct file *fp; Y { Y+ register int error = 0; Y+ Y #ifdef INET Y! if (fp->f_data) Y! error = SOCLOSE((struct socket *)fp->f_data); Y! fp->f_data = 0; Y #else Y! error = EOPNOTSUPP; Y #endif Y+ return(error); Y } Y*** /usr/src/sys/sys/sys_inode.c.old Sat Sep 28 20:39:15 1996 Y--- /usr/src/sys/sys/sys_inode.c Tue Feb 4 20:01:28 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_inode.c 1.8 (2.11BSD GTE) 1996/9/19 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_inode.c 1.9 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 28,36 **** Y #include "quota.h" Y #endif Y Y! int ino_rw(), ino_ioctl(), ino_select(), ino_close(); Y struct fileops inodeops = Y! { ino_rw, ino_ioctl, ino_select, ino_close }; Y Y ino_rw(fp, uio) Y struct file *fp; Y--- 28,38 ---- Y #include "quota.h" Y #endif Y Y! extern int vn_closefile(); Y! int ino_rw(), ino_ioctl(), ino_select(); Y! Y struct fileops inodeops = Y! { ino_rw, ino_ioctl, ino_select, vn_closefile }; Y Y ino_rw(fp, uio) Y struct file *fp; Y*************** Y*** 114,124 **** Y int error = 0; Y int flags; Y Y! #ifdef DIAGNOSTIC Y! if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE) Y! panic("rwip"); Y! #endif Y! if (uio->uio_offset < 0) Y return (EINVAL); Y type = ip->i_mode&IFMT; Y /* Y--- 116,122 ---- Y int error = 0; Y int flags; Y Y! if (uio->uio_offset < 0) Y return (EINVAL); Y type = ip->i_mode&IFMT; Y /* Y*************** Y*** 433,503 **** Y return (0); Y } Y Y! ino_close(fp) Y! register struct file *fp; Y! { Y! register struct inode *ip = (struct inode *)fp->f_data; Y register struct mount *mp; Y! int flag, mode; Y! dev_t dev; Y! int (*cfunc)(); Y Y- if (fp->f_flag & (FSHLOCK | FEXLOCK)) Y- ino_unlock(fp, FSHLOCK | FEXLOCK); Y- flag = fp->f_flag; Y- dev = (dev_t)ip->i_rdev; Y mode = ip->i_mode & IFMT; Y! ilock(ip); Y! if (fp->f_type == DTYPE_PIPE) { Y! if (ip->i_rsel) { Y! selwakeup(ip->i_rsel, (long)(ip->i_flag & IRCOLL)); Y! ip->i_rsel = 0; Y! ip->i_flag &= ~IRCOLL; Y! } Y! if (ip->i_wsel) { Y! selwakeup(ip->i_wsel, (long)(ip->i_flag & IWCOLL)); Y! ip->i_wsel = 0; Y! ip->i_flag &= ~IWCOLL; Y! } Y! ip->i_mode &= ~(IREAD|IWRITE); Y! wakeup((caddr_t)ip+1); Y! wakeup((caddr_t)ip+2); Y! } Y! iput(ip); Y! fp->f_data = (caddr_t) 0; /* XXX */ Y! switch (mode) { Y Y! case IFCHR: Y! cfunc = cdevsw[major(dev)].d_close; Y! break; Y! Y! case IFBLK: Y /* Y * We don't want to really close the device if it is mounted Y */ Y /* MOUNT TABLE SHOULD HOLD INODE */ Y! for (mp = mount; mp < &mount[NMOUNT]; mp++) Y! if (mp->m_inodp != NULL && mp->m_dev == dev) Y! return; Y! cfunc = bdevsw[major(dev)].d_close; Y! break; Y! Y! default: Y! return; Y! } Y /* Y * Check that another inode for the same device isn't active. Y * This is because the same device can be referenced by two Y * different inodes. Y */ Y! for (fp = file; fp < fileNFILE; fp++) { Y if (fp->f_type != DTYPE_INODE) Y continue; Y if (fp->f_count && (ip = (struct inode *)fp->f_data) && Y ip->i_rdev == dev && (ip->i_mode&IFMT) == mode) Y! return; Y! } Y! if (mode == IFBLK) { Y /* Y * On last close of a block device (that isn't mounted) Y * we must invalidate any in core blocks, so that Y--- 431,489 ---- Y return (0); Y } Y Y! /* Y! * This routine, like its counterpart openi(), calls the device driver for Y! * special (IBLK, ICHR) files. Normal files simply return early (the default Y! * case in the switch statement). Pipes and sockets do NOT come here because Y! * they have their own close routines. Y! */ Y! Y! closei(ip, flag) Y! register struct inode *ip; Y! int flag; Y! { Y register struct mount *mp; Y! register struct file *fp; Y! int mode, error; Y! dev_t dev; Y! int (*cfunc)(); Y Y mode = ip->i_mode & IFMT; Y! dev = ip->i_rdev; Y Y! switch (mode) Y! { Y! case IFCHR: Y! cfunc = cdevsw[major(dev)].d_close; Y! break; Y! case IFBLK: Y /* Y * We don't want to really close the device if it is mounted Y */ Y /* MOUNT TABLE SHOULD HOLD INODE */ Y! for (mp = mount; mp < &mount[NMOUNT]; mp++) Y! if (mp->m_inodp != NULL && mp->m_dev == dev) Y! return; Y! cfunc = bdevsw[major(dev)].d_close; Y! break; Y! default: Y! return(0); Y! } Y /* Y * Check that another inode for the same device isn't active. Y * This is because the same device can be referenced by two Y * different inodes. Y */ Y! for (fp = file; fp < fileNFILE; fp++) Y! { Y if (fp->f_type != DTYPE_INODE) Y continue; Y if (fp->f_count && (ip = (struct inode *)fp->f_data) && Y ip->i_rdev == dev && (ip->i_mode&IFMT) == mode) Y! return(0); Y! } Y! if (mode == IFBLK) Y! { Y /* Y * On last close of a block device (that isn't mounted) Y * we must invalidate any in core blocks, so that Y*************** Y*** 505,522 **** Y */ Y bflush(dev); Y binval(dev); Y! } Y! if (setjmp(&u.u_qsave)) { Y /* Y * If device close routine is interrupted, Y * must return so closef can clean up. Y */ Y! if (u.u_error == 0) Y! u.u_error = EINTR; /* ??? */ Y! return; Y } Y- (*cfunc)(dev, flag, mode); Y- } Y Y /* Y * Place an advisory lock on an inode. Y--- 491,517 ---- Y */ Y bflush(dev); Y binval(dev); Y! } Y! /* Y! * NOTE: none of the device drivers appear to either set u_error OR return Y! * anything meaningful from their close routines. It's a good thing Y! * programs don't bother checking the error status on close() calls. Y! * Apparently the only time "errno" is meaningful after a "close" is Y! * when the process is interrupted. Y! */ Y! if (setjmp(&u.u_qsave)) Y! { Y /* Y * If device close routine is interrupted, Y * must return so closef can clean up. Y */ Y! if ((error = u.u_error) == 0) Y! error = EINTR; Y! } Y! else Y! error = (*cfunc)(dev, flag, mode); Y! return(error); Y } Y Y /* Y * Place an advisory lock on an inode. Y*************** Y*** 574,583 **** Y sleep((caddr_t)&ip->i_shlockc, PLOCK); Y goto again; Y } Y- #ifdef DIAGNOSTIC Y- if (fp->f_flag & FEXLOCK) Y- panic("ino_lock"); Y- #endif Y if (cmd & LOCK_EX) { Y cmd &= ~LOCK_SH; Y ip->i_exlockc++; Y--- 569,574 ---- Y*************** Y*** 607,614 **** Y return; Y flags = ip->i_flag; Y if (kind & FSHLOCK) { Y- if ((flags & ISHLOCK) == 0) Y- panic("SHLOCK"); Y if (--ip->i_shlockc == 0) { Y ip->i_flag &= ~ISHLOCK; Y if (flags & ILWAIT) Y--- 598,603 ---- Y*************** Y*** 617,624 **** Y fp->f_flag &= ~FSHLOCK; Y } Y if (kind & FEXLOCK) { Y- if ((flags & IEXLOCK) == 0) Y- panic("EXLOCK"); Y if (--ip->i_exlockc == 0) { Y ip->i_flag &= ~(IEXLOCK|ILWAIT); Y if (flags & ILWAIT) Y--- 606,611 ---- Y*** /usr/src/sys/sys/sys_kern.c.old Fri Jan 24 14:53:47 1997 Y--- /usr/src/sys/sys/sys_kern.c Thu Jan 30 14:05:25 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * sys_kern.c 1.1 (2.11BSD) 1997/1/18 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * sys_kern.c 1.2 (2.11BSD) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 169,173 **** Y struct file *fp; Y { Y --fp->f_msgcount; Y! closef(fp); Y } Y--- 169,173 ---- Y struct file *fp; Y { Y --fp->f_msgcount; Y! return(closef(fp)); Y } Y*** /usr/src/sys/sys/sys_pipe.c.old Fri Jan 24 14:54:03 1997 Y--- /usr/src/sys/sys/sys_pipe.c Tue Feb 4 20:02:07 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_pipe.c 1.3 (2.11BSD GTE) 1997/1/18 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)sys_pipe.c 1.4 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 16,25 **** Y #include "mount.h" Y #include "uio.h" Y Y! extern int ino_ioctl(), ino_close(); Y! int pipe_rw(), pipe_select(); Y struct fileops pipeops = Y! { pipe_rw, ino_ioctl, pipe_select, ino_close }; Y Y /* Y * The sys-pipe entry. Y--- 16,25 ---- Y #include "mount.h" Y #include "uio.h" Y Y! extern int ino_ioctl(); Y! int pipe_rw(), pipe_select(), pipe_close(); Y struct fileops pipeops = Y! { pipe_rw, ino_ioctl, pipe_select, pipe_close }; Y Y /* Y * The sys-pipe entry. Y*************** Y*** 122,128 **** Y if (fp->f_flag & FNONBLOCK) Y return (EWOULDBLOCK); Y ip->i_mode |= IREAD; Y! sleep((caddr_t)ip+2, PPIPE); Y goto loop; Y } Y Y--- 122,128 ---- Y if (fp->f_flag & FNONBLOCK) Y return (EWOULDBLOCK); Y ip->i_mode |= IREAD; Y! sleep((caddr_t)ip+4, PPIPE); Y goto loop; Y } Y Y*************** Y*** 139,145 **** Y ip->i_size = 0; Y if (ip->i_mode & IWRITE) { Y ip->i_mode &= ~IWRITE; Y! wakeup((caddr_t)ip+1); Y } Y if (ip->i_wsel) { Y selwakeup(ip->i_wsel, (long)(ip->i_flag & IWCOLL)); Y--- 139,145 ---- Y ip->i_size = 0; Y if (ip->i_mode & IWRITE) { Y ip->i_mode &= ~IWRITE; Y! wakeup((caddr_t)ip+2); Y } Y if (ip->i_wsel) { Y selwakeup(ip->i_wsel, (long)(ip->i_flag & IWCOLL)); Y*************** Y*** 192,198 **** Y if (ip->i_size >= MAXPIPSIZ) { Y ip->i_mode |= IWRITE; Y IUNLOCK(ip); Y! sleep((caddr_t)ip+1, PPIPE); Y ILOCK(ip); Y goto loop; Y } Y--- 192,198 ---- Y if (ip->i_size >= MAXPIPSIZ) { Y ip->i_mode |= IWRITE; Y IUNLOCK(ip); Y! sleep((caddr_t)ip+2, PPIPE); Y ILOCK(ip); Y goto loop; Y } Y*************** Y*** 209,215 **** Y error = rwip(ip, uio, flag); Y if (ip->i_mode&IREAD) { Y ip->i_mode &= ~IREAD; Y! wakeup((caddr_t)ip+2); Y } Y if (ip->i_rsel) { Y selwakeup(ip->i_rsel, (long)(ip->i_flag & IRCOLL)); Y--- 209,215 ---- Y error = rwip(ip, uio, flag); Y if (ip->i_mode&IREAD) { Y ip->i_mode &= ~IREAD; Y! wakeup((caddr_t)ip+4); Y } Y if (ip->i_rsel) { Y selwakeup(ip->i_rsel, (long)(ip->i_flag & IRCOLL)); Y*************** Y*** 258,260 **** Y--- 258,302 ---- Y IUNLOCK(ip); Y return(retval); Y } Y+ Y+ /* Y+ * This routine was pulled out of what used to be called 'ino_close'. Doing Y+ * so saved a test of the inode belonging to a pipe. We know this is a pipe Y+ * because the inode type was DTYPE_PIPE. The dispatch in closef() can come Y+ * directly here instead of the general inode close routine. Y+ * Y+ * This routine frees the inode by calling 'irele'. The inode must be Y+ * unlocked prior to calling this routine. Y+ */ Y+ Y+ pipe_close(fp) Y+ struct file *fp; Y+ { Y+ register struct inode *ip = (struct inode *)fp->f_data; Y+ Y+ #ifdef DIAGNOSTIC Y+ if ((ip->i_flag & IPIPE) == 0) Y+ panic("pipe_close !IPIPE"); Y+ #endif Y+ if (ip->i_rsel) Y+ { Y+ selwakeup(ip->i_rsel, (long)(ip->i_flag & IRCOLL)); Y+ ip->i_rsel = 0; Y+ ip->i_flag &= ~IRCOLL; Y+ } Y+ if (ip->i_wsel) Y+ { Y+ selwakeup(ip->i_wsel, (long)(ip->i_flag & IWCOLL)); Y+ ip->i_wsel = 0; Y+ ip->i_flag &= ~IWCOLL; Y+ } Y+ ip->i_mode &= ~(IREAD|IWRITE); Y+ wakeup((caddr_t)ip+2); Y+ wakeup((caddr_t)ip+4); Y+ Y+ /* Y+ * And finally decrement the reference count and (likely) release the inode. Y+ */ Y+ irele(ip); Y+ return(0); Y+ } Y*** /usr/src/sys/sys/ufs_namei.c.old Sat Sep 28 20:39:43 1996 Y--- /usr/src/sys/sys/ufs_namei.c Thu Jan 30 10:24:24 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)ufs_namei.c 1.4 (2.11BSD GTE) 1996/9/13 Y */ Y #include "param.h" Y #include "../machine/seg.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)ufs_namei.c 1.5 (2.11BSD GTE) 1997/1/30 Y */ Y #include "param.h" Y #include "../machine/seg.h" Y*************** Y*** 161,167 **** Y (u_int *)0); Y if (error) { Y u.u_error = error; Y! return (NULL); Y } Y Y /* Y--- 161,167 ---- Y (u_int *)0); Y if (error) { Y u.u_error = error; Y! goto retNULL; Y } Y Y /* Y*************** Y*** 232,238 **** Y u.u_error = EISDIR; Y goto bad; Y } Y! return (dp); Y } Y Y /* Y--- 232,238 ---- Y u.u_error = EISDIR; Y goto bad; Y } Y! goto retDP; Y } Y Y /* Y*************** Y*** 542,548 **** Y * directory inode in ndp->ni_pdir. Y */ Y ndp->ni_pdir = dp; Y! return (NULL); Y } Y u.u_error = ENOENT; Y goto bad; Y--- 542,548 ---- Y * directory inode in ndp->ni_pdir. Y */ Y ndp->ni_pdir = dp; Y! goto retNULL; Y } Y u.u_error = ENOENT; Y goto bad; Y*************** Y*** 628,634 **** Y } Y } Y } Y! return (dp); Y } Y Y /* Y--- 628,634 ---- Y } Y } Y } Y! goto retDP; Y } Y Y /* Y*************** Y*** 682,688 **** Y iput(ndp->ni_pdir); Y goto bad; Y } Y! return (dp); Y } Y Y /* Y--- 682,688 ---- Y iput(ndp->ni_pdir); Y goto bad; Y } Y! goto retDP; Y } Y Y /* Y*************** Y*** 826,832 **** Y--- 826,835 ---- Y ndp->ni_pdir = pdp; Y else Y irele(pdp); Y+ retDP: Y+ ndp->ni_ip = dp; Y return (dp); Y+ Y bad2: Y irele(pdp); Y bad: Y*************** Y*** 836,841 **** Y--- 839,846 ---- Y } Y if (dp) Y iput(dp); Y+ retNULL: Y+ ndp->ni_ip = NULL; Y return (NULL); Y } Y Y*************** Y*** 845,851 **** Y char *how; Y { Y Y! printf("%s: bad dir ino %u at offset %ld: %s\n", Y ip->i_fs->fs_fsmnt, ip->i_number, offset, how); Y } Y Y--- 850,856 ---- Y char *how; Y { Y Y! printf("%s: bad dir I=%u off %ld: %s\n", Y ip->i_fs->fs_fsmnt, ip->i_number, offset, how); Y } Y Y*************** Y*** 1193,1199 **** Y Y out: Y if (error == ENOTDIR) Y! printf("checkpath: .. not a directory\n"); Y if (ip != NULL) Y iput(ip); Y return (error); Y--- 1198,1204 ---- Y Y out: Y if (error == ENOTDIR) Y! printf("checkpath: .. !dir\n"); Y if (ip != NULL) Y iput(ip); Y return (error); Y*** /usr/src/sys/sys/ufs_syscalls.c.old Fri Jan 24 14:53:39 1997 Y--- /usr/src/sys/sys/ufs_syscalls.c Sat Feb 1 12:13:59 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)ufs_syscalls.c 1.8 (2.11BSD GTE) 1997/1/18 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)ufs_syscalls.c 1.9 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 136,240 **** Y int mode; Y int arg; Y caddr_t fname; Y! { Y register struct inode *ip; Y register struct file *fp; Y struct nameidata nd; Y register struct nameidata *ndp = &nd; Y! int indx, type; Y Y- mode = FFLAGS(mode); /* convert from open to kernel flags */ Y fp = falloc(); Y! if (fp == NULL) Y return; Y indx = u.u_r.r_val1; Y NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, fname); Y! if (mode & O_CREAT) { Y! if (mode & O_EXCL) Y! ndp->ni_nameiop = CREATE; Y! else Y! ndp->ni_nameiop = CREATE | FOLLOW; Y! ip = namei(ndp); Y! if (ip == NULL) { Y! if (u.u_error) Y! goto bad1; Y! ip = maknode(arg&07777&(~ISVTX), ndp); Y! if (ip == NULL) Y! goto bad1; Y! mode &= ~O_TRUNC; Y! } else { Y! if (mode & O_EXCL) { Y! u.u_error = EEXIST; Y! goto bad; Y } Y! mode &= ~O_CREAT; Y } Y! } else { Y! ndp->ni_nameiop = LOOKUP | FOLLOW; Y! ip = namei(ndp); Y! if (ip == NULL) Y! goto bad1; Y! } Y! if ((ip->i_mode & IFMT) == IFSOCK) { Y! u.u_error = EOPNOTSUPP; Y! goto bad; Y! } Y! if ((ip->i_flags & APPEND) && (mode & (FWRITE|O_APPEND)) == FWRITE) { Y! u.u_error = EPERM; Y! goto bad; Y! } Y! if ((mode& O_CREAT) == 0) { Y! if (mode&FREAD) Y! if (access(ip, IREAD)) Y! goto bad; Y! if (mode&(FWRITE|O_TRUNC)) { Y! if (access(ip, IWRITE)) Y! goto bad; Y! if ((ip->i_mode&IFMT) == IFDIR) { Y! u.u_error = EISDIR; Y! goto bad; Y } Y } Y } Y- if (mode & O_TRUNC) Y- itrunc(ip, (u_long)0, mode & O_FSYNC ? IO_SYNC : 0); Y- iunlock(ip); Y- fp->f_flag = mode&FMASK; Y- fp->f_type = DTYPE_INODE; Y- fp->f_data = (caddr_t)ip; Y- if (setjmp(&u.u_qsave)) { Y- if (u.u_error == 0) Y- u.u_error = EINTR; Y- bad2: Y- u.u_ofile[indx] = NULL; Y- closef(fp); Y- return; Y- } Y- u.u_error = openi(ip, mode); Y- if (u.u_error == 0) { Y- if (mode & O_EXLOCK) Y- mode &= ~O_SHLOCK; Y- type = 0; Y- if (mode & O_SHLOCK) Y- type |= LOCK_SH; Y- if (mode & O_EXLOCK) Y- type |= LOCK_EX; Y- if (!type) Y- return; Y- if (mode & O_NONBLOCK) Y- type |= LOCK_NB; Y- u.u_error = ino_lock(fp, type); Y- if (u.u_error == 0) Y- return; Y- goto bad2; Y- } Y- ilock(ip); Y- bad: Y- iput(ip); Y- bad1: Y- u.u_ofile[indx] = NULL; Y- fp->f_count--; Y- } Y Y /* Y * Mknod system call Y--- 136,218 ---- Y int mode; Y int arg; Y caddr_t fname; Y! { Y register struct inode *ip; Y register struct file *fp; Y struct nameidata nd; Y register struct nameidata *ndp = &nd; Y! int indx, type, flags, cmode, error; Y Y fp = falloc(); Y! if (fp == NULL) Y return; Y+ flags = FFLAGS(mode); /* convert from open to kernel flags */ Y+ fp->f_flag = flags & FMASK; Y+ fp->f_type = DTYPE_INODE; Y+ cmode = (arg & 077777) & ~ISVTX; Y indx = u.u_r.r_val1; Y+ u.u_dupfd = -indx - 1; Y NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, fname); Y! Y! /* Y! * ENODEV is returned by the 'fdopen()' routine - see the comments in that Y! * routine for details about the hack being used. Y! * Y! * ENXIO only comes out of the 'portal fs' code (which 2.11BSD does not have). Y! * It probably should have been removed during the port of the 'file descriptor Y! * driver' since it's a "can not happen" event. Y! * Y! * u.u_dupfd is used because there the space in the proc structure is at a Y! * premium in 2.11 while space in the u structure is relatively free. Also Y! * there were more unused (pad) fields available in 'u' as compared to 'proc'. Y! */ Y! if (error = vn_open(ndp, flags, cmode)) Y! { Y! fp->f_count = 0; Y! if ((error == ENODEV || error == ENXIO) && Y! u.u_dupfd >= 0 && Y! (error = dupfdopen(indx,u.u_dupfd,flags,error) == 0)) Y! { Y! u.u_r.r_val1 = indx; Y! u.u_error = 0; Y! return; Y } Y! u.u_ofile[indx] = NULL; Y! u.u_error = error; /* XXX */ Y! return; Y } Y! ip = ndp->ni_ip; Y! #ifdef DIAGNOSTIC Y! if (!ip) Y! { Y! printf("copen(%o,%o,%s) !ni_ip u_error %d\n", mode, Y! arg, fname,u.u_error); Y! } Y! #endif Y! u.u_dupfd = 0; Y! Y! /* Don't need to do this here because 'vn_open' returns an unlocked inode */ Y! /* iunlock(ip); */ Y! fp->f_data = (caddr_t)ip; Y! Y! if (flags & (O_EXLOCK | O_SHLOCK)) Y! { Y! if (flags & O_EXLOCK) Y! type = LOCK_EX; Y! else Y! type = LOCK_SH; Y! if (flags & FNONBLOCK) Y! type |= LOCK_NB; Y! error = ino_lock(fp, type); Y! if (error) Y! { Y! closef(fp); Y! u.u_ofile[indx] = NULL; Y } Y } Y+ u.u_error = error; Y+ return; Y } Y Y /* Y * Mknod system call Y*************** Y*** 752,784 **** Y return (0); Y } Y Y- utimes() Y- { Y- register struct a { Y- char *fname; Y- struct timeval *tptr; Y- } *uap = (struct a *)u.u_ap; Y- register struct inode *ip; Y- struct nameidata nd; Y- register struct nameidata *ndp = &nd; Y- struct timeval tv[2]; Y- struct vattr vattr; Y- Y- VATTR_NULL(&vattr); Y- if (uap->tptr == NULL) { Y- tv[0].tv_sec = tv[1].tv_sec = time.tv_sec; Y- vattr.va_vaflags |= VA_UTIMES_NULL; Y- } else if (u.u_error = copyin((caddr_t)uap->tptr,(caddr_t)tv,sizeof(tv))) Y- return; Y- NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); Y- if ((ip = namei(ndp)) == NULL) Y- return; Y- vattr.va_atime = tv[0].tv_sec; Y- vattr.va_mtime = tv[1].tv_sec; Y- u.u_error = ufs_setattr(ip, &vattr); Y- iput(ip); Y- } Y- Y /* Y * Truncate a file given its path name. Y */ Y--- 730,735 ---- Y*************** Y*** 834,856 **** Y } Y Y /* Y- * Synch an open file. Y- */ Y- fsync() Y- { Y- register struct a { Y- int fd; Y- } *uap = (struct a *)u.u_ap; Y- register struct inode *ip; Y- Y- if ((ip = getinode(uap->fd)) == NULL) Y- return; Y- ilock(ip); Y- syncip(ip); Y- iunlock(ip); Y- } Y- Y- /* Y * Rename system call. Y * rename("foo", "bar"); Y * is essentially Y--- 785,790 ---- Y*************** Y*** 1224,1229 **** Y--- 1158,1164 ---- Y iput(ip); Y return (NULL); Y } Y+ ndp->ni_ip = ip; Y return (ip); Y } Y Y*** /usr/src/sys/sys/ufs_syscalls2.c.old Sun Jan 19 10:02:26 1997 Y--- /usr/src/sys/sys/ufs_syscalls2.c Fri Jan 31 23:13:13 1997 Y*************** Y*** 1,5 **** Y /* Y! * @(#) ufs_syscalls2.c 1.4 (2.11BSD) 1997/1/18 Y * Y * ufs_syscalls was getting too large. Various UFS related system calls were Y * relocated to this file. Y--- 1,5 ---- Y /* Y! * @(#) ufs_syscalls2.c 1.5 (2.11BSD) 1997/1/31 Y * Y * ufs_syscalls was getting too large. Various UFS related system calls were Y * relocated to this file. Y*************** Y*** 239,242 **** Y--- 239,286 ---- Y return; Y } Y u.u_r.r_off = fp->f_offset; Y+ } Y+ Y+ /* Y+ * Synch an open file. Y+ */ Y+ fsync() Y+ { Y+ register struct a { Y+ int fd; Y+ } *uap = (struct a *)u.u_ap; Y+ register struct inode *ip; Y+ Y+ if ((ip = getinode(uap->fd)) == NULL) Y+ return; Y+ ilock(ip); Y+ syncip(ip); Y+ iunlock(ip); Y+ } Y+ Y+ utimes() Y+ { Y+ register struct a { Y+ char *fname; Y+ struct timeval *tptr; Y+ } *uap = (struct a *)u.u_ap; Y+ register struct inode *ip; Y+ struct nameidata nd; Y+ register struct nameidata *ndp = &nd; Y+ struct timeval tv[2]; Y+ struct vattr vattr; Y+ Y+ VATTR_NULL(&vattr); Y+ if (uap->tptr == NULL) { Y+ tv[0].tv_sec = tv[1].tv_sec = time.tv_sec; Y+ vattr.va_vaflags |= VA_UTIMES_NULL; Y+ } else if (u.u_error = copyin((caddr_t)uap->tptr,(caddr_t)tv,sizeof(tv))) Y+ return; Y+ NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname); Y+ if ((ip = namei(ndp)) == NULL) Y+ return; Y+ vattr.va_atime = tv[0].tv_sec; Y+ vattr.va_mtime = tv[1].tv_sec; Y+ u.u_error = ufs_setattr(ip, &vattr); Y+ iput(ip); Y } Y*** /usr/src/sys/h/user.h.old Fri Jan 24 14:54:08 1997 Y--- /usr/src/sys/h/user.h Thu Jan 30 15:42:01 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)user.h 1.2 (2.11BSD) 1997/1/18 Y */ Y Y #ifdef KERNEL Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)user.h 1.3 (2.11BSD) 1997/1/30 Y */ Y Y #ifdef KERNEL Y*************** Y*** 119,125 **** Y struct k_itimerval u_timer[2]; /* profile/virtual timers */ Y long u_start; Y char u_acflag; Y! char dummy2; /* room for another char */ Y Y struct uprof { /* profile arguments */ Y short *pr_base; /* buffer base */ Y--- 119,125 ---- Y struct k_itimerval u_timer[2]; /* profile/virtual timers */ Y long u_start; Y char u_acflag; Y! char u_dupfd; /* XXX - see kern_descrip.c/fdopen */ Y Y struct uprof { /* profile arguments */ Y short *pr_base; /* buffer base */ Y*** /usr/src/sys/pdp/conf.c.old Wed Dec 27 15:39:41 1995 Y--- /usr/src/sys/pdp/conf.c Fri Jan 31 20:49:43 1997 Y*************** Y*** 3,9 **** Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)conf.c 2.9 (2.11BSD GTE) 1995/12/24 Y */ Y Y #include "param.h" Y--- 3,9 ---- Y * All rights reserved. The Berkeley software License Agreement Y * specifies the terms and conditions for redistribution. Y * Y! * @(#)conf.c 3.0 (2.11BSD GTE) 1997/1/30 Y */ Y Y #include "param.h" Y*************** Y*** 350,355 **** Y--- 350,356 ---- Y #define ingres_ioctl nodev Y #endif Y Y+ int fdopen(); Y int ttselect(), seltrue(); Y Y struct cdevsw cdevsw[] = { Y*************** Y*** 457,462 **** Y--- 458,467 ---- Y ingres_open, ingres_close, ingres_read, ingres_write, Y ingres_ioctl, nulldev, 0, seltrue, Y nulldev, Y+ /* fd = 26 */ Y+ fdopen, nodev, nodev, nodev, Y+ nodev, nodev, 0, nodev, Y+ nodev, Y }; Y Y int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]); Y*************** Y*** 515,521 **** Y /* NOTREACHED */ Y } Y Y! #define MAXDEV 26 Y static char chrtoblktbl[MAXDEV] = { Y /* CHR */ /* BLK */ Y /* 0 */ NODEV, Y--- 520,526 ---- Y /* NOTREACHED */ Y } Y Y! #define MAXDEV 27 Y static char chrtoblktbl[MAXDEV] = { Y /* CHR */ /* BLK */ Y /* 0 */ NODEV, Y*************** Y*** 543,549 **** Y /* 22 */ NODEV, Y /* 23 */ 12, /* tmscp */ Y /* 24 */ NODEV, Y! /* 25 */ NODEV Y }; Y Y /* Y--- 548,555 ---- Y /* 22 */ NODEV, Y /* 23 */ 12, /* tmscp */ Y /* 24 */ NODEV, Y! /* 25 */ NODEV, Y! /* 26 */ NODEV Y }; Y Y /* Y*** /usr/src/sys/pdpstand/Makefile.old Sat Jan 18 15:41:57 1997 Y--- /usr/src/sys/pdpstand/Makefile Fri Jan 24 17:56:43 1997 Y*************** Y*** 1,4 **** Y! # Makefile (2.11BSD) 2.1 1997/1/18 Y # Y # The limitations on program size have been removed. The addition Y # of disklabel support pushed 'restor' over the limit. Even with Y--- 1,4 ---- Y! # Makefile (2.11BSD) 2.2 1997/1/24 Y # Y # The limitations on program size have been removed. The addition Y # of disklabel support pushed 'restor' over the limit. Even with Y*************** Y*** 13,22 **** Y # It is still possible to hand craft a version of the utilities by leaving Y # out all but the necessary drivers. Y # Y! # If a GENERIC kernel distribution is being created be sure Y! # to install /sys/pdpdist/dtab (or /etc/dtab.save) as ${ROOT}/etc/dtab Y! # so that the GENERIC kernel can find the tape device. Y! # Y # 1996/10/28 - added usr/sbin, usr/libexec and corresponding src directories. Y # 1995/12/05 - add RX02 driver. Y # 1995/06/05 - add disklabel program to Makefile. Y--- 13,20 ---- Y # It is still possible to hand craft a version of the utilities by leaving Y # out all but the necessary drivers. Y # Y! # 1997/1/24 - remove 'skel' from lists of directories. Y! # 1997/1/18 - add 'makesimtape' target. Y # 1996/10/28 - added usr/sbin, usr/libexec and corresponding src directories. Y # 1995/12/05 - add RX02 driver. Y # 1995/06/05 - add disklabel program to Makefile. Y*************** Y*** 66,72 **** Y cd ${ROOT}/usr; tar cfb /dev/nr${TAPE} 20 \ Y adm bin crash dict doc games guest hosts include ingres \ Y lib libdata libexec local man msgs new old preserve pub \ Y! sbin share skel spool tmp ucb Y cd ${ROOT}/usr/src; tar cfb /dev/nr${TAPE} 20 \ Y sys include Y cd ${ROOT}/usr/src; tar cfb /dev/r${TAPE} 20 \ Y--- 64,70 ---- Y cd ${ROOT}/usr; tar cfb /dev/nr${TAPE} 20 \ Y adm bin crash dict doc games guest hosts include ingres \ Y lib libdata libexec local man msgs new old preserve pub \ Y! sbin share spool tmp ucb Y cd ${ROOT}/usr/src; tar cfb /dev/nr${TAPE} 20 \ Y sys include Y cd ${ROOT}/usr/src; tar cfb /dev/r${TAPE} 20 \ Y*************** Y*** 80,86 **** Y cd ${ROOT}/usr; tar cfb /dev/nr${TAPE} 20 \ Y adm bin crash dict doc games guest hosts include ingres \ Y lib libdata libexec local man msgs new old preserve pub \ Y! sbin share skel spool tmp ucb Y cd ${ROOT}/usr/src; tar cfb /dev/nr${TAPE} 20 \ Y sys include Y Y--- 78,84 ---- Y cd ${ROOT}/usr; tar cfb /dev/nr${TAPE} 20 \ Y adm bin crash dict doc games guest hosts include ingres \ Y lib libdata libexec local man msgs new old preserve pub \ Y! sbin share spool tmp ucb Y cd ${ROOT}/usr/src; tar cfb /dev/nr${TAPE} 20 \ Y sys include Y Y*** /usr/src/sys/GENERIC/Makefile.old Fri Jan 24 14:54:24 1997 Y--- /usr/src/sys/GENERIC/Makefile Sat Feb 1 10:35:14 1997 Y*************** Y*** 10,16 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.8 (2.11BSD GTE) 1997/1/21 Y # Y ######################################################### Y # Non-network, but separate I/D kernel # Y--- 10,16 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.9 (2.11BSD GTE) 1997/1/31 Y # Y ######################################################### Y # Non-network, but separate I/D kernel # Y*************** Y*** 49,59 **** Y BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ Y kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ Y kern_synch.o lp.o machdep.o ra.o ram.o si.o \ Y! subr_rmap.o subr_xxx.o sys_inode.o sys_pipe.o trap.o tty.o \ Y tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ Y ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y xp.o Y! OV1= sys_generic.o ufs_syscalls.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= clock.o cons.o kern_time.o \ Y machdep2.o quota_sys.o subr_prf.o sys_process.o \ Y--- 49,59 ---- Y BASE= br.o dh.o dhu.o dhv.o dkbad.o dr.o dz.o init_sysent.o kern_clock.o \ Y kern_descrip.o kern_mman.o kern_proc.o kern_sig.o kern_subr.o \ Y kern_synch.o lp.o machdep.o ra.o ram.o si.o \ Y! subr_rmap.o subr_xxx.o sys_inode.o trap.o tty.o \ Y tty_conf.o tty_subr.o tty_tb.o tty_tty.o ufs_alloc.o ufs_bio.o \ Y ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_namei.o \ Y xp.o Y! OV1= sys_generic.o ufs_syscalls.o vfs_vnops.o Y OV2= kern_acct.o kern_exec.o kern_exit.o kern_fork.o kern_resource.o Y OV3= clock.o cons.o kern_time.o \ Y machdep2.o quota_sys.o subr_prf.o sys_process.o \ Y*************** Y*** 64,70 **** Y OV6= tmscp.o tmscpdump.o Y OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o Y OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o Y! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o rk.o Y Y KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ Y ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ Y--- 64,70 ---- Y OV6= tmscp.o tmscpdump.o Y OV7= rl.o mch_fpsim.o ingreslock.o ufs_disksubr.o Y OV8= rx.o kern_sysctl.o vm_sched.o vm_text.o Y! OV9= kern_pdp.o kern_xxx.o ufs_syscalls2.o mem.o ufs_subr.o rk.o sys_pipe.o Y Y KERNOBJ=${CONF} ${BASE} ${OV1} ${OV2} ${OV3} ${OV4} ${OV5} \ Y ${OV6} ${OV7} ${OV8} ${OV9} ${OV10} ${OV11} ${OV12} \ Y*** /usr/src/sys/GENERIC/Make.sys.old Mon Jun 17 20:04:02 1996 Y--- /usr/src/sys/GENERIC/Make.sys Fri Jan 31 21:03:43 1997 Y*************** Y*** 9,15 **** Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.3 (2.11BSD GTE) 1996/6/8 Y # Y S= ../sys Y VPATH= ../sys Y--- 9,15 ---- Y # software without specific prior written permission. This software Y # is provided ``as is'' without express or implied warranty. Y # Y! # 2.4 (2.11BSD GTE) 1997/1/31 Y # Y S= ../sys Y VPATH= ../sys Y*************** Y*** 32,37 **** Y--- 32,38 ---- Y ${S}/ufs_mount.c ${S}/ufs_namei.c ${S}/ufs_subr.c \ Y ${S}/ufs_disksubr.c ${S}/ufs_syscalls2.c \ Y ${S}/ufs_syscalls.c ${S}/uipc_syscalls.c ${S}/vm_proc.c \ Y+ ${S}/vfs_vnops.c \ Y ${S}/vm_sched.c ${S}/vm_swap.c ${S}/vm_swp.c ${S}/vm_text.c Y OBJS= init_main.o init_sysent.o kern_acct.o kern_clock.o \ Y kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o \ Y*************** Y*** 45,50 **** Y--- 46,52 ---- Y ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o \ Y ufs_subr.o ufs_syscalls.o uipc_syscalls.o vm_proc.o vm_sched.o \ Y ufs_disksubr.o ufs_syscalls2.o \ Y+ vfs_vnops.o \ Y vm_swap.o vm_swp.o vm_text.o Y Y .c.o: Y*** /usr/src/etc/MAKEDEV.old Sat Nov 16 13:30:30 1996 Y--- /usr/src/etc/MAKEDEV Sat Feb 1 15:56:17 1997 Y*************** Y*** 4,14 **** Y # All rights reserved. The Berkeley software License Agreement Y # specifies the terms and conditions for redistribution. Y # Y! # @(#)MAKEDEV 4.27.4 (2.11BSD GTE) 1996/11/16 Y # Y # Device "make" file. Valid arguments: Y # std standard devices Y # local configuration specific devices Y # Tapes: Y # ht* unibus tu77 & te16 Y # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) Y--- 4,15 ---- Y # All rights reserved. The Berkeley software License Agreement Y # specifies the terms and conditions for redistribution. Y # Y! # @(#)MAKEDEV 4.27.5 (2.11BSD GTE) 1997/1/31 Y # Y # Device "make" file. Valid arguments: Y # std standard devices Y # local configuration specific devices Y+ # fd file descriptor driver Y # Tapes: Y # ht* unibus tu77 & te16 Y # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) Y*************** Y*** 59,64 **** Y--- 60,78 ---- Y mknod zero c 1 3 ; chmod 444 zero Y mknod tty c 9 0 ; chmod 666 tty Y mknod klog c 22 0 ; chmod 600 klog Y+ ;; Y+ Y+ fd) Y+ umask 0 Y+ rm -rf fd Y+ rm -f stdin stdout stderr Y+ mkdir fd Y+ chmod 755 fd Y+ mknod stdin c 26 0 Y+ mknod stdout c 26 1 Y+ mknod stderr c 26 2 Y+ eval `echo "" | awk '{ for (i = 0; i < 32; i++) Y+ printf("mknod fd/%d c 26 %d; ",i,i); }'` Y ;; Y Y ht*|tm*|ts*|tu*) Y*** /VERSION.old Sun Jan 19 10:16:54 1997 Y--- /VERSION Sat Feb 1 15:53:05 1997 Y*************** Y*** 1,4 **** Y! Current Patch Level: 362 Y Y 2.11 BSD Y ============ Y--- 1,4 ---- Y! Current Patch Level: 363 Y Y 2.11 BSD Y ============ SHAR_EOF fi # end of overwriting check # End of shell archive exit 0