diff options
| author | cgd <cgd@NetBSD.org> | 1994-06-29 06:29:24 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1994-06-29 06:29:24 +0000 |
| commit | cf92afd66eb26ee2097f3883397b4bc5bb0e82aa (patch) | |
| tree | 6bbe162c1ba0d8484b4d2a42807167c3229f6cca /sys | |
| parent | bb627c6f25da6cf7b3a7203ef05fc66264ac77b8 (diff) | |
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
Diffstat (limited to 'sys')
311 files changed, 9844 insertions, 566 deletions
diff --git a/sys/adosfs/adlookup.c b/sys/adosfs/adlookup.c index e03dcc32f1d..ee55db3a356 100644 --- a/sys/adosfs/adlookup.c +++ b/sys/adosfs/adlookup.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: adlookup.c,v 1.6 1994/06/27 19:27:39 cgd Exp $ */ +/* $NetBSD: adlookup.c,v 1.7 1994/06/29 06:29:24 cgd Exp $ */ + /* * Copyright (c) 1994 Christian E. Hopps * All rights reserved. diff --git a/sys/adosfs/adosfs.h b/sys/adosfs/adosfs.h index 0b90e1c3917..52100e86b67 100644 --- a/sys/adosfs/adosfs.h +++ b/sys/adosfs/adosfs.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: adosfs.h,v 1.3 1994/06/27 19:27:40 cgd Exp $ */ +/* $NetBSD: adosfs.h,v 1.4 1994/06/29 06:29:27 cgd Exp $ */ + /* * Copyright (c) 1994 Christian E. Hopps * All rights reserved. diff --git a/sys/adosfs/adutil.c b/sys/adosfs/adutil.c index 0a033fa5c6c..9629c4c825d 100644 --- a/sys/adosfs/adutil.c +++ b/sys/adosfs/adutil.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: adutil.c,v 1.4 1994/06/27 19:27:42 cgd Exp $ */ +/* $NetBSD: adutil.c,v 1.5 1994/06/29 06:29:29 cgd Exp $ */ + /* * Copyright (c) 1994 Christian E. Hopps * All rights reserved. diff --git a/sys/adosfs/advfsops.c b/sys/adosfs/advfsops.c index 74f6591035a..754172a34fa 100644 --- a/sys/adosfs/advfsops.c +++ b/sys/adosfs/advfsops.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: advfsops.c,v 1.3 1994/06/27 19:27:44 cgd Exp $ */ +/* $NetBSD: advfsops.c,v 1.4 1994/06/29 06:29:30 cgd Exp $ */ + /* * Copyright (c) 1994 Christian E. Hopps * All rights reserved. diff --git a/sys/adosfs/advnops.c b/sys/adosfs/advnops.c index 35722267543..25651c63e82 100644 --- a/sys/adosfs/advnops.c +++ b/sys/adosfs/advnops.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: advnops.c,v 1.7 1994/06/27 19:27:46 cgd Exp $ */ +/* $NetBSD: advnops.c,v 1.8 1994/06/29 06:29:32 cgd Exp $ */ + /* * Copyright (c) 1994 Christian E. Hopps * All rights reserved. diff --git a/sys/arch/i386/conf/BOAT_ANCHOR b/sys/arch/i386/conf/BOAT_ANCHOR index 43493e627e2..8dc85dd19fa 100644 --- a/sys/arch/i386/conf/BOAT_ANCHOR +++ b/sys/arch/i386/conf/BOAT_ANCHOR @@ -1,7 +1,7 @@ # # BOAT_ANCHOR -- kernel for the 386-20 the gang uses for testing # -# $Id: BOAT_ANCHOR,v 1.35 1994/05/21 08:37:31 cgd Exp $ +# $Id: BOAT_ANCHOR,v 1.36 1994/06/29 06:29:42 cgd Exp $ # machine "i386" cpu "I386_CPU" @@ -15,7 +15,7 @@ options "COMPAT_43" options "TCP_COMPAT_42" options XSERVER,UCONSOLE options "DUMMY_NOPS" -options MSDOSFS +#options MSDOSFS options KTRACE options "COMPAT_09" options "COMPAT_NOMID" diff --git a/sys/arch/i386/conf/KICKME b/sys/arch/i386/conf/KICKME index 67ab5c802e5..22f1f34ce03 100644 --- a/sys/arch/i386/conf/KICKME +++ b/sys/arch/i386/conf/KICKME @@ -1,7 +1,7 @@ # # KICKME -- 486Cx-33 development machine. # -# $Id: KICKME,v 1.10 1994/06/14 05:27:20 cgd Exp $ +# $Id: KICKME,v 1.11 1994/06/29 06:29:44 cgd Exp $ # machine "i386" @@ -11,9 +11,9 @@ timezone 8 dst maxusers 10 options SWAPPAGER,VNODEPAGER,DEVPAGER options FFS -options INET,ISOFS,NFSSERVER,NFSCLIENT +options INET,ISOFS,NFSSERVER,NFSCLIENT,NULLFS options "COMPAT_43" -options MSDOSFS +#options MSDOSFS options SCSI options "MATH_EMULATE" options "COMPAT_NOMID" diff --git a/sys/arch/i386/conf/PAIN b/sys/arch/i386/conf/PAIN index bf9108fd423..1952005c1f1 100644 --- a/sys/arch/i386/conf/PAIN +++ b/sys/arch/i386/conf/PAIN @@ -1,7 +1,7 @@ # # PAIN -- kernel for another of cgd's 486/50 EISA boxes... # -# $Id: PAIN,v 1.33 1994/06/03 20:52:09 cgd Exp $ +# $Id: PAIN,v 1.34 1994/06/29 06:29:45 cgd Exp $ # machine "i386" cpu "I486_CPU" @@ -45,8 +45,9 @@ options USER_LDT options FFS options MFS options NFSSERVER,NFSCLIENT -options MSDOSFS,ISOFS -options FDESC,FIFO,KERNFS,LOFS,PORTAL,PROCFS +#options MSDOSFS +options ISOFS,NULLFS +options FDESC,FIFO,KERNFS,PORTAL,PROCFS # and even UFS quotas options QUOTA diff --git a/sys/arch/i386/conf/SUN_LAMP b/sys/arch/i386/conf/SUN_LAMP index 72f00317985..f1ec75307a2 100644 --- a/sys/arch/i386/conf/SUN_LAMP +++ b/sys/arch/i386/conf/SUN_LAMP @@ -1,7 +1,7 @@ # # SUN_LAMP -- kernel for one of cgd's 486/50 EISA boxes... # -# $Id: SUN_LAMP,v 1.47 1994/06/03 20:28:48 cgd Exp $ +# $Id: SUN_LAMP,v 1.48 1994/06/29 06:29:47 cgd Exp $ # machine "i386" cpu "I486_CPU" @@ -10,7 +10,7 @@ timezone 8 dst maxusers 24 options SWAPPAGER,VNODEPAGER,DEVPAGER options FFS -options INET,NFSSERVER,NFSCLIENT,MFS,ISOFS,LOFS +options INET,NFSSERVER,NFSCLIENT,MFS,ISOFS,NULLFS options "COMPAT_43" options "TCP_COMPAT_42" options UCONSOLE, XSERVER diff --git a/sys/compat/sunos/exec.h b/sys/compat/sunos/exec.h index 8be9e520c29..780e9ec2f40 100644 --- a/sys/compat/sunos/exec.h +++ b/sys/compat/sunos/exec.h @@ -1,3 +1,5 @@ +/* $NetBSD: exec.h,v 1.3 1994/06/29 06:30:07 cgd Exp $ */ + /* * Copyright (c) 1993 Theo de Raadt * All rights reserved. @@ -23,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec.h,v 1.2 1994/01/28 23:46:30 jtc Exp $ */ #ifndef _SUNOS_EXEC_H_ diff --git a/sys/compat/sunos/makesyscalls.sh b/sys/compat/sunos/makesyscalls.sh index dfacacf6a9b..ec69b5edac1 100644 --- a/sys/compat/sunos/makesyscalls.sh +++ b/sys/compat/sunos/makesyscalls.sh @@ -1,6 +1,7 @@ #! /bin/sh - -# from: @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 -# $Id: makesyscalls.sh,v 1.6 1994/05/01 06:14:04 cgd Exp $ +# $NetBSD: makesyscalls.sh,v 1.7 1994/06/29 06:30:12 cgd Exp $ +# +# @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 set -e @@ -49,17 +50,17 @@ awk < $1 " printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr } NR == 1 { - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysdcl + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysdcl printf "#include <sys/param.h>\n" > sysdcl printf "#include <sys/systm.h>\n\n" > sysdcl printf "int\tnosys();\n\n" > sysdcl printf "struct sysent sun_sysent[] = {\n" > sysent - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysnames + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysnames printf "char *sun_syscallnames[] = {\n" > sysnames - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > syshdr + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > syshdr next } NF == 0 || $1 ~ /^;/ { diff --git a/sys/compat/sunos/sun_exec.c b/sys/compat/sunos/sun_exec.c index 5b71e56bff7..608cf3f55ac 100644 --- a/sys/compat/sunos/sun_exec.c +++ b/sys/compat/sunos/sun_exec.c @@ -1,3 +1,5 @@ +/* $NetBSD: sun_exec.c,v 1.5 1994/06/29 06:30:14 cgd Exp $ */ + /* * Copyright (c) 1993 Theo de Raadt * All rights reserved. @@ -23,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sun_exec.c,v 1.4 1994/01/28 23:46:34 jtc Exp $ */ #include <sys/param.h> diff --git a/sys/compat/sunos/sun_ioctl.c b/sys/compat/sunos/sun_ioctl.c index 0ea148b9dbc..cca9fa10e10 100644 --- a/sys/compat/sunos/sun_ioctl.c +++ b/sys/compat/sunos/sun_ioctl.c @@ -1,3 +1,5 @@ +/* $NetBSD: sun_ioctl.c,v 1.11 1994/06/29 06:30:16 cgd Exp $ */ + /* * Copyright (c) 1993 Markus Wild. * All rights reserved. @@ -22,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * loosely from: Header: sun_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp - * $Id: sun_ioctl.c,v 1.10 1994/05/21 08:22:08 deraadt Exp $ */ #include <sys/param.h> diff --git a/sys/compat/sunos/sun_misc.c b/sys/compat/sunos/sun_misc.c index ae56a2d10cb..b86ed8938bc 100644 --- a/sys/compat/sunos/sun_misc.c +++ b/sys/compat/sunos/sun_misc.c @@ -1,3 +1,5 @@ +/* $NetBSD: sun_misc.c,v 1.30 1994/06/29 06:30:20 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -41,8 +43,7 @@ * * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * - * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * $Id: sun_misc.c,v 1.29 1994/06/22 08:24:53 pk Exp $ + * Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp */ /* diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c index 54ee9f35f25..31addd0e6e1 100644 --- a/sys/compat/sunos/sunos_exec.c +++ b/sys/compat/sunos/sunos_exec.c @@ -1,3 +1,5 @@ +/* $NetBSD: sunos_exec.c,v 1.5 1994/06/29 06:30:14 cgd Exp $ */ + /* * Copyright (c) 1993 Theo de Raadt * All rights reserved. @@ -23,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sunos_exec.c,v 1.4 1994/01/28 23:46:34 jtc Exp $ */ #include <sys/param.h> diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c index d702003673d..5d3431b9777 100644 --- a/sys/compat/sunos/sunos_ioctl.c +++ b/sys/compat/sunos/sunos_ioctl.c @@ -1,3 +1,5 @@ +/* $NetBSD: sunos_ioctl.c,v 1.11 1994/06/29 06:30:16 cgd Exp $ */ + /* * Copyright (c) 1993 Markus Wild. * All rights reserved. @@ -22,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * loosely from: Header: sun_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp - * $Id: sunos_ioctl.c,v 1.10 1994/05/21 08:22:08 deraadt Exp $ */ #include <sys/param.h> diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 7ea480d69c3..e266ac66bb2 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,3 +1,5 @@ +/* $NetBSD: sunos_misc.c,v 1.30 1994/06/29 06:30:20 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -41,8 +43,7 @@ * * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * - * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * $Id: sunos_misc.c,v 1.29 1994/06/22 08:24:53 pk Exp $ + * Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp */ /* diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master index 394a85b4bf0..8b815ec0dbf 100644 --- a/sys/compat/sunos/syscalls.master +++ b/sys/compat/sunos/syscalls.master @@ -1,5 +1,5 @@ - $Id: syscalls.master,v 1.16 1994/06/14 10:51:12 chopps Exp $ -; from: @(#)syscalls.master 8.1 (Berkeley) 7/19/93 + $NetBSD: syscalls.master,v 1.17 1994/06/29 06:30:25 cgd Exp $ +; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from SunOS). ; Processed to created sun_sysent.c, sun_syscalls.c and sun_syscall.h. diff --git a/sys/compat/svr4/exec.h b/sys/compat/svr4/exec.h index 9e50e10a9ca..23aefbe39a6 100644 --- a/sys/compat/svr4/exec.h +++ b/sys/compat/svr4/exec.h @@ -1,3 +1,5 @@ +/* $NetBSD: exec.h,v 1.2 1994/06/29 06:30:27 cgd Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -23,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec.h,v 1.1 1994/05/22 10:04:26 deraadt Exp $ */ #ifndef _SVR4_EXEC_H_ diff --git a/sys/compat/svr4/makesyscalls.sh b/sys/compat/svr4/makesyscalls.sh index 640dfab3d5e..4829d127f56 100644 --- a/sys/compat/svr4/makesyscalls.sh +++ b/sys/compat/svr4/makesyscalls.sh @@ -1,6 +1,7 @@ #! /bin/sh - -# from: @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 -# $Id: makesyscalls.sh,v 1.1 1994/05/22 10:04:28 deraadt Exp $ +# $NetBSD: makesyscalls.sh,v 1.2 1994/06/29 06:30:30 cgd Exp $ +# +# @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 set -e @@ -49,17 +50,17 @@ awk < $1 " printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr } NR == 1 { - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysdcl + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysdcl printf "#include <sys/param.h>\n" > sysdcl printf "#include <sys/systm.h>\n\n" > sysdcl printf "int\tnosys();\n\n" > sysdcl printf "struct sysent svr4_sysent[] = {\n" > sysent - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysnames + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysnames printf "char *svr4_syscallnames[] = {\n" > sysnames - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > syshdr + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > syshdr next } NF == 0 || $1 ~ /^;/ { diff --git a/sys/compat/svr4/svr4_exec.c b/sys/compat/svr4/svr4_exec.c index 5fbb62f4159..775c7a2d40d 100644 --- a/sys/compat/svr4/svr4_exec.c +++ b/sys/compat/svr4/svr4_exec.c @@ -1,3 +1,5 @@ +/* $NetBSD: svr4_exec.c,v 1.2 1994/06/29 06:30:31 cgd Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -23,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: svr4_exec.c,v 1.1 1994/05/22 10:04:31 deraadt Exp $ */ #include <sys/param.h> diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index b9d61b12ce6..0574af5e5a5 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -1,3 +1,5 @@ +/* $NetBSD: svr4_ioctl.c,v 1.2 1994/06/29 06:30:33 cgd Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -20,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: svr4_ioctl.c,v 1.1 1994/05/22 10:04:33 deraadt Exp $ */ #include <sys/param.h> diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index b1c6cbadeb7..6cfcd1a0bce 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,3 +1,5 @@ +/* $NetBSD: svr4_misc.c,v 1.5 1994/06/29 06:30:35 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -42,7 +44,6 @@ * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp * * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 - * $Id: svr4_misc.c,v 1.4 1994/06/24 07:30:17 deraadt Exp $ */ /* diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master index 5bdf04fac6a..51e429bddb0 100644 --- a/sys/compat/svr4/syscalls.master +++ b/sys/compat/svr4/syscalls.master @@ -1,5 +1,5 @@ - $Id: syscalls.master,v 1.1 1994/05/22 10:04:45 deraadt Exp $ -; from: @(#)syscalls.master 8.1 (Berkeley) 7/19/93 + $NetBSD: syscalls.master,v 1.2 1994/06/29 06:30:37 cgd Exp $ +; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from SunOS). ; Processed to created svr4_sysent.c, svr4_syscalls.c and svr4_syscall.h. diff --git a/sys/compat/ultrix/makesyscalls.sh b/sys/compat/ultrix/makesyscalls.sh index 22309eaef3b..6311d881af6 100644 --- a/sys/compat/ultrix/makesyscalls.sh +++ b/sys/compat/ultrix/makesyscalls.sh @@ -1,6 +1,7 @@ #! /bin/sh - -# from: @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 -# $Id: makesyscalls.sh,v 1.2 1994/06/15 05:18:01 glass Exp $ +# $NetBSD: makesyscalls.sh,v 1.3 1994/06/29 06:30:39 cgd Exp $ +# +# @(#)makesyscalls.sh 8.1 (Berkeley) 6/11/93 set -e @@ -49,17 +50,17 @@ awk < $1 " printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr } NR == 1 { - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysdcl + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysdcl printf "#include <sys/param.h>\n" > sysdcl printf "#include <sys/systm.h>\n\n" > sysdcl printf "int\tnosys();\n\n" > sysdcl printf "struct sysent ultrix_sysent[] = {\n" > sysent - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysnames + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysnames printf "char *ultrix_syscallnames[] = {\n" > sysnames - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > syshdr + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > syshdr next } NF == 0 || $1 ~ /^;/ { diff --git a/sys/compat/ultrix/syscalls.master b/sys/compat/ultrix/syscalls.master index 426c2e4e9d9..7798b5dd313 100644 --- a/sys/compat/ultrix/syscalls.master +++ b/sys/compat/ultrix/syscalls.master @@ -1,5 +1,5 @@ - $Id: syscalls.master,v 1.3 1994/06/22 03:37:15 glass Exp $ -; from: @(#)syscalls.master 8.1 (Berkeley) 7/19/93 + $NetBSD: syscalls.master,v 1.4 1994/06/29 06:30:40 cgd Exp $ +; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from SunOS). ; Processed to created sun_sysent.c, sun_syscalls.c and sun_syscall.h. diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index d1d7d2e5ea4..445a3c1a055 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,3 +1,5 @@ +/* $NetBSD: ultrix_misc.c,v 1.5 1994/06/29 06:30:42 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -39,10 +41,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * $Id: ultrix_misc.c,v 1.4 1994/06/25 07:06:49 glass Exp $ */ /* diff --git a/sys/conf/files b/sys/conf/files index 6267311f7c9..be5df5c09cc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,5 @@ -# NetBSD $Id: files,v 1.54 1994/06/27 19:44:02 cgd Exp $ +# $NetBSD: files,v 1.55 1994/06/29 06:30:45 cgd Exp $ +# adosfs/adlookup.c optional adosfs adosfs/adutil.c optional adosfs adosfs/advfsops.c optional adosfs diff --git a/sys/conf/files.newconf b/sys/conf/files.newconf index e5bdc612c7f..4d2882e77ea 100644 --- a/sys/conf/files.newconf +++ b/sys/conf/files.newconf @@ -1,4 +1,5 @@ -# NetBSD $Id: files.newconf,v 1.31 1994/06/27 19:44:04 cgd Exp $ +# $NetBSD: files.newconf,v 1.32 1994/06/29 06:30:47 cgd Exp $ + # @(#)files.newconf 7.5 (Berkeley) 5/10/93 # generic attributes diff --git a/sys/conf/files.oldconf b/sys/conf/files.oldconf index 1808e73e7bf..23b568df36f 100644 --- a/sys/conf/files.oldconf +++ b/sys/conf/files.oldconf @@ -1,4 +1,5 @@ -# NetBSD $Id: files.oldconf,v 1.54 1994/06/27 19:44:02 cgd Exp $ +# $NetBSD: files.oldconf,v 1.55 1994/06/29 06:30:45 cgd Exp $ +# adosfs/adlookup.c optional adosfs adosfs/adutil.c optional adosfs adosfs/advfsops.c optional adosfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 995f37860a0..eb860bc67f7 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -1,5 +1,6 @@ #!/bin/sh - -# NetBSD $Id: newvers.sh,v 1.15 1994/06/27 19:44:05 cgd Exp $ +# +# $NetBSD: newvers.sh,v 1.16 1994/06/29 06:30:49 cgd Exp $ # # Copyright (c) 1984, 1986, 1990, 1993 # The Regents of the University of California. All rights reserved. diff --git a/sys/conf/param.c b/sys/conf/param.c index b82b7e9e606..41a68a1923c 100644 --- a/sys/conf/param.c +++ b/sys/conf/param.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: param.c,v 1.10 1994/06/27 19:44:07 cgd Exp $ */ +/* $NetBSD: param.c,v 1.11 1994/06/29 06:30:52 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1989 Regents of the University of California. * All rights reserved. diff --git a/sys/ddb/db_access.c b/sys/ddb/db_access.c index 25335e86da2..2011894f206 100644 --- a/sys/ddb/db_access.c +++ b/sys/ddb/db_access.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_access.c,v 1.5 1994/06/29 06:30:55 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_access.c,v 1.4 1994/01/31 23:55:06 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_access.h b/sys/ddb/db_access.h index f22bd9a8adf..9108cf13435 100644 --- a/sys/ddb/db_access.h +++ b/sys/ddb/db_access.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_access.h,v 1.4 1994/06/29 06:30:56 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_access.h,v 1.3 1994/02/15 14:50:41 mycroft Exp $ */ /* diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index 36656b0f60b..c94b91f9ace 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_aout.c,v 1.11 1994/06/29 06:30:57 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -22,8 +24,6 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. - * - * $Id: db_aout.c,v 1.10 1994/06/03 01:58:32 gwr Exp $ */ #include <sys/types.h> diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index 24057ebbf75..aa52164da2a 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_break.c,v 1.4 1994/06/29 06:30:59 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_break.c,v 1.3 1993/12/18 04:46:28 mycroft Exp $ */ /* diff --git a/sys/ddb/db_break.h b/sys/ddb/db_break.h index 38dfcb5691c..b5f07d230ce 100644 --- a/sys/ddb/db_break.h +++ b/sys/ddb/db_break.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_break.h,v 1.5 1994/06/29 06:31:00 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_break.h,v 1.4 1994/02/15 14:50:42 mycroft Exp $ */ #ifndef _DDB_DB_BREAK_H_ diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index ebf02eed553..25205002d38 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_command.c,v 1.12 1994/06/29 06:31:01 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -22,8 +24,6 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. - * - * $Id: db_command.c,v 1.11 1994/04/27 10:49:07 pk Exp $ */ /* diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index e11a3dab9a6..a89221a9112 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_command.h,v 1.5 1994/06/29 06:31:03 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_command.h,v 1.4 1994/03/23 20:00:57 pk Exp $ */ /* diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index d84bc104721..6116c9efe69 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_examine.c,v 1.4 1994/06/29 06:31:05 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_examine.c,v 1.3 1993/12/18 04:46:31 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c index eb595e7b20a..1182a1f9993 100644 --- a/sys/ddb/db_expr.c +++ b/sys/ddb/db_expr.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_expr.c,v 1.4 1994/06/29 06:31:06 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_expr.c,v 1.3 1993/12/18 04:46:32 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c index 83d77e576a9..2359626424f 100644 --- a/sys/ddb/db_input.c +++ b/sys/ddb/db_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_input.c,v 1.4 1994/06/29 06:31:08 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_input.c,v 1.3 1993/12/18 04:46:33 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_lex.c b/sys/ddb/db_lex.c index 970d1bbba51..c586dae20b5 100644 --- a/sys/ddb/db_lex.c +++ b/sys/ddb/db_lex.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_lex.c,v 1.4 1994/06/29 06:31:10 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_lex.c,v 1.3 1993/12/18 04:46:34 mycroft Exp $ */ /* diff --git a/sys/ddb/db_lex.h b/sys/ddb/db_lex.h index bacc02a6428..40e4fe7dcc6 100644 --- a/sys/ddb/db_lex.h +++ b/sys/ddb/db_lex.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_lex.h,v 1.4 1994/06/29 06:31:11 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_lex.h,v 1.3 1994/02/15 14:50:44 mycroft Exp $ */ /* diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 6d4621517a1..7517bf466ad 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_output.c,v 1.7 1994/06/29 06:31:12 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -22,8 +24,6 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. - * - * $Id: db_output.c,v 1.6 1993/12/18 04:46:35 mycroft Exp $ */ /* diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h index ec22efe4d00..9c89db27a05 100644 --- a/sys/ddb/db_output.h +++ b/sys/ddb/db_output.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_output.h,v 1.4 1994/06/29 06:31:14 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 8/90 - * $Id: db_output.h,v 1.3 1994/02/15 14:50:45 mycroft Exp $ */ /* diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index 769775fe037..a584216c310 100644 --- a/sys/ddb/db_print.c +++ b/sys/ddb/db_print.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_print.c,v 1.4 1994/06/29 06:31:15 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_print.c,v 1.3 1993/12/18 04:46:36 mycroft Exp $ */ /* diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c index 2b609d68dba..ad9eebbe2e2 100644 --- a/sys/ddb/db_run.c +++ b/sys/ddb/db_run.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_run.c,v 1.5 1994/06/29 06:31:16 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_run.c,v 1.4 1993/12/18 04:46:37 mycroft Exp $ */ /* diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 270f8ac67d0..8eea203cc03 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_sym.c,v 1.7 1994/06/29 06:31:18 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -22,8 +24,6 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. - * - * $Id: db_sym.c,v 1.6 1993/12/18 04:46:39 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_sym.h b/sys/ddb/db_sym.h index 109bafbb490..f3e7501ddee 100644 --- a/sys/ddb/db_sym.h +++ b/sys/ddb/db_sym.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_sym.h,v 1.5 1994/06/29 06:31:19 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: Alessandro Forin, Carnegie Mellon University * Date: 8/90 - * $Id: db_sym.h,v 1.4 1994/02/15 14:50:46 mycroft Exp $ */ /* diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c index 8f41f041e80..0b8281b6d56 100644 --- a/sys/ddb/db_trap.c +++ b/sys/ddb/db_trap.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_trap.c,v 1.5 1994/06/29 06:31:22 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_trap.c,v 1.4 1994/04/04 08:59:38 mycroft Exp $ */ /* diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c index 7ab88145293..3a7881f6362 100644 --- a/sys/ddb/db_variables.c +++ b/sys/ddb/db_variables.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_variables.c,v 1.6 1994/06/29 06:31:23 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -22,8 +24,6 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. - * - * $Id: db_variables.c,v 1.5 1993/12/18 04:46:42 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_variables.h b/sys/ddb/db_variables.h index 838f98b8f39..8bdb6dea5d4 100644 --- a/sys/ddb/db_variables.h +++ b/sys/ddb/db_variables.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_variables.h,v 1.4 1994/06/29 06:31:24 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_variables.h,v 1.3 1994/02/15 14:50:47 mycroft Exp $ */ #ifndef _DB_VARIABLES_H_ diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index 06bfba073ed..0e0426530ab 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_watch.c,v 1.5 1994/06/29 06:31:26 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: Richard P. Draves, Carnegie Mellon University * Date: 10/90 - * $Id: db_watch.c,v 1.4 1994/01/08 01:01:51 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/ddb/db_watch.h b/sys/ddb/db_watch.h index daaf92967f6..8e62b1bd103 100644 --- a/sys/ddb/db_watch.h +++ b/sys/ddb/db_watch.h @@ -1,3 +1,5 @@ +/* $NetBSD: db_watch.h,v 1.5 1994/06/29 06:31:27 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 10/90 - * $Id: db_watch.h,v 1.4 1994/02/15 14:50:47 mycroft Exp $ */ #ifndef _DDB_DB_WATCH_ diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c index 17dcfba3fa1..3c70573469d 100644 --- a/sys/ddb/db_write_cmd.c +++ b/sys/ddb/db_write_cmd.c @@ -1,3 +1,5 @@ +/* $NetBSD: db_write_cmd.c,v 1.4 1994/06/29 06:31:28 cgd Exp $ */ + /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -25,7 +27,6 @@ * * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 - * $Id: db_write_cmd.c,v 1.3 1993/12/18 04:46:44 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 92a655b657f..ddb3792bf2c 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,3 +1,5 @@ +/* $NetBSD: ccd.c,v 1.2 1994/06/29 06:31:30 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990 The Regents of the University of California. @@ -35,9 +37,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: Utah Hdr: ccd.c 1.6 90/11/28 - * from: @(#)cd.c 7.4 (Berkeley) 5/7/91 - * $Id: ccd.c,v 1.1 1994/06/24 14:11:02 hpeyerl Exp $ + * from: Utah $Hdr: cd.c 1.6 90/11/28$ + * + * @(#)cd.c 7.4 (Berkeley) 5/7/91 */ /* diff --git a/sys/dev/ccdvar.h b/sys/dev/ccdvar.h index 42d6020080b..c57f1f44e73 100644 --- a/sys/dev/ccdvar.h +++ b/sys/dev/ccdvar.h @@ -1,3 +1,5 @@ +/* $NetBSD: ccdvar.h,v 1.2 1994/06/29 06:31:31 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990 The Regents of the University of California. @@ -35,9 +37,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: Utah Hdr: cdvar.h 1.1 90/07/09 - * from: @(#)cdvar.h 7.2 (Berkeley) 11/4/90 - * $Id: ccdvar.h,v 1.1 1994/06/24 14:11:04 hpeyerl Exp $ + * from: Utah $Hdr: cdvar.h 1.1 90/07/09$ + * + * @(#)cdvar.h 7.2 (Berkeley) 11/4/90 */ #define NCCDISKS 8 /* max # of component disks */ diff --git a/sys/dev/cons.c b/sys/dev/cons.c index b89584f836c..bd9e0c2fb27 100644 --- a/sys/dev/cons.c +++ b/sys/dev/cons.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cons.c,v 1.17 1994/06/27 19:49:45 cgd Exp $ */ +/* $NetBSD: cons.c,v 1.18 1994/06/29 06:31:32 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/dev/cons.h b/sys/dev/cons.h index 8fea02ca986..2f0d5ed9a4d 100644 --- a/sys/dev/cons.h +++ b/sys/dev/cons.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: cons.h,v 1.5 1994/06/27 19:49:47 cgd Exp $ */ +/* $NetBSD: cons.h,v 1.6 1994/06/29 06:31:34 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/dev/vn.c b/sys/dev/vn.c index 3692b9c783f..173cd603f3a 100644 --- a/sys/dev/vn.c +++ b/sys/dev/vn.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: vn.c,v 1.10 1994/06/27 19:49:48 cgd Exp $ */ +/* $NetBSD: vn.c,v 1.11 1994/06/29 06:31:35 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 96c1da4bc81..08f8f94c710 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: vnd.c,v 1.10 1994/06/27 19:49:48 cgd Exp $ */ +/* $NetBSD: vnd.c,v 1.11 1994/06/29 06:31:35 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/dev/vndioctl.h b/sys/dev/vndioctl.h index 0f7502d7ade..b62649dbd20 100644 --- a/sys/dev/vndioctl.h +++ b/sys/dev/vndioctl.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: vndioctl.h,v 1.2 1994/06/27 19:49:50 cgd Exp $ */ +/* $NetBSD: vndioctl.h,v 1.3 1994/06/29 06:31:37 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/dev/vnioctl.h b/sys/dev/vnioctl.h index 1a54af0bf6f..809e4fa88b9 100644 --- a/sys/dev/vnioctl.h +++ b/sys/dev/vnioctl.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: vnioctl.h,v 1.2 1994/06/27 19:49:50 cgd Exp $ */ +/* $NetBSD: vnioctl.h,v 1.3 1994/06/29 06:31:37 cgd Exp $ */ + /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 diff --git a/sys/isofs/cd9660/TODO b/sys/isofs/cd9660/TODO index 924f412754b..95d34cdd9f0 100644 --- a/sys/isofs/cd9660/TODO +++ b/sys/isofs/cd9660/TODO @@ -1,4 +1,4 @@ -# NetBSD $Id: TODO,v 1.2 1994/06/27 19:40:57 cgd Exp $ +# $NetBSD: TODO,v 1.3 1994/06/29 06:31:40 cgd Exp $ 1) should understand "older", original High Sierra ("CDROM001") type diff --git a/sys/isofs/cd9660/TODO.hibler b/sys/isofs/cd9660/TODO.hibler index 29e0f4a9efb..75e36180310 100644 --- a/sys/isofs/cd9660/TODO.hibler +++ b/sys/isofs/cd9660/TODO.hibler @@ -1,4 +1,4 @@ -# NetBSD $Id: TODO.hibler,v 1.2 1994/06/27 19:40:59 cgd Exp $ +# $NetBSD: TODO.hibler,v 1.3 1994/06/29 06:31:41 cgd Exp $ 1. Investiate making ISOFS another UFS shared filesystem (ala FFS/MFS/LFS). Since it was modelled after the inode code, we might be able to merge diff --git a/sys/isofs/cd9660/cd9660_bmap.c b/sys/isofs/cd9660/cd9660_bmap.c index 16977379fd7..228141e7cdb 100644 --- a/sys/isofs/cd9660/cd9660_bmap.c +++ b/sys/isofs/cd9660/cd9660_bmap.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_bmap.c,v 1.2 1994/06/27 19:41:00 cgd Exp $ */ +/* $NetBSD: cd9660_bmap.c,v 1.3 1994/06/29 06:31:42 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c index f7ec2b34be4..f0969bc67c9 100644 --- a/sys/isofs/cd9660/cd9660_lookup.c +++ b/sys/isofs/cd9660/cd9660_lookup.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_lookup.c,v 1.3 1994/06/27 19:41:02 cgd Exp $ */ +/* $NetBSD: cd9660_lookup.c,v 1.4 1994/06/29 06:31:43 cgd Exp $ */ + /*- * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c index 67553540ff7..9e110435f37 100644 --- a/sys/isofs/cd9660/cd9660_node.c +++ b/sys/isofs/cd9660/cd9660_node.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_node.c,v 1.3 1994/06/27 19:41:03 cgd Exp $ */ +/* $NetBSD: cd9660_node.c,v 1.4 1994/06/29 06:31:45 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1989, 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_node.h b/sys/isofs/cd9660/cd9660_node.h index 516479e8996..a7cf818b333 100644 --- a/sys/isofs/cd9660/cd9660_node.h +++ b/sys/isofs/cd9660/cd9660_node.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_node.h,v 1.2 1994/06/27 19:41:05 cgd Exp $ */ +/* $NetBSD: cd9660_node.h,v 1.3 1994/06/29 06:31:47 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_rrip.c b/sys/isofs/cd9660/cd9660_rrip.c index 36b487e67f3..f9a4dd526a4 100644 --- a/sys/isofs/cd9660/cd9660_rrip.c +++ b/sys/isofs/cd9660/cd9660_rrip.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_rrip.c,v 1.3 1994/06/27 19:41:06 cgd Exp $ */ +/* $NetBSD: cd9660_rrip.c,v 1.4 1994/06/29 06:31:49 cgd Exp $ */ + /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_rrip.h b/sys/isofs/cd9660/cd9660_rrip.h index fe1fc43a235..8420d9f3280 100644 --- a/sys/isofs/cd9660/cd9660_rrip.h +++ b/sys/isofs/cd9660/cd9660_rrip.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_rrip.h,v 1.2 1994/06/27 19:41:08 cgd Exp $ */ +/* $NetBSD: cd9660_rrip.h,v 1.3 1994/06/29 06:31:53 cgd Exp $ */ + /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_util.c b/sys/isofs/cd9660/cd9660_util.c index f8f3935f43b..aba56aebef4 100644 --- a/sys/isofs/cd9660/cd9660_util.c +++ b/sys/isofs/cd9660/cd9660_util.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_util.c,v 1.2 1994/06/27 19:41:09 cgd Exp $ */ +/* $NetBSD: cd9660_util.c,v 1.3 1994/06/29 06:31:54 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index d13a5b451a1..f5581d4770a 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_vfsops.c,v 1.3 1994/06/27 19:41:12 cgd Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.4 1994/06/29 06:31:56 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index b37fdd24d9e..9c1f51127d0 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,5 @@ -/* NetBSD $Id: cd9660_vnops.c,v 1.3 1994/06/27 19:41:17 cgd Exp $ */ +/* $NetBSD: cd9660_vnops.c,v 1.4 1994/06/29 06:31:59 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/iso.h b/sys/isofs/cd9660/iso.h index 945f05a39c7..52f47e2c7c9 100644 --- a/sys/isofs/cd9660/iso.h +++ b/sys/isofs/cd9660/iso.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: iso.h,v 1.2 1994/06/27 19:41:21 cgd Exp $ */ +/* $NetBSD: iso.h,v 1.3 1994/06/29 06:32:01 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/isofs/cd9660/iso_rrip.h b/sys/isofs/cd9660/iso_rrip.h index e672b48b05d..04691a90a58 100644 --- a/sys/isofs/cd9660/iso_rrip.h +++ b/sys/isofs/cd9660/iso_rrip.h @@ -1,4 +1,5 @@ -/* NetBSD $Id: iso_rrip.h,v 1.2 1994/06/27 19:41:24 cgd Exp $ */ +/* $NetBSD: iso_rrip.h,v 1.3 1994/06/29 06:32:02 cgd Exp $ */ + /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. diff --git a/sys/kern/exec_aout.c b/sys/kern/exec_aout.c index 33e68dabbd2..4e449636d38 100644 --- a/sys/kern/exec_aout.c +++ b/sys/kern/exec_aout.c @@ -1,3 +1,5 @@ +/* $NetBSD: exec_aout.c,v 1.10 1994/06/29 06:32:06 cgd Exp $ */ + /* * Copyright (c) 1993, 1994 Christopher G. Demetriou * All rights reserved. @@ -26,8 +28,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec_aout.c,v 1.9 1994/01/28 23:46:59 jtc Exp $ */ #include <sys/param.h> diff --git a/sys/kern/exec_conf.c b/sys/kern/exec_conf.c index 1b446318d32..b618ca8207a 100644 --- a/sys/kern/exec_conf.c +++ b/sys/kern/exec_conf.c @@ -1,3 +1,5 @@ +/* $NetBSD: exec_conf.c,v 1.5 1994/06/29 06:32:08 cgd Exp $ */ + /* * Copyright (c) 1993, 1994 Christopher G. Demetriou * All rights reserved. @@ -26,8 +28,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec_conf.c,v 1.4 1994/05/27 09:20:13 glass Exp $ */ #define EXEC_SCRIPT /* XXX */ diff --git a/sys/kern/exec_ecoff.c b/sys/kern/exec_ecoff.c index 5539d4985e1..d243e91294d 100644 --- a/sys/kern/exec_ecoff.c +++ b/sys/kern/exec_ecoff.c @@ -1,3 +1,5 @@ +/* $NetBSD: exec_ecoff.c,v 1.3 1994/06/29 06:32:10 cgd Exp $ */ + /* * Copyright (c) 1994 Adam Glass * Copyright (c) 1993, 1994 Christopher G. Demetriou @@ -27,8 +29,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec_ecoff.c,v 1.2 1994/05/28 20:21:30 glass Exp $ */ #include <sys/param.h> diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 10e3dca6f7b..208761e9d02 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,3 +1,5 @@ +/* $NetBSD: exec_script.c,v 1.8 1994/06/29 06:32:12 cgd Exp $ */ + /* * Copyright (c) 1993, 1994 Christopher G. Demetriou * All rights reserved. @@ -26,8 +28,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec_script.c,v 1.7 1994/06/08 11:28:29 mycroft Exp $ */ #if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS) diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index cbbebe1187c..62cb67cebe1 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: exec_subr.c,v 1.8 1994/06/29 06:32:13 cgd Exp $ */ + /* * Copyright (c) 1993, 1994 Christopher G. Demetriou * All rights reserved. @@ -26,8 +28,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: exec_subr.c,v 1.7 1994/05/23 03:04:57 cgd Exp $ */ #include <sys/param.h> diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index d15e3c8b51d..72345c8d239 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1 +1 @@ -revision 1.56 intentionally removed +revision 1.57 intentionally removed diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index cfbbcbdd063..24e9adefb08 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_acct.c,v 1.30 1994/06/29 06:32:17 cgd Exp $ */ + /*- * Copyright (c) 1994 Christopher G. Demetriou * Copyright (c) 1982, 1986, 1989, 1993 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 - * $Id: kern_acct.c,v 1.29 1994/06/19 22:58:29 cgd Exp $ + * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 */ #include <sys/param.h> diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 69553503f94..10ff1d08a6c 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1 +1,561 @@ -revision 1.18 intentionally removed +/* $NetBSD: kern_clock.c,v 1.19 1994/06/29 06:32:19 cgd Exp $ */ + +/*- + * Copyright (c) 1982, 1986, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/dkstat.h> +#include <sys/callout.h> +#include <sys/kernel.h> +#include <sys/proc.h> +#include <sys/resourcevar.h> + +#include <machine/cpu.h> + +#ifdef GPROF +#include <sys/gmon.h> +#endif + +/* + * Clock handling routines. + * + * This code is written to operate with two timers that run independently of + * each other. The main clock, running hz times per second, is used to keep + * track of real time. The second timer handles kernel and user profiling, + * and does resource use estimation. If the second timer is programmable, + * it is randomized to avoid aliasing between the two clocks. For example, + * the randomization prevents an adversary from always giving up the cpu + * just before its quantum expires. Otherwise, it would never accumulate + * cpu ticks. The mean frequency of the second timer is stathz. + * + * If no second timer exists, stathz will be zero; in this case we drive + * profiling and statistics off the main clock. This WILL NOT be accurate; + * do not do it unless absolutely necessary. + * + * The statistics clock may (or may not) be run at a higher rate while + * profiling. This profile clock runs at profhz. We require that profhz + * be an integral multiple of stathz. + * + * If the statistics clock is running fast, it must be divided by the ratio + * profhz/stathz for statistics. (For profiling, every tick counts.) + */ + +/* + * TODO: + * allocate more timeout table slots when table overflows. + */ + +/* + * Bump a timeval by a small number of usec's. + */ +#define BUMPTIME(t, usec) { \ + register volatile struct timeval *tp = (t); \ + register long us; \ + \ + tp->tv_usec = us = tp->tv_usec + (usec); \ + if (us >= 1000000) { \ + tp->tv_usec = us - 1000000; \ + tp->tv_sec++; \ + } \ +} + +int stathz; +int profhz; +int profprocs; +int ticks; +static int psdiv, pscnt; /* prof => stat divider */ +int psratio; /* ratio: prof / stat */ + +volatile struct timeval time; +volatile struct timeval mono_time; + +/* + * Initialize clock frequencies and start both clocks running. + */ +void +initclocks() +{ + register int i; + + /* + * Set divisors to 1 (normal case) and let the machine-specific + * code do its bit. + */ + psdiv = pscnt = 1; + cpu_initclocks(); + + /* + * Compute profhz/stathz, and fix profhz if needed. + */ + i = stathz ? stathz : hz; + if (profhz == 0) + profhz = i; + psratio = profhz / i; +} + +/* + * The real-time timer, interrupting hz times per second. + */ +void +hardclock(frame) + register struct clockframe *frame; +{ + register struct callout *p1; + register struct proc *p; + register int delta, needsoft; + extern int tickdelta; + extern long timedelta; + + /* + * Update real-time timeout queue. + * At front of queue are some number of events which are ``due''. + * The time to these is <= 0 and if negative represents the + * number of ticks which have passed since it was supposed to happen. + * The rest of the q elements (times > 0) are events yet to happen, + * where the time for each is given as a delta from the previous. + * Decrementing just the first of these serves to decrement the time + * to all events. + */ + needsoft = 0; + for (p1 = calltodo.c_next; p1 != NULL; p1 = p1->c_next) { + if (--p1->c_time > 0) + break; + needsoft = 1; + if (p1->c_time == 0) + break; + } + + p = curproc; + if (p) { + register struct pstats *pstats; + + /* + * Run current process's virtual and profile time, as needed. + */ + pstats = p->p_stats; + if (CLKF_USERMODE(frame) && + timerisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) + psignal(p, SIGVTALRM); + if (timerisset(&pstats->p_timer[ITIMER_PROF].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) + psignal(p, SIGPROF); + } + + /* + * If no separate statistics clock is available, run it from here. + */ + if (stathz == 0) + statclock(frame); + + /* + * Increment the time-of-day. The increment is just ``tick'' unless + * we are still adjusting the clock; see adjtime(). + */ + ticks++; + if (timedelta == 0) + delta = tick; + else { + delta = tick + tickdelta; + timedelta -= tickdelta; + } + BUMPTIME(&time, delta); + BUMPTIME(&mono_time, delta); + + /* + * Process callouts at a very low cpu priority, so we don't keep the + * relatively high clock interrupt priority any longer than necessary. + */ + if (needsoft) { + if (CLKF_BASEPRI(frame)) { + /* + * Save the overhead of a software interrupt; + * it will happen as soon as we return, so do it now. + */ + (void)splsoftclock(); + softclock(); + } else + setsoftclock(); + } +} + +/* + * Software (low priority) clock interrupt. + * Run periodic events from timeout queue. + */ +/*ARGSUSED*/ +void +softclock() +{ + register struct callout *c; + register void *arg; + register void (*func) __P((void *)); + register int s; + + s = splhigh(); + while ((c = calltodo.c_next) != NULL && c->c_time <= 0) { + func = c->c_func; + arg = c->c_arg; + calltodo.c_next = c->c_next; + c->c_next = callfree; + callfree = c; + splx(s); + (*func)(arg); + (void) splhigh(); + } + splx(s); +} + +/* + * timeout -- + * Execute a function after a specified length of time. + * + * untimeout -- + * Cancel previous timeout function call. + * + * See AT&T BCI Driver Reference Manual for specification. This + * implementation differs from that one in that no identification + * value is returned from timeout, rather, the original arguments + * to timeout are used to identify entries for untimeout. + */ +void +timeout(ftn, arg, ticks) + void (*ftn) __P((void *)); + void *arg; + register int ticks; +{ + register struct callout *new, *p, *t; + register int s; + + if (ticks <= 0) + ticks = 1; + + /* Lock out the clock. */ + s = splhigh(); + + /* Fill in the next free callout structure. */ + if (callfree == NULL) + panic("timeout table full"); + new = callfree; + callfree = new->c_next; + new->c_arg = arg; + new->c_func = ftn; + + /* + * The time for each event is stored as a difference from the time + * of the previous event on the queue. Walk the queue, correcting + * the ticks argument for queue entries passed. Correct the ticks + * value for the queue entry immediately after the insertion point + * as well. Watch out for negative c_time values; these represent + * overdue events. + */ + for (p = &calltodo; + (t = p->c_next) != NULL && ticks > t->c_time; p = t) + if (t->c_time > 0) + ticks -= t->c_time; + new->c_time = ticks; + if (t != NULL) + t->c_time -= ticks; + + /* Insert the new entry into the queue. */ + p->c_next = new; + new->c_next = t; + splx(s); +} + +void +untimeout(ftn, arg) + void (*ftn) __P((void *)); + void *arg; +{ + register struct callout *p, *t; + register int s; + + s = splhigh(); + for (p = &calltodo; (t = p->c_next) != NULL; p = t) + if (t->c_func == ftn && t->c_arg == arg) { + /* Increment next entry's tick count. */ + if (t->c_next && t->c_time > 0) + t->c_next->c_time += t->c_time; + + /* Move entry from callout queue to callfree queue. */ + p->c_next = t->c_next; + t->c_next = callfree; + callfree = t; + break; + } + splx(s); +} + +/* + * Compute number of hz until specified time. Used to + * compute third argument to timeout() from an absolute time. + */ +int +hzto(tv) + struct timeval *tv; +{ + register long ticks, sec; + int s; + + /* + * If number of milliseconds will fit in 32 bit arithmetic, + * then compute number of milliseconds to time and scale to + * ticks. Otherwise just compute number of hz in time, rounding + * times greater than representible to maximum value. + * + * Delta times less than 25 days can be computed ``exactly''. + * Maximum value for any timeout in 10ms ticks is 250 days. + */ + s = splhigh(); + sec = tv->tv_sec - time.tv_sec; + if (sec <= 0x7fffffff / 1000 - 1000) + ticks = ((tv->tv_sec - time.tv_sec) * 1000 + + (tv->tv_usec - time.tv_usec) / 1000) / (tick / 1000); + else if (sec <= 0x7fffffff / hz) + ticks = sec * hz; + else + ticks = 0x7fffffff; + splx(s); + return (ticks); +} + +/* + * Start profiling on a process. + * + * Kernel profiling passes proc0 which never exits and hence + * keeps the profile clock running constantly. + */ +void +startprofclock(p) + register struct proc *p; +{ + int s; + + if ((p->p_flag & P_PROFIL) == 0) { + p->p_flag |= P_PROFIL; + if (++profprocs == 1 && stathz != 0) { + s = splstatclock(); + psdiv = pscnt = psratio; + setstatclockrate(profhz); + splx(s); + } + } +} + +/* + * Stop profiling on a process. + */ +void +stopprofclock(p) + register struct proc *p; +{ + int s; + + if (p->p_flag & P_PROFIL) { + p->p_flag &= ~P_PROFIL; + if (--profprocs == 0 && stathz != 0) { + s = splstatclock(); + psdiv = pscnt = 1; + setstatclockrate(stathz); + splx(s); + } + } +} + +int dk_ndrive = DK_NDRIVE; + +/* + * Statistics clock. Grab profile sample, and if divider reaches 0, + * do process and kernel statistics. + */ +void +statclock(frame) + register struct clockframe *frame; +{ +#ifdef GPROF + register struct gmonparam *g; +#endif + register struct proc *p; + register int i; + + if (CLKF_USERMODE(frame)) { + p = curproc; + if (p->p_flag & P_PROFIL) + addupc_intr(p, CLKF_PC(frame), 1); + if (--pscnt > 0) + return; + /* + * Came from user mode; CPU was in user state. + * If this process is being profiled record the tick. + */ + p->p_uticks++; + if (p->p_nice > NZERO) + cp_time[CP_NICE]++; + else + cp_time[CP_USER]++; + } else { +#ifdef GPROF + /* + * Kernel statistics are just like addupc_intr, only easier. + */ + g = &_gmonparam; + if (g->state == GMON_PROF_ON) { + i = CLKF_PC(frame) - g->lowpc; + if (i < g->textsize) { + i /= HISTFRACTION * sizeof(*g->kcount); + g->kcount[i]++; + } + } +#endif + if (--pscnt > 0) + return; + /* + * Came from kernel mode, so we were: + * - handling an interrupt, + * - doing syscall or trap work on behalf of the current + * user process, or + * - spinning in the idle loop. + * Whichever it is, charge the time as appropriate. + * Note that we charge interrupts to the current process, + * regardless of whether they are ``for'' that process, + * so that we know how much of its real time was spent + * in ``non-process'' (i.e., interrupt) work. + */ + p = curproc; + if (CLKF_INTR(frame)) { + if (p != NULL) + p->p_iticks++; + cp_time[CP_INTR]++; + } else if (p != NULL) { + p->p_sticks++; + cp_time[CP_SYS]++; + } else + cp_time[CP_IDLE]++; + } + pscnt = psdiv; + + /* + * We maintain statistics shown by user-level statistics + * programs: the amount of time in each cpu state, and + * the amount of time each of DK_NDRIVE ``drives'' is busy. + * + * XXX should either run linked list of drives, or (better) + * grab timestamps in the start & done code. + */ + for (i = 0; i < DK_NDRIVE; i++) + if (dk_busy & (1 << i)) + dk_time[i]++; + + /* + * We adjust the priority of the current process. The priority of + * a process gets worse as it accumulates CPU time. The cpu usage + * estimator (p_estcpu) is increased here. The formula for computing + * priorities (in kern_synch.c) will compute a different value each + * time p_estcpu increases by 4. The cpu usage estimator ramps up + * quite quickly when the process is running (linearly), and decays + * away exponentially, at a rate which is proportionally slower when + * the system is busy. The basic principal is that the system will + * 90% forget that the process used a lot of CPU time in 5 * loadav + * seconds. This causes the system to favor processes which haven't + * run much recently, and to round-robin among other processes. + */ + if (p != NULL) { + p->p_cpticks++; + if (++p->p_estcpu == 0) + p->p_estcpu--; + if ((p->p_estcpu & 3) == 0) { + resetpriority(p); + if (p->p_priority >= PUSER) + p->p_priority = p->p_usrpri; + } + } +} + +/* + * Return information about system clocks. + */ +sysctl_clockrate(where, sizep) + register char *where; + size_t *sizep; +{ + struct clockinfo clkinfo; + + /* + * Construct clockinfo structure. + */ + clkinfo.hz = hz; + clkinfo.tick = tick; + clkinfo.profhz = profhz; + clkinfo.stathz = stathz ? stathz : hz; + return (sysctl_rdstruct(where, sizep, NULL, &clkinfo, sizeof(clkinfo))); +} + +#ifdef DDB +#include <ddb/db_access.h> +#include <ddb/db_sym.h> + +void db_show_callout(long addr, int haddr, int count, char *modif) +{ + register struct callout *p1; + register int cum; + register int s; + db_expr_t offset; + char *name; + + db_printf(" cum ticks arg func\n"); + s = splhigh(); + for (cum = 0, p1 = calltodo.c_next; p1; p1 = p1->c_next) { + register int t = p1->c_time; + + if (t > 0) + cum += t; + + db_find_sym_and_offset(p1->c_func, &name, &offset); + if (name == NULL) + name = "?"; + + db_printf("%9d %9d %8x %s (%x)\n", + cum, t, p1->c_arg, name, p1->c_func); + } + splx(s); +} +#endif diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e676821724d..ed9454b71d6 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_descrip.c,v 1.22 1994/06/29 06:32:23 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 - * $Id: kern_descrip.c,v 1.21 1994/06/22 03:00:21 mycroft Exp $ + * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 13e1264c4b9..7ce88816c14 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1 +1,531 @@ -revision 1.54 intentionally removed +/* $NetBSD: kern_exec.c,v 1.55 1994/06/29 06:32:24 cgd Exp $ */ + +/*- + * Copyright (C) 1993, 1994 Christopher G. Demetriou + * Copyright (C) 1992 Wolfgang Solfrank. + * Copyright (C) 1992 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/filedesc.h> +#include <sys/kernel.h> +#include <sys/proc.h> +#include <sys/mount.h> +#include <sys/malloc.h> +#include <sys/namei.h> +#include <sys/vnode.h> +#include <sys/file.h> +#include <sys/acct.h> +#include <sys/exec.h> +#include <sys/ktrace.h> +#include <sys/resourcevar.h> +#include <sys/wait.h> +#include <sys/mman.h> +#include <sys/signalvar.h> +#include <sys/stat.h> + +#include <vm/vm.h> +#include <vm/vm_kern.h> + +#include <machine/cpu.h> +#include <machine/reg.h> + +#ifdef COPY_SIGCODE +extern char sigcode[], esigcode[]; + +#define szsigcode (esigcode - sigcode) +#else +#define szsigcode 0 +#endif + +/* + * check exec: + * given an "executable" described in the exec package's namei info, + * see what we can do with it. + * + * ON ENTRY: + * exec package with appropriate namei info + * proc pointer of exec'ing proc + * NO SELF-LOCKED VNODES + * + * ON EXIT: + * error: nothing held, etc. exec header still allocated. + * ok: filled exec package, one locked vnode. + * + * EXEC SWITCH ENTRY: + * Locked vnode to check, exec package, proc. + * + * EXEC SWITCH EXIT: + * ok: return 0, filled exec package, one locked vnode. + * error: destructive: + * everything deallocated execept exec header. + * non-descructive: + * error code, locked vnode, exec header unmodified + */ +int +check_exec(p, epp) + struct proc *p; + struct exec_package *epp; +{ + int error, i; + struct vnode *vp; + char *cp, *ep, *name; + struct nameidata *ndp; + int resid; + + ndp = epp->ep_ndp; + ndp->ni_cnd.cn_nameiop = LOOKUP; + ndp->ni_cnd.cn_flags = FOLLOW | LOCKLEAF | SAVENAME; + /* first get the vnode */ + if (error = namei(ndp)) + return error; + epp->ep_vp = vp = ndp->ni_vp; + + /* check for regular file */ + if (vp->v_type != VREG) { + error = EACCES; + goto bad1; + } + + /* get attributes */ + if (error = VOP_GETATTR(vp, epp->ep_vap, p->p_ucred, p)) + goto bad1; + + /* Check mount point */ + if (vp->v_mount->mnt_flag & MNT_NOEXEC) { + error = EACCES; + goto bad1; + } + if ((vp->v_mount->mnt_flag & MNT_NOSUID) || (p->p_flag & P_TRACED)) + epp->ep_vap->va_mode &= ~(VSUID | VSGID); + + /* check access. for root we have to see if any exec bit on */ + if (error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p)) + goto bad1; + if ((epp->ep_vap->va_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) { + error = EACCES; + goto bad1; + } + + /* try to open it */ + if (error = VOP_OPEN(vp, FREAD, p->p_ucred, p)) + goto bad1; + + /* now we have the file, get the exec header */ + if (error = vn_rdwr(UIO_READ, vp, epp->ep_hdr, epp->ep_hdrlen, 0, + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p)) + goto bad2; + epp->ep_hdrvalid = epp->ep_hdrlen - resid; + + /* + * set up the vmcmds for creation of the process + * address space + */ + error = ENOEXEC; + for (i = 0; i < nexecs && error != 0; i++) { + if (execsw[i].es_check != NULL) + error = (*execsw[i].es_check)(p, epp); + if (epp->ep_flags & EXEC_DESTR && error != 0) + return error; + } + if (!error) { + /* check that entry point is sane */ + if (epp->ep_entry > VM_MAXUSER_ADDRESS) + error = ENOEXEC; + + /* check limits */ + if ((epp->ep_tsize > MAXTSIZ) || + (epp->ep_dsize > p->p_rlimit[RLIMIT_DATA].rlim_cur)) + error = ENOMEM; + + if (!error) + return (0); + } + + /* + * free any vmspace-creation commands, + * and release their references + */ + kill_vmcmds(&epp->ep_vmcmds); + +bad2: + /* + * unlock and close the vnode, restore the old one, free the + * pathname buf, and punt. + */ + VOP_UNLOCK(vp); + vn_close(vp, FREAD, p->p_ucred, p); + FREE(ndp->ni_cnd.cn_pnbuf, M_NAMEI); + return error; + +bad1: + /* + * free the namei pathname buffer, and put the vnode + * (which we don't yet have open). + */ + FREE(ndp->ni_cnd.cn_pnbuf, M_NAMEI); + vput(vp); + return error; +} + +/* + * exec system call + */ +/* ARGSUSED */ +execve(p, uap, retval) + register struct proc *p; + register struct execve_args *uap; + int *retval; +{ + int error, i; + struct exec_package pack; + struct nameidata nid; + struct vattr attr; + struct ucred *cred = p->p_ucred; + char *argp; + char **cpp, *dp, *sp, *np; + int argc, envc, len; + char *stack; + struct ps_strings arginfo; + struct vmspace *vm = p->p_vmspace; + char **tmpfap; + + /* + * figure out the maximum size of an exec header, if necessary. + * XXX should be able to keep LKM code from modifying exec switch + * when we're still using it, but... + */ + if (exec_maxhdrsz == 0) { + for (i = 0; i < nexecs; i++) + if (execsw[i].es_check != NULL + && execsw[i].es_hdrsz > exec_maxhdrsz) + exec_maxhdrsz = execsw[i].es_hdrsz; + } + + /* init the namei data to point the file user's program name */ + NDINIT(&nid, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, p); + + /* + * initialize the fields of the exec package. + */ + pack.ep_name = uap->path; + MALLOC(pack.ep_hdr, void *, exec_maxhdrsz, M_EXEC, M_WAITOK); + pack.ep_hdrlen = exec_maxhdrsz; + pack.ep_hdrvalid = 0; + pack.ep_ndp = &nid; + pack.ep_setup = NULL; /* assume no setup function */ + pack.ep_vmcmds.evs_cnt = 0; + pack.ep_vmcmds.evs_used = 0; + pack.ep_vap = &attr; + pack.ep_emul = EMUL_NETBSD; + pack.ep_flags = 0; + + /* see if we can run it. */ + if (error = check_exec(p, &pack)) + goto freehdr; + + /* XXX -- THE FOLLOWING SECTION NEEDS MAJOR CLEANUP */ + + /* allocate an argument buffer */ + argp = (char *) kmem_alloc_wait(exec_map, NCARGS); +#ifdef DIAGNOSTIC + if (argp == (vm_offset_t) 0) + panic("execve: argp == NULL"); +#endif + dp = argp; + argc = 0; + + /* copy the fake args list, if there's one, freeing it as we go */ + if (pack.ep_flags & EXEC_HASARGL) { + tmpfap = pack.ep_fa; + while (*tmpfap != NULL) { + char *cp; + + cp = *tmpfap; + while (*cp) + *dp++ = *cp++; + *dp++; + + FREE(*tmpfap, M_EXEC); + tmpfap++; argc++; + } + FREE(pack.ep_fa, M_EXEC); + pack.ep_flags &= ~EXEC_HASARGL; + } + + /* Now get argv & environment */ + if (!(cpp = uap->argp)) { + error = EINVAL; + goto bad; + } + + if (pack.ep_flags & EXEC_SKIPARG) + cpp++; + + while (1) { + len = argp + ARG_MAX - dp; + if (error = copyin(cpp, &sp, sizeof(sp))) + goto bad; + if (!sp) + break; + if (error = copyinstr(sp, dp, len, (u_int *) & len)) { + if (error == ENAMETOOLONG) + error = E2BIG; + goto bad; + } + dp += len; + cpp++; + argc++; + } + + envc = 0; + if (cpp = uap->envp) { /* environment need not be there */ + while (1) { + len = argp + ARG_MAX - dp; + if (error = copyin(cpp, &sp, sizeof(sp))) + goto bad; + if (!sp) + break; + if (error = copyinstr(sp, dp, len, (u_int *) & len)) { + if (error == ENAMETOOLONG) + error = E2BIG; + goto bad; + } + dp += len; + cpp++; + envc++; + } + dp = (char *) ALIGN(dp); + } + + /* Now check if args & environ fit into new stack */ + len = ((argc + envc + 2) * sizeof(char *) + sizeof(int) + + dp + STACKGAPLEN + szsigcode + sizeof(struct ps_strings)) - argp; + len = ALIGN(len); /* make the stack "safely" aligned */ + + if (len > pack.ep_ssize) { /* in effect, compare to initial limit */ + error = ENOMEM; + goto bad; + } + + /* adjust "active stack depth" for process VSZ */ + pack.ep_ssize = len; /* maybe should go elsewhere, but... */ + + /* Unmap old program */ +#ifdef sparc + kill_user_windows(p); /* before stack addresses go away */ +#endif + /* Kill shared memory and unmap old program */ +#ifdef SYSVSHM + if (vm->vm_shm) + shmexit(p); +#endif + vm_deallocate(&vm->vm_map, VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS); + + /* Now map address space */ + vm->vm_taddr = (char *) pack.ep_taddr; + vm->vm_tsize = btoc(pack.ep_tsize); + vm->vm_daddr = (char *) pack.ep_daddr; + vm->vm_dsize = btoc(pack.ep_dsize); + vm->vm_ssize = btoc(pack.ep_ssize); + vm->vm_maxsaddr = (char *) pack.ep_maxsaddr; + + /* create the new process's VM space by running the vmcmds */ +#ifdef DIAGNOSTIC + if (pack.ep_vmcmds.evs_used == 0) + panic("execve: no vmcmds"); +#endif + for (i = 0; i < pack.ep_vmcmds.evs_used && !error; i++) { + struct exec_vmcmd *vcp; + + vcp = &pack.ep_vmcmds.evs_cmds[i]; + error = (*vcp->ev_proc)(p, vcp); + } + + /* free the vmspace-creation commands, and release their references */ + kill_vmcmds(&pack.ep_vmcmds); + + /* if an error happened, deallocate and punt */ + if (error) + goto exec_abort; + + /* remember information about the process */ + arginfo.ps_nargvstr = argc; + arginfo.ps_nenvstr = envc; + + /* Now copy argc, args & environ to new stack */ + stack = (char *) (USRSTACK - len); + cpp = (char **) stack; + + if (copyout(&argc, cpp++, sizeof(argc))) + goto exec_abort; + dp = (char *) (cpp + argc + envc + 2); + + /* XXX don't copy them out, remap them! */ + arginfo.ps_argvstr = dp; /* remember location of argv for later */ + for (sp = argp; --argc >= 0; sp += len, dp += len) { + len = strlen(sp) + 1; + if (copyout(&dp, cpp++, sizeof(dp)) + || copyoutstr(sp, dp, len, 0)) + goto exec_abort; + } + np = 0; + if (copyout(&np, cpp++, sizeof(np))) + goto exec_abort; + + arginfo.ps_envstr = dp; /* remember location of env for later */ + for (; --envc >= 0; sp += len, dp += len) { + len = strlen(sp) + 1; + if (copyout(&dp, cpp++, sizeof(dp)) + || copyoutstr(sp, dp, len, 0)) + goto exec_abort; + } + if (copyout(&np, cpp, sizeof(np))) + goto exec_abort; + + /* copy out the process's ps_strings structure */ + if (copyout(&arginfo, (char *) PS_STRINGS, sizeof(arginfo))) + goto exec_abort; + +#ifdef COPY_SIGCODE + /* copy out the process's signal trapoline code */ + if (copyout((char *) sigcode, ((char *) PS_STRINGS) - szsigcode, + szsigcode)) { + goto exec_abort; + } +#endif + + fdcloseexec(p); /* handle close on exec */ + execsigs(p); /* reset catched signals */ + + /* set command name & other accounting info */ + len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN); + bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len); + p->p_comm[len] = 0; + p->p_acflag &= ~AFORK; + + /* record proc's vnode, for use by procfs and others */ + if (p->p_textvp) + vrele(p->p_textvp); + VREF(pack.ep_vp); + p->p_textvp = pack.ep_vp; + + p->p_flag |= P_EXEC; + if (p->p_flag & P_PPWAIT) { + p->p_flag &= ~P_PPWAIT; + wakeup((caddr_t) p->p_pptr); + } + + /* + * deal with set[ug]id. + * MNT_NOEXEC and P_TRACED have already been used to disable s[ug]id. + */ + p->p_flag &= ~P_SUGID; + if (((attr.va_mode & VSUID) != 0 && + p->p_ucred->cr_uid != attr.va_uid) + || (attr.va_mode & VSGID) != 0 && + p->p_ucred->cr_gid != attr.va_gid) { + p->p_ucred = crcopy(cred); +#ifdef KTRACE + /* + * If process is being ktraced, turn off - unless + * root set it. + */ + if (p->p_tracep && !(p->p_traceflag & KTRFAC_ROOT)) { + vrele(p->p_tracep); + p->p_tracep = NULL; + p->p_traceflag = 0; + } +#endif + if (attr.va_mode & VSUID) + p->p_ucred->cr_uid = attr.va_uid; + if (attr.va_mode & VSGID) + p->p_ucred->cr_gid = attr.va_gid; + p->p_flag |= P_SUGID; + } + p->p_cred->p_svuid = p->p_ucred->cr_uid; + p->p_cred->p_svgid = p->p_ucred->cr_gid; + + kmem_free_wakeup(exec_map, (vm_offset_t) argp, NCARGS); + + FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI); + VOP_CLOSE(pack.ep_vp, FREAD, cred, p); + vput(pack.ep_vp); + + /* setup new registers and do misc. setup. */ + setregs(p, pack.ep_entry, (u_long) stack, retval); + if (pack.ep_setup != NULL) + (*pack.ep_setup)(p, &pack); + + if (p->p_flag & P_TRACED) + psignal(p, SIGTRAP); + + p->p_emul = pack.ep_emul; + FREE(pack.ep_hdr, M_EXEC); + return 0; + +bad: + /* free the vmspace-creation commands, and release their references */ + kill_vmcmds(&pack.ep_vmcmds); + /* kill any opened file descriptor, if necessary */ + if (pack.ep_flags & EXEC_HASFD) { + pack.ep_flags &= ~EXEC_HASFD; + exec_closefd(p, pack.ep_fd); + } + /* close and put the exec'd file */ + VOP_CLOSE(pack.ep_vp, FREAD, cred, p); + vput(pack.ep_vp); + FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI); + kmem_free_wakeup(exec_map, (vm_offset_t) argp, NCARGS); + +freehdr: + FREE(pack.ep_hdr, M_EXEC); + return error; + +exec_abort: + /* + * the old process doesn't exist anymore. exit gracefully. + * get rid of the (new) address space we have created, if any, get rid + * of our namei data and vnode, and exit noting failure + */ + vm_deallocate(&vm->vm_map, VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS); + FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI); + VOP_CLOSE(pack.ep_vp, FREAD, cred, p); + vput(pack.ep_vp); + kmem_free_wakeup(exec_map, (vm_offset_t) argp, NCARGS); + FREE(pack.ep_hdr, M_EXEC); + exit1(p, W_EXITCODE(0, SIGABRT)); + exit1(p, -1); + + /* NOTREACHED */ + return 0; +} diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 312fc611559..33bb3c6a759 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1 +1,507 @@ -revision 1.23 intentionally removed +/* $NetBSD: kern_exit.c,v 1.24 1994/06/29 06:32:26 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1989, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/map.h> +#include <sys/ioctl.h> +#include <sys/proc.h> +#include <sys/tty.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/kernel.h> +#include <sys/proc.h> +#include <sys/buf.h> +#include <sys/wait.h> +#include <sys/file.h> +#include <sys/vnode.h> +#include <sys/syslog.h> +#include <sys/malloc.h> +#include <sys/resourcevar.h> +#include <sys/ptrace.h> + +#include <machine/cpu.h> +#ifdef COMPAT_43 +#include <machine/reg.h> +#include <machine/psl.h> +#endif + +#include <vm/vm.h> +#include <vm/vm_kern.h> + +__dead void cpu_exit __P((struct proc *)); +__dead void exit1 __P((struct proc *, int)); + +/* + * exit -- + * Death of process. + */ +struct exit_args { + int rval; +}; +__dead void +exit(p, uap, retval) + struct proc *p; + struct exit_args *uap; + int *retval; +{ + + exit1(p, W_EXITCODE(uap->rval, 0)); + /* NOTREACHED */ +} + +/* + * Exit: deallocate address space and other resources, change proc state + * to zombie, and unlink proc from allproc and parent's lists. Save exit + * status and rusage for wait(). Check for child processes and orphan them. + */ +__dead void +exit1(p, rv) + register struct proc *p; + int rv; +{ + register struct proc *q, *nq; + register struct proc **pp; + register struct vmspace *vm; + + if (p->p_pid == 1) + panic("init died (signal %d, exit %d)", + WTERMSIG(rv), WEXITSTATUS(rv)); +#ifdef PGINPROF + vmsizmon(); +#endif + if (p->p_flag & P_PROFIL) + stopprofclock(p); + MALLOC(p->p_ru, struct rusage *, sizeof(struct rusage), + M_ZOMBIE, M_WAITOK); + /* + * If parent is waiting for us to exit or exec, + * P_PPWAIT is set; we will wakeup the parent below. + */ + p->p_flag &= ~(P_TRACED | P_PPWAIT); + p->p_flag |= P_WEXIT; + p->p_sigignore = ~0; + p->p_siglist = 0; + untimeout(realitexpire, (caddr_t)p); + + /* + * Close open files and release open-file table. + * This may block! + */ + fdfree(p); + + /* The next three chunks should probably be moved to vmspace_exit. */ + vm = p->p_vmspace; +#ifdef SYSVSHM + if (vm->vm_shm) + shmexit(p); +#endif +#ifdef SYSVSEM + semexit(p); +#endif + /* + * Release user portion of address space. + * This releases references to vnodes, + * which could cause I/O if the file has been unlinked. + * Need to do this early enough that we can still sleep. + * Can't free the entire vmspace as the kernel stack + * may be mapped within that space also. + */ + if (vm->vm_refcnt == 1) + (void) vm_map_remove(&vm->vm_map, VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS); + + if (SESS_LEADER(p)) { + register struct session *sp = p->p_session; + + if (sp->s_ttyvp) { + /* + * Controlling process. + * Signal foreground pgrp, + * drain controlling terminal + * and revoke access to controlling terminal. + */ + if (sp->s_ttyp->t_session == sp) { + if (sp->s_ttyp->t_pgrp) + pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1); + (void) ttywait(sp->s_ttyp); + /* + * The tty could have been revoked + * if we blocked. + */ + if (sp->s_ttyvp) + vgoneall(sp->s_ttyvp); + } + if (sp->s_ttyvp) + vrele(sp->s_ttyvp); + sp->s_ttyvp = NULL; + /* + * s_ttyp is not zero'd; we use this to indicate + * that the session once had a controlling terminal. + * (for logging and informational purposes) + */ + } + sp->s_leader = NULL; + } + fixjobc(p, p->p_pgrp, 0); + p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; + (void)acct_process(p); +#ifdef KTRACE + /* + * release trace file + */ + p->p_traceflag = 0; /* don't trace the vrele() */ + if (p->p_tracep) + vrele(p->p_tracep); +#endif + /* + * Remove proc from allproc queue and pidhash chain. + * Place onto zombproc. Unlink from parent's child list. + */ + if (*p->p_prev = p->p_next) + p->p_next->p_prev = p->p_prev; + if (p->p_next = zombproc) + p->p_next->p_prev = &p->p_next; + p->p_prev = &zombproc; + zombproc = p; + p->p_stat = SZOMB; + + for (pp = &pidhash[PIDHASH(p->p_pid)]; *pp; pp = &(*pp)->p_hash) + if (*pp == p) { + *pp = p->p_hash; + goto done; + } + panic("exit"); +done: + + if (p->p_cptr) /* only need this if any child is S_ZOMB */ + wakeup((caddr_t) initproc); + for (q = p->p_cptr; q != NULL; q = nq) { + nq = q->p_osptr; + if (nq != NULL) + nq->p_ysptr = NULL; + if (initproc->p_cptr) + initproc->p_cptr->p_ysptr = q; + q->p_osptr = initproc->p_cptr; + q->p_ysptr = NULL; + initproc->p_cptr = q; + + q->p_pptr = initproc; + /* + * Traced processes are killed + * since their existence means someone is screwing up. + */ + if (q->p_flag & P_TRACED) { + q->p_flag &= ~P_TRACED; + psignal(q, SIGKILL); + } + } + p->p_cptr = NULL; + + /* + * Save exit status and final rusage info, adding in child rusage + * info and self times. + */ + p->p_xstat = rv; + *p->p_ru = p->p_stats->p_ru; + calcru(p, &p->p_ru->ru_utime, &p->p_ru->ru_stime, NULL); + ruadd(p->p_ru, &p->p_stats->p_cru); + + /* + * Notify parent that we're gone. + */ + psignal(p->p_pptr, SIGCHLD); + wakeup((caddr_t)p->p_pptr); + /* + * Notify procfs debugger + */ + if (p->p_flag & P_FSTRACE) + wakeup((caddr_t)p); +#if defined(tahoe) + /* move this to cpu_exit */ + p->p_addr->u_pcb.pcb_savacc.faddr = (float *)NULL; +#endif + /* + * Clear curproc after we've done all operations + * that could block, and before tearing down the rest + * of the process state that might be used from clock, etc. + * Also, can't clear curproc while we're still runnable, + * as we're not on a run queue (we are current, just not + * a proper proc any longer!). + * + * Other substructures are freed from wait(). + */ + curproc = NULL; + if (--p->p_limit->p_refcnt == 0) + FREE(p->p_limit, M_SUBPROC); + + /* + * Finally, call machine-dependent code to release the remaining + * resources including address space, the kernel stack and pcb. + * The address space is released by "vmspace_free(p->p_vmspace)"; + * This is machine-dependent, as we may have to change stacks + * or ensure that the current one isn't reallocated before we + * finish. cpu_exit will end with a call to cpu_swtch(), finishing + * our execution (pun intended). + */ + cpu_exit(p); +} + +struct wait_args { + int pid; + int *status; + int options; + struct rusage *rusage; +#ifdef COMPAT_43 + int compat; /* pseudo */ +#endif +}; + +#ifdef COMPAT_43 +#ifdef m68k +#include <machine/frame.h> +#define GETPS(rp) ((struct frame *)(rp))->f_sr +#else +#define GETPS(rp) (rp)[PS] +#endif + +owait(p, uap, retval) + struct proc *p; + register struct wait_args *uap; + int *retval; +{ + +#ifdef PSL_ALLCC + if ((GETPS(p->p_md.md_regs) & PSL_ALLCC) != PSL_ALLCC) { + uap->options = 0; + uap->rusage = NULL; + } else { + uap->options = p->p_md.md_regs[R0]; + uap->rusage = (struct rusage *)p->p_md.md_regs[R1]; + } +#else + uap->options = 0; + uap->rusage = NULL; +#endif + uap->pid = WAIT_ANY; + uap->status = NULL; + uap->compat = 1; + return (wait1(p, uap, retval)); +} + +wait4(p, uap, retval) + struct proc *p; + struct wait_args *uap; + int *retval; +{ + + uap->compat = 0; + return (wait1(p, uap, retval)); +} +#else +#define wait1 wait4 +#endif + +int +wait1(q, uap, retval) + register struct proc *q; + register struct wait_args *uap; + int retval[]; +{ + register int nfound; + register struct proc *p, *t; + int status, error; + +#ifdef COMPAT_09 + uap->pid = (short) uap->pid; +#endif + + if (uap->pid == 0) + uap->pid = -q->p_pgid; +#ifdef notyet + if (uap->options &~ (WUNTRACED|WNOHANG)) + return (EINVAL); +#endif +loop: + nfound = 0; + for (p = q->p_cptr; p; p = p->p_osptr) { + if (uap->pid != WAIT_ANY && + p->p_pid != uap->pid && p->p_pgid != -uap->pid) + continue; + nfound++; + if (p->p_stat == SZOMB) { + retval[0] = p->p_pid; +#ifdef COMPAT_43 + if (uap->compat) + retval[1] = p->p_xstat; + else +#endif + if (uap->status) { + status = p->p_xstat; /* convert to int */ + if (error = copyout((caddr_t)&status, + (caddr_t)uap->status, sizeof(status))) + return (error); + } + if (uap->rusage && (error = copyout((caddr_t)p->p_ru, + (caddr_t)uap->rusage, sizeof (struct rusage)))) + return (error); + /* + * If we got the child via a ptrace 'attach', + * we need to give it back to the old parent. + */ + if (p->p_oppid && (t = pfind(p->p_oppid))) { + p->p_oppid = 0; + proc_reparent(p, t); + psignal(t, SIGCHLD); + wakeup((caddr_t)t); + return (0); + } + p->p_xstat = 0; + ruadd(&q->p_stats->p_cru, p->p_ru); + FREE(p->p_ru, M_ZOMBIE); + + /* + * Decrement the count of procs running with this uid. + */ + (void)chgproccnt(p->p_cred->p_ruid, -1); + + /* + * Free up credentials. + */ + if (--p->p_cred->p_refcnt == 0) { + crfree(p->p_cred->pc_ucred); + FREE(p->p_cred, M_SUBPROC); + } + + /* + * Release reference to text vnode + */ + if (p->p_textvp) + vrele(p->p_textvp); + + /* + * Finally finished with old proc entry. + * Unlink it from its process group and free it. + */ + leavepgrp(p); + if (*p->p_prev = p->p_next) /* off zombproc */ + p->p_next->p_prev = p->p_prev; + if (q = p->p_ysptr) + q->p_osptr = p->p_osptr; + if (q = p->p_osptr) + q->p_ysptr = p->p_ysptr; + if ((q = p->p_pptr)->p_cptr == p) + q->p_cptr = p->p_osptr; + + /* + * Give machine-dependent layer a chance + * to free anything that cpu_exit couldn't + * release while still running in process context. + */ + cpu_wait(p); + FREE(p, M_PROC); + nprocs--; + return (0); + } + if (p->p_stat == SSTOP && (p->p_flag & P_WAITED) == 0 && + (p->p_flag & P_TRACED || uap->options & WUNTRACED)) { + p->p_flag |= P_WAITED; + retval[0] = p->p_pid; +#ifdef COMPAT_43 + if (uap->compat) { + retval[1] = W_STOPCODE(p->p_xstat); + error = 0; + } else +#endif + if (uap->status) { + status = W_STOPCODE(p->p_xstat); + error = copyout((caddr_t)&status, + (caddr_t)uap->status, sizeof(status)); + } else + error = 0; + return (error); + } + } + if (nfound == 0) + return (ECHILD); + if (uap->options & WNOHANG) { + retval[0] = 0; + return (0); + } + if (error = tsleep((caddr_t)q, PWAIT | PCATCH, "wait", 0)) + return (error); + goto loop; +} + +/* + * make process 'parent' the new parent of process 'child'. + */ +void +proc_reparent(child, parent) + register struct proc *child; + register struct proc *parent; +{ + register struct proc *o; + register struct proc *y; + + if (child->p_pptr == parent) + return; + + /* fix up the child linkage for the old parent */ + o = child->p_osptr; + y = child->p_ysptr; + if (y) + y->p_osptr = o; + if (o) + o->p_ysptr = y; + if (child->p_pptr->p_cptr == child) + child->p_pptr->p_cptr = o; + + /* fix up child linkage for new parent */ + o = parent->p_cptr; + if (o) + o->p_ysptr = child; + child->p_osptr = o; + child->p_ysptr = NULL; + parent->p_cptr = child; + child->p_pptr = parent; +} diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 8ca462dca78..73e9f26a4f2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_fork.c,v 1.19 1994/06/29 06:32:28 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 - * $Id: kern_fork.c,v 1.18 1994/06/15 19:59:21 mycroft Exp $ + * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 12e189896e5..150b5e192d9 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_ktrace.c,v 1.11 1994/06/29 06:32:29 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 - * $Id: kern_ktrace.c,v 1.10 1994/06/08 11:28:37 mycroft Exp $ + * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 */ #ifdef KTRACE diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index 3d2b4da9f31..92aa400f87d 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_lkm.c,v 1.18 1994/06/29 06:32:31 cgd Exp $ */ + /* * Copyright (c) 1994 Christopher G. Demetriou * Copyright (c) 1992 Terrence R. Lambert. @@ -29,8 +31,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id: kern_lkm.c,v 1.17 1994/06/08 11:28:38 mycroft Exp $ */ /* diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index a7842fbbe6d..07b2685dd80 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_malloc.c,v 1.9 1994/06/29 06:32:33 cgd Exp $ */ + /* * Copyright (c) 1987, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94 - * $Id: kern_malloc.c,v 1.8 1994/05/13 08:32:17 cgd Exp $ + * @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index b54da2f07b6..a73fbdf0b39 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -1 +1,325 @@ -revision 1.19 intentionally removed +/* $NetBSD: kern_physio.c,v 1.20 1994/06/29 06:32:34 cgd Exp $ */ + +/*- + * Copyright (c) 1994 Christopher G. Demetriou + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kern_physio.c 8.1 (Berkeley) 6/10/93 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/buf.h> +#include <sys/conf.h> +#include <sys/proc.h> + +/* + * The routines implemented in this file are described in: + * Leffler, et al.: The Design and Implementation of the 4.3BSD + * UNIX Operating System (Addison Welley, 1989) + * on pages 231-233. + * + * The routines "getphysbuf" and "putphysbuf" steal and return a swap + * buffer. Leffler, et al., says that swap buffers are used to do the + * I/O, so raw I/O requests don't have to be single-threaded. + */ + +struct buf *getphysbuf __P((void)); +void putphysbuf __P((struct buf *bp)); + +/* + * Do "physical I/O" on behalf of a user. "Physical I/O" is I/O directly + * from the raw device to user buffers, and bypasses the buffer cache. + * + * Comments in brackets are from Leffler, et al.'s pseudo-code implementation. + */ +int +physio(strategy, bp, dev, flags, minphys, uio) + int (*strategy)(); + struct buf *bp; + dev_t dev; + int flags; + u_int (*minphys)(); + struct uio *uio; +{ + struct iovec *iovp; + struct proc *p = curproc; + int error, done, i, nobuf, s, todo; + + error = 0; + flags &= B_READ | B_WRITE; + + /* + * [check user read/write access to the data buffer] + * + * Check each iov one by one. Note that we know if we're reading or + * writing, so we ignore the uio's rw parameter. Also note that if + * we're doing a read, that's a *write* to user-space. + */ + for (i = 0; i < uio->uio_iovcnt; i++) + if (!useracc(uio->uio_iov[i].iov_base, uio->uio_iov[i].iov_len, + (flags == B_READ) ? B_WRITE : B_READ)) + return (EFAULT); + + /* Make sure we have a buffer, creating one if necessary. */ + if (nobuf = (bp == NULL)) + bp = getphysbuf(); + + /* [raise the processor priority level to splbio;] */ + s = splbio(); + + /* [while the buffer is marked busy] */ + while (bp->b_flags & B_BUSY) { + /* [mark the buffer wanted] */ + bp->b_flags |= B_WANTED; + /* [wait until the buffer is available] */ + tsleep((caddr_t)bp, PRIBIO+1, "physbuf", 0); + } + + /* Mark it busy, so nobody else will use it. */ + bp->b_flags |= B_BUSY; + + /* [lower the priority level] */ + splx(s); + + /* [set up the fixed part of the buffer for a transfer] */ + bp->b_dev = dev; + bp->b_error = 0; + bp->b_proc = p; + + /* + * [while there are data to transfer and no I/O error] + * Note that I/O errors are handled with a 'goto' at the bottom + * of the 'while' loop. + */ + for (i = 0; i < uio->uio_iovcnt; i++) { + iovp = &uio->uio_iov[i]; + while (iovp->iov_len > 0) { + /* + * [mark the buffer busy for physical I/O] + * (i.e. set B_PHYS (because it's an I/O to user + * memory, and B_RAW, because B_RAW is to be + * "Set by physio for raw transfers.", in addition + * to the "busy" and read/write flag.) + */ + s = splbio(); + bp->b_flags = B_BUSY | B_PHYS | B_RAW | flags; + splx(s); + + /* [set up the buffer for a maximum-sized transfer] */ + bp->b_blkno = btodb(uio->uio_offset); + bp->b_bcount = iovp->iov_len; + bp->b_data = iovp->iov_base; + + /* + * [call minphys to bound the tranfer size] + * and remember the amount of data to transfer, + * for later comparison. + */ + (*minphys)(bp); + todo = bp->b_bcount; + + /* + * [lock the part of the user address space involved + * in the transfer] + * Beware vmapbuf(); it clobbers b_data and + * saves it in b_saveaddr. However, vunmapbuf() + * restores it. + */ + p->p_holdcnt++; + vslock(bp->b_data, todo); + vmapbuf(bp, todo); + + /* [call strategy to start the transfer] */ + (*strategy)(bp); + + /* + * Note that the raise/wait/lower/get error + * steps below would be done by biowait(), but + * we want to unlock the address space before + * we lower the priority. + * + * [raise the priority level to splbio] + */ + s = splbio(); + + /* [wait for the transfer to complete] */ + while ((bp->b_flags & B_DONE) == 0) + tsleep((caddr_t) bp, PRIBIO + 1, "physio", 0); + + /* + * [unlock the part of the address space previously + * locked] + */ + vunmapbuf(bp, todo); + vsunlock(bp->b_data, todo); + p->p_holdcnt--; + + /* remember error value (save a splbio/splx pair) */ + if (bp->b_flags & B_ERROR) + error = (bp->b_error ? bp->b_error : EIO); + + /* [lower the priority level] */ + splx(s); + + /* + * [deduct the transfer size from the total number + * of data to transfer] + */ + done = bp->b_bcount - bp->b_resid; + iovp->iov_len -= done; + iovp->iov_base += done; + uio->uio_offset += done; + uio->uio_resid -= done; + + /* + * Now, check for an error. + * Also, handle weird end-of-disk semantics. + */ + if (error || done < todo) + goto done; + } + } + +done: + /* + * [clean up the state of the buffer] + * Remember if somebody wants it, so we can wake them up below. + * Also, if we had to steal it, give it back. + */ + s = splbio(); + bp->b_flags &= ~(B_BUSY | B_PHYS | B_RAW); + if (nobuf) + putphysbuf(bp); + else { + /* + * [if another process is waiting for the raw I/O buffer, + * wake up processes waiting to do physical I/O; + */ + if (bp->b_flags & B_WANTED) { + bp->b_flags &= ~B_WANTED; + wakeup(bp); + } + } + splx(s); + + return (error); +} + +/* + * Get a swap buffer structure, for use in physical I/O. + * Mostly taken from /sys/vm/swap_pager.c, except that it no longer + * records buffer list-empty conditions, and sleeps at PRIBIO + 1, + * rather than PSWP + 1 (and on a different wchan). + */ +struct buf * +getphysbuf() +{ + struct buf *bp; + int s; + + s = splbio(); + while (bswlist.b_actf == NULL) { + bswlist.b_flags |= B_WANTED; + tsleep((caddr_t)&bswlist, PRIBIO + 1, "getphys", 0); + } + bp = bswlist.b_actf; + bswlist.b_actf = bp->b_actf; + splx(s); + return (bp); +} + +/* + * Get rid of a swap buffer structure which has been used in physical I/O. + * Mostly taken from /sys/vm/swap_pager.c, except that it now uses + * wakeup() rather than the VM-internal thread_wakeup(), and that the caller + * must mask disk interrupts, rather than putphysbuf() itself. + */ +void +putphysbuf(bp) + struct buf *bp; +{ + + bp->b_actf = bswlist.b_actf; + bswlist.b_actf = bp; + if (bp->b_vp) + brelvp(bp); + if (bswlist.b_flags & B_WANTED) { + bswlist.b_flags &= ~B_WANTED; + wakeup(&bswlist); + } +} + +/* + * Leffler, et al., says on p. 231: + * "The minphys() routine is called by physio() to adjust the + * size of each I/O transfer before the latter is passed to + * the strategy routine..." + * + * so, just adjust the buffer's count accounting to MAXPHYS here, + * and return the new count; + */ +u_int +minphys(bp) + struct buf *bp; +{ + + bp->b_bcount = min(MAXPHYS, bp->b_bcount); + return bp->b_bcount; +} + +/* + * Do a read on a device for a user process. + */ +rawread(dev, uio) + dev_t dev; + struct uio *uio; +{ + return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL, + dev, B_READ, minphys, uio)); +} + +/* + * Do a write on a device for a user process. + */ +rawwrite(dev, uio) + dev_t dev; + struct uio *uio; +{ + return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL, + dev, B_WRITE, minphys, uio)); +} diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index c2ae18190ee..5bc626c349b 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_proc.c,v 1.9 1994/06/29 06:32:36 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_proc.c 8.4 (Berkeley) 1/4/94 - * $Id: kern_proc.c,v 1.8 1994/06/08 11:28:40 mycroft Exp $ + * @(#)kern_proc.c 8.4 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index e6188b3e32e..6eead24f4ac 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_prot.c,v 1.16 1994/06/29 06:32:38 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_prot.c,v 1.15 1994/05/19 05:57:55 cgd Exp $ + * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 */ /* diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 77ef7830ac8..2de1814f2db 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_resource.c,v 1.20 1994/06/29 06:32:39 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.19 1994/05/19 08:13:22 cgd Exp $ + * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 146e00004d6..3609db74c3d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1 +1,1263 @@ -revision 1.28 intentionally removed +/* $NetBSD: kern_sig.c,v 1.29 1994/06/29 06:32:41 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1989, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 + */ + +#define SIGPROP /* include signal properties table */ +#include <sys/param.h> +#include <sys/signalvar.h> +#include <sys/resourcevar.h> +#include <sys/namei.h> +#include <sys/vnode.h> +#include <sys/proc.h> +#include <sys/systm.h> +#include <sys/timeb.h> +#include <sys/times.h> +#include <sys/buf.h> +#include <sys/acct.h> +#include <sys/file.h> +#include <sys/kernel.h> +#include <sys/wait.h> +#include <sys/ktrace.h> +#include <sys/syslog.h> +#include <sys/stat.h> +#include <sys/core.h> + +#include <machine/cpu.h> + +#include <vm/vm.h> +#include <sys/user.h> /* for coredump */ + +void stop __P((struct proc *p)); + +/* + * Can process p, with pcred pc, send the signal signum to process q? + */ +#define CANSIGNAL(p, pc, q, signum) \ + ((pc)->pc_ucred->cr_uid == 0 || \ + (pc)->p_ruid == (q)->p_cred->p_ruid || \ + (pc)->pc_ucred->cr_uid == (q)->p_cred->p_ruid || \ + (pc)->p_ruid == (q)->p_ucred->cr_uid || \ + (pc)->pc_ucred->cr_uid == (q)->p_ucred->cr_uid || \ + ((signum) == SIGCONT && (q)->p_session == (p)->p_session)) + +struct sigaction_args { + int signum; + struct sigaction *nsa; + struct sigaction *osa; +}; +/* ARGSUSED */ +sigaction(p, uap, retval) + struct proc *p; + register struct sigaction_args *uap; + int *retval; +{ + struct sigaction vec; + register struct sigaction *sa; + register struct sigacts *ps = p->p_sigacts; + register int signum; + int bit, error; + + signum = uap->signum; + if (signum <= 0 || signum >= NSIG || + signum == SIGKILL || signum == SIGSTOP) + return (EINVAL); + sa = &vec; + if (uap->osa) { + sa->sa_handler = ps->ps_sigact[signum]; + sa->sa_mask = ps->ps_catchmask[signum]; + bit = sigmask(signum); + sa->sa_flags = 0; + if ((ps->ps_sigonstack & bit) != 0) + sa->sa_flags |= SA_ONSTACK; + if ((ps->ps_sigintr & bit) == 0) + sa->sa_flags |= SA_RESTART; + if (p->p_flag & P_NOCLDSTOP) + sa->sa_flags |= SA_NOCLDSTOP; + if (error = copyout((caddr_t)sa, (caddr_t)uap->osa, + sizeof (vec))) + return (error); + } + if (uap->nsa) { + if (error = copyin((caddr_t)uap->nsa, (caddr_t)sa, + sizeof (vec))) + return (error); + setsigvec(p, signum, sa); + } + return (0); +} + +setsigvec(p, signum, sa) + register struct proc *p; + int signum; + register struct sigaction *sa; +{ + register struct sigacts *ps = p->p_sigacts; + register int bit; + + bit = sigmask(signum); + /* + * Change setting atomically. + */ + (void) splhigh(); + ps->ps_sigact[signum] = sa->sa_handler; + ps->ps_catchmask[signum] = sa->sa_mask &~ sigcantmask; + if ((sa->sa_flags & SA_RESTART) == 0) + ps->ps_sigintr |= bit; + else + ps->ps_sigintr &= ~bit; + if (sa->sa_flags & SA_ONSTACK) + ps->ps_sigonstack |= bit; + else + ps->ps_sigonstack &= ~bit; +#ifdef COMPAT_SUNOS + if (p->p_emul == EMUL_SUNOS && sa->sa_flags & SA_USERTRAMP) + ps->ps_usertramp |= bit; + else + ps->ps_usertramp &= ~bit; +#endif + if (signum == SIGCHLD) { + if (sa->sa_flags & SA_NOCLDSTOP) + p->p_flag |= P_NOCLDSTOP; + else + p->p_flag &= ~P_NOCLDSTOP; + } + /* + * Set bit in p_sigignore for signals that are set to SIG_IGN, + * and for signals set to SIG_DFL where the default is to ignore. + * However, don't put SIGCONT in p_sigignore, + * as we have to restart the process. + */ + if (sa->sa_handler == SIG_IGN || + (sigprop[signum] & SA_IGNORE && sa->sa_handler == SIG_DFL)) { + p->p_siglist &= ~bit; /* never to be seen again */ + if (signum != SIGCONT) + p->p_sigignore |= bit; /* easier in psignal */ + p->p_sigcatch &= ~bit; + } else { + p->p_sigignore &= ~bit; + if (sa->sa_handler == SIG_DFL) + p->p_sigcatch &= ~bit; + else + p->p_sigcatch |= bit; + } + (void) spl0(); +} + +/* + * Initialize signal state for process 0; + * set to ignore signals that are ignored by default. + */ +void +siginit(p) + struct proc *p; +{ + register int i; + + for (i = 0; i < NSIG; i++) + if (sigprop[i] & SA_IGNORE && i != SIGCONT) + p->p_sigignore |= sigmask(i); +} + +/* + * Reset signals for an exec of the specified process. + */ +void +execsigs(p) + register struct proc *p; +{ + register struct sigacts *ps = p->p_sigacts; + register int nc, mask; + + /* + * Reset caught signals. Held signals remain held + * through p_sigmask (unless they were caught, + * and are now ignored by default). + */ + while (p->p_sigcatch) { + nc = ffs((long)p->p_sigcatch); + mask = sigmask(nc); + p->p_sigcatch &= ~mask; + if (sigprop[nc] & SA_IGNORE) { + if (nc != SIGCONT) + p->p_sigignore |= mask; + p->p_siglist &= ~mask; + } + ps->ps_sigact[nc] = SIG_DFL; + } + /* + * Reset stack state to the user stack. + * Clear set of signals caught on the signal stack. + */ + ps->ps_sigstk.ss_flags = SA_DISABLE; + ps->ps_sigstk.ss_size = 0; + ps->ps_sigstk.ss_base = 0; + ps->ps_flags = 0; +} + +/* + * Manipulate signal mask. + * Note that we receive new mask, not pointer, + * and return old mask as return value; + * the library stub does the rest. + */ +struct sigprocmask_args { + int how; + sigset_t mask; +}; +sigprocmask(p, uap, retval) + register struct proc *p; + struct sigprocmask_args *uap; + int *retval; +{ + int error = 0; + + *retval = p->p_sigmask; + (void) splhigh(); + + switch (uap->how) { + case SIG_BLOCK: + p->p_sigmask |= uap->mask &~ sigcantmask; + break; + + case SIG_UNBLOCK: + p->p_sigmask &= ~uap->mask; + break; + + case SIG_SETMASK: + p->p_sigmask = uap->mask &~ sigcantmask; + break; + + default: + error = EINVAL; + break; + } + (void) spl0(); + return (error); +} + +/* ARGSUSED */ +sigpending(p, uap, retval) + struct proc *p; + void *uap; + int *retval; +{ + + *retval = p->p_siglist; + return (0); +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +/* + * Generalized interface signal handler, 4.3-compatible. + */ +struct osigvec_args { + int signum; + struct sigvec *nsv; + struct sigvec *osv; +}; +/* ARGSUSED */ +osigvec(p, uap, retval) + struct proc *p; + register struct osigvec_args *uap; + int *retval; +{ + struct sigvec vec; + register struct sigacts *ps = p->p_sigacts; + register struct sigvec *sv; + register int signum; + int bit, error; + + signum = uap->signum; + if (signum <= 0 || signum >= NSIG || + signum == SIGKILL || signum == SIGSTOP) + return (EINVAL); + sv = &vec; + if (uap->osv) { + *(sig_t *)&sv->sv_handler = ps->ps_sigact[signum]; + sv->sv_mask = ps->ps_catchmask[signum]; + bit = sigmask(signum); + sv->sv_flags = 0; + if ((ps->ps_sigonstack & bit) != 0) + sv->sv_flags |= SV_ONSTACK; + if ((ps->ps_sigintr & bit) != 0) + sv->sv_flags |= SV_INTERRUPT; +#ifdef COMPAT_SUNOS + if (p->p_emul != EMUL_SUNOS) +#endif + if (p->p_flag & P_NOCLDSTOP) + sv->sv_flags |= SA_NOCLDSTOP; + if (error = copyout((caddr_t)sv, (caddr_t)uap->osv, + sizeof (vec))) + return (error); + } + if (uap->nsv) { + if (error = copyin((caddr_t)uap->nsv, (caddr_t)sv, + sizeof (vec))) + return (error); +#ifdef COMPAT_SUNOS + /* + * SunOS uses this bit (4, aka SA_DISABLE) as SV_RESETHAND, + * `reset to SIG_DFL on delivery'. We have no such option + * now or ever! + */ + if (p->p_emul == EMUL_SUNOS) { + if (sv->sv_flags & SA_DISABLE) + return (EINVAL); + sv->sv_flags |= SA_USERTRAMP; + } +#endif + sv->sv_flags ^= SA_RESTART; /* opposite of SV_INTERRUPT */ + setsigvec(p, signum, (struct sigaction *)sv); + } + return (0); +} + +struct osigblock_args { + int mask; +}; +osigblock(p, uap, retval) + register struct proc *p; + struct osigblock_args *uap; + int *retval; +{ + + (void) splhigh(); + *retval = p->p_sigmask; + p->p_sigmask |= uap->mask &~ sigcantmask; + (void) spl0(); + return (0); +} + +struct osigsetmask_args { + int mask; +}; +int +osigsetmask(p, uap, retval) + struct proc *p; + struct osigsetmask_args *uap; + int *retval; +{ + + (void) splhigh(); + *retval = p->p_sigmask; + p->p_sigmask = uap->mask &~ sigcantmask; + (void) spl0(); + return (0); +} +#endif /* COMPAT_43 || COMPAT_SUNOS */ + +/* + * Suspend process until signal, providing mask to be set + * in the meantime. Note nonstandard calling convention: + * libc stub passes mask, not pointer, to save a copyin. + */ +struct sigsuspend_args { + sigset_t mask; +}; +/* ARGSUSED */ +int +sigsuspend(p, uap, retval) + register struct proc *p; + struct sigsuspend_args *uap; + int *retval; +{ + register struct sigacts *ps = p->p_sigacts; + + /* + * When returning from sigpause, we want + * the old mask to be restored after the + * signal handler has finished. Thus, we + * save it here and mark the sigacts structure + * to indicate this. + */ + ps->ps_oldmask = p->p_sigmask; + ps->ps_flags |= SAS_OLDMASK; + p->p_sigmask = uap->mask &~ sigcantmask; + while (tsleep((caddr_t) ps, PPAUSE|PCATCH, "pause", 0) == 0) + /* void */; + /* always return EINTR rather than ERESTART... */ + return (EINTR); +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_HPUX) +struct osigstack_args { + struct sigstack *nss; + struct sigstack *oss; +}; +/* ARGSUSED */ +int +osigstack(p, uap, retval) + struct proc *p; + register struct osigstack_args *uap; + int *retval; +{ + struct sigstack ss; + struct sigacts *psp; + int error = 0; + + psp = p->p_sigacts; + ss.ss_sp = psp->ps_sigstk.ss_base; + ss.ss_onstack = psp->ps_sigstk.ss_flags & SA_ONSTACK; + if (uap->oss && (error = copyout((caddr_t)&ss, (caddr_t)uap->oss, + sizeof (struct sigstack)))) + return (error); + if (uap->nss && (error = copyin((caddr_t)uap->nss, (caddr_t)&ss, + sizeof (ss))) == 0) { + psp->ps_sigstk.ss_base = ss.ss_sp; + psp->ps_sigstk.ss_size = 0; + psp->ps_sigstk.ss_flags |= ss.ss_onstack & SA_ONSTACK; + psp->ps_flags |= SAS_ALTSTACK; + } + return (error); +} +#endif /* COMPAT_43 || COMPAT_SUNOS || COMPAT_HPUX */ + +struct sigaltstack_args { + struct sigaltstack *nss; + struct sigaltstack *oss; +}; +/* ARGSUSED */ +sigaltstack(p, uap, retval) + struct proc *p; + register struct sigaltstack_args *uap; + int *retval; +{ + struct sigacts *psp; + struct sigaltstack ss; + int error; + + psp = p->p_sigacts; + if ((psp->ps_flags & SAS_ALTSTACK) == 0) + psp->ps_sigstk.ss_flags |= SA_DISABLE; + if (uap->oss && (error = copyout((caddr_t)&psp->ps_sigstk, + (caddr_t)uap->oss, sizeof (struct sigaltstack)))) + return (error); + if (uap->nss == 0) + return (0); + if (error = copyin((caddr_t)uap->nss, (caddr_t)&ss, sizeof (ss))) + return (error); + if (ss.ss_flags & SA_DISABLE) { + if (psp->ps_sigstk.ss_flags & SA_ONSTACK) + return (EINVAL); + psp->ps_flags &= ~SAS_ALTSTACK; + psp->ps_sigstk.ss_flags = ss.ss_flags; + return (0); + } + if (ss.ss_size < MINSIGSTKSZ) + return (ENOMEM); + psp->ps_flags |= SAS_ALTSTACK; + psp->ps_sigstk= ss; + return (0); +} + +struct kill_args { + pid_t pid; + int signum; +}; +/* ARGSUSED */ +int +kill(cp, uap, retval) + register struct proc *cp; + register struct kill_args *uap; + int *retval; +{ + register struct proc *p; + register struct pcred *pc = cp->p_cred; + +#ifdef COMPAT_09 + uap->pid = (short) uap->pid; +#endif + + if ((u_int)uap->signum >= NSIG) + return (EINVAL); + if (uap->pid > 0) { + /* kill single process */ + if ((p = pfind(uap->pid)) == NULL) + return (ESRCH); + if (!CANSIGNAL(cp, pc, p, uap->signum)) + return (EPERM); + if (uap->signum) + psignal(p, uap->signum); + return (0); + } + switch (uap->pid) { + case -1: /* broadcast signal */ + return (killpg1(cp, uap->signum, 0, 1)); + case 0: /* signal own process group */ + return (killpg1(cp, uap->signum, 0, 0)); + default: /* negative explicit process group */ + return (killpg1(cp, uap->signum, -uap->pid, 0)); + } + /* NOTREACHED */ +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +struct okillpg_args { + int pgid; + int signum; +}; +/* ARGSUSED */ +okillpg(p, uap, retval) + struct proc *p; + register struct okillpg_args *uap; + int *retval; +{ + +#ifdef COMPAT_09 + uap->pgid = (short) uap->pgid; +#endif + + if ((u_int)uap->signum >= NSIG) + return (EINVAL); + return (killpg1(p, uap->signum, uap->pgid, 0)); +} +#endif /* COMPAT_43 || COMPAT_SUNOS */ + +/* + * Common code for kill process group/broadcast kill. + * cp is calling process. + */ +killpg1(cp, signum, pgid, all) + register struct proc *cp; + int signum, pgid, all; +{ + register struct proc *p; + register struct pcred *pc = cp->p_cred; + struct pgrp *pgrp; + int nfound = 0; + + if (all) + /* + * broadcast + */ + for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || + p == cp || !CANSIGNAL(cp, pc, p, signum)) + continue; + nfound++; + if (signum) + psignal(p, signum); + } + else { + if (pgid == 0) + /* + * zero pgid means send to my process group. + */ + pgrp = cp->p_pgrp; + else { + pgrp = pgfind(pgid); + if (pgrp == NULL) + return (ESRCH); + } + for (p = pgrp->pg_mem; p != NULL; p = p->p_pgrpnxt) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || + p->p_stat == SZOMB || + !CANSIGNAL(cp, pc, p, signum)) + continue; + nfound++; + if (signum) + psignal(p, signum); + } + } + return (nfound ? 0 : ESRCH); +} + +/* + * Send a signal to a process group. + */ +void +gsignal(pgid, signum) + int pgid, signum; +{ + struct pgrp *pgrp; + + if (pgid && (pgrp = pgfind(pgid))) + pgsignal(pgrp, signum, 0); +} + +/* + * Send a signal to a process group. If checktty is 1, + * limit to members which have a controlling terminal. + */ +void +pgsignal(pgrp, signum, checkctty) + struct pgrp *pgrp; + int signum, checkctty; +{ + register struct proc *p; + + if (pgrp) + for (p = pgrp->pg_mem; p != NULL; p = p->p_pgrpnxt) + if (checkctty == 0 || p->p_flag & P_CONTROLT) + psignal(p, signum); +} + +/* + * Send a signal caused by a trap to the current process. + * If it will be caught immediately, deliver it with correct code. + * Otherwise, post it normally. + */ +void +trapsignal(p, signum, code) + struct proc *p; + register int signum; + u_int code; +{ + register struct sigacts *ps = p->p_sigacts; + int mask; + + mask = sigmask(signum); + if ((p->p_flag & P_TRACED) == 0 && (p->p_sigcatch & mask) != 0 && + (p->p_sigmask & mask) == 0) { + p->p_stats->p_ru.ru_nsignals++; +#ifdef KTRACE + if (KTRPOINT(p, KTR_PSIG)) + ktrpsig(p->p_tracep, signum, ps->ps_sigact[signum], + p->p_sigmask, code); +#endif + sendsig(ps->ps_sigact[signum], signum, p->p_sigmask, code); + p->p_sigmask |= ps->ps_catchmask[signum] | mask; + } else { + ps->ps_code = code; /* XXX for core dump/debugger */ + psignal(p, signum); + } +} + +/* + * Send the signal to the process. If the signal has an action, the action + * is usually performed by the target process rather than the caller; we add + * the signal to the set of pending signals for the process. + * + * Exceptions: + * o When a stop signal is sent to a sleeping process that takes the + * default action, the process is stopped without awakening it. + * o SIGCONT restarts stopped processes (or puts them back to sleep) + * regardless of the signal action (eg, blocked or ignored). + * + * Other ignored signals are discarded immediately. + */ +void +psignal(p, signum) + register struct proc *p; + register int signum; +{ + register int s, prop; + register sig_t action; + int mask; + + if ((u_int)signum >= NSIG || signum == 0) + panic("psignal signal number"); + mask = sigmask(signum); + prop = sigprop[signum]; + + /* + * If proc is traced, always give parent a chance. + */ + if (p->p_flag & P_TRACED) + action = SIG_DFL; + else { + /* + * If the signal is being ignored, + * then we forget about it immediately. + * (Note: we don't set SIGCONT in p_sigignore, + * and if it is set to SIG_IGN, + * action will be SIG_DFL here.) + */ + if (p->p_sigignore & mask) + return; + if (p->p_sigmask & mask) + action = SIG_HOLD; + else if (p->p_sigcatch & mask) + action = SIG_CATCH; + else + action = SIG_DFL; + } + + if (p->p_nice > NZERO && action == SIG_DFL && (prop & SA_KILL) && + (p->p_flag & P_TRACED) == 0) + p->p_nice = NZERO; + + if (prop & SA_CONT) + p->p_siglist &= ~stopsigmask; + + if (prop & SA_STOP) { + /* + * If sending a tty stop signal to a member of an orphaned + * process group, discard the signal here if the action + * is default; don't stop the process below if sleeping, + * and don't clear any pending SIGCONT. + */ + if (prop & SA_TTYSTOP && p->p_pgrp->pg_jobc == 0 && + action == SIG_DFL) + return; + p->p_siglist &= ~contsigmask; + } + p->p_siglist |= mask; + + /* + * Defer further processing for signals which are held, + * except that stopped processes must be continued by SIGCONT. + */ + if (action == SIG_HOLD && ((prop & SA_CONT) == 0 || p->p_stat != SSTOP)) + return; + s = splhigh(); + switch (p->p_stat) { + + case SSLEEP: + /* + * If process is sleeping uninterruptibly + * we can't interrupt the sleep... the signal will + * be noticed when the process returns through + * trap() or syscall(). + */ + if ((p->p_flag & P_SINTR) == 0) + goto out; + /* + * Process is sleeping and traced... make it runnable + * so it can discover the signal in issignal() and stop + * for the parent. + */ + if (p->p_flag & P_TRACED) + goto run; + /* + * If SIGCONT is default (or ignored) and process is + * asleep, we are finished; the process should not + * be awakened. + */ + if ((prop & SA_CONT) && action == SIG_DFL) { + p->p_siglist &= ~mask; + goto out; + } + /* + * When a sleeping process receives a stop + * signal, process immediately if possible. + * All other (caught or default) signals + * cause the process to run. + */ + if (prop & SA_STOP) { + if (action != SIG_DFL) + goto runfast; + /* + * If a child holding parent blocked, + * stopping could cause deadlock. + */ + if (p->p_flag & P_PPWAIT) + goto out; + p->p_siglist &= ~mask; + p->p_xstat = signum; + if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) + psignal(p->p_pptr, SIGCHLD); + stop(p); + goto out; + } else + goto runfast; + /*NOTREACHED*/ + + case SSTOP: + /* + * If traced process is already stopped, + * then no further action is necessary. + */ + if (p->p_flag & P_TRACED) + goto out; + + /* + * Kill signal always sets processes running. + */ + if (signum == SIGKILL) + goto runfast; + + if (prop & SA_CONT) { + /* + * If SIGCONT is default (or ignored), we continue the + * process but don't leave the signal in p_siglist, as + * it has no further action. If SIGCONT is held, we + * continue the process and leave the signal in + * p_siglist. If the process catches SIGCONT, let it + * handle the signal itself. If it isn't waiting on + * an event, then it goes back to run state. + * Otherwise, process goes back to sleep state. + */ + if (action == SIG_DFL) + p->p_siglist &= ~mask; + if (action == SIG_CATCH) + goto runfast; + if (p->p_wchan == 0) + goto run; + p->p_stat = SSLEEP; + goto out; + } + + if (prop & SA_STOP) { + /* + * Already stopped, don't need to stop again. + * (If we did the shell could get confused.) + */ + p->p_siglist &= ~mask; /* take it away */ + goto out; + } + + /* + * If process is sleeping interruptibly, then simulate a + * wakeup so that when it is continued, it will be made + * runnable and can look at the signal. But don't make + * the process runnable, leave it stopped. + */ + if (p->p_wchan && p->p_flag & P_SINTR) + unsleep(p); + goto out; + + default: + /* + * SRUN, SIDL, SZOMB do nothing with the signal, + * other than kicking ourselves if we are running. + * It will either never be noticed, or noticed very soon. + */ + if (p == curproc) + signotify(p); + goto out; + } + /*NOTREACHED*/ + +runfast: + /* + * Raise priority to at least PUSER. + */ + if (p->p_priority > PUSER) + p->p_priority = PUSER; +run: + setrunnable(p); +out: + splx(s); +} + +/* + * If the current process has received a signal (should be caught or cause + * termination, should interrupt current syscall), return the signal number. + * Stop signals with default action are processed immediately, then cleared; + * they aren't returned. This is checked after each entry to the system for + * a syscall or trap (though this can usually be done without calling issignal + * by checking the pending signal masks in the CURSIG macro.) The normal call + * sequence is + * + * while (signum = CURSIG(curproc)) + * postsig(signum); + */ +int +issignal(p) + register struct proc *p; +{ + register int signum, mask, prop; + + for (;;) { + mask = p->p_siglist & ~p->p_sigmask; + if (p->p_flag & P_PPWAIT) + mask &= ~stopsigmask; + if (mask == 0) /* no signal to send */ + return (0); + signum = ffs((long)mask); + mask = sigmask(signum); + prop = sigprop[signum]; + /* + * We should see pending but ignored signals + * only if P_TRACED was on when they were posted. + */ + if (mask & p->p_sigignore && (p->p_flag & P_TRACED) == 0) { + p->p_siglist &= ~mask; + continue; + } + if (p->p_flag & P_TRACED && (p->p_flag & P_PPWAIT) == 0) { + /* + * If traced, always stop, and stay + * stopped until released by the debugger. + */ + p->p_xstat = signum; + if (p->p_flag & P_FSTRACE) { +#ifdef PROCFS + /* procfs debugging */ + p->p_stat = SSTOP; + wakeup((caddr_t)p); + mi_switch(); +#else + panic("procfs debugging"); +#endif + } else { + /* ptrace debugging */ + psignal(p->p_pptr, SIGCHLD); + do { + stop(p); + mi_switch(); + } while (!trace_req(p) && p->p_flag & P_TRACED); + } + + /* + * If the traced bit got turned off, go back up + * to the top to rescan signals. This ensures + * that p_sig* and ps_sigact are consistent. + */ + if ((p->p_flag & P_TRACED) == 0) + continue; + + /* + * If parent wants us to take the signal, + * then it will leave it in p->p_xstat; + * otherwise we just look for signals again. + */ + p->p_siglist &= ~mask; /* clear the old signal */ + signum = p->p_xstat; + if (signum == 0) + continue; + + /* + * Put the new signal into p_siglist. If the + * signal is being masked, look for other signals. + */ + mask = sigmask(signum); + p->p_siglist |= mask; + if (p->p_sigmask & mask) + continue; + } + + /* + * Decide whether the signal should be returned. + * Return the signal's number, or fall through + * to clear it from the pending mask. + */ + switch ((int)p->p_sigacts->ps_sigact[signum]) { + + case SIG_DFL: + /* + * Don't take default actions on system processes. + */ + if (p->p_pid <= 1) { +#ifdef DIAGNOSTIC + /* + * Are you sure you want to ignore SIGSEGV + * in init? XXX + */ + printf("Process (pid %d) got signal %d\n", + p->p_pid, signum); +#endif + break; /* == ignore */ + } + /* + * If there is a pending stop signal to process + * with default action, stop here, + * then clear the signal. However, + * if process is member of an orphaned + * process group, ignore tty stop signals. + */ + if (prop & SA_STOP) { + if (p->p_flag & P_TRACED || + (p->p_pgrp->pg_jobc == 0 && + prop & SA_TTYSTOP)) + break; /* == ignore */ + p->p_xstat = signum; + stop(p); + if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) + psignal(p->p_pptr, SIGCHLD); + mi_switch(); + break; + } else if (prop & SA_IGNORE) { + /* + * Except for SIGCONT, shouldn't get here. + * Default action is to ignore; drop it. + */ + break; /* == ignore */ + } else + return (signum); + /*NOTREACHED*/ + + case SIG_IGN: + /* + * Masking above should prevent us ever trying + * to take action on an ignored signal other + * than SIGCONT, unless process is traced. + */ + if ((prop & SA_CONT) == 0 && + (p->p_flag & P_TRACED) == 0) + printf("issignal\n"); + break; /* == ignore */ + + default: + /* + * This signal has an action, let + * postsig() process it. + */ + return (signum); + } + p->p_siglist &= ~mask; /* take the signal! */ + } + /* NOTREACHED */ +} + +/* + * Put the argument process into the stopped state and notify the parent + * via wakeup. Signals are handled elsewhere. The process must not be + * on the run queue. + */ +void +stop(p) + register struct proc *p; +{ + + p->p_stat = SSTOP; + p->p_flag &= ~P_WAITED; + wakeup((caddr_t)p->p_pptr); +} + +/* + * Take the action for the specified signal + * from the current set of pending signals. + */ +void +postsig(signum) + register int signum; +{ + register struct proc *p = curproc; + register struct sigacts *ps = p->p_sigacts; + register sig_t action; + int code, mask, returnmask; + +#ifdef DIAGNOSTIC + if (signum == 0) + panic("postsig"); +#endif + mask = sigmask(signum); + p->p_siglist &= ~mask; + action = ps->ps_sigact[signum]; +#ifdef KTRACE + if (KTRPOINT(p, KTR_PSIG)) + ktrpsig(p->p_tracep, + signum, action, ps->ps_flags & SAS_OLDMASK ? + ps->ps_oldmask : p->p_sigmask, 0); +#endif + if (action == SIG_DFL) { + /* + * Default action, where the default is to kill + * the process. (Other cases were ignored above.) + */ + sigexit(p, signum); + /* NOTREACHED */ + } else { + /* + * If we get here, the signal must be caught. + */ +#ifdef DIAGNOSTIC + if (action == SIG_IGN || (p->p_sigmask & mask)) + panic("postsig action"); +#endif + /* + * Set the new mask value and also defer further + * occurences of this signal. + * + * Special case: user has done a sigpause. Here the + * current mask is not of interest, but rather the + * mask from before the sigpause is what we want + * restored after the signal processing is completed. + */ + (void) splhigh(); + if (ps->ps_flags & SAS_OLDMASK) { + returnmask = ps->ps_oldmask; + ps->ps_flags &= ~SAS_OLDMASK; + } else + returnmask = p->p_sigmask; + p->p_sigmask |= ps->ps_catchmask[signum] | mask; + (void) spl0(); + p->p_stats->p_ru.ru_nsignals++; + if (ps->ps_sig != signum) { + code = 0; + } else { + code = ps->ps_code; + ps->ps_code = 0; + } + sendsig(action, signum, returnmask, code); + } +} + +/* + * Kill the current process for stated reason. + */ +killproc(p, why) + struct proc *p; + char *why; +{ + + log(LOG_ERR, "pid %d was killed: %s\n", p->p_pid, why); + uprintf("sorry, pid %d was killed: %s\n", p->p_pid, why); + psignal(p, SIGKILL); +} + +/* + * Force the current process to exit with the specified signal, dumping core + * if appropriate. We bypass the normal tests for masked and caught signals, + * allowing unrecoverable failures to terminate the process without changing + * signal state. Mark the accounting record with the signal termination. + * If dumping core, save the signal number for the debugger. Calls exit and + * does not return. + */ +int +sigexit(p, signum) + register struct proc *p; + int signum; +{ + + p->p_acflag |= AXSIG; + if (sigprop[signum] & SA_CORE) { + p->p_sigacts->ps_sig = signum; + if (coredump(p) == 0) + signum |= WCOREFLAG; + } + exit1(p, W_EXITCODE(0, signum)); + /* NOTREACHED */ +} + +/* + * Dump core, into a file named "progname.core", unless the process was + * setuid/setgid. + */ +int +coredump(p) + register struct proc *p; +{ + register struct vnode *vp; + register struct pcred *pcred = p->p_cred; + register struct ucred *cred = pcred->pc_ucred; + register struct vmspace *vm = p->p_vmspace; + struct nameidata nd; + struct vattr vattr; + int error, error1; + char name[MAXCOMLEN+6]; /* progname.core */ + struct core core; + + if (pcred->p_svuid != pcred->p_ruid || pcred->p_svgid != pcred->p_rgid) + return (EFAULT); + if (ctob(UPAGES + vm->vm_dsize + vm->vm_ssize) >= + p->p_rlimit[RLIMIT_CORE].rlim_cur) + return (EFAULT); + sprintf(name, "%s.core", p->p_comm); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, name, p); + if (error = vn_open(&nd, + O_CREAT | FWRITE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) + return (error); + vp = nd.ni_vp; + + /* Don't dump to non-regular files or files with links. */ + if (vp->v_type != VREG || + VOP_GETATTR(vp, &vattr, cred, p) || vattr.va_nlink != 1) { + error = EFAULT; + goto out; + } + VATTR_NULL(&vattr); + vattr.va_size = 0; + LEASE_CHECK(vp, p, cred, LEASE_WRITE); + VOP_SETATTR(vp, &vattr, cred, p); + p->p_acflag |= ACORE; + bcopy(p, &p->p_addr->u_kproc.kp_proc, sizeof(struct proc)); + fill_eproc(p, &p->p_addr->u_kproc.kp_eproc); + + core.c_midmag = 0; + strncpy(core.c_name, p->p_comm, MAXCOMLEN); + core.c_nseg = 0; + core.c_signo = p->p_sigacts->ps_sig; + core.c_ucode = p->p_sigacts->ps_code; + core.c_cpusize = 0; + core.c_tsize = (u_long)ctob(vm->vm_tsize); + core.c_dsize = (u_long)ctob(vm->vm_dsize); + core.c_ssize = (u_long)round_page(ctob(vm->vm_ssize)); + error = cpu_coredump(p, vp, cred, &core); + if (error) + goto out; + if (core.c_midmag == 0) { + /* XXX + * cpu_coredump() didn't bother to set the magic; assume + * this is a request to do a traditional dump. cpu_coredump() + * is still responsible for setting sensible values in + * the core header. + */ + if (core.c_cpusize == 0) + core.c_cpusize = NBPG * UPAGES; /* Just in case */ + error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr, + (int)core.c_dsize, + (off_t)core.c_cpusize, UIO_USERSPACE, + IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p); + if (error) + goto out; + error = vn_rdwr(UIO_WRITE, vp, + (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)), + core.c_ssize, + (off_t)(core.c_cpusize + core.c_dsize), UIO_USERSPACE, + IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p); + } else { + /* + * vm_coredump() spits out all appropriate segments. + * All that's left to do is to write the core header. + */ + error = vm_coredump(p, vp, cred, &core); + if (error) + goto out; + error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&core, + (int)core.c_hdrsize, (off_t)0, + UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p); + } +out: + VOP_UNLOCK(vp); + error1 = vn_close(vp, FWRITE, cred, p); + if (error == 0) + error = error1; + return (error); +} + +/* + * Nonexistent system call-- signal process (may want to handle it). + * Flag error in case process won't see signal immediately (blocked or ignored). + */ +/* ARGSUSED */ +int +nosys(p, args, retval) + struct proc *p; + void *args; + int *retval; +{ + + psignal(p, SIGSYS); + return (EINVAL); +} diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index f33ccb638dd..a998f9c249d 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_subr.c,v 1.12 1994/06/29 06:32:43 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_subr.c,v 1.11 1994/05/18 12:46:29 mycroft Exp $ + * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 85c35a9bf29..031053c2824 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1 +1,719 @@ -revision 1.25 intentionally removed +/* $NetBSD: kern_synch.c,v 1.26 1994/06/29 06:32:45 cgd Exp $ */ + +/*- + * Copyright (c) 1982, 1986, 1990, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kern_synch.c 8.6 (Berkeley) 1/21/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/proc.h> +#include <sys/kernel.h> +#include <sys/buf.h> +#include <sys/signalvar.h> +#include <sys/resourcevar.h> +#include <sys/vmmeter.h> +#ifdef KTRACE +#include <sys/ktrace.h> +#endif + +#include <machine/cpu.h> + +u_char curpriority; /* usrpri of curproc */ +int lbolt; /* once a second sleep address */ + +/* + * Force switch among equal priority processes every 100ms. + */ +/* ARGSUSED */ +void +roundrobin(arg) + void *arg; +{ + + need_resched(); + timeout(roundrobin, NULL, hz / 10); +} + +/* + * Constants for digital decay and forget: + * 90% of (p_estcpu) usage in 5 * loadav time + * 95% of (p_pctcpu) usage in 60 seconds (load insensitive) + * Note that, as ps(1) mentions, this can let percentages + * total over 100% (I've seen 137.9% for 3 processes). + * + * Note that hardclock updates p_estcpu and p_cpticks independently. + * + * We wish to decay away 90% of p_estcpu in (5 * loadavg) seconds. + * That is, the system wants to compute a value of decay such + * that the following for loop: + * for (i = 0; i < (5 * loadavg); i++) + * p_estcpu *= decay; + * will compute + * p_estcpu *= 0.1; + * for all values of loadavg: + * + * Mathematically this loop can be expressed by saying: + * decay ** (5 * loadavg) ~= .1 + * + * The system computes decay as: + * decay = (2 * loadavg) / (2 * loadavg + 1) + * + * We wish to prove that the system's computation of decay + * will always fulfill the equation: + * decay ** (5 * loadavg) ~= .1 + * + * If we compute b as: + * b = 2 * loadavg + * then + * decay = b / (b + 1) + * + * We now need to prove two things: + * 1) Given factor ** (5 * loadavg) ~= .1, prove factor == b/(b+1) + * 2) Given b/(b+1) ** power ~= .1, prove power == (5 * loadavg) + * + * Facts: + * For x close to zero, exp(x) =~ 1 + x, since + * exp(x) = 0! + x**1/1! + x**2/2! + ... . + * therefore exp(-1/b) =~ 1 - (1/b) = (b-1)/b. + * For x close to zero, ln(1+x) =~ x, since + * ln(1+x) = x - x**2/2 + x**3/3 - ... -1 < x < 1 + * therefore ln(b/(b+1)) = ln(1 - 1/(b+1)) =~ -1/(b+1). + * ln(.1) =~ -2.30 + * + * Proof of (1): + * Solve (factor)**(power) =~ .1 given power (5*loadav): + * solving for factor, + * ln(factor) =~ (-2.30/5*loadav), or + * factor =~ exp(-1/((5/2.30)*loadav)) =~ exp(-1/(2*loadav)) = + * exp(-1/b) =~ (b-1)/b =~ b/(b+1). QED + * + * Proof of (2): + * Solve (factor)**(power) =~ .1 given factor == (b/(b+1)): + * solving for power, + * power*ln(b/(b+1)) =~ -2.30, or + * power =~ 2.3 * (b + 1) = 4.6*loadav + 2.3 =~ 5*loadav. QED + * + * Actual power values for the implemented algorithm are as follows: + * loadav: 1 2 3 4 + * power: 5.68 10.32 14.94 19.55 + */ + +/* calculations for digital decay to forget 90% of usage in 5*loadav sec */ +#define loadfactor(loadav) (2 * (loadav)) +#define decay_cpu(loadfac, cpu) (((loadfac) * (cpu)) / ((loadfac) + FSCALE)) + +/* decay 95% of `p_pctcpu' in 60 seconds; see CCPU_SHIFT before changing */ +fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */ + +/* + * If `ccpu' is not equal to `exp(-1/20)' and you still want to use the + * faster/more-accurate formula, you'll have to estimate CCPU_SHIFT below + * and possibly adjust FSHIFT in "param.h" so that (FSHIFT >= CCPU_SHIFT). + * + * To estimate CCPU_SHIFT for exp(-1/20), the following formula was used: + * 1 - exp(-1/20) ~= 0.0487 ~= 0.0488 == 1 (fixed pt, *11* bits). + * + * If you dont want to bother with the faster/more-accurate formula, you + * can set CCPU_SHIFT to (FSHIFT + 1) which will use a slower/less-accurate + * (more general) method of calculating the %age of CPU used by a process. + */ +#define CCPU_SHIFT 11 + +/* + * Recompute process priorities, every hz ticks. + */ +/* ARGSUSED */ +void +schedcpu(arg) + void *arg; +{ + register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]); + register struct proc *p; + register int s; + register unsigned int newcpu; + + wakeup((caddr_t)&lbolt); + for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { + /* + * Increment time in/out of memory and sleep time + * (if sleeping). We ignore overflow; with 16-bit int's + * (remember them?) overflow takes 45 days. + */ + p->p_swtime++; + if (p->p_stat == SSLEEP || p->p_stat == SSTOP) + p->p_slptime++; + p->p_pctcpu = (p->p_pctcpu * ccpu) >> FSHIFT; + /* + * If the process has slept the entire second, + * stop recalculating its priority until it wakes up. + */ + if (p->p_slptime > 1) + continue; + s = splstatclock(); /* prevent state changes */ + /* + * p_pctcpu is only for ps. + */ +#if (FSHIFT >= CCPU_SHIFT) + p->p_pctcpu += (hz == 100)? + ((fixpt_t) p->p_cpticks) << (FSHIFT - CCPU_SHIFT): + 100 * (((fixpt_t) p->p_cpticks) + << (FSHIFT - CCPU_SHIFT)) / hz; +#else + p->p_pctcpu += ((FSCALE - ccpu) * + (p->p_cpticks * FSCALE / hz)) >> FSHIFT; +#endif + p->p_cpticks = 0; + newcpu = (u_int) decay_cpu(loadfac, p->p_estcpu) + p->p_nice; + p->p_estcpu = min(newcpu, UCHAR_MAX); + resetpriority(p); + if (p->p_priority >= PUSER) { +#define PPQ (128 / NQS) /* priorities per queue */ + if ((p != curproc) && + p->p_stat == SRUN && + (p->p_flag & P_INMEM) && + (p->p_priority / PPQ) != (p->p_usrpri / PPQ)) { + remrq(p); + p->p_priority = p->p_usrpri; + setrunqueue(p); + } else + p->p_priority = p->p_usrpri; + } + splx(s); + } + vmmeter(); + if (bclnlist != NULL) + wakeup((caddr_t)pageproc); + timeout(schedcpu, (void *)0, hz); +} + +/* + * Recalculate the priority of a process after it has slept for a while. + * For all load averages >= 1 and max p_estcpu of 255, sleeping for at + * least six times the loadfactor will decay p_estcpu to zero. + */ +void +updatepri(p) + register struct proc *p; +{ + register unsigned int newcpu = p->p_estcpu; + register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]); + + if (p->p_slptime > 5 * loadfac) + p->p_estcpu = 0; + else { + p->p_slptime--; /* the first time was done in schedcpu */ + while (newcpu && --p->p_slptime) + newcpu = (int) decay_cpu(loadfac, newcpu); + p->p_estcpu = min(newcpu, UCHAR_MAX); + } + resetpriority(p); +} + +/* + * We're only looking at 7 bits of the address; everything is + * aligned to 4, lots of things are aligned to greater powers + * of 2. Shift right by 8, i.e. drop the bottom 256 worth. + */ +#define TABLESIZE 128 +#define LOOKUP(x) (((int)(x) >> 8) & (TABLESIZE - 1)) +struct slpque { + struct proc *sq_head; + struct proc **sq_tailp; +} slpque[TABLESIZE]; + +/* + * During autoconfiguration or after a panic, a sleep will simply + * lower the priority briefly to allow interrupts, then return. + * The priority to be used (safepri) is machine-dependent, thus this + * value is initialized and maintained in the machine-dependent layers. + * This priority will typically be 0, or the lowest priority + * that is safe for use on the interrupt stack; it can be made + * higher to block network software interrupts after panics. + */ +int safepri; + +/* + * General sleep call. Suspends the current process until a wakeup is + * performed on the specified identifier. The process will then be made + * runnable with the specified priority. Sleeps at most timo/hz seconds + * (0 means no timeout). If pri includes PCATCH flag, signals are checked + * before and after sleeping, else signals are not checked. Returns 0 if + * awakened, EWOULDBLOCK if the timeout expires. If PCATCH is set and a + * signal needs to be delivered, ERESTART is returned if the current system + * call should be restarted if possible, and EINTR is returned if the system + * call should be interrupted by the signal (return EINTR). + */ +int +tsleep(ident, priority, wmesg, timo) + void *ident; + int priority, timo; + char *wmesg; +{ + register struct proc *p = curproc; + register struct slpque *qp; + register s; + int sig, catch = priority & PCATCH; + extern int cold; + void endtsleep __P((void *)); + +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 1, 0); +#endif + s = splhigh(); + if (cold || panicstr) { + /* + * After a panic, or during autoconfiguration, + * just give interrupts a chance, then just return; + * don't run any other procs or panic below, + * in case this is the idle process and already asleep. + */ + splx(safepri); + splx(s); + return (0); + } +#ifdef DIAGNOSTIC + if (ident == NULL || p->p_stat != SRUN || p->p_back) + panic("tsleep"); +#endif + p->p_wchan = ident; + p->p_wmesg = wmesg; + p->p_slptime = 0; + p->p_priority = priority & PRIMASK; + qp = &slpque[LOOKUP(ident)]; + if (qp->sq_head == 0) + qp->sq_head = p; + else + *qp->sq_tailp = p; + *(qp->sq_tailp = &p->p_forw) = 0; + if (timo) + timeout(endtsleep, (void *)p, timo); + /* + * We put ourselves on the sleep queue and start our timeout + * before calling CURSIG, as we could stop there, and a wakeup + * or a SIGCONT (or both) could occur while we were stopped. + * A SIGCONT would cause us to be marked as SSLEEP + * without resuming us, thus we must be ready for sleep + * when CURSIG is called. If the wakeup happens while we're + * stopped, p->p_wchan will be 0 upon return from CURSIG. + */ + if (catch) { + p->p_flag |= P_SINTR; + if (sig = CURSIG(p)) { + if (p->p_wchan) + unsleep(p); + p->p_stat = SRUN; + goto resume; + } + if (p->p_wchan == 0) { + catch = 0; + goto resume; + } + } else + sig = 0; + p->p_stat = SSLEEP; + p->p_stats->p_ru.ru_nvcsw++; + mi_switch(); +#ifdef DDB + /* handy breakpoint location after process "wakes" */ + asm(".globl bpendtsleep ; bpendtsleep:"); +#endif +resume: + curpriority = p->p_usrpri; + splx(s); + p->p_flag &= ~P_SINTR; + if (p->p_flag & P_TIMEOUT) { + p->p_flag &= ~P_TIMEOUT; + if (sig == 0) { +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 0, 0); +#endif + return (EWOULDBLOCK); + } + } else if (timo) + untimeout(endtsleep, (void *)p); + if (catch && (sig != 0 || (sig = CURSIG(p)))) { +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 0, 0); +#endif + if (p->p_sigacts->ps_sigintr & sigmask(sig)) + return (EINTR); + return (ERESTART); + } +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 0, 0); +#endif + return (0); +} + +/* + * Implement timeout for tsleep. + * If process hasn't been awakened (wchan non-zero), + * set timeout flag and undo the sleep. If proc + * is stopped, just unsleep so it will remain stopped. + */ +void +endtsleep(arg) + void *arg; +{ + register struct proc *p; + int s; + + p = (struct proc *)arg; + s = splhigh(); + if (p->p_wchan) { + if (p->p_stat == SSLEEP) + setrunnable(p); + else + unsleep(p); + p->p_flag |= P_TIMEOUT; + } + splx(s); +} + +/* + * Short-term, non-interruptable sleep. + */ +void +sleep(ident, priority) + void *ident; + int priority; +{ + register struct proc *p = curproc; + register struct slpque *qp; + register s; + extern int cold; + +#ifdef DIAGNOSTIC + if (priority > PZERO) { + printf("sleep called with priority %d > PZERO, wchan: %x\n", + priority, ident); + panic("old sleep"); + } +#endif + s = splhigh(); + if (cold || panicstr) { + /* + * After a panic, or during autoconfiguration, + * just give interrupts a chance, then just return; + * don't run any other procs or panic below, + * in case this is the idle process and already asleep. + */ + splx(safepri); + splx(s); + return; + } +#ifdef DIAGNOSTIC + if (ident == NULL || p->p_stat != SRUN || p->p_back) + panic("sleep"); +#endif + p->p_wchan = ident; + p->p_wmesg = NULL; + p->p_slptime = 0; + p->p_priority = priority; + qp = &slpque[LOOKUP(ident)]; + if (qp->sq_head == 0) + qp->sq_head = p; + else + *qp->sq_tailp = p; + *(qp->sq_tailp = &p->p_forw) = 0; + p->p_stat = SSLEEP; + p->p_stats->p_ru.ru_nvcsw++; +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 1, 0); +#endif + mi_switch(); +#ifdef DDB + /* handy breakpoint location after process "wakes" */ + asm(".globl bpendsleep ; bpendsleep:"); +#endif +#ifdef KTRACE + if (KTRPOINT(p, KTR_CSW)) + ktrcsw(p->p_tracep, 0, 0); +#endif + curpriority = p->p_usrpri; + splx(s); +} + +/* + * Remove a process from its wait queue + */ +void +unsleep(p) + register struct proc *p; +{ + register struct slpque *qp; + register struct proc **hp; + int s; + + s = splhigh(); + if (p->p_wchan) { + hp = &(qp = &slpque[LOOKUP(p->p_wchan)])->sq_head; + while (*hp != p) + hp = &(*hp)->p_forw; + *hp = p->p_forw; + if (qp->sq_tailp == &p->p_forw) + qp->sq_tailp = hp; + p->p_wchan = 0; + } + splx(s); +} + +/* + * Make all processes sleeping on the specified identifier runnable. + */ +void +wakeup(ident) + register void *ident; +{ + register struct slpque *qp; + register struct proc *p, **q; + int s; + + s = splhigh(); + qp = &slpque[LOOKUP(ident)]; +restart: + for (q = &qp->sq_head; p = *q; ) { +#ifdef DIAGNOSTIC + if (p->p_back || p->p_stat != SSLEEP && p->p_stat != SSTOP) + panic("wakeup"); +#endif + if (p->p_wchan == ident) { + p->p_wchan = 0; + *q = p->p_forw; + if (qp->sq_tailp == &p->p_forw) + qp->sq_tailp = q; + if (p->p_stat == SSLEEP) { + /* OPTIMIZED EXPANSION OF setrunnable(p); */ + if (p->p_slptime > 1) + updatepri(p); + p->p_slptime = 0; + p->p_stat = SRUN; + if (p->p_flag & P_INMEM) + setrunqueue(p); + /* + * Since curpriority is a user priority, + * p->p_priority is always better than + * curpriority. + */ + if ((p->p_flag & P_INMEM) == 0) + wakeup((caddr_t)&proc0); + else + need_resched(); + /* END INLINE EXPANSION */ + goto restart; + } + } else + q = &p->p_forw; + } + splx(s); +} + +/* + * The machine independent parts of mi_switch(). + * Must be called at splstatclock() or higher. + */ +void +mi_switch() +{ + register struct proc *p = curproc; /* XXX */ + register struct rlimit *rlim; + register long s, u; + struct timeval tv; + + /* + * Compute the amount of time during which the current + * process was running, and add that to its total so far. + */ + microtime(&tv); + u = p->p_rtime.tv_usec + (tv.tv_usec - runtime.tv_usec); + s = p->p_rtime.tv_sec + (tv.tv_sec - runtime.tv_sec); + if (u < 0) { + u += 1000000; + s--; + } else if (u >= 1000000) { + u -= 1000000; + s++; + } + p->p_rtime.tv_usec = u; + p->p_rtime.tv_sec = s; + + /* + * Check if the process exceeds its cpu resource allocation. + * If over max, kill it. In any case, if it has run for more + * than 10 minutes, reduce priority to give others a chance. + */ + rlim = &p->p_rlimit[RLIMIT_CPU]; + if (s >= rlim->rlim_cur) { + if (s >= rlim->rlim_max) + psignal(p, SIGKILL); + else { + psignal(p, SIGXCPU); + if (rlim->rlim_cur < rlim->rlim_max) + rlim->rlim_cur += 5; + } + } + if (s > 10 * 60 && p->p_ucred->cr_uid && p->p_nice == NZERO) { + p->p_nice = NZERO + 4; + resetpriority(p); + } + + /* + * Pick a new current process and record its start time. + */ + cnt.v_swtch++; + cpu_switch(p); + microtime(&runtime); +} + +/* + * Initialize the (doubly-linked) run queues + * to be empty. + */ +void +rqinit() +{ + register int i; + + for (i = 0; i < NQS; i++) + qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; +} + +/* + * Change process state to be runnable, + * placing it on the run queue if it is in memory, + * and awakening the swapper if it isn't in memory. + */ +void +setrunnable(p) + register struct proc *p; +{ + register int s; + + s = splhigh(); + switch (p->p_stat) { + case 0: + case SRUN: + case SZOMB: + default: + panic("setrunnable"); + case SSTOP: + case SSLEEP: + unsleep(p); /* e.g. when sending signals */ + break; + + case SIDL: + break; + } + p->p_stat = SRUN; + if (p->p_flag & P_INMEM) + setrunqueue(p); + splx(s); + if (p->p_slptime > 1) + updatepri(p); + p->p_slptime = 0; + if ((p->p_flag & P_INMEM) == 0) + wakeup((caddr_t)&proc0); + else if (p->p_priority < curpriority) + need_resched(); +} + +/* + * Compute the priority of a process when running in user mode. + * Arrange to reschedule if the resulting priority is better + * than that of the current process. + */ +void +resetpriority(p) + register struct proc *p; +{ + register unsigned int newpriority; + + newpriority = PUSER + p->p_estcpu / 4 + 2 * p->p_nice; + newpriority = min(newpriority, MAXPRI); + p->p_usrpri = newpriority; + if (newpriority < curpriority) + need_resched(); +} + +#ifdef DDB +void db_show_all_procs(long addr, int haddr, int count, char *modif) +{ + int np; + struct proc *ap, *p, *pp; + + np = nprocs; + p = ap = (struct proc *)allproc; + if (modif[0] == 'm') + db_printf(" pid proc addr map comm wchan\n"); + else + db_printf(" pid proc addr uid ppid pgrp flag stat comm wchan\n"); + while (--np >= 0) { + pp = p->p_pptr; + if (pp == 0) + pp = p; + if (p->p_stat) { + if (modif[0] == 'm') { + db_printf("%5d %06x %06x %06x %s ", + p->p_pid, ap, p->p_addr, p->p_vmspace, p->p_comm); + } + else { + db_printf("%5d %06x %06x %3d %5d %5d %06x %d %s ", + p->p_pid, ap, p->p_addr, p->p_cred->p_ruid, + pp->p_pid, p->p_pgrp->pg_id, p->p_flag, + p->p_stat, p->p_comm); + } + if (p->p_wchan) { + if (p->p_wmesg) + db_printf("%s ", p->p_wmesg); + db_printf("%x", p->p_wchan); + } + db_printf("\n"); + } + ap = p->p_next; + if (ap == 0 && np > 0) + ap = zombproc; + p = ap; + } +} +#endif diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c1710ebfe1f..5fbf0f0098f 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_sysctl.c,v 1.2 1994/06/29 06:32:47 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_sysctl.c,v 1.1 1994/05/06 22:43:23 cgd Exp $ + * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 */ /* diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 352f742bcac..dfe4995a901 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_time.c,v 1.9 1994/06/29 06:32:48 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.8 1994/05/20 07:24:51 cgd Exp $ + * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 4ea6dc1d35b..f3a7dc87a57 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -1,3 +1,5 @@ +/* $NetBSD: kern_xxx.c,v 1.18 1994/06/29 06:32:50 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 - * $Id: kern_xxx.c,v 1.17 1994/05/20 07:24:58 cgd Exp $ + * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 */ #include <sys/param.h> diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 594969909b6..138976c0f3d 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,6 +1,7 @@ #! /bin/sh - -# from: @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93 -# $Id: makesyscalls.sh,v 1.8 1994/05/18 04:15:51 mycroft Exp $ +# $NetBSD: makesyscalls.sh,v 1.9 1994/06/29 06:32:53 cgd Exp $ +# +# @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93 set -e @@ -56,17 +57,17 @@ awk < $1 " printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr } NR == 1 { - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysdcl + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysdcl printf "#include <sys/param.h>\n" > sysdcl printf "#include <sys/systm.h>\n\n" > sysdcl printf "int\tnosys();\n\n" > sysdcl printf "struct sysent sysent[] = {\n" > sysent - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > sysnames + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > sysnames printf "char *syscallnames[] = {\n" > sysnames - printf " * created from: %s %s %s %s\n */\n\n",$2,$3,$4,$5 > syshdr + printf " * created from: %s %s %s %s\n */\n\n",$1,$3,$4,$5,$6 > syshdr next } NF == 0 || $1 ~ /^;/ { diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 8ce65603ca7..dcb4aa318a3 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_autoconf.c,v 1.9 1994/06/29 06:32:54 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -40,8 +42,8 @@ * SUCH DAMAGE. * * from: Header: subr_autoconf.c,v 1.12 93/02/01 19:31:48 torek Exp (LBL) - * from: @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_autoconf.c,v 1.8 1994/05/20 04:31:22 cgd Exp $ + * + * @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 586fe9141e1..778fbd6ddea 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_disk.c,v 1.12 1994/06/29 06:32:56 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: subr_disk.c,v 1.11 1994/05/19 03:43:13 mycroft Exp $ + * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index ace435ebc03..f2bceb0e9a5 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_log.c,v 1.7 1994/06/29 06:32:57 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)subr_log.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_log.c,v 1.6 1994/05/19 08:13:44 cgd Exp $ + * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 6c6081636a8..ff6d670d052 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_prf.c,v 1.15 1994/06/29 06:32:59 cgd Exp $ */ + /*- * Copyright (c) 1986, 1988, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.14 1994/05/13 06:02:45 cgd Exp $ + * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index a3da486716c..7795aa69acb 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_prof.c,v 1.3 1994/06/29 06:33:01 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)subr_prof.c 8.3 (Berkeley) 9/23/93 - * $Id: subr_prof.c,v 1.2 1994/05/07 00:55:46 cgd Exp $ + * @(#)subr_prof.c 8.3 (Berkeley) 9/23/93 */ #include <sys/param.h> diff --git a/sys/kern/subr_rmap.c b/sys/kern/subr_rmap.c index 37ba0a781f5..6de5f356836 100644 --- a/sys/kern/subr_rmap.c +++ b/sys/kern/subr_rmap.c @@ -1 +1,221 @@ -revision 1.8 intentionally removed +/* $NetBSD: subr_rmap.c,v 1.9 1994/06/29 06:33:02 cgd Exp $ */ + +/* + * Copyright (C) 1992, 1994 Wolfgang Solfrank. + * Copyright (C) 1992, 1994 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/param.h> +#include <sys/map.h> + +/* + * Resource allocation map handling. + * + * Code derived from usage in ../vm/swap_pager.c and ../vm/vm_swap.c + * and the (corrected due to the above) comments in ../sys/map.h. + * + * Assume small maps. Keep it sorted by addr with free mapents last. + */ + +/* + * Initialize a resource map. + * The map is called "name", and has nelem-1 + * slots (the first one is reused to describe the map). + * Initially it manages the address range starting at + * addr with size size. + */ +void +rminit(mp, size, addr, name, nelem) + struct map *mp; + long size, addr; + char *name; + int nelem; +{ + struct mapent *ep; + + /* mapsize had better be at least 2 */ + if (nelem < 2 || addr <= 0 || size < 0) + panic("rminit %s",name); + mp->m_name = name; + mp->m_limit = (struct mapent *)mp + nelem; + + /* initially the first entry describes all free space */ + ep = (struct mapent *)mp + 1; + ep->m_size = size; + ep->m_addr = addr; + /* the remaining slots are unused (indicated by m_addr == 0) */ + while (++ep < mp->m_limit) + ep->m_addr = 0; +} + +/* + * Allocate space out of a resource map. + * Try to find an exact match. Otherwise get the space from + * the smallest slot. + */ +long +rmalloc(mp, size) + struct map *mp; + long size; +{ + struct mapent *ep, *fp; + long addr; + + /* first check arguments */ + if (size < 0) + panic("rmalloc %s", mp->m_name); + if (!size) + return 0; + + fp = 0; + /* try to find the smallest fit */ + for (ep = (struct mapent *)mp + 1; ep < mp->m_limit; ep++) { + if (!ep->m_addr) { + /* unused slots terminate the list */ + break; + } + if (ep->m_size == size) { + /* found exact match, use it, ... */ + addr = ep->m_addr; + /* copy over the remaining slots ... */ + ovbcopy(ep + 1,ep,(char *)mp->m_limit - (char *)(ep + 1)); + /* and mark the last slot as unused */ + mp->m_limit[-1].m_addr = 0; + return addr; + } + if (ep->m_size > size + && (!fp + || fp->m_size > ep->m_size)) { + /* found a larger slot, remember the smallest of these */ + fp = ep; + } + } + if (fp) { + /* steal requested size from a larger slot */ + addr = fp->m_addr; + fp->m_addr += size; + fp->m_size -= size; + return addr; + } + return 0; +} + +/* + * Free (or add) space to a resource map. + * If there aren't enough slots in the map to describe the free space, + * drop the smallest slot. + */ +void +rmfree(mp, size, addr) + struct map *mp; + long size, addr; +{ + struct mapent *ep, *fp; + + /* first check arguments */ + if (size <= 0 || addr <= 0) + panic("rmfree %s", mp->m_name); + + while (1) { + fp = 0; + + for (ep = (struct mapent *)mp + 1; ep < mp->m_limit; ep++) { + if (!ep->m_addr) { + /* unused slots terminate the list */ + break; + } + if (ep->m_addr + ep->m_size == addr) { + /* this slot ends just with the address to free */ + ep->m_size += size; /* increase size of slot */ + if (ep < mp->m_limit + && ep[1].m_addr + && (addr += size) >= ep[1].m_addr) { + if (addr > ep[1].m_addr) /* overlapping frees? */ + panic("rmfree %s", mp->m_name); + /* the next slot is now contiguous, so join ... */ + ep->m_size += ep[1].m_size; + ovbcopy(ep + 2, ep + 1, + (char *)mp->m_limit - (char *)(ep + 2)); + /* and mark the last slot as unused */ + mp->m_limit[-1].m_addr = 0; + } + return; + } + if (addr + size == ep->m_addr) { + /* range to free is contiguous to this slot */ + ep->m_addr = addr; + ep->m_size += size; + return; + } + if (addr < ep->m_addr + && !mp->m_limit[-1].m_addr) { + /* insert entry into list keeping it sorted on m_addr */ + ovbcopy(ep,ep + 1,(char *)(mp->m_limit - 1) - (char *)ep); + ep->m_addr = addr; + ep->m_size = size; + return; + } + if (!fp || fp->m_size > ep->m_size) { + /* find the slot with the smallest size to drop */ + fp = ep; + } + } + if (ep != (struct mapent *)mp + 1 + && ep[-1].m_addr + ep[-1].m_size == addr) { + /* range to free is contiguous to the last used slot */ + (--ep)->m_size += size; + return; + } + if (ep != mp->m_limit) { + /* use empty slot for range to free */ + ep->m_addr = addr; + ep->m_size = size; + return; + } + /* + * The range to free isn't contiguous to any free space, + * and there is no free slot available, so we are sorry, + * but we have to loose some space. + * fp points to the slot with the smallest size + */ + if (fp->m_size > size) { + /* range to free is smaller, so drop that */ + printf("rmfree: map '%s' loses space (%d)\n", mp->m_name, + size); + return; + } else { + /* drop the smallest slot in the list */ + printf("rmfree: map '%s' loses space (%d)\n", mp->m_name, + fp->m_size); + ovbcopy(fp + 1,fp,(char *)(mp->m_limit - 1) - (char *)fp); + mp->m_limit[-1].m_addr = 0; + /* now retry */ + } + } +} diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c index 89e8f906f37..902ace34f36 100644 --- a/sys/kern/subr_xxx.c +++ b/sys/kern/subr_xxx.c @@ -1,3 +1,5 @@ +/* $NetBSD: subr_xxx.c,v 1.9 1994/06/29 06:33:03 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_xxx.c,v 1.8 1994/05/12 03:16:33 cgd Exp $ + * @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index ea15b814f50..4a9420a3ca5 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1 +1,689 @@ -revision 1.14 intentionally removed +/* $NetBSD: sys_generic.c,v 1.15 1994/06/29 06:33:05 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/filedesc.h> +#include <sys/ioctl.h> +#include <sys/file.h> +#include <sys/proc.h> +#include <sys/socketvar.h> +#include <sys/uio.h> +#include <sys/kernel.h> +#include <sys/stat.h> +#include <sys/malloc.h> +#ifdef KTRACE +#include <sys/ktrace.h> +#endif + +/* + * Read system call. + */ +struct read_args { + int fd; + char *buf; + u_int nbyte; +}; +/* ARGSUSED */ +read(p, uap, retval) + struct proc *p; + register struct read_args *uap; + int *retval; +{ + register struct file *fp; + register struct filedesc *fdp = p->p_fd; + struct uio auio; + struct iovec aiov; + long cnt, error = 0; +#ifdef KTRACE + struct iovec ktriov; +#endif + + if (((u_int)uap->fd) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fd]) == NULL || + (fp->f_flag & FREAD) == 0) + return (EBADF); + aiov.iov_base = (caddr_t)uap->buf; + aiov.iov_len = uap->nbyte; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_resid = uap->nbyte; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + if (auio.uio_resid < 0) + return EINVAL; +#ifdef KTRACE + /* + * if tracing, save a copy of iovec + */ + if (KTRPOINT(p, KTR_GENIO)) + ktriov = aiov; +#endif + cnt = uap->nbyte; + if (error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred)) + if (auio.uio_resid != cnt && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + cnt -= auio.uio_resid; +#ifdef KTRACE + if (KTRPOINT(p, KTR_GENIO) && error == 0) + ktrgenio(p->p_tracep, uap->fd, UIO_READ, &ktriov, cnt, error); +#endif + *retval = cnt; + return (error); +} + +/* + * Scatter read system call. + */ +struct readv_args { + int fdes; + struct iovec *iovp; + u_int iovcnt; +}; +readv(p, uap, retval) + struct proc *p; + register struct readv_args *uap; + int *retval; +{ + register struct file *fp; + register struct filedesc *fdp = p->p_fd; + struct uio auio; + register struct iovec *iov; + struct iovec *needfree; + struct iovec aiov[UIO_SMALLIOV]; + long i, cnt, error = 0; + u_int iovlen; +#ifdef KTRACE + struct iovec *ktriov = NULL; +#endif + + if (((u_int)uap->fdes) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fdes]) == NULL || + (fp->f_flag & FREAD) == 0) + return (EBADF); + /* note: can't use iovlen until iovcnt is validated */ + iovlen = uap->iovcnt * sizeof (struct iovec); + if (uap->iovcnt > UIO_SMALLIOV) { + if (uap->iovcnt > UIO_MAXIOV) + return (EINVAL); + MALLOC(iov, struct iovec *, iovlen, M_IOV, M_WAITOK); + needfree = iov; + } else { + iov = aiov; + needfree = NULL; + } + auio.uio_iov = iov; + auio.uio_iovcnt = uap->iovcnt; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + if (error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen)) + goto done; + auio.uio_resid = 0; + for (i = 0; i < uap->iovcnt; i++) { + if (iov->iov_len < 0) { + error = EINVAL; + goto done; + } + auio.uio_resid += iov->iov_len; + if (auio.uio_resid < 0) { + error = EINVAL; + goto done; + } + iov++; + } +#ifdef KTRACE + /* + * if tracing, save a copy of iovec + */ + if (KTRPOINT(p, KTR_GENIO)) { + MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); + bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); + } +#endif + cnt = auio.uio_resid; + if (error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred)) + if (auio.uio_resid != cnt && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + cnt -= auio.uio_resid; +#ifdef KTRACE + if (ktriov != NULL) { + if (error == 0) + ktrgenio(p->p_tracep, uap->fdes, UIO_READ, ktriov, + cnt, error); + FREE(ktriov, M_TEMP); + } +#endif + *retval = cnt; +done: + if (needfree) + FREE(needfree, M_IOV); + return (error); +} + +/* + * Write system call + */ +struct write_args { + int fd; + char *buf; + u_int nbyte; +}; +write(p, uap, retval) + struct proc *p; + register struct write_args *uap; + int *retval; +{ + register struct file *fp; + register struct filedesc *fdp = p->p_fd; + struct uio auio; + struct iovec aiov; + long cnt, error = 0; +#ifdef KTRACE + struct iovec ktriov; +#endif + + if (((u_int)uap->fd) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fd]) == NULL || + (fp->f_flag & FWRITE) == 0) + return (EBADF); + aiov.iov_base = (caddr_t)uap->buf; + aiov.iov_len = uap->nbyte; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_resid = uap->nbyte; + auio.uio_rw = UIO_WRITE; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + if (auio.uio_resid < 0) + return EINVAL; +#ifdef KTRACE + /* + * if tracing, save a copy of iovec + */ + if (KTRPOINT(p, KTR_GENIO)) + ktriov = aiov; +#endif + cnt = uap->nbyte; + if (error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred)) { + if (auio.uio_resid != cnt && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + if (error == EPIPE) + psignal(p, SIGPIPE); + } + cnt -= auio.uio_resid; +#ifdef KTRACE + if (KTRPOINT(p, KTR_GENIO) && error == 0) + ktrgenio(p->p_tracep, uap->fd, UIO_WRITE, + &ktriov, cnt, error); +#endif + *retval = cnt; + return (error); +} + +/* + * Gather write system call + */ +struct writev_args { + int fd; + struct iovec *iovp; + u_int iovcnt; +}; +writev(p, uap, retval) + struct proc *p; + register struct writev_args *uap; + int *retval; +{ + register struct file *fp; + register struct filedesc *fdp = p->p_fd; + struct uio auio; + register struct iovec *iov; + struct iovec *needfree; + struct iovec aiov[UIO_SMALLIOV]; + long i, cnt, error = 0; + u_int iovlen; +#ifdef KTRACE + struct iovec *ktriov = NULL; +#endif + + if (((u_int)uap->fd) >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fd]) == NULL || + (fp->f_flag & FWRITE) == 0) + return (EBADF); + /* note: can't use iovlen until iovcnt is validated */ + iovlen = uap->iovcnt * sizeof (struct iovec); + if (uap->iovcnt > UIO_SMALLIOV) { + if (uap->iovcnt > UIO_MAXIOV) + return (EINVAL); + MALLOC(iov, struct iovec *, iovlen, M_IOV, M_WAITOK); + needfree = iov; + } else { + iov = aiov; + needfree = NULL; + } + auio.uio_iov = iov; + auio.uio_iovcnt = uap->iovcnt; + auio.uio_rw = UIO_WRITE; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + if (error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen)) + goto done; + auio.uio_resid = 0; + for (i = 0; i < uap->iovcnt; i++) { + if (iov->iov_len < 0) { + error = EINVAL; + goto done; + } + auio.uio_resid += iov->iov_len; + if (auio.uio_resid < 0) { + error = EINVAL; + goto done; + } + iov++; + } +#ifdef KTRACE + /* + * if tracing, save a copy of iovec + */ + if (KTRPOINT(p, KTR_GENIO)) { + MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); + bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); + } +#endif + cnt = auio.uio_resid; + if (error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred)) { + if (auio.uio_resid != cnt && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + if (error == EPIPE) + psignal(p, SIGPIPE); + } + cnt -= auio.uio_resid; +#ifdef KTRACE + if (ktriov != NULL) { + if (error == 0) + ktrgenio(p->p_tracep, uap->fd, UIO_WRITE, + ktriov, cnt, error); + FREE(ktriov, M_TEMP); + } +#endif + *retval = cnt; +done: + if (needfree) + FREE(needfree, M_IOV); + return (error); +} + +/* + * Ioctl system call + */ +struct ioctl_args { + int fd; + int com; + caddr_t data; +}; +/* ARGSUSED */ +ioctl(p, uap, retval) + struct proc *p; + register struct ioctl_args *uap; + int *retval; +{ + register struct file *fp; + register struct filedesc *fdp; + register int com, error; + register u_int size; + caddr_t data, memp; + int tmp; +#define STK_PARAMS 128 + char stkbuf[STK_PARAMS]; + + fdp = p->p_fd; + if ((u_int)uap->fd >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fd]) == NULL) + return (EBADF); + + if ((fp->f_flag & (FREAD | FWRITE)) == 0) + return (EBADF); + + switch (com = uap->com) { + case FIONCLEX: + fdp->fd_ofileflags[uap->fd] &= ~UF_EXCLOSE; + return (0); + case FIOCLEX: + fdp->fd_ofileflags[uap->fd] |= UF_EXCLOSE; + return (0); + } + + /* + * Interpret high order word to find amount of data to be + * copied to/from the user's address space. + */ + size = IOCPARM_LEN(com); + if (size > IOCPARM_MAX) + return (ENOTTY); + memp = NULL; + if (size > sizeof (stkbuf)) { + memp = (caddr_t)malloc((u_long)size, M_IOCTLOPS, M_WAITOK); + data = memp; + } else + data = stkbuf; + if (com&IOC_IN) { + if (size) { + error = copyin(uap->data, data, (u_int)size); + if (error) { + if (memp) + free(memp, M_IOCTLOPS); + return (error); + } + } else + *(caddr_t *)data = uap->data; + } else if ((com&IOC_OUT) && size) + /* + * Zero the buffer so the user always + * gets back something deterministic. + */ + bzero(data, size); + else if (com&IOC_VOID) + *(caddr_t *)data = uap->data; + + switch (com) { + + case FIONBIO: + if (tmp = *(int *)data) + fp->f_flag |= FNONBLOCK; + else + fp->f_flag &= ~FNONBLOCK; + error = (*fp->f_ops->fo_ioctl)(fp, FIONBIO, (caddr_t)&tmp, p); + break; + + case FIOASYNC: + if (tmp = *(int *)data) + fp->f_flag |= FASYNC; + else + fp->f_flag &= ~FASYNC; + error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p); + break; + + case FIOSETOWN: + tmp = *(int *)data; + if (fp->f_type == DTYPE_SOCKET) { + ((struct socket *)fp->f_data)->so_pgid = tmp; + error = 0; + break; + } + if (tmp <= 0) { + tmp = -tmp; + } else { + struct proc *p1 = pfind(tmp); + if (p1 == 0) { + error = ESRCH; + break; + } + tmp = p1->p_pgrp->pg_id; + } + error = (*fp->f_ops->fo_ioctl) + (fp, (int)TIOCSPGRP, (caddr_t)&tmp, p); + break; + + case FIOGETOWN: + if (fp->f_type == DTYPE_SOCKET) { + error = 0; + *(int *)data = ((struct socket *)fp->f_data)->so_pgid; + break; + } + error = (*fp->f_ops->fo_ioctl)(fp, (int)TIOCGPGRP, data, p); + *(int *)data = -*(int *)data; + break; + + default: + error = (*fp->f_ops->fo_ioctl)(fp, com, data, p); + /* + * Copy any data to user, size was + * already set and checked above. + */ + if (error == 0 && (com&IOC_OUT) && size) + error = copyout(data, uap->data, (u_int)size); + break; + } + if (memp) + free(memp, M_IOCTLOPS); + return (error); +} + +int selwait, nselcoll; + +/* + * Select system call. + */ +struct select_args { + u_int nd; + fd_set *in, *ou, *ex; + struct timeval *tv; +}; +select(p, uap, retval) + register struct proc *p; + register struct select_args *uap; + int *retval; +{ + fd_set ibits[3], obits[3]; + struct timeval atv; + int s, ncoll, error = 0, timo; + u_int ni; + + bzero((caddr_t)ibits, sizeof(ibits)); + bzero((caddr_t)obits, sizeof(obits)); + if (uap->nd > FD_SETSIZE) + return (EINVAL); + if (uap->nd > p->p_fd->fd_nfiles) + uap->nd = p->p_fd->fd_nfiles; /* forgiving; slightly wrong */ + ni = howmany(uap->nd, NFDBITS) * sizeof(fd_mask); + +#define getbits(name, x) \ + if (uap->name && \ + (error = copyin((caddr_t)uap->name, (caddr_t)&ibits[x], ni))) \ + goto done; + getbits(in, 0); + getbits(ou, 1); + getbits(ex, 2); +#undef getbits + + if (uap->tv) { + error = copyin((caddr_t)uap->tv, (caddr_t)&atv, + sizeof (atv)); + if (error) + goto done; + if (itimerfix(&atv)) { + error = EINVAL; + goto done; + } + s = splclock(); + timevaladd(&atv, (struct timeval *)&time); + timo = hzto(&atv); + /* + * Avoid inadvertently sleeping forever. + */ + if (timo == 0) + timo = 1; + splx(s); + } else + timo = 0; +retry: + ncoll = nselcoll; + p->p_flag |= P_SELECT; + error = selscan(p, ibits, obits, uap->nd, retval); + if (error || *retval) + goto done; + s = splhigh(); + /* this should be timercmp(&time, &atv, >=) */ + if (uap->tv && (time.tv_sec > atv.tv_sec || + time.tv_sec == atv.tv_sec && time.tv_usec >= atv.tv_usec)) { + splx(s); + goto done; + } + if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) { + splx(s); + goto retry; + } + p->p_flag &= ~P_SELECT; + error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "select", timo); + splx(s); + if (error == 0) + goto retry; +done: + p->p_flag &= ~P_SELECT; + /* select is not restarted after signals... */ + if (error == ERESTART) + error = EINTR; + if (error == EWOULDBLOCK) + error = 0; +#define putbits(name, x) \ + if (uap->name && \ + (error2 = copyout((caddr_t)&obits[x], (caddr_t)uap->name, ni))) \ + error = error2; + if (error == 0) { + int error2; + + putbits(in, 0); + putbits(ou, 1); + putbits(ex, 2); +#undef putbits + } + return (error); +} + +selscan(p, ibits, obits, nfd, retval) + struct proc *p; + fd_set *ibits, *obits; + int nfd, *retval; +{ + register struct filedesc *fdp = p->p_fd; + register int msk, i, j, fd; + register fd_mask bits; + struct file *fp; + int n = 0; + static int flag[3] = { FREAD, FWRITE, 0 }; + + for (msk = 0; msk < 3; msk++) { + for (i = 0; i < nfd; i += NFDBITS) { + bits = ibits[msk].fds_bits[i/NFDBITS]; + while ((j = ffs(bits)) && (fd = i + --j) < nfd) { + bits &= ~(1 << j); + fp = fdp->fd_ofiles[fd]; + if (fp == NULL) + return (EBADF); + if ((*fp->f_ops->fo_select)(fp, flag[msk], p)) { + FD_SET(fd, &obits[msk]); + n++; + } + } + } + } + *retval = n; + return (0); +} + +/*ARGSUSED*/ +seltrue(dev, flag, p) + dev_t dev; + int flag; + struct proc *p; +{ + + return (1); +} + +/* + * Record a select request. + */ +void +selrecord(selector, sip) + struct proc *selector; + struct selinfo *sip; +{ + struct proc *p; + pid_t mypid; + + mypid = selector->p_pid; + if (sip->si_pid == mypid) + return; + if (sip->si_pid && (p = pfind(sip->si_pid)) && + p->p_wchan == (caddr_t)&selwait) + sip->si_flags |= SI_COLL; + else + sip->si_pid = mypid; +} + +/* + * Do a wakeup when a selectable event occurs. + */ +void +selwakeup(sip) + register struct selinfo *sip; +{ + register struct proc *p; + int s; + + if (sip->si_pid == 0) + return; + if (sip->si_flags & SI_COLL) { + nselcoll++; + sip->si_flags &= ~SI_COLL; + wakeup((caddr_t)&selwait); + } + p = pfind(sip->si_pid); + sip->si_pid = 0; + if (p != NULL) { + s = splhigh(); + if (p->p_wchan == (caddr_t)&selwait) { + if (p->p_stat == SSLEEP) + setrunnable(p); + else + unsleep(p); + } else if (p->p_flag & P_SELECT) + p->p_flag &= ~P_SELECT; + splx(s); + } +} diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index a0560e91455..e69adee01df 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1 +1 @@ -revision 1.32 intentionally removed +revision 1.33 intentionally removed diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 634738ba7e9..aa33d0619e5 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,3 +1,5 @@ +/* $NetBSD: sys_socket.c,v 1.11 1994/06/29 06:33:08 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 - * $Id: sys_socket.c,v 1.10 1994/05/13 06:01:27 mycroft Exp $ + * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index eb4e6b24d6b..55bf37ecb15 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,5 +1,5 @@ - $Id: syscalls.master,v 1.21 1994/06/14 05:18:03 cgd Exp $ -; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 + $NetBSD: syscalls.master,v 1.22 1994/06/29 06:33:10 cgd Exp $ +; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; System call name/number master file. ; Processed to created init_sysent.c, syscalls.c and syscall.h. diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index d4de1479e08..721d51f1133 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -1,3 +1,5 @@ +/* $NetBSD: sysv_ipc.c,v 1.7 1994/06/29 06:33:11 cgd Exp $ */ + /* * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> * All rights reserved. @@ -26,7 +28,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * */ #include <sys/param.h> diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index e3ed9f35385..7a3c4552229 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,3 +1,5 @@ +/* $NetBSD: sysv_msg.c,v 1.9 1994/06/29 06:33:13 cgd Exp $ */ + /* * Implementation of SVID messages * @@ -15,8 +17,6 @@ * but requiring it would be too onerous. * * This software is provided ``AS IS'' without any warranties of any kind. - * - * $Id: sysv_msg.c,v 1.8 1994/05/25 08:17:01 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 6b0d492b546..92c50b48d6c 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,11 +1,11 @@ +/* $NetBSD: sysv_sem.c,v 1.9 1994/06/29 06:33:15 cgd Exp $ */ + /* * Implementation of SVID semaphores * * Author: Daniel Boulet * * This software is provided ``AS IS'' without any warranties of any kind. - * - * $Id: sysv_sem.c,v 1.8 1994/05/25 08:15:49 mycroft Exp $ */ #include <sys/param.h> diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 7bb601dd595..1b8e0dde740 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,3 +1,5 @@ +/* $NetBSD: sysv_shm.c,v 1.22 1994/06/29 06:33:17 cgd Exp $ */ + /* * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved. * diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e8cb65aaca8..17a655bcc91 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1 +1,2041 @@ -revision 1.48 intentionally removed +/* $NetBSD: tty.c,v 1.49 1994/06/29 06:33:20 cgd Exp $ */ + +/*- + * Copyright (c) 1982, 1986, 1990, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tty.c 8.8 (Berkeley) 1/21/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/ioctl.h> +#include <sys/proc.h> +#define TTYDEFCHARS +#include <sys/tty.h> +#undef TTYDEFCHARS +#include <sys/file.h> +#include <sys/conf.h> +#include <sys/dkstat.h> +#include <sys/uio.h> +#include <sys/kernel.h> +#include <sys/vnode.h> +#include <sys/syslog.h> +#include <sys/malloc.h> + +#include <vm/vm.h> + +static int proc_compare __P((struct proc *p1, struct proc *p2)); +static int ttnread __P((struct tty *)); +static void ttyblock __P((struct tty *tp)); +static void ttyecho __P((int, struct tty *tp)); +static void ttyrubo __P((struct tty *, int)); + +/* Symbolic sleep message strings. */ +char ttclos[] = "ttycls"; +char ttopen[] = "ttyopn"; +char ttybg[] = "ttybg"; +#ifdef REAL_CLISTS +char ttybuf[] = "ttybuf"; +#endif +char ttyin[] = "ttyin"; +char ttyout[] = "ttyout"; + +/* + * Table with character classes and parity. The 8th bit indicates parity, + * the 7th bit indicates the character is an alphameric or underscore (for + * ALTWERASE), and the low 6 bits indicate delay type. If the low 6 bits + * are 0 then the character needs no special processing on output; classes + * other than 0 might be translated or (not currently) require delays. + */ +#define E 0x00 /* Even parity. */ +#define O 0x80 /* Odd parity. */ +#define PARITY(c) (char_type[c] & O) + +#define ALPHA 0x40 /* Alpha or underscore. */ +#define ISALPHA(c) (char_type[(c) & TTY_CHARMASK] & ALPHA) + +#define CCLASSMASK 0x3f +#define CCLASS(c) (char_type[c] & CCLASSMASK) + +#define BS BACKSPACE +#define CC CONTROL +#define CR RETURN +#define NA ORDINARY | ALPHA +#define NL NEWLINE +#define NO ORDINARY +#define TB TAB +#define VT VTAB + +char const char_type[] = { + E|CC, O|CC, O|CC, E|CC, O|CC, E|CC, E|CC, O|CC, /* nul - bel */ + O|BS, E|TB, E|NL, O|CC, E|VT, O|CR, O|CC, E|CC, /* bs - si */ + O|CC, E|CC, E|CC, O|CC, E|CC, O|CC, O|CC, E|CC, /* dle - etb */ + E|CC, O|CC, O|CC, E|CC, O|CC, E|CC, E|CC, O|CC, /* can - us */ + O|NO, E|NO, E|NO, O|NO, E|NO, O|NO, O|NO, E|NO, /* sp - ' */ + E|NO, O|NO, O|NO, E|NO, O|NO, E|NO, E|NO, O|NO, /* ( - / */ + E|NA, O|NA, O|NA, E|NA, O|NA, E|NA, E|NA, O|NA, /* 0 - 7 */ + O|NA, E|NA, E|NO, O|NO, E|NO, O|NO, O|NO, E|NO, /* 8 - ? */ + O|NO, E|NA, E|NA, O|NA, E|NA, O|NA, O|NA, E|NA, /* @ - G */ + E|NA, O|NA, O|NA, E|NA, O|NA, E|NA, E|NA, O|NA, /* H - O */ + E|NA, O|NA, O|NA, E|NA, O|NA, E|NA, E|NA, O|NA, /* P - W */ + O|NA, E|NA, E|NA, O|NO, E|NO, O|NO, O|NO, O|NA, /* X - _ */ + E|NO, O|NA, O|NA, E|NA, O|NA, E|NA, E|NA, O|NA, /* ` - g */ + O|NA, E|NA, E|NA, O|NA, E|NA, O|NA, O|NA, E|NA, /* h - o */ + O|NA, E|NA, E|NA, O|NA, E|NA, O|NA, O|NA, E|NA, /* p - w */ + E|NA, O|NA, O|NA, E|NO, O|NO, E|NO, E|NO, O|CC, /* x - del */ + /* + * Meta chars; should be settable per character set; + * for now, treat them all as normal characters. + */ + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, + NA, NA, NA, NA, NA, NA, NA, NA, +}; +#undef BS +#undef CC +#undef CR +#undef NA +#undef NL +#undef NO +#undef TB +#undef VT + +/* Macros to clear/set/test flags. */ +#define SET(t, f) (t) |= (f) +#define CLR(t, f) (t) &= ~(f) +#define ISSET(t, f) ((t) & (f)) + +/* + * Initial open of tty, or (re)entry to standard tty line discipline. + */ +int +ttyopen(device, tp) + dev_t device; + register struct tty *tp; +{ + int s; + + s = spltty(); + tp->t_dev = device; + if (!ISSET(tp->t_state, TS_ISOPEN)) { + SET(tp->t_state, TS_ISOPEN); + bzero(&tp->t_winsize, sizeof(tp->t_winsize)); + } + CLR(tp->t_state, TS_WOPEN); + splx(s); + return (0); +} + +/* + * Handle close() on a tty line: flush and set to initial state, + * bumping generation number so that pending read/write calls + * can detect recycling of the tty. + */ +int +ttyclose(tp) + register struct tty *tp; +{ + extern struct tty *constty; /* Temporary virtual console. */ + + if (constty == tp) + constty = NULL; + + ttyflush(tp, FREAD | FWRITE); + + tp->t_gen++; + tp->t_pgrp = NULL; + tp->t_session = NULL; + tp->t_state = 0; + return (0); +} + +#define FLUSHQ(q) { \ + if ((q)->c_cc) \ + ndflush(q, (q)->c_cc); \ +} + +/* Is 'c' a line delimiter ("break" character)? */ +#define TTBREAKC(c) \ + ((c) == '\n' || ((c) == cc[VEOF] || \ + (c) == cc[VEOL] || (c) == cc[VEOL2]) && (c) != _POSIX_VDISABLE) + + +/* + * Process input of a single character received on a tty. + */ +int +ttyinput(c, tp) + register int c; + register struct tty *tp; +{ + register int iflag, lflag; + register u_char *cc; + int i, err; + + /* + * If input is pending take it first. + */ + lflag = tp->t_lflag; + if (ISSET(lflag, PENDIN)) + ttypend(tp); + /* + * Gather stats. + */ + if (ISSET(lflag, ICANON)) { + ++tk_cancc; + ++tp->t_cancc; + } else { + ++tk_rawcc; + ++tp->t_rawcc; + } + ++tk_nin; + + /* Handle exceptional conditions (break, parity, framing). */ + cc = tp->t_cc; + iflag = tp->t_iflag; + if (err = (ISSET(c, TTY_ERRORMASK))) { + CLR(c, TTY_ERRORMASK); + if (ISSET(err, TTY_FE) && !c) { /* Break. */ + if (ISSET(iflag, IGNBRK)) + goto endcase; + else if (ISSET(iflag, BRKINT) && + ISSET(lflag, ISIG) && + (cc[VINTR] != _POSIX_VDISABLE)) + c = cc[VINTR]; + else if (ISSET(iflag, PARMRK)) + goto parmrk; + } else if (ISSET(err, TTY_PE) && + ISSET(iflag, INPCK) || ISSET(err, TTY_FE)) { + if (ISSET(iflag, IGNPAR)) + goto endcase; + else if (ISSET(iflag, PARMRK)) { +parmrk: (void)putc(0377 | TTY_QUOTE, &tp->t_rawq); + (void)putc(0 | TTY_QUOTE, &tp->t_rawq); + (void)putc(c | TTY_QUOTE, &tp->t_rawq); + goto endcase; + } else + c = 0; + } + } + /* + * In tandem mode, check high water mark. + */ + if (ISSET(iflag, IXOFF) || ISSET(tp->t_cflag, CHWFLOW)) + ttyblock(tp); + if (!ISSET(tp->t_state, TS_TYPEN) && ISSET(iflag, ISTRIP)) + CLR(c, 0x80); + if (!ISSET(lflag, EXTPROC)) { + /* + * Check for literal nexting very first + */ + if (ISSET(tp->t_state, TS_LNCH)) { + SET(c, TTY_QUOTE); + CLR(tp->t_state, TS_LNCH); + } + /* + * Scan for special characters. This code + * is really just a big case statement with + * non-constant cases. The bottom of the + * case statement is labeled ``endcase'', so goto + * it after a case match, or similar. + */ + + /* + * Control chars which aren't controlled + * by ICANON, ISIG, or IXON. + */ + if (ISSET(lflag, IEXTEN)) { + if (CCEQ(cc[VLNEXT], c)) { + if (ISSET(lflag, ECHO)) { + if (ISSET(lflag, ECHOE)) { + (void)ttyoutput('^', tp); + (void)ttyoutput('\b', tp); + } else + ttyecho(c, tp); + } + SET(tp->t_state, TS_LNCH); + goto endcase; + } + if (CCEQ(cc[VDISCARD], c)) { + if (ISSET(lflag, FLUSHO)) + CLR(tp->t_lflag, FLUSHO); + else { + ttyflush(tp, FWRITE); + ttyecho(c, tp); + if (tp->t_rawq.c_cc + tp->t_canq.c_cc) + ttyretype(tp); + SET(tp->t_lflag, FLUSHO); + } + goto startoutput; + } + } + /* + * Signals. + */ + if (ISSET(lflag, ISIG)) { + if (CCEQ(cc[VINTR], c) || CCEQ(cc[VQUIT], c)) { + if (!ISSET(lflag, NOFLSH)) + ttyflush(tp, FREAD | FWRITE); + ttyecho(c, tp); + pgsignal(tp->t_pgrp, + CCEQ(cc[VINTR], c) ? SIGINT : SIGQUIT, 1); + goto endcase; + } + if (CCEQ(cc[VSUSP], c)) { + if (!ISSET(lflag, NOFLSH)) + ttyflush(tp, FREAD); + ttyecho(c, tp); + pgsignal(tp->t_pgrp, SIGTSTP, 1); + goto endcase; + } + } + /* + * Handle start/stop characters. + */ + if (ISSET(iflag, IXON)) { + if (CCEQ(cc[VSTOP], c)) { + if (!ISSET(tp->t_state, TS_TTSTOP)) { + SET(tp->t_state, TS_TTSTOP); + (*cdevsw[major(tp->t_dev)].d_stop)(tp, + 0); + return (0); + } + if (!CCEQ(cc[VSTART], c)) + return (0); + /* + * if VSTART == VSTOP then toggle + */ + goto endcase; + } + if (CCEQ(cc[VSTART], c)) + goto restartoutput; + } + /* + * IGNCR, ICRNL, & INLCR + */ + if (c == '\r') { + if (ISSET(iflag, IGNCR)) + goto endcase; + else if (ISSET(iflag, ICRNL)) + c = '\n'; + } else if (c == '\n' && ISSET(iflag, INLCR)) + c = '\r'; + } + if (!ISSET(tp->t_lflag, EXTPROC) && ISSET(lflag, ICANON)) { + /* + * From here on down canonical mode character + * processing takes place. + */ + /* + * erase (^H / ^?) + */ + if (CCEQ(cc[VERASE], c)) { + if (tp->t_rawq.c_cc) + ttyrub(unputc(&tp->t_rawq), tp); + goto endcase; + } + /* + * kill (^U) + */ + if (CCEQ(cc[VKILL], c)) { + if (ISSET(lflag, ECHOKE) && + tp->t_rawq.c_cc == tp->t_rocount && + !ISSET(lflag, ECHOPRT)) + while (tp->t_rawq.c_cc) + ttyrub(unputc(&tp->t_rawq), tp); + else { + ttyecho(c, tp); + if (ISSET(lflag, ECHOK) || + ISSET(lflag, ECHOKE)) + ttyecho('\n', tp); + FLUSHQ(&tp->t_rawq); + tp->t_rocount = 0; + } + CLR(tp->t_state, TS_LOCAL); + goto endcase; + } + /* + * word erase (^W) + */ + if (CCEQ(cc[VWERASE], c)) { + int alt = ISSET(lflag, ALTWERASE); + int ctype; + + /* + * erase whitespace + */ + while ((c = unputc(&tp->t_rawq)) == ' ' || c == '\t') + ttyrub(c, tp); + if (c == -1) + goto endcase; + /* + * erase last char of word and remember the + * next chars type (for ALTWERASE) + */ + ttyrub(c, tp); + c = unputc(&tp->t_rawq); + if (c == -1) + goto endcase; + if (c == ' ' || c == '\t') { + (void)putc(c, &tp->t_rawq); + goto endcase; + } + ctype = ISALPHA(c); + /* + * erase rest of word + */ + do { + ttyrub(c, tp); + c = unputc(&tp->t_rawq); + if (c == -1) + goto endcase; + } while (c != ' ' && c != '\t' && + (alt == 0 || ISALPHA(c) == ctype)); + (void)putc(c, &tp->t_rawq); + goto endcase; + } + /* + * reprint line (^R) + */ + if (CCEQ(cc[VREPRINT], c)) { + ttyretype(tp); + goto endcase; + } + /* + * ^T - kernel info and generate SIGINFO + */ + if (CCEQ(cc[VSTATUS], c)) { + if (ISSET(lflag, ISIG)) + pgsignal(tp->t_pgrp, SIGINFO, 1); + if (!ISSET(lflag, NOKERNINFO)) + ttyinfo(tp); + goto endcase; + } + } + /* + * Check for input buffer overflow + */ + if (tp->t_rawq.c_cc + tp->t_canq.c_cc >= TTYHOG) { + if (ISSET(iflag, IMAXBEL)) { + if (tp->t_outq.c_cc < tp->t_hiwat) + (void)ttyoutput(CTRL('g'), tp); + } else + ttyflush(tp, FREAD | FWRITE); + goto endcase; + } + /* + * Put data char in q for user and + * wakeup on seeing a line delimiter. + */ + if (putc(c, &tp->t_rawq) >= 0) { + if (!ISSET(lflag, ICANON)) { + ttwakeup(tp); + ttyecho(c, tp); + goto endcase; + } + if (TTBREAKC(c)) { + tp->t_rocount = 0; + catq(&tp->t_rawq, &tp->t_canq); + ttwakeup(tp); + } else if (tp->t_rocount++ == 0) + tp->t_rocol = tp->t_column; + if (ISSET(tp->t_state, TS_ERASE)) { + /* + * end of prterase \.../ + */ + CLR(tp->t_state, TS_ERASE); + (void)ttyoutput('/', tp); + } + i = tp->t_column; + ttyecho(c, tp); + if (CCEQ(cc[VEOF], c) && ISSET(lflag, ECHO)) { + /* + * Place the cursor over the '^' of the ^D. + */ + i = min(2, tp->t_column - i); + while (i > 0) { + (void)ttyoutput('\b', tp); + i--; + } + } + } +endcase: + /* + * IXANY means allow any character to restart output. + */ + if (ISSET(tp->t_state, TS_TTSTOP) && + !ISSET(iflag, IXANY) && cc[VSTART] != cc[VSTOP]) + return (0); +restartoutput: + CLR(tp->t_lflag, FLUSHO); + CLR(tp->t_state, TS_TTSTOP); +startoutput: + return (ttstart(tp)); +} + +/* + * Output a single character on a tty, doing output processing + * as needed (expanding tabs, newline processing, etc.). + * Returns < 0 if succeeds, otherwise returns char to resend. + * Must be recursive. + */ +int +ttyoutput(c, tp) + register int c; + register struct tty *tp; +{ + register long oflag; + register int col, notout, s; + + oflag = tp->t_oflag; + if (!ISSET(oflag, OPOST)) { + if (ISSET(tp->t_lflag, FLUSHO)) + return (-1); + if (putc(c, &tp->t_outq)) + return (c); + tk_nout++; + tp->t_outcc++; + return (-1); + } + /* + * Do tab expansion if OXTABS is set. Special case if we external + * processing, we don't do the tab expansion because we'll probably + * get it wrong. If tab expansion needs to be done, let it happen + * externally. + */ + CLR(c, ~TTY_CHARMASK); + if (c == '\t' && + ISSET(oflag, OXTABS) && !ISSET(tp->t_lflag, EXTPROC)) { + c = 8 - (tp->t_column & 7); + if (ISSET(tp->t_lflag, FLUSHO)) { + notout = 0; + } else { + s = spltty(); /* Don't interrupt tabs. */ + notout = b_to_q(" ", c, &tp->t_outq); + c -= notout; + tk_nout += c; + tp->t_outcc += c; + splx(s); + } + tp->t_column += c; + return (notout ? '\t' : -1); + } + if (c == CEOT && ISSET(oflag, ONOEOT)) + return (-1); + + /* + * Newline translation: if ONLCR is set, + * translate newline into "\r\n". + */ + if (c == '\n' && ISSET(tp->t_oflag, ONLCR)) { + tk_nout++; + tp->t_outcc++; + if (putc('\r', &tp->t_outq)) + return (c); + } + tk_nout++; + tp->t_outcc++; + if (!ISSET(tp->t_lflag, FLUSHO) && putc(c, &tp->t_outq)) + return (c); + + col = tp->t_column; + switch (CCLASS(c)) { + case BACKSPACE: + if (col > 0) + --col; + break; + case CONTROL: + break; + case NEWLINE: + case RETURN: + col = 0; + break; + case ORDINARY: + ++col; + break; + case TAB: + col = (col + 8) & ~7; + break; + } + tp->t_column = col; + return (-1); +} + +/* + * Ioctls for all tty devices. Called after line-discipline specific ioctl + * has been called to do discipline-specific functions and/or reject any + * of these ioctl commands. + */ +/* ARGSUSED */ +int +ttioctl(tp, cmd, data, flag, p) + register struct tty *tp; + int cmd, flag; + void *data; + struct proc *p; +{ + extern struct tty *constty; /* Temporary virtual console. */ + extern int nlinesw; + int s, error; + + /* If the ioctl involves modification, hang if in the background. */ + switch (cmd) { + case TIOCFLUSH: + case TIOCSETA: + case TIOCSETD: + case TIOCSETAF: + case TIOCSETAW: +#ifdef notdef + case TIOCSPGRP: +#endif + case TIOCSTAT: + case TIOCSTI: + case TIOCSWINSZ: +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) + case TIOCLBIC: + case TIOCLBIS: + case TIOCLSET: + case TIOCSETC: + case OTIOCSETD: + case TIOCSETN: + case TIOCSETP: + case TIOCSLTC: +#endif + while (isbackground(curproc, tp) && + p->p_pgrp->pg_jobc && (p->p_flag & P_PPWAIT) == 0 && + (p->p_sigignore & sigmask(SIGTTOU)) == 0 && + (p->p_sigmask & sigmask(SIGTTOU)) == 0) { + pgsignal(p->p_pgrp, SIGTTOU, 1); + if (error = ttysleep(tp, + &lbolt, TTOPRI | PCATCH, ttybg, 0)) + return (error); + } + break; + } + + switch (cmd) { /* Process the ioctl. */ + case FIOASYNC: /* set/clear async i/o */ + s = spltty(); + if (*(int *)data) + SET(tp->t_state, TS_ASYNC); + else + CLR(tp->t_state, TS_ASYNC); + splx(s); + break; + case FIONBIO: /* set/clear non-blocking i/o */ + break; /* XXX: delete. */ + case FIONREAD: /* get # bytes to read */ + *(int *)data = ttnread(tp); + break; + case TIOCEXCL: /* set exclusive use of tty */ + s = spltty(); + SET(tp->t_state, TS_XCLUDE); + splx(s); + break; + case TIOCFLUSH: { /* flush buffers */ + register int flags = *(int *)data; + + if (flags == 0) + flags = FREAD | FWRITE; + else + flags &= FREAD | FWRITE; + ttyflush(tp, flags); + break; + } + case TIOCCONS: /* become virtual console */ + if (*(int *)data) { + if (constty && constty != tp && + ISSET(constty->t_state, TS_CARR_ON | TS_ISOPEN) == + (TS_CARR_ON | TS_ISOPEN)) + return (EBUSY); +#ifndef UCONSOLE + if (error = suser(p->p_ucred, &p->p_acflag)) + return (error); +#endif + constty = tp; + } else if (tp == constty) + constty = NULL; + break; + case TIOCDRAIN: /* wait till output drained */ + if (error = ttywait(tp)) + return (error); + break; + case TIOCGETA: { /* get termios struct */ + struct termios *t = (struct termios *)data; + + bcopy(&tp->t_termios, t, sizeof(struct termios)); + break; + } + case TIOCGETD: /* get line discipline */ + *(int *)data = tp->t_line; + break; + case TIOCGWINSZ: /* get window size */ + *(struct winsize *)data = tp->t_winsize; + break; + case TIOCGPGRP: /* get pgrp of tty */ + if (!isctty(p, tp)) + return (ENOTTY); + *(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID; + break; +#ifdef TIOCHPCL + case TIOCHPCL: /* hang up on last close */ + s = spltty(); + SET(tp->t_cflag, HUPCL); + splx(s); + break; +#endif + case TIOCNXCL: /* reset exclusive use of tty */ + s = spltty(); + CLR(tp->t_state, TS_XCLUDE); + splx(s); + break; + case TIOCOUTQ: /* output queue size */ + *(int *)data = tp->t_outq.c_cc; + break; + case TIOCSETA: /* set termios struct */ + case TIOCSETAW: /* drain output, set */ + case TIOCSETAF: { /* drn out, fls in, set */ + register struct termios *t = (struct termios *)data; + + s = spltty(); + if (cmd == TIOCSETAW || cmd == TIOCSETAF) { + if (error = ttywait(tp)) { + splx(s); + return (error); + } + if (cmd == TIOCSETAF) + ttyflush(tp, FREAD); + } + if (!ISSET(t->c_cflag, CIGNORE)) { + /* + * Set device hardware. + */ + if (tp->t_param && (error = (*tp->t_param)(tp, t))) { + splx(s); + return (error); + } else { + if (!ISSET(tp->t_state, TS_CARR_ON) && + ISSET(tp->t_cflag, CLOCAL) && + !ISSET(t->c_cflag, CLOCAL)) { + CLR(tp->t_state, TS_ISOPEN); + SET(tp->t_state, TS_WOPEN); + ttwakeup(tp); + } + tp->t_cflag = t->c_cflag; + tp->t_ispeed = t->c_ispeed; + tp->t_ospeed = t->c_ospeed; + if (t->c_ospeed == 0 && tp->t_session && + tp->t_session->s_leader) + psignal(tp->t_session->s_leader, + SIGHUP); + } + ttsetwater(tp); + } + if (cmd != TIOCSETAF) { + if (ISSET(t->c_lflag, ICANON) != + ISSET(tp->t_lflag, ICANON)) + if (ISSET(t->c_lflag, ICANON)) { + SET(tp->t_lflag, PENDIN); + ttwakeup(tp); + } else { + struct clist tq; + + catq(&tp->t_rawq, &tp->t_canq); + tq = tp->t_rawq; + tp->t_rawq = tp->t_canq; + tp->t_canq = tq; + CLR(tp->t_lflag, PENDIN); + } + } + tp->t_iflag = t->c_iflag; + tp->t_oflag = t->c_oflag; + /* + * Make the EXTPROC bit read only. + */ + if (ISSET(tp->t_lflag, EXTPROC)) + SET(t->c_lflag, EXTPROC); + else + CLR(t->c_lflag, EXTPROC); + tp->t_lflag = t->c_lflag | ISSET(tp->t_lflag, PENDIN); + bcopy(t->c_cc, tp->t_cc, sizeof(t->c_cc)); + splx(s); + break; + } + case TIOCSETD: { /* set line discipline */ + register int t = *(int *)data; + dev_t device = tp->t_dev; + + if ((u_int)t >= nlinesw) + return (ENXIO); + if (t != tp->t_line) { + s = spltty(); + (*linesw[tp->t_line].l_close)(tp, flag); + error = (*linesw[t].l_open)(device, tp); + if (error) { + (void)(*linesw[tp->t_line].l_open)(device, tp); + splx(s); + return (error); + } + tp->t_line = t; + splx(s); + } + break; + } + case TIOCSTART: /* start output, like ^Q */ + s = spltty(); + if (ISSET(tp->t_state, TS_TTSTOP) || + ISSET(tp->t_lflag, FLUSHO)) { + CLR(tp->t_lflag, FLUSHO); + CLR(tp->t_state, TS_TTSTOP); + ttstart(tp); + } + splx(s); + break; + case TIOCSTI: /* simulate terminal input */ + if (p->p_ucred->cr_uid && (flag & FREAD) == 0) + return (EPERM); + if (p->p_ucred->cr_uid && !isctty(p, tp)) + return (EACCES); + (*linesw[tp->t_line].l_rint)(*(u_char *)data, tp); + break; + case TIOCSTOP: /* stop output, like ^S */ + s = spltty(); + if (!ISSET(tp->t_state, TS_TTSTOP)) { + SET(tp->t_state, TS_TTSTOP); + (*cdevsw[major(tp->t_dev)].d_stop)(tp, 0); + } + splx(s); + break; + case TIOCSCTTY: /* become controlling tty */ + /* Session ctty vnode pointer set in vnode layer. */ + if (!SESS_LEADER(p) || + (p->p_session->s_ttyvp || tp->t_session) && + (tp->t_session != p->p_session)) + return (EPERM); + tp->t_session = p->p_session; + tp->t_pgrp = p->p_pgrp; + p->p_session->s_ttyp = tp; + p->p_flag |= P_CONTROLT; + break; + case TIOCSPGRP: { /* set pgrp of tty */ + register struct pgrp *pgrp = pgfind(*(int *)data); + + if (!isctty(p, tp)) + return (ENOTTY); + else if (pgrp == NULL || pgrp->pg_session != p->p_session) + return (EPERM); + tp->t_pgrp = pgrp; + break; + } + case TIOCSTAT: /* get load avg stats */ + ttyinfo(tp); + break; + case TIOCSWINSZ: /* set window size */ + if (bcmp((caddr_t)&tp->t_winsize, data, + sizeof (struct winsize))) { + tp->t_winsize = *(struct winsize *)data; + pgsignal(tp->t_pgrp, SIGWINCH, 1); + } + break; + default: +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) + return (ttcompat(tp, cmd, data, flag, p)); +#else + return (-1); +#endif + } + return (0); +} + +int +ttselect(device, rw, p) + dev_t device; + int rw; + struct proc *p; +{ + register struct tty *tp; + int nread, s; + + tp = cdevsw[major(device)].d_ttys[minor(device)]; + + s = spltty(); + switch (rw) { + case FREAD: + nread = ttnread(tp); + if (nread > 0 || !ISSET(tp->t_cflag, CLOCAL) && + !ISSET(tp->t_state, TS_CARR_ON)) + goto win; + selrecord(p, &tp->t_rsel); + break; + case FWRITE: + if (tp->t_outq.c_cc <= tp->t_lowat) { +win: splx(s); + return (1); + } + selrecord(p, &tp->t_wsel); + break; + } + splx(s); + return (0); +} + +static int +ttnread(tp) + struct tty *tp; +{ + int nread; + + if (ISSET(tp->t_lflag, PENDIN)) + ttypend(tp); + nread = tp->t_canq.c_cc; + if (!ISSET(tp->t_lflag, ICANON)) { + nread += tp->t_rawq.c_cc; + if (nread < tp->t_cc[VMIN] && !tp->t_cc[VTIME]) + nread = 0; + } + return (nread); +} + +/* + * Wait for output to drain. + */ +int +ttywait(tp) + register struct tty *tp; +{ + int error, s; + + error = 0; + s = spltty(); + while ((tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) && + (ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL)) + && tp->t_oproc) { + (*tp->t_oproc)(tp); + SET(tp->t_state, TS_ASLEEP); + if (error = ttysleep(tp, + &tp->t_outq, TTOPRI | PCATCH, ttyout, 0)) + break; + } + splx(s); + return (error); +} + +/* + * Flush if successfully wait. + */ +int +ttywflush(tp) + struct tty *tp; +{ + int error; + + if ((error = ttywait(tp)) == 0) + ttyflush(tp, FREAD); + return (error); +} + +/* + * Flush tty read and/or write queues, notifying anyone waiting. + */ +void +ttyflush(tp, rw) + register struct tty *tp; + int rw; +{ + register int s; + + s = spltty(); + if (rw & FREAD) { + FLUSHQ(&tp->t_canq); + FLUSHQ(&tp->t_rawq); + tp->t_rocount = 0; + tp->t_rocol = 0; + CLR(tp->t_state, TS_LOCAL); + ttwakeup(tp); + } + if (rw & FWRITE) { + CLR(tp->t_state, TS_TTSTOP); + (*cdevsw[major(tp->t_dev)].d_stop)(tp, rw); + FLUSHQ(&tp->t_outq); + wakeup((caddr_t)&tp->t_outq); + selwakeup(&tp->t_wsel); + } + splx(s); +} + +/* + * Copy in the default termios characters. + */ +void +ttychars(tp) + struct tty *tp; +{ + + bcopy(ttydefchars, tp->t_cc, sizeof(ttydefchars)); +} + +/* + * Send stop character on input overflow. + */ +static void +ttyblock(tp) + register struct tty *tp; +{ + register int total; + + total = tp->t_rawq.c_cc + tp->t_canq.c_cc; + if (tp->t_rawq.c_cc > TTYHOG) { + ttyflush(tp, FREAD | FWRITE); + CLR(tp->t_state, TS_TBLOCK); + } + /* + * Block further input iff: current input > threshold + * AND input is available to user program. + */ + if (total >= TTYHOG / 2 && + !ISSET(tp->t_state, TS_TBLOCK) && + !ISSET(tp->t_lflag, ICANON) || tp->t_canq.c_cc > 0 && + tp->t_cc[VSTOP] != _POSIX_VDISABLE) { + if (putc(tp->t_cc[VSTOP], &tp->t_outq) == 0) { + SET(tp->t_state, TS_TBLOCK); + ttstart(tp); + } + /* try to block remote output via hardware flow control */ + if (ISSET(tp->t_cflag, CHWFLOW) && tp->t_hwiflow && + (*tp->t_hwiflow)(tp, 1) != 0) + SET(tp->t_state, TS_TBLOCK); + } +} + +void +ttrstrt(tp_arg) + void *tp_arg; +{ + struct tty *tp; + int s; + +#ifdef DIAGNOSTIC + if (tp_arg == NULL) + panic("ttrstrt"); +#endif + tp = tp_arg; + s = spltty(); + + CLR(tp->t_state, TS_TIMEOUT); + ttstart(tp); + + splx(s); +} + +int +ttstart(tp) + struct tty *tp; +{ + + if (tp->t_oproc != NULL) /* XXX: Kludge for pty. */ + (*tp->t_oproc)(tp); + return (0); +} + +/* + * "close" a line discipline + */ +int +ttylclose(tp, flag) + struct tty *tp; + int flag; +{ + + if (flag & IO_NDELAY) + ttyflush(tp, FREAD | FWRITE); + else + ttywflush(tp); + return (0); +} + +/* + * Handle modem control transition on a tty. + * Flag indicates new state of carrier. + * Returns 0 if the line should be turned off, otherwise 1. + */ +int +ttymodem(tp, flag) + register struct tty *tp; + int flag; +{ + + if (!ISSET(tp->t_state, TS_WOPEN) && ISSET(tp->t_cflag, MDMBUF)) { + /* + * MDMBUF: do flow control according to carrier flag + */ + if (flag) { + CLR(tp->t_state, TS_TTSTOP); + ttstart(tp); + } else if (!ISSET(tp->t_state, TS_TTSTOP)) { + SET(tp->t_state, TS_TTSTOP); + (*cdevsw[major(tp->t_dev)].d_stop)(tp, 0); + } + } else if (flag == 0) { + /* + * Lost carrier. + */ + CLR(tp->t_state, TS_CARR_ON); + if (ISSET(tp->t_state, TS_ISOPEN) && + !ISSET(tp->t_cflag, CLOCAL)) { + if (tp->t_session && tp->t_session->s_leader) + psignal(tp->t_session->s_leader, SIGHUP); + ttyflush(tp, FREAD | FWRITE); + return (0); + } + } else { + /* + * Carrier now on. + */ + SET(tp->t_state, TS_CARR_ON); + ttwakeup(tp); + } + return (1); +} + +/* + * Default modem control routine (for other line disciplines). + * Return argument flag, to turn off device on carrier drop. + */ +int +nullmodem(tp, flag) + register struct tty *tp; + int flag; +{ + + if (flag) + SET(tp->t_state, TS_CARR_ON); + else { + CLR(tp->t_state, TS_CARR_ON); + if (!ISSET(tp->t_cflag, CLOCAL)) { + if (tp->t_session && tp->t_session->s_leader) + psignal(tp->t_session->s_leader, SIGHUP); + return (0); + } + } + return (1); +} + +/* + * Reinput pending characters after state switch + * call at spltty(). + */ +void +ttypend(tp) + register struct tty *tp; +{ + struct clist tq; + register c; + + CLR(tp->t_lflag, PENDIN); + SET(tp->t_state, TS_TYPEN); + tq = tp->t_rawq; + tp->t_rawq.c_cc = 0; + tp->t_rawq.c_cf = tp->t_rawq.c_cl = 0; + while ((c = getc(&tq)) >= 0) + ttyinput(c, tp); + CLR(tp->t_state, TS_TYPEN); +} + +/* + * Process a read call on a tty device. + */ +int +ttread(tp, uio, flag) + register struct tty *tp; + struct uio *uio; + int flag; +{ + register struct clist *qp; + register int c; + register long lflag; + register u_char *cc = tp->t_cc; + register struct proc *p = curproc; + int s, first, error = 0; + struct timeval stime; + int has_stime = 0, last_cc; + long slp = 0; + +loop: lflag = tp->t_lflag; + s = spltty(); + /* + * take pending input first + */ + if (ISSET(lflag, PENDIN)) + ttypend(tp); + splx(s); + + /* + * Hang process if it's in the background. + */ + if (isbackground(p, tp)) { + if ((p->p_sigignore & sigmask(SIGTTIN)) || + (p->p_sigmask & sigmask(SIGTTIN)) || + p->p_flag & P_PPWAIT || p->p_pgrp->pg_jobc == 0) + return (EIO); + pgsignal(p->p_pgrp, SIGTTIN, 1); + if (error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, ttybg, 0)) + return (error); + goto loop; + } + + s = spltty(); + if (!ISSET(lflag, ICANON)) { + int m = cc[VMIN]; + long t = cc[VTIME]; + + qp = &tp->t_rawq; + /* + * Check each of the four combinations. + * (m > 0 && t == 0) is the normal read case. + * It should be fairly efficient, so we check that and its + * companion case (m == 0 && t == 0) first. + * For the other two cases, we compute the target sleep time + * into slp. + */ + if (t == 0) { + if (qp->c_cc < m) + goto sleep; + goto read; + } + t *= 100000; /* time in us */ +#define diff(t1, t2) (((t1).tv_sec - (t2).tv_sec) * 1000000 + \ + ((t1).tv_usec - (t2).tv_usec)) + if (m > 0) { + if (qp->c_cc <= 0) + goto sleep; + if (qp->c_cc >= m) + goto read; + if (!has_stime) { + /* first character, start timer */ + has_stime = 1; + stime = time; + slp = t; + } else if (qp->c_cc > last_cc) { + /* got a character, restart timer */ + stime = time; + slp = t; + } else { + /* nothing, check expiration */ + slp = t - diff(time, stime); + } + last_cc = qp->c_cc; + } else { /* m == 0 */ + if (qp->c_cc > 0) + goto read; + if (!has_stime) { + has_stime = 1; + stime = time; + slp = t; + } else + slp = t - diff(time, stime); + } +#undef diff + if (slp > 0) { + /* + * Rounding down may make us wake up just short + * of the target, so we round up. + * The formula is ceiling(slp * hz/1000000). + * 32-bit arithmetic is enough for hz < 169. + * + * Also, use plain wakeup() not ttwakeup(). + */ + slp = (long) (((u_long)slp * hz) + 999999) / 1000000; + timeout(wakeup, (caddr_t)qp, slp); + goto sleep; + } + } else if ((qp = &tp->t_canq)->c_cc <= 0) { + int carrier; + +sleep: + /* + * If there is no input, sleep on rawq + * awaiting hardware receipt and notification. + * If we have data, we don't need to check for carrier. + */ + carrier = ISSET(tp->t_state, TS_CARR_ON) || + ISSET(tp->t_cflag, CLOCAL); + if (!carrier && ISSET(tp->t_state, TS_ISOPEN)) { + if (slp) + untimeout(wakeup, (caddr_t)qp); + splx(s); + return (0); /* EOF */ + } + if (flag & IO_NDELAY) { + if (slp) + untimeout(wakeup, (caddr_t)qp); + splx(s); + return (EWOULDBLOCK); + } + error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, + carrier ? ttyin : ttopen, 0); + if (slp) + untimeout(wakeup, (caddr_t)qp); + splx(s); + if (error) + return (error); + goto loop; + } +read: + splx(s); + + /* + * Input present, check for input mapping and processing. + */ + first = 1; + while ((c = getc(qp)) >= 0) { + /* + * delayed suspend (^Y) + */ + if (CCEQ(cc[VDSUSP], c) && ISSET(lflag, ISIG)) { + pgsignal(tp->t_pgrp, SIGTSTP, 1); + if (first) { + if (error = ttysleep(tp, + &lbolt, TTIPRI | PCATCH, ttybg, 0)) + break; + goto loop; + } + break; + } + /* + * Interpret EOF only in canonical mode. + */ + if (CCEQ(cc[VEOF], c) && ISSET(lflag, ICANON)) + break; + /* + * Give user character. + */ + error = ureadc(c, uio); + if (error) + break; + if (uio->uio_resid == 0) + break; + /* + * In canonical mode check for a "break character" + * marking the end of a "line of input". + */ + if (ISSET(lflag, ICANON) && TTBREAKC(c)) + break; + first = 0; + } + /* + * Look to unblock output now that (presumably) + * the input queue has gone down. + */ + s = spltty(); + if (ISSET(tp->t_state, TS_TBLOCK) && tp->t_rawq.c_cc < TTYHOG/5) { + if (cc[VSTART] != _POSIX_VDISABLE && + putc(cc[VSTART], &tp->t_outq) == 0) { + CLR(tp->t_state, TS_TBLOCK); + ttstart(tp); + } + /* try to unblock remote output via hardware flow control */ + if (tp->t_cflag&CHWFLOW && tp->t_hwiflow && + (*tp->t_hwiflow)(tp, 0) != 0) + tp->t_state &= ~TS_TBLOCK; + } + splx(s); + return (error); +} + +/* + * Check the output queue on tp for space for a kernel message (from uprintf + * or tprintf). Allow some space over the normal hiwater mark so we don't + * lose messages due to normal flow control, but don't let the tty run amok. + * Sleeps here are not interruptible, but we return prematurely if new signals + * arrive. + */ +int +ttycheckoutq(tp, wait) + register struct tty *tp; + int wait; +{ + int hiwat, s, oldsig; + + hiwat = tp->t_hiwat; + s = spltty(); + oldsig = wait ? curproc->p_siglist : 0; + if (tp->t_outq.c_cc > hiwat + 200) + while (tp->t_outq.c_cc > hiwat) { + ttstart(tp); + if (wait == 0 || curproc->p_siglist != oldsig) { + splx(s); + return (0); + } + timeout((void (*)__P((void *)))wakeup, + (void *)&tp->t_outq, hz); + SET(tp->t_state, TS_ASLEEP); + tsleep(&tp->t_outq, PZERO - 1, "ttckoutq", 0); + } + splx(s); + return (1); +} + +/* + * Process a write call on a tty device. + */ +int +ttwrite(tp, uio, flag) + register struct tty *tp; + register struct uio *uio; + int flag; +{ + register u_char *cp; + register int cc, ce; + register struct proc *p; + int i, hiwat, cnt, error, s; + u_char obuf[OBUFSIZ]; + + hiwat = tp->t_hiwat; + cnt = uio->uio_resid; + error = 0; + cc = 0; +loop: + s = spltty(); + if (!ISSET(tp->t_state, TS_CARR_ON) && + !ISSET(tp->t_cflag, CLOCAL)) { + if (ISSET(tp->t_state, TS_ISOPEN)) { + splx(s); + return (EIO); + } else if (flag & IO_NDELAY) { + splx(s); + error = EWOULDBLOCK; + goto out; + } else { + /* Sleep awaiting carrier. */ + error = ttysleep(tp, + &tp->t_rawq, TTIPRI | PCATCH, ttopen, 0); + splx(s); + if (error) + goto out; + goto loop; + } + } + splx(s); + /* + * Hang the process if it's in the background. + */ + p = curproc; + if (isbackground(p, tp) && + ISSET(tp->t_lflag, TOSTOP) && (p->p_flag & P_PPWAIT) == 0 && + (p->p_sigignore & sigmask(SIGTTOU)) == 0 && + (p->p_sigmask & sigmask(SIGTTOU)) == 0 && + p->p_pgrp->pg_jobc) { + pgsignal(p->p_pgrp, SIGTTOU, 1); + if (error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, ttybg, 0)) + goto out; + goto loop; + } + /* + * Process the user's data in at most OBUFSIZ chunks. Perform any + * output translation. Keep track of high water mark, sleep on + * overflow awaiting device aid in acquiring new space. + */ + while (uio->uio_resid > 0 || cc > 0) { + if (ISSET(tp->t_lflag, FLUSHO)) { + uio->uio_resid = 0; + return (0); + } + if (tp->t_outq.c_cc > hiwat) + goto ovhiwat; + /* + * Grab a hunk of data from the user, unless we have some + * leftover from last time. + */ + if (cc == 0) { + cc = min(uio->uio_resid, OBUFSIZ); + cp = obuf; + error = uiomove(cp, cc, uio); + if (error) { + cc = 0; + break; + } + } + /* + * If nothing fancy need be done, grab those characters we + * can handle without any of ttyoutput's processing and + * just transfer them to the output q. For those chars + * which require special processing (as indicated by the + * bits in char_type), call ttyoutput. After processing + * a hunk of data, look for FLUSHO so ^O's will take effect + * immediately. + */ + while (cc > 0) { + if (!ISSET(tp->t_oflag, OPOST)) + ce = cc; + else { + ce = cc - scanc((u_int)cc, cp, + (u_char *)char_type, CCLASSMASK); + /* + * If ce is zero, then we're processing + * a special character through ttyoutput. + */ + if (ce == 0) { + tp->t_rocount = 0; + if (ttyoutput(*cp, tp) >= 0) { +#ifdef REAL_CLISTS + /* No Clists, wait a bit. */ + ttstart(tp); + if (error = ttysleep(tp, &lbolt, + TTOPRI | PCATCH, ttybuf, 0)) + break; + goto loop; +#else + /* out of space */ + goto overfull; +#endif + } + cp++; + cc--; + if (ISSET(tp->t_lflag, FLUSHO) || + tp->t_outq.c_cc > hiwat) + goto ovhiwat; + continue; + } + } + /* + * A bunch of normal characters have been found. + * Transfer them en masse to the output queue and + * continue processing at the top of the loop. + * If there are any further characters in this + * <= OBUFSIZ chunk, the first should be a character + * requiring special handling by ttyoutput. + */ + tp->t_rocount = 0; + i = b_to_q(cp, ce, &tp->t_outq); + ce -= i; + tp->t_column += ce; + cp += ce, cc -= ce, tk_nout += ce; + tp->t_outcc += ce; + if (i > 0) { +#ifdef REAL_CLISTS + /* No Clists, wait a bit. */ + ttstart(tp); + if (error = ttysleep(tp, + &lbolt, TTOPRI | PCATCH, ttybuf, 0)) + break; + goto loop; +#else + /* out of space */ + goto overfull; +#endif + } + if (ISSET(tp->t_lflag, FLUSHO) || + tp->t_outq.c_cc > hiwat) + break; + } + ttstart(tp); + } +out: + /* + * If cc is nonzero, we leave the uio structure inconsistent, as the + * offset and iov pointers have moved forward, but it doesn't matter + * (the call will either return short or restart with a new uio). + */ + uio->uio_resid += cc; + return (error); + +#ifndef REAL_CLISTS +overfull: + /* + * Since we are using ring buffers, if we can't insert any more into + * the output queue, we can assume the ring is full and that someone + * forgot to set the high water mark correctly. We set it and then + * proceed as normal. + */ + hiwat = tp->t_outq.c_cc - 1; +#endif + +ovhiwat: + ttstart(tp); + s = spltty(); + /* + * This can only occur if FLUSHO is set in t_lflag, + * or if ttstart/oproc is synchronous (or very fast). + */ + if (tp->t_outq.c_cc <= hiwat) { + splx(s); + goto loop; + } + if (flag & IO_NDELAY) { + splx(s); + uio->uio_resid += cc; + return (uio->uio_resid == cnt ? EWOULDBLOCK : 0); + } + SET(tp->t_state, TS_ASLEEP); + error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0); + splx(s); + if (error) + goto out; + goto loop; +} + +/* + * Rubout one character from the rawq of tp + * as cleanly as possible. + */ +void +ttyrub(c, tp) + int c; + register struct tty *tp; +{ + register u_char *cp; + register int savecol; + int tabc, s; + + if (!ISSET(tp->t_lflag, ECHO) || ISSET(tp->t_lflag, EXTPROC)) + return; + CLR(tp->t_lflag, FLUSHO); + if (ISSET(tp->t_lflag, ECHOE)) { + if (tp->t_rocount == 0) { + /* + * Screwed by ttwrite; retype + */ + ttyretype(tp); + return; + } + if (c == ('\t' | TTY_QUOTE) || c == ('\n' | TTY_QUOTE)) + ttyrubo(tp, 2); + else { + CLR(c, ~TTY_CHARMASK); + switch (CCLASS(c)) { + case ORDINARY: + ttyrubo(tp, 1); + break; + case BACKSPACE: + case CONTROL: + case NEWLINE: + case RETURN: + case VTAB: + if (ISSET(tp->t_lflag, ECHOCTL)) + ttyrubo(tp, 2); + break; + case TAB: + if (tp->t_rocount < tp->t_rawq.c_cc) { + ttyretype(tp); + return; + } + s = spltty(); + savecol = tp->t_column; + SET(tp->t_state, TS_CNTTB); + SET(tp->t_lflag, FLUSHO); + tp->t_column = tp->t_rocol; + for (cp = firstc(&tp->t_rawq, &c); cp; + cp = nextc(&tp->t_rawq, cp, &tabc)) + ttyecho(tabc, tp); + CLR(tp->t_lflag, FLUSHO); + CLR(tp->t_state, TS_CNTTB); + splx(s); + + /* savecol will now be length of the tab. */ + savecol -= tp->t_column; + tp->t_column += savecol; + if (savecol > 8) + savecol = 8; /* overflow screw */ + while (--savecol >= 0) + (void)ttyoutput('\b', tp); + break; + default: /* XXX */ +#define PANICSTR "ttyrub: would panic c = %d, val = %d\n" + (void)printf(PANICSTR, c, CCLASS(c)); +#ifdef notdef + panic(PANICSTR, c, CCLASS(c)); +#endif + } + } + } else if (ISSET(tp->t_lflag, ECHOPRT)) { + if (!ISSET(tp->t_state, TS_ERASE)) { + SET(tp->t_state, TS_ERASE); + (void)ttyoutput('\\', tp); + } + ttyecho(c, tp); + } else + ttyecho(tp->t_cc[VERASE], tp); + --tp->t_rocount; +} + +/* + * Back over cnt characters, erasing them. + */ +static void +ttyrubo(tp, cnt) + register struct tty *tp; + int cnt; +{ + + while (cnt-- > 0) { + (void)ttyoutput('\b', tp); + (void)ttyoutput(' ', tp); + (void)ttyoutput('\b', tp); + } +} + +/* + * ttyretype -- + * Reprint the rawq line. Note, it is assumed that c_cc has already + * been checked. + */ +void +ttyretype(tp) + register struct tty *tp; +{ + register u_char *cp; + int s, c; + + /* Echo the reprint character. */ + if (tp->t_cc[VREPRINT] != _POSIX_VDISABLE) + ttyecho(tp->t_cc[VREPRINT], tp); + + (void)ttyoutput('\n', tp); + + s = spltty(); + for (cp = firstc(&tp->t_canq, &c); cp; cp = nextc(&tp->t_canq, cp, &c)) + ttyecho(c, tp); + for (cp = firstc(&tp->t_rawq, &c); cp; cp = nextc(&tp->t_rawq, cp, &c)) + ttyecho(c, tp); + CLR(tp->t_state, TS_ERASE); + splx(s); + + tp->t_rocount = tp->t_rawq.c_cc; + tp->t_rocol = 0; +} + +/* + * Echo a typed character to the terminal. + */ +static void +ttyecho(c, tp) + register int c; + register struct tty *tp; +{ + + if (!ISSET(tp->t_state, TS_CNTTB)) + CLR(tp->t_lflag, FLUSHO); + if ((!ISSET(tp->t_lflag, ECHO) && + (!ISSET(tp->t_lflag, ECHONL) || c == '\n')) || + ISSET(tp->t_lflag, EXTPROC)) + return; + if (ISSET(tp->t_lflag, ECHOCTL) && + (ISSET(c, TTY_CHARMASK) <= 037 && c != '\t' && c != '\n' || + ISSET(c, TTY_CHARMASK) == 0177)) { + (void)ttyoutput('^', tp); + CLR(c, ~TTY_CHARMASK); + if (c == 0177) + c = '?'; + else + c += 'A' - 1; + } + (void)ttyoutput(c, tp); +} + +/* + * Wake up any readers on a tty. + */ +void +ttwakeup(tp) + register struct tty *tp; +{ + + selwakeup(&tp->t_rsel); + if (ISSET(tp->t_state, TS_ASYNC)) + pgsignal(tp->t_pgrp, SIGIO, 1); + wakeup((caddr_t)&tp->t_rawq); +} + +/* + * Look up a code for a specified speed in a conversion table; + * used by drivers to map software speed values to hardware parameters. + */ +int +ttspeedtab(speed, table) + int speed; + register struct speedtab *table; +{ + + for ( ; table->sp_speed != -1; table++) + if (table->sp_speed == speed) + return (table->sp_code); + return (-1); +} + +/* + * Set tty hi and low water marks. + * + * Try to arrange the dynamics so there's about one second + * from hi to low water. + */ +void +ttsetwater(tp) + struct tty *tp; +{ + register int cps, x; + +#define CLAMP(x, h, l) ((x) > h ? h : ((x) < l) ? l : (x)) + + cps = tp->t_ospeed / 10; + tp->t_lowat = x = CLAMP(cps / 2, TTMAXLOWAT, TTMINLOWAT); + x += cps; + x = CLAMP(x, TTMAXHIWAT, TTMINHIWAT); + tp->t_hiwat = roundup(x, CBSIZE); +#undef CLAMP +} + +/* + * Report on state of foreground process group. + */ +void +ttyinfo(tp) + register struct tty *tp; +{ + register struct proc *p, *pick; + struct timeval utime, stime; + int tmp; + + if (ttycheckoutq(tp,0) == 0) + return; + + /* Print load average. */ + tmp = (averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT; + ttyprintf(tp, "load: %d.%02d ", tmp / 100, tmp % 100); + + if (tp->t_session == NULL) + ttyprintf(tp, "not a controlling terminal\n"); + else if (tp->t_pgrp == NULL) + ttyprintf(tp, "no foreground process group\n"); + else if ((p = tp->t_pgrp->pg_mem) == NULL) + ttyprintf(tp, "empty foreground process group\n"); + else { + /* Pick interesting process. */ + for (pick = NULL; p != NULL; p = p->p_pgrpnxt) + if (proc_compare(pick, p)) + pick = p; + + ttyprintf(tp, " cmd: %s %d [%s] ", pick->p_comm, pick->p_pid, + pick->p_stat == SRUN ? "running" : + pick->p_wmesg ? pick->p_wmesg : "iowait"); + + calcru(pick, &utime, &stime, NULL); + + /* Print user time. */ + ttyprintf(tp, "%d.%02du ", + utime.tv_sec, (utime.tv_usec + 5000) / 10000); + + /* Print system time. */ + ttyprintf(tp, "%d.%02ds ", + stime.tv_sec, (stime.tv_usec + 5000) / 10000); + +#define pgtok(a) (((a) * NBPG) / 1024) + /* Print percentage cpu, resident set size. */ + tmp = pick->p_pctcpu * 10000 + FSCALE / 2 >> FSHIFT; + ttyprintf(tp, "%d%% %dk\n", + tmp / 100, + pick->p_stat == SIDL || pick->p_stat == SZOMB ? 0 : +#ifdef pmap_resident_count + pgtok(pmap_resident_count(&pick->p_vmspace->vm_pmap)) +#else + pgtok(pick->p_vmspace->vm_rssize) +#endif + ); + } + tp->t_rocount = 0; /* so pending input will be retyped if BS */ +} + +/* + * Returns 1 if p2 is "better" than p1 + * + * The algorithm for picking the "interesting" process is thus: + * + * 1) Only foreground processes are eligible - implied. + * 2) Runnable processes are favored over anything else. The runner + * with the highest cpu utilization is picked (p_estcpu). Ties are + * broken by picking the highest pid. + * 3) The sleeper with the shortest sleep time is next. With ties, + * we pick out just "short-term" sleepers (P_SINTR == 0). + * 4) Further ties are broken by picking the highest pid. + */ +#define ISRUN(p) (((p)->p_stat == SRUN) || ((p)->p_stat == SIDL)) +#define TESTAB(a, b) ((a)<<1 | (b)) +#define ONLYA 2 +#define ONLYB 1 +#define BOTH 3 + +static int +proc_compare(p1, p2) + register struct proc *p1, *p2; +{ + + if (p1 == NULL) + return (1); + /* + * see if at least one of them is runnable + */ + switch (TESTAB(ISRUN(p1), ISRUN(p2))) { + case ONLYA: + return (0); + case ONLYB: + return (1); + case BOTH: + /* + * tie - favor one with highest recent cpu utilization + */ + if (p2->p_estcpu > p1->p_estcpu) + return (1); + if (p1->p_estcpu > p2->p_estcpu) + return (0); + return (p2->p_pid > p1->p_pid); /* tie - return highest pid */ + } + /* + * weed out zombies + */ + switch (TESTAB(p1->p_stat == SZOMB, p2->p_stat == SZOMB)) { + case ONLYA: + return (1); + case ONLYB: + return (0); + case BOTH: + return (p2->p_pid > p1->p_pid); /* tie - return highest pid */ + } + /* + * pick the one with the smallest sleep time + */ + if (p2->p_slptime > p1->p_slptime) + return (0); + if (p1->p_slptime > p2->p_slptime) + return (1); + /* + * favor one sleeping in a non-interruptible sleep + */ + if (p1->p_flag & P_SINTR && (p2->p_flag & P_SINTR) == 0) + return (1); + if (p2->p_flag & P_SINTR && (p1->p_flag & P_SINTR) == 0) + return (0); + return (p2->p_pid > p1->p_pid); /* tie - return highest pid */ +} + +/* + * Output char to tty; console putchar style. + */ +int +tputchar(c, tp) + int c; + struct tty *tp; +{ + register int s; + + s = spltty(); + if (ISSET(tp->t_state, + TS_CARR_ON | TS_ISOPEN) != (TS_CARR_ON | TS_ISOPEN)) { + splx(s); + return (-1); + } + if (c == '\n') + (void)ttyoutput('\r', tp); + (void)ttyoutput(c, tp); + ttstart(tp); + splx(s); + return (0); +} + +/* + * Sleep on chan, returning ERESTART if tty changed while we napped and + * returning any errors (e.g. EINTR/ETIMEDOUT) reported by tsleep. If + * the tty is revoked, restarting a pending call will redo validation done + * at the start of the call. + */ +int +ttysleep(tp, chan, pri, wmesg, timo) + struct tty *tp; + void *chan; + int pri, timo; + char *wmesg; +{ + int error; + short gen; + + gen = tp->t_gen; + if (error = tsleep(chan, pri, wmesg, timo)) + return (error); + return (tp->t_gen == gen ? 0 : ERESTART); +} + +/* + * Allocate a tty structure and its associated buffers. + */ +struct tty * +ttymalloc() +{ + struct tty *tp; + + MALLOC(tp, struct tty *, sizeof(struct tty), M_TTYS, M_WAITOK); + bzero(tp, sizeof *tp); + /* XXX: default to 1024 chars for now */ + clalloc(&tp->t_rawq, 1024, 1); + clalloc(&tp->t_canq, 1024, 1); + /* output queue doesn't need quoting */ + clalloc(&tp->t_outq, 1024, 0); + return(tp); +} + +/* + * Free a tty structure and its buffers. + */ +void +ttyfree(tp) +struct tty *tp; +{ + clfree(&tp->t_rawq); + clfree(&tp->t_canq); + clfree(&tp->t_outq); + FREE(tp, M_TTYS); +} diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index 17ace392d38..c2b31adf734 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_compat.c,v 1.14 1994/06/29 06:33:24 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 - * $Id: tty_compat.c,v 1.13 1994/05/12 03:42:23 cgd Exp $ + * @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index b9556fc6b32..a2522fd9552 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_conf.c,v 1.14 1994/06/29 06:33:25 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tty_conf.c 8.4 (Berkeley) 1/21/94 - * $Id: tty_conf.c,v 1.13 1994/06/20 00:32:31 paulus Exp $ + * @(#)tty_conf.c 8.4 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index c6fee3390d0..c348737ad87 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_pty.c,v 1.23 1994/06/29 06:33:26 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_pty.c,v 1.22 1994/05/12 03:48:36 cgd Exp $ + * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 */ /* diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 3297409c724..52f3aa9304c 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_subr.c,v 1.8 1994/06/29 06:33:28 cgd Exp $ */ + /* * Copyright (c) 1993, 1994 Theo de Raadt * All rights reserved. @@ -29,8 +31,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id: tty_subr.c,v 1.7 1994/05/25 10:00:26 deraadt Exp $ */ #include <sys/param.h> diff --git a/sys/kern/tty_tb.c b/sys/kern/tty_tb.c index ddadd339139..a722f145e98 100644 --- a/sys/kern/tty_tb.c +++ b/sys/kern/tty_tb.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_tb.c,v 1.14 1994/06/29 06:33:30 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tty_tb.c 8.1 (Berkeley) 6/10/93 - * $Id: tty_tb.c,v 1.13 1994/05/18 00:10:10 cgd Exp $ + * @(#)tty_tb.c 8.1 (Berkeley) 6/10/93 */ #include "tb.h" diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index 09aa7ff759f..373b2f1afe3 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -1,3 +1,5 @@ +/* $NetBSD: tty_tty.c,v 1.10 1994/06/29 06:33:31 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_tty.c,v 1.9 1994/05/12 03:48:37 cgd Exp $ + * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 */ /* diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 0345b84e099..1bc3132cc60 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_domain.c,v 1.12 1994/06/29 06:33:33 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 - * $Id: uipc_domain.c,v 1.11 1994/05/13 06:01:30 mycroft Exp $ + * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 */ #include <sys/param.h> diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 2f5aef7c6f0..b4b1e4d557e 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_mbuf.c,v 1.10 1994/06/29 06:33:34 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 - * $Id: uipc_mbuf.c,v 1.9 1994/05/13 06:01:32 mycroft Exp $ + * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/kern/uipc_proto.c b/sys/kern/uipc_proto.c index 7880710a087..a04c2a96dc1 100644 --- a/sys/kern/uipc_proto.c +++ b/sys/kern/uipc_proto.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_proto.c,v 1.5 1994/06/29 06:33:36 cgd Exp $ */ + /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_proto.c,v 1.4 1994/05/13 06:01:34 mycroft Exp $ + * @(#)uipc_proto.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 528a763157d..30bfe2d1969 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_socket.c,v 1.16 1994/06/29 06:33:37 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 - * $Id: uipc_socket.c,v 1.15 1994/05/13 06:01:37 mycroft Exp $ + * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 */ #include <sys/param.h> diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 63ed94c289d..90ce10c651a 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_socket2.c,v 1.9 1994/06/29 06:33:39 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.8 1994/05/13 06:01:40 mycroft Exp $ + * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 0f1b41abf8f..be7bd9386e8 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_syscalls.c,v 1.8 1994/06/29 06:33:41 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 - * $Id: uipc_syscalls.c,v 1.7 1994/05/04 10:27:20 mycroft Exp $ + * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 */ #include <sys/param.h> diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 148ac919c8b..60c2c650208 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,3 +1,5 @@ +/* $NetBSD: uipc_usrreq.c,v 1.10 1994/06/29 06:33:43 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 - * $Id: uipc_usrreq.c,v 1.9 1994/06/08 11:28:47 mycroft Exp $ + * @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index c73edbc5404..2492776bbb2 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1 +1 @@ -revision 1.29 intentionally removed +revision 1.30 intentionally removed diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 61a31ccc37c..4c5b9bd129f 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_cache.c,v 1.6 1994/06/29 06:33:47 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_cache.c 8.1 (Berkeley) 6/10/93 - * $Id: vfs_cache.c,v 1.5 1994/06/08 11:28:50 mycroft Exp $ + * @(#)vfs_cache.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> @@ -70,7 +71,7 @@ long numcache; /* number of cache entries allocated */ struct namecache *nchhead, **nchtail; /* LRU chain pointers */ struct nchstats nchstats; /* cache effectiveness statistics */ -int doingcache = 1; /* 1 => enable the cache */ +int doingcache = 0; /* 1 => enable the cache */ /* * Look for a the name in the cache. We don't do this diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 515f308d777..857e534cdd5 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_cluster.c,v 1.2 1994/06/29 06:33:49 cgd Exp $ */ + /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 - * $Id: vfs_cluster.c,v 1.1 1994/06/08 11:28:51 mycroft Exp $ + * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 */ #include <sys/param.h> diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 982391e2c5e..b265cb3eedb 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_conf.c,v 1.21 1994/06/29 06:33:52 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 - * $Id: vfs_conf.c,v 1.20 1994/06/08 11:28:52 mycroft Exp $ + * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 */ #include <sys/param.h> diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index e392458ced2..21728056b4e 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_init.c,v 1.2 1994/06/29 06:33:53 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 - * $Id: vfs_init.c,v 1.1 1994/06/08 11:28:54 mycroft Exp $ + * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 */ diff --git a/sys/kern/vfs_lockf.c b/sys/kern/vfs_lockf.c index 14649c07db9..db71fcb0b9a 100644 --- a/sys/kern/vfs_lockf.c +++ b/sys/kern/vfs_lockf.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_lockf.c,v 1.5 1994/06/29 06:33:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 - * $Id: vfs_lockf.c,v 1.4 1994/05/19 06:13:50 mycroft Exp $ + * @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 */ #include <sys/param.h> diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 41708d3927b..3242afbc069 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_lookup.c,v 1.13 1994/06/29 06:33:57 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 - * $Id: vfs_lookup.c,v 1.12 1994/06/08 11:28:55 mycroft Exp $ + * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 */ #include <sys/param.h> diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index d129bb4935c..f2ccb7d1d5d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_subr.c,v 1.32 1994/06/29 06:33:59 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.31 1994/06/13 15:37:55 mycroft Exp $ + * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 */ /* diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 2492776bbb2..06633174e60 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1 +1,2174 @@ -revision 1.30 intentionally removed +/* $NetBSD: vfs_syscalls.c,v 1.31 1994/06/29 06:34:02 cgd Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)vfs_syscalls.c 8.15 (Berkeley) 6/4/94 + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/namei.h> +#include <sys/filedesc.h> +#include <sys/kernel.h> +#include <sys/file.h> +#include <sys/stat.h> +#include <sys/vnode.h> +#include <sys/mount.h> +#include <sys/proc.h> +#include <sys/uio.h> +#include <sys/malloc.h> +#include <sys/dirent.h> + +#include <vm/vm.h> +#include <sys/sysctl.h> + +static int change_dir __P((struct nameidata *ndp, struct proc *p)); + +/* + * Virtual File System System Calls + */ + +/* + * Mount a file system. + */ +struct mount_args { + char *type; + char *path; + int flags; + caddr_t data; +}; +/* ARGSUSED */ +mount(p, uap, retval) + struct proc *p; + register struct mount_args *uap; + int *retval; +{ + register struct vnode *vp; + register struct mount *mp; + int error, flag; + u_long fsindex; + char fstypename[MFSNAMELEN]; + struct nameidata nd; + + /* + * Must be super user + */ + if (error = suser(p->p_ucred, &p->p_acflag)) + return (error); + /* + * Get vnode to be covered + */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (uap->flags & MNT_UPDATE) { + if ((vp->v_flag & VROOT) == 0) { + vput(vp); + return (EINVAL); + } + mp = vp->v_mount; + flag = mp->mnt_flag; + /* + * We only allow the filesystem to be reloaded if it + * is currently mounted read-only. + */ + if ((uap->flags & MNT_RELOAD) && + ((mp->mnt_flag & MNT_RDONLY) == 0)) { + vput(vp); + return (EOPNOTSUPP); /* Needs translation */ + } + mp->mnt_flag |= + uap->flags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE); + VOP_UNLOCK(vp); + goto update; + } + if (error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, 0)) + return (error); + if (vp->v_type != VDIR) { + vput(vp); + return (ENOTDIR); + } + if (error = copyin(uap->type, fstypename, MFSNAMELEN)) { +#ifdef COMPAT_09 + goto check_num; +#else + vput(vp); + return (error); +#endif + } + fstypename[MFSNAMELEN] = '\0'; + for (fsindex = 0; fsindex < nvfssw; fsindex++) + if (vfssw[fsindex] != NULL && + !strncmp(vfssw[fsindex]->vfs_name, fstypename, MFSNAMELEN)) + break; + if (fsindex >= nvfssw) { +#ifdef COMPAT_09 +check_num: + fsindex = (unsigned long)uap->type; + if (fsindex >= nvfssw || vfssw[fsindex] == NULL) { + vput(vp); + return (ENODEV); + } +#else + vput(vp); + return (ENODEV); +#endif + } + + /* + * Allocate and initialize the file system. + */ + mp = (struct mount *)malloc((u_long)sizeof(struct mount), + M_MOUNT, M_WAITOK); + bzero((char *)mp, (u_long)sizeof(struct mount)); + mp->mnt_op = vfssw[fsindex]; + if (error = vfs_lock(mp)) { + free((caddr_t)mp, M_MOUNT); + vput(vp); + return (error); + } + if (vp->v_mountedhere != NULL) { + vfs_unlock(mp); + free((caddr_t)mp, M_MOUNT); + vput(vp); + return (EBUSY); + } + vp->v_mountedhere = mp; + mp->mnt_vnodecovered = vp; +update: + /* + * Set the mount level flags. + */ + if (uap->flags & MNT_RDONLY) + mp->mnt_flag |= MNT_RDONLY; + else if (mp->mnt_flag & MNT_RDONLY) + mp->mnt_flag |= MNT_WANTRDWR; + mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | + MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC); + mp->mnt_flag |= uap->flags & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | + MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC); + /* + * Mount the filesystem. + */ + error = VFS_MOUNT(mp, uap->path, uap->data, &nd, p); + if (mp->mnt_flag & MNT_UPDATE) { + vrele(vp); + if (mp->mnt_flag & MNT_WANTRDWR) + mp->mnt_flag &= ~MNT_RDONLY; + mp->mnt_flag &=~ + (MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_WANTRDWR); + if (error) + mp->mnt_flag = flag; + return (error); + } + /* + * Put the new filesystem on the mount list after root. + */ + cache_purge(vp); + if (!error) { + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); + VOP_UNLOCK(vp); + vfs_unlock(mp); + error = VFS_START(mp, 0, p); + } else { + mp->mnt_vnodecovered->v_mountedhere = (struct mount *)0; + vfs_unlock(mp); + free((caddr_t)mp, M_MOUNT); + vput(vp); + } + return (error); +} + +/* + * Unmount a file system. + * + * Note: unmount takes a path to the vnode mounted on as argument, + * not special file (as before). + */ +struct unmount_args { + char *path; + int flags; +}; +/* ARGSUSED */ +unmount(p, uap, retval) + struct proc *p; + register struct unmount_args *uap; + int *retval; +{ + register struct vnode *vp; + struct mount *mp; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + + /* + * Unless this is a user mount, then must + * have suser privilege. + */ + if (((vp->v_mount->mnt_flag & MNT_USER) == 0) && + (error = suser(p->p_ucred, &p->p_acflag))) { + vput(vp); + return (error); + } + + /* + * Must be the root of the filesystem + */ + if ((vp->v_flag & VROOT) == 0) { + vput(vp); + return (EINVAL); + } + mp = vp->v_mount; + vput(vp); + return (dounmount(mp, uap->flags, p)); +} + +/* + * Do the actual file system unmount. + */ +dounmount(mp, flags, p) + register struct mount *mp; + int flags; + struct proc *p; +{ + struct vnode *coveredvp; + int error; + + coveredvp = mp->mnt_vnodecovered; + if (vfs_busy(mp)) + return (EBUSY); + mp->mnt_flag |= MNT_UNMOUNT; + if (error = vfs_lock(mp)) + return (error); + + mp->mnt_flag &=~ MNT_ASYNC; + vnode_pager_umount(mp); /* release cached vnodes */ + cache_purgevfs(mp); /* remove cache entries for this file sys */ + if ((error = VFS_SYNC(mp, MNT_WAIT, p->p_ucred, p)) == 0 || + (flags & MNT_FORCE)) + error = VFS_UNMOUNT(mp, flags, p); + mp->mnt_flag &= ~MNT_UNMOUNT; + vfs_unbusy(mp); + if (error) { + vfs_unlock(mp); + } else { + vrele(coveredvp); + TAILQ_REMOVE(&mountlist, mp, mnt_list); + mp->mnt_vnodecovered->v_mountedhere = (struct mount *)0; + vfs_unlock(mp); + if (mp->mnt_vnodelist.lh_first != NULL) + panic("unmount: dangling vnode"); + free((caddr_t)mp, M_MOUNT); + } + return (error); +} + +/* + * Sync each mounted filesystem. + */ +#ifdef DEBUG +int syncprt = 0; +struct ctldebug debug0 = { "syncprt", &syncprt }; +#endif + +/* ARGSUSED */ +sync(p, uap, retval) + struct proc *p; + void *uap; + int *retval; +{ + register struct mount *mp, *nmp; + int asyncflag; + + for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) { + nmp = mp->mnt_list.tqe_next; + /* + * The lock check below is to avoid races with mount + * and unmount. + */ + if ((mp->mnt_flag & (MNT_MLOCK|MNT_RDONLY|MNT_MPBUSY)) == 0 && + !vfs_busy(mp)) { + asyncflag = mp->mnt_flag & MNT_ASYNC; + mp->mnt_flag &= ~MNT_ASYNC; + VFS_SYNC(mp, MNT_NOWAIT, p->p_ucred, p); + if (asyncflag) + mp->mnt_flag |= MNT_ASYNC; + vfs_unbusy(mp); + } + } +#ifdef DEBUG + if (syncprt) + vfs_bufstats(); +#endif /* DEBUG */ + return (0); +} + +/* + * Change filesystem quotas. + */ +struct quotactl_args { + char *path; + int cmd; + int uid; + caddr_t arg; +}; +/* ARGSUSED */ +quotactl(p, uap, retval) + struct proc *p; + register struct quotactl_args *uap; + int *retval; +{ + register struct mount *mp; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + mp = nd.ni_vp->v_mount; + vrele(nd.ni_vp); + return (VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, p)); +} + +/* + * Get filesystem statistics. + */ +struct statfs_args { + char *path; + struct statfs *buf; +}; +/* ARGSUSED */ +statfs(p, uap, retval) + struct proc *p; + register struct statfs_args *uap; + int *retval; +{ + register struct mount *mp; + register struct statfs *sp; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + mp = nd.ni_vp->v_mount; + sp = &mp->mnt_stat; + vrele(nd.ni_vp); + if (error = VFS_STATFS(mp, sp, p)) + return (error); + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp))); +} + +/* + * Get filesystem statistics. + */ +struct fstatfs_args { + int fd; + struct statfs *buf; +}; +/* ARGSUSED */ +fstatfs(p, uap, retval) + struct proc *p; + register struct fstatfs_args *uap; + int *retval; +{ + struct file *fp; + struct mount *mp; + register struct statfs *sp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + mp = ((struct vnode *)fp->f_data)->v_mount; + sp = &mp->mnt_stat; + if (error = VFS_STATFS(mp, sp, p)) + return (error); + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp))); +} + +/* + * Get statistics on all filesystems. + */ +struct getfsstat_args { + struct statfs *buf; + long bufsize; + int flags; +}; +getfsstat(p, uap, retval) + struct proc *p; + register struct getfsstat_args *uap; + int *retval; +{ + register struct mount *mp, *nmp; + register struct statfs *sp; + caddr_t sfsp; + long count, maxcount, error; + + maxcount = uap->bufsize / sizeof(struct statfs); + sfsp = (caddr_t)uap->buf; + for (count = 0, mp = mountlist.tqh_first; mp != NULL; mp = nmp) { + nmp = mp->mnt_list.tqe_next; + if (sfsp && count < maxcount && + ((mp->mnt_flag & MNT_MLOCK) == 0)) { + sp = &mp->mnt_stat; + /* + * If MNT_NOWAIT is specified, do not refresh the + * fsstat cache. MNT_WAIT overrides MNT_NOWAIT. + */ + if (((uap->flags & MNT_NOWAIT) == 0 || + (uap->flags & MNT_WAIT)) && + (error = VFS_STATFS(mp, sp, p))) + continue; + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + if (error = copyout((caddr_t)sp, sfsp, sizeof(*sp))) + return (error); + sfsp += sizeof(*sp); + } + count++; + } + if (sfsp && count > maxcount) + *retval = maxcount; + else + *retval = count; + return (0); +} + +/* + * Change current working directory to a given file descriptor. + */ +struct fchdir_args { + int fd; +}; +/* ARGSUSED */ +fchdir(p, uap, retval) + struct proc *p; + struct fchdir_args *uap; + int *retval; +{ + register struct filedesc *fdp = p->p_fd; + register struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(fdp, uap->fd, &fp)) + return (error); + vp = (struct vnode *)fp->f_data; + VOP_LOCK(vp); + if (vp->v_type != VDIR) + error = ENOTDIR; + else + error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); + VOP_UNLOCK(vp); + if (error) + return (error); + VREF(vp); + vrele(fdp->fd_cdir); + fdp->fd_cdir = vp; + return (0); +} + +/* + * Change current working directory (``.''). + */ +struct chdir_args { + char *path; +}; +/* ARGSUSED */ +chdir(p, uap, retval) + struct proc *p; + struct chdir_args *uap; + int *retval; +{ + register struct filedesc *fdp = p->p_fd; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = change_dir(&nd, p)) + return (error); + vrele(fdp->fd_cdir); + fdp->fd_cdir = nd.ni_vp; + return (0); +} + +/* + * Change notion of root (``/'') directory. + */ +struct chroot_args { + char *path; +}; +/* ARGSUSED */ +chroot(p, uap, retval) + struct proc *p; + struct chroot_args *uap; + int *retval; +{ + register struct filedesc *fdp = p->p_fd; + int error; + struct nameidata nd; + + if (error = suser(p->p_ucred, &p->p_acflag)) + return (error); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = change_dir(&nd, p)) + return (error); + if (fdp->fd_rdir != NULL) + vrele(fdp->fd_rdir); + fdp->fd_rdir = nd.ni_vp; + return (0); +} + +/* + * Common routine for chroot and chdir. + */ +static int +change_dir(ndp, p) + register struct nameidata *ndp; + struct proc *p; +{ + struct vnode *vp; + int error; + + if (error = namei(ndp)) + return (error); + vp = ndp->ni_vp; + if (vp->v_type != VDIR) + error = ENOTDIR; + else + error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); + VOP_UNLOCK(vp); + if (error) + vrele(vp); + return (error); +} + +/* + * Check permissions, allocate an open file structure, + * and call the device open routine if any. + */ +struct open_args { + char *path; + int flags; + int mode; +}; +open(p, uap, retval) + struct proc *p; + register struct open_args *uap; + int *retval; +{ + register struct filedesc *fdp = p->p_fd; + register struct file *fp; + register struct vnode *vp; + int flags, cmode; + struct file *nfp; + int type, indx, error; + struct flock lf; + struct nameidata nd; + extern struct fileops vnops; + + if (error = falloc(p, &nfp, &indx)) + return (error); + fp = nfp; + flags = FFLAGS(uap->flags); + cmode = ((uap->mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + p->p_dupfd = -indx - 1; /* XXX check for fdopen */ + if (error = vn_open(&nd, flags, cmode)) { + ffree(fp); + if ((error == ENODEV || error == ENXIO) && + p->p_dupfd >= 0 && /* XXX from fdopen */ + (error = + dupfdopen(fdp, indx, p->p_dupfd, flags, error)) == 0) { + *retval = indx; + return (0); + } + if (error == ERESTART) + error = EINTR; + fdp->fd_ofiles[indx] = NULL; + return (error); + } + p->p_dupfd = 0; + vp = nd.ni_vp; + fp->f_flag = flags & FMASK; + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + fp->f_data = (caddr_t)vp; + if (flags & (O_EXLOCK | O_SHLOCK)) { + lf.l_whence = SEEK_SET; + lf.l_start = 0; + lf.l_len = 0; + if (flags & O_EXLOCK) + lf.l_type = F_WRLCK; + else + lf.l_type = F_RDLCK; + type = F_FLOCK; + if ((flags & FNONBLOCK) == 0) + type |= F_WAIT; + VOP_UNLOCK(vp); + if (error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) { + (void) vn_close(vp, fp->f_flag, fp->f_cred, p); + ffree(fp); + fdp->fd_ofiles[indx] = NULL; + return (error); + } + VOP_LOCK(vp); + fp->f_flag |= FHASLOCK; + } + VOP_UNLOCK(vp); + *retval = indx; + return (0); +} + +#ifdef COMPAT_43 +/* + * Create a file. + */ +struct ocreat_args { + char *path; + int mode; +}; +ocreat(p, uap, retval) + struct proc *p; + register struct ocreat_args *uap; + int *retval; +{ + struct open_args openuap; + + openuap.path = uap->path; + openuap.mode = uap->mode; + openuap.flags = O_WRONLY | O_CREAT | O_TRUNC; + return (open(p, &openuap, retval)); +} +#endif /* COMPAT_43 */ + +/* + * Create a special file. + */ +struct mknod_args { + char *path; + int mode; + int dev; +}; +/* ARGSUSED */ +mknod(p, uap, retval) + struct proc *p; + register struct mknod_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + if (error = suser(p->p_ucred, &p->p_acflag)) + return (error); + NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp != NULL) { + error = EEXIST; + goto bad; + } + VATTR_NULL(&vattr); + vattr.va_mode = (uap->mode & ALLPERMS) &~ p->p_fd->fd_cmask; + vattr.va_rdev = uap->dev; + + switch (uap->mode & S_IFMT) { + case S_IFMT: /* used by badsect to flag bad sectors */ + vattr.va_type = VBAD; + break; + case S_IFCHR: + vattr.va_type = VCHR; + break; + case S_IFBLK: + vattr.va_type = VBLK; + break; + default: + error = EINVAL; + goto bad; + } + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr)); +bad: + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + if (vp) + vrele(vp); + return (error); +} + +/* + * Create a named pipe. + */ +struct mkfifo_args { + char *path; + int mode; +}; +/* ARGSUSED */ +mkfifo(p, uap, retval) + struct proc *p; + register struct mkfifo_args *uap; + int *retval; +{ + struct vattr vattr; + int error; + struct nameidata nd; + +#ifndef FIFO + return (EOPNOTSUPP); +#else + NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + if (nd.ni_vp != NULL) { + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == nd.ni_vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vrele(nd.ni_vp); + return (EEXIST); + } + VATTR_NULL(&vattr); + vattr.va_type = VFIFO; + vattr.va_mode = (uap->mode & ALLPERMS) &~ p->p_fd->fd_cmask; + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr)); +#endif /* FIFO */ +} + +/* + * Make a hard file link. + */ +struct link_args { + char *path; + char *link; +}; +/* ARGSUSED */ +link(p, uap, retval) + struct proc *p; + register struct link_args *uap; + int *retval; +{ + register struct vnode *vp; + struct nameidata nd; + int error; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp->v_type == VDIR && + (error = suser(p->p_ucred, &p->p_acflag))) + goto bad1; + nd.ni_cnd.cn_nameiop = CREATE; + nd.ni_cnd.cn_flags = LOCKPARENT; + nd.ni_dirp = uap->link; + if (error = namei(&nd)) + goto bad1; + if (nd.ni_vp != NULL) { + error = EEXIST; + goto bad2; + } + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); + vrele(vp); + return (error); +bad2: + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == nd.ni_vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + if (nd.ni_vp) + vrele(nd.ni_vp); +bad1: + vrele(vp); + return (error); +} + +/* + * Make a symbolic link. + */ +struct symlink_args { + char *path; + char *link; +}; +/* ARGSUSED */ +symlink(p, uap, retval) + struct proc *p; + register struct symlink_args *uap; + int *retval; +{ + struct vattr vattr; + char *path; + int error; + struct nameidata nd; + + MALLOC(path, char *, MAXPATHLEN, M_NAMEI, M_WAITOK); + if (error = copyinstr(uap->path, path, MAXPATHLEN, (u_int*)0)) + goto bad; + NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, uap->link, p); + if (error = namei(&nd)) + goto bad; + if (nd.ni_vp) { + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == nd.ni_vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vrele(nd.ni_vp); + error = EEXIST; + goto bad; + } + VATTR_NULL(&vattr); + vattr.va_mode = ACCESSPERMS &~ p->p_fd->fd_cmask; + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, path); +bad: + FREE(path, M_NAMEI); + return (error); +} + +/* + * Delete a name from the filesystem. + */ +struct unlink_args { + char *path; +}; +/* ARGSUSED */ +unlink(p, uap, retval) + struct proc *p; + struct unlink_args *uap; + int *retval; +{ + register struct vnode *vp; + int error; + struct nameidata nd; + + NDINIT(&nd, DELETE, LOCKPARENT, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + + if (vp->v_type == VDIR && + (error = suser(p->p_ucred, &p->p_acflag))) + goto bad; + /* + * The root of a mounted filesystem cannot be deleted. + */ + if (vp->v_flag & VROOT) { + error = EBUSY; + goto bad; + } + (void)vnode_pager_uncache(vp); + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + return (VOP_REMOVE(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd)); +bad: + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vput(vp); + return (error); +} + +/* + * Reposition read/write file offset. + */ +struct lseek_args { + int fd; + int pad; + off_t offset; + int whence; +}; +lseek(p, uap, retval) + struct proc *p; + register struct lseek_args *uap; + int *retval; +{ + struct ucred *cred = p->p_ucred; + register struct filedesc *fdp = p->p_fd; + register struct file *fp; + struct vattr vattr; + int error; + + if ((u_int)uap->fd >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[uap->fd]) == NULL) + return (EBADF); + if (fp->f_type != DTYPE_VNODE) + return (ESPIPE); + switch (uap->whence) { + case L_INCR: + fp->f_offset += uap->offset; + break; + case L_XTND: + if (error = + VOP_GETATTR((struct vnode *)fp->f_data, &vattr, cred, p)) + return (error); + fp->f_offset = uap->offset + vattr.va_size; + break; + case L_SET: + fp->f_offset = uap->offset; + break; + default: + return (EINVAL); + } + *(off_t *)retval = fp->f_offset; + return (0); +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +/* + * Reposition read/write file offset. + */ +struct olseek_args { + int fd; + long offset; + int whence; +}; +olseek(p, uap, retval) + struct proc *p; + register struct olseek_args *uap; + int *retval; +{ + struct lseek_args nuap; + off_t qret; + int error; + + nuap.fd = uap->fd; + nuap.offset = uap->offset; + nuap.whence = uap->whence; + error = lseek(p, &nuap, &qret); + *(long *)retval = qret; + return (error); +} +#endif /* COMPAT_43 || COMPAT_SUNOS */ + +/* + * Check access permissions. + */ +struct access_args { + char *path; + int flags; +}; +access(p, uap, retval) + struct proc *p; + register struct access_args *uap; + int *retval; +{ + register struct ucred *cred = p->p_ucred; + register struct vnode *vp; + int error, flags, t_gid, t_uid; + struct nameidata nd; + + t_uid = cred->cr_uid; + t_gid = cred->cr_groups[0]; + cred->cr_uid = p->p_cred->p_ruid; + cred->cr_groups[0] = p->p_cred->p_rgid; + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + goto out1; + vp = nd.ni_vp; + + /* Flags == 0 means only check for existence. */ + if (uap->flags) { + flags = 0; + if (uap->flags & R_OK) + flags |= VREAD; + if (uap->flags & W_OK) + flags |= VWRITE; + if (uap->flags & X_OK) + flags |= VEXEC; + if ((flags & VWRITE) == 0 || (error = vn_writechk(vp)) == 0) + error = VOP_ACCESS(vp, flags, cred, p); + } + vput(vp); +out1: + cred->cr_uid = t_uid; + cred->cr_groups[0] = t_gid; + return (error); +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +/* + * Get file status; this version follows links. + */ +struct ostat_args { + char *path; + struct ostat *ub; +}; +/* ARGSUSED */ +ostat(p, uap, retval) + struct proc *p; + register struct ostat_args *uap; + int *retval; +{ + struct stat sb; + struct ostat osb; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + error = vn_stat(nd.ni_vp, &sb, p); + vput(nd.ni_vp); + if (error) + return (error); + cvtstat(&sb, &osb); + error = copyout((caddr_t)&osb, (caddr_t)uap->ub, sizeof (osb)); + return (error); +} + +/* + * Get file status; this version does not follow links. + */ +struct olstat_args { + char *path; + struct ostat *ub; +}; +/* ARGSUSED */ +olstat(p, uap, retval) + struct proc *p; + register struct olstat_args *uap; + int *retval; +{ + struct stat sb; + struct ostat osb; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + error = vn_stat(nd.ni_vp, &sb, p); + vput(nd.ni_vp); + if (error) + return (error); + cvtstat(&sb, &osb); + error = copyout((caddr_t)&osb, (caddr_t)uap->ub, sizeof (osb)); + return (error); +} + +/* + * Convert from an old to a new stat structure. + */ +cvtstat(st, ost) + struct stat *st; + struct ostat *ost; +{ + + ost->st_dev = st->st_dev; + ost->st_ino = st->st_ino; + ost->st_mode = st->st_mode; + ost->st_nlink = st->st_nlink; + ost->st_uid = st->st_uid; + ost->st_gid = st->st_gid; + ost->st_rdev = st->st_rdev; + if (st->st_size < (quad_t)1 << 32) + ost->st_size = st->st_size; + else + ost->st_size = -2; + ost->st_atime = st->st_atime; + ost->st_mtime = st->st_mtime; + ost->st_ctime = st->st_ctime; + ost->st_blksize = st->st_blksize; + ost->st_blocks = st->st_blocks; + ost->st_flags = st->st_flags; + ost->st_gen = st->st_gen; +} +#endif /* COMPAT_43 || COMPAT_SUNOS */ + +/* + * Get file status; this version follows links. + */ +struct stat_args { + char *path; + struct stat *ub; +}; +/* ARGSUSED */ +stat(p, uap, retval) + struct proc *p; + register struct stat_args *uap; + int *retval; +{ + struct stat sb; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + error = vn_stat(nd.ni_vp, &sb, p); + vput(nd.ni_vp); + if (error) + return (error); + error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb)); + return (error); +} + +/* + * Get file status; this version does not follow links. + */ +struct lstat_args { + char *path; + struct stat *ub; +}; +/* ARGSUSED */ +lstat(p, uap, retval) + struct proc *p; + register struct lstat_args *uap; + int *retval; +{ + int error; + struct vnode *vp, *dvp; + struct stat sb, sb1; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKPARENT, UIO_USERSPACE, + uap->path, p); + if (error = namei(&nd)) + return (error); + /* + * For symbolic links, always return the attributes of its + * containing directory, except for mode, size, and links. + */ + vp = nd.ni_vp; + dvp = nd.ni_dvp; + if (vp->v_type != VLNK) { + if (dvp == vp) + vrele(dvp); + else + vput(dvp); + error = vn_stat(vp, &sb, p); + vput(vp); + if (error) + return (error); + } else { + error = vn_stat(dvp, &sb, p); + vput(dvp); + if (error) { + vput(vp); + return (error); + } + error = vn_stat(vp, &sb1, p); + vput(vp); + if (error) + return (error); + sb.st_mode &= ~S_IFDIR; + sb.st_mode |= S_IFLNK; + sb.st_nlink = sb1.st_nlink; + sb.st_size = sb1.st_size; + sb.st_blocks = sb1.st_blocks; + } + error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb)); + return (error); +} + +/* + * Get configurable pathname variables. + */ +struct pathconf_args { + char *path; + int name; +}; +/* ARGSUSED */ +pathconf(p, uap, retval) + struct proc *p; + register struct pathconf_args *uap; + int *retval; +{ + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + error = VOP_PATHCONF(nd.ni_vp, uap->name, retval); + vput(nd.ni_vp); + return (error); +} + +/* + * Return target name of a symbolic link. + */ +struct readlink_args { + char *path; + char *buf; + int count; +}; +/* ARGSUSED */ +readlink(p, uap, retval) + struct proc *p; + register struct readlink_args *uap; + int *retval; +{ + register struct vnode *vp; + struct iovec aiov; + struct uio auio; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp->v_type != VLNK) + error = EINVAL; + else { + aiov.iov_base = uap->buf; + aiov.iov_len = uap->count; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + auio.uio_resid = uap->count; + error = VOP_READLINK(vp, &auio, p->p_ucred); + } + vput(vp); + *retval = uap->count - auio.uio_resid; + return (error); +} + +/* + * Change flags of a file given a path name. + */ +struct chflags_args { + char *path; + int flags; +}; +/* ARGSUSED */ +chflags(p, uap, retval) + struct proc *p; + register struct chflags_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_flags = uap->flags; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + vput(vp); + return (error); +} + +/* + * Change flags of a file given a file descriptor. + */ +struct fchflags_args { + int fd; + int flags; +}; +/* ARGSUSED */ +fchflags(p, uap, retval) + struct proc *p; + register struct fchflags_args *uap; + int *retval; +{ + struct vattr vattr; + struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + vp = (struct vnode *)fp->f_data; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_flags = uap->flags; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + VOP_UNLOCK(vp); + return (error); +} + +/* + * Change mode of a file given path name. + */ +struct chmod_args { + char *path; + int mode; +}; +/* ARGSUSED */ +chmod(p, uap, retval) + struct proc *p; + register struct chmod_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_mode = uap->mode & ALLPERMS; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + vput(vp); + return (error); +} + +/* + * Change mode of a file given a file descriptor. + */ +struct fchmod_args { + int fd; + int mode; +}; +/* ARGSUSED */ +fchmod(p, uap, retval) + struct proc *p; + register struct fchmod_args *uap; + int *retval; +{ + struct vattr vattr; + struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + vp = (struct vnode *)fp->f_data; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_mode = uap->mode & ALLPERMS; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + VOP_UNLOCK(vp); + return (error); +} + +/* + * Set ownership given a path name. + */ +struct chown_args { + char *path; + int uid; + int gid; +}; +/* ARGSUSED */ +chown(p, uap, retval) + struct proc *p; + register struct chown_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_uid = uap->uid; + vattr.va_gid = uap->gid; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + vput(vp); + return (error); +} + +/* + * Set ownership given a file descriptor. + */ +struct fchown_args { + int fd; + int uid; + int gid; +}; +/* ARGSUSED */ +fchown(p, uap, retval) + struct proc *p; + register struct fchown_args *uap; + int *retval; +{ + struct vattr vattr; + struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + vp = (struct vnode *)fp->f_data; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + VATTR_NULL(&vattr); + vattr.va_uid = uap->uid; + vattr.va_gid = uap->gid; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + VOP_UNLOCK(vp); + return (error); +} + +/* + * Set the access and modification times of a file. + */ +struct utimes_args { + char *path; + struct timeval *tptr; +}; +/* ARGSUSED */ +utimes(p, uap, retval) + struct proc *p; + register struct utimes_args *uap; + int *retval; +{ + register struct vnode *vp; + struct timeval tv[2]; + struct vattr vattr; + int error; + struct nameidata nd; + + VATTR_NULL(&vattr); + if (uap->tptr == NULL) { + microtime(&tv[0]); + tv[1] = tv[0]; + vattr.va_vaflags |= VA_UTIMES_NULL; + } else if (error = copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof (tv))) + return (error); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_mount->mnt_flag & MNT_RDONLY) + error = EROFS; + else { + vattr.va_atime.ts_sec = tv[0].tv_sec; + vattr.va_atime.ts_nsec = tv[0].tv_usec * 1000; + vattr.va_mtime.ts_sec = tv[1].tv_sec; + vattr.va_mtime.ts_nsec = tv[1].tv_usec * 1000; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + vput(vp); + return (error); +} + +/* + * Truncate a file given its path name. + */ +struct truncate_args { + char *path; + int pad; + off_t length; +}; +/* ARGSUSED */ +truncate(p, uap, retval) + struct proc *p; + register struct truncate_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_type == VDIR) + error = EISDIR; + else if ((error = vn_writechk(vp)) == 0 && + (error = VOP_ACCESS(vp, VWRITE, p->p_ucred, p)) == 0) { + VATTR_NULL(&vattr); + vattr.va_size = uap->length; + error = VOP_SETATTR(vp, &vattr, p->p_ucred, p); + } + vput(vp); + return (error); +} + +/* + * Truncate a file given a file descriptor. + */ +struct ftruncate_args { + int fd; + int pad; + off_t length; +}; +/* ARGSUSED */ +ftruncate(p, uap, retval) + struct proc *p; + register struct ftruncate_args *uap; + int *retval; +{ + struct vattr vattr; + struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + if ((fp->f_flag & FWRITE) == 0) + return (EINVAL); + vp = (struct vnode *)fp->f_data; + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + VOP_LOCK(vp); + if (vp->v_type == VDIR) + error = EISDIR; + else if ((error = vn_writechk(vp)) == 0) { + VATTR_NULL(&vattr); + vattr.va_size = uap->length; + error = VOP_SETATTR(vp, &vattr, fp->f_cred, p); + } + VOP_UNLOCK(vp); + return (error); +} + +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +/* + * Truncate a file given its path name. + */ +struct otruncate_args { + char *path; + long length; +}; +/* ARGSUSED */ +otruncate(p, uap, retval) + struct proc *p; + register struct otruncate_args *uap; + int *retval; +{ + struct truncate_args nuap; + + nuap.path = uap->path; + nuap.length = uap->length; + return (truncate(p, &nuap, retval)); +} + +/* + * Truncate a file given a file descriptor. + */ +struct oftruncate_args { + int fd; + long length; +}; +/* ARGSUSED */ +oftruncate(p, uap, retval) + struct proc *p; + register struct oftruncate_args *uap; + int *retval; +{ + struct ftruncate_args nuap; + + nuap.fd = uap->fd; + nuap.length = uap->length; + return (ftruncate(p, &nuap, retval)); +} +#endif /* COMPAT_43 || COMPAT_SUNOS */ + +/* + * Sync an open file. + */ +struct fsync_args { + int fd; +}; +/* ARGSUSED */ +fsync(p, uap, retval) + struct proc *p; + struct fsync_args *uap; + int *retval; +{ + register struct vnode *vp; + struct file *fp; + int error; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + vp = (struct vnode *)fp->f_data; + VOP_LOCK(vp); + error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p); + VOP_UNLOCK(vp); + return (error); +} + +/* + * Rename files. Source and destination must either both be directories, + * or both not be directories. If target is a directory, it must be empty. + */ +struct rename_args { + char *from; + char *to; +}; +/* ARGSUSED */ +rename(p, uap, retval) + struct proc *p; + register struct rename_args *uap; + int *retval; +{ + register struct vnode *tvp, *fvp, *tdvp; + struct nameidata fromnd, tond; + int error; + + NDINIT(&fromnd, DELETE, WANTPARENT | SAVESTART, UIO_USERSPACE, + uap->from, p); + if (error = namei(&fromnd)) + return (error); + fvp = fromnd.ni_vp; + NDINIT(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART, + UIO_USERSPACE, uap->to, p); + if (error = namei(&tond)) { + VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd); + vrele(fromnd.ni_dvp); + vrele(fvp); + goto out1; + } + tdvp = tond.ni_dvp; + tvp = tond.ni_vp; + if (tvp != NULL) { + if (fvp->v_type == VDIR && tvp->v_type != VDIR) { + error = ENOTDIR; + goto out; + } else if (fvp->v_type != VDIR && tvp->v_type == VDIR) { + error = EISDIR; + goto out; + } + } + if (fvp == tdvp) + error = EINVAL; + /* + * If source is the same as the destination (that is the + * same inode number with the same name in the same directory), + * then there is nothing to do. + */ + if (fvp == tvp && fromnd.ni_dvp == tdvp && + fromnd.ni_cnd.cn_namelen == tond.ni_cnd.cn_namelen && + !bcmp(fromnd.ni_cnd.cn_nameptr, tond.ni_cnd.cn_nameptr, + fromnd.ni_cnd.cn_namelen)) + error = -1; +out: + if (!error) { + LEASE_CHECK(tdvp, p, p->p_ucred, LEASE_WRITE); + if (fromnd.ni_dvp != tdvp) + LEASE_CHECK(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + if (tvp) + LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE); + error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd, + tond.ni_dvp, tond.ni_vp, &tond.ni_cnd); + } else { + VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd); + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + if (tvp) + vput(tvp); + VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd); + vrele(fromnd.ni_dvp); + vrele(fvp); + } + vrele(tond.ni_startdir); + FREE(tond.ni_cnd.cn_pnbuf, M_NAMEI); +out1: + if (fromnd.ni_startdir) + vrele(fromnd.ni_startdir); + FREE(fromnd.ni_cnd.cn_pnbuf, M_NAMEI); + if (error == -1) + return (0); + return (error); +} + +/* + * Make a directory file. + */ +struct mkdir_args { + char *path; + int mode; +}; +/* ARGSUSED */ +mkdir(p, uap, retval) + struct proc *p; + register struct mkdir_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp != NULL) { + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vrele(vp); + return (EEXIST); + } + VATTR_NULL(&vattr); + vattr.va_type = VDIR; + vattr.va_mode = (uap->mode & ACCESSPERMS) &~ p->p_fd->fd_cmask; + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); + if (!error) + vput(nd.ni_vp); + return (error); +} + +/* + * Remove a directory file. + */ +struct rmdir_args { + char *path; +}; +/* ARGSUSED */ +rmdir(p, uap, retval) + struct proc *p; + struct rmdir_args *uap; + int *retval; +{ + register struct vnode *vp; + int error; + struct nameidata nd; + + NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp->v_type != VDIR) { + error = ENOTDIR; + goto out; + } + /* + * No rmdir "." please. + */ + if (nd.ni_dvp == vp) { + error = EINVAL; + goto out; + } + /* + * The root of a mounted filesystem cannot be deleted. + */ + if (vp->v_flag & VROOT) + error = EBUSY; +out: + if (!error) { + LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); + LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); + error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); + } else { + VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + if (nd.ni_dvp == vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vput(vp); + } + return (error); +} + +#if defined(COMPAT_43) || defined(COMPAT_HPUX) +/* + * Read a block of directory entries in a file system independent format. + */ +struct ogetdirentries_args { + int fd; + char *buf; + u_int count; + long *basep; +}; +ogetdirentries(p, uap, retval) + struct proc *p; + register struct ogetdirentries_args *uap; + int *retval; +{ + register struct vnode *vp; + struct file *fp; + struct uio auio, kuio; + struct iovec aiov, kiov; + struct dirent *dp, *edp; + caddr_t dirbuf; + int error, eofflag, readcnt; + long loff; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + if ((fp->f_flag & FREAD) == 0) + return (EBADF); + vp = (struct vnode *)fp->f_data; +unionread: + if (vp->v_type != VDIR) + return (EINVAL); + aiov.iov_base = uap->buf; + aiov.iov_len = uap->count; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + auio.uio_resid = uap->count; + VOP_LOCK(vp); + loff = auio.uio_offset = fp->f_offset; +# if (BYTE_ORDER != LITTLE_ENDIAN) + if (vp->v_mount->mnt_maxsymlinklen <= 0) { + error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, + (u_long *)0, 0); + fp->f_offset = auio.uio_offset; + } else +# endif + { + kuio = auio; + kuio.uio_iov = &kiov; + kuio.uio_segflg = UIO_SYSSPACE; + kiov.iov_len = uap->count; + MALLOC(dirbuf, caddr_t, uap->count, M_TEMP, M_WAITOK); + kiov.iov_base = dirbuf; + error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag, + (u_long *)0, 0); + fp->f_offset = kuio.uio_offset; + if (error == 0) { + readcnt = uap->count - kuio.uio_resid; + edp = (struct dirent *)&dirbuf[readcnt]; + for (dp = (struct dirent *)dirbuf; dp < edp; ) { +# if (BYTE_ORDER == LITTLE_ENDIAN) + /* + * The expected low byte of + * dp->d_namlen is our dp->d_type. + * The high MBZ byte of dp->d_namlen + * is our dp->d_namlen. + */ + dp->d_type = dp->d_namlen; + dp->d_namlen = 0; +# else + /* + * The dp->d_type is the high byte + * of the expected dp->d_namlen, + * so must be zero'ed. + */ + dp->d_type = 0; +# endif + if (dp->d_reclen > 0) { + dp = (struct dirent *) + ((char *)dp + dp->d_reclen); + } else { + error = EIO; + break; + } + } + if (dp >= edp) + error = uiomove(dirbuf, readcnt, &auio); + } + FREE(dirbuf, M_TEMP); + } + VOP_UNLOCK(vp); + if (error) + return (error); + +#ifdef UNION +{ + extern int (**union_vnodeop_p)(); + extern struct vnode *union_lowervp __P((struct vnode *)); + + if ((uap->count == auio.uio_resid) && + (vp->v_op == union_vnodeop_p)) { + struct vnode *lvp; + + lvp = union_lowervp(vp); + if (lvp != NULLVP) { + VOP_LOCK(lvp); + error = VOP_OPEN(lvp, FREAD, fp->f_cred, p); + VOP_UNLOCK(lvp); + + if (error) { + vrele(lvp); + return (error); + } + fp->f_data = (caddr_t) lvp; + fp->f_offset = 0; + error = vn_close(vp, FREAD, fp->f_cred, p); + if (error) + return (error); + vp = lvp; + goto unionread; + } + } +} +#endif /* UNION */ + + if ((uap->count == auio.uio_resid) && + (vp->v_flag & VROOT) && + (vp->v_mount->mnt_flag & MNT_UNION)) { + struct vnode *tvp = vp; + vp = vp->v_mount->mnt_vnodecovered; + VREF(vp); + fp->f_data = (caddr_t) vp; + fp->f_offset = 0; + vrele(tvp); + goto unionread; + } + error = copyout((caddr_t)&loff, (caddr_t)uap->basep, sizeof(long)); + *retval = uap->count - auio.uio_resid; + return (error); +} +#endif /* COMPAT_43 */ + +/* + * Read a block of directory entries in a file system independent format. + */ +struct getdirentries_args { + int fd; + char *buf; + u_int count; + long *basep; +}; +getdirentries(p, uap, retval) + struct proc *p; + register struct getdirentries_args *uap; + int *retval; +{ + register struct vnode *vp; + struct file *fp; + struct uio auio; + struct iovec aiov; + long loff; + int error, eofflag; + + if (error = getvnode(p->p_fd, uap->fd, &fp)) + return (error); + if ((fp->f_flag & FREAD) == 0) + return (EBADF); + vp = (struct vnode *)fp->f_data; +unionread: + if (vp->v_type != VDIR) + return (EINVAL); + aiov.iov_base = uap->buf; + aiov.iov_len = uap->count; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_procp = p; + auio.uio_resid = uap->count; + VOP_LOCK(vp); + loff = auio.uio_offset = fp->f_offset; + error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, (u_long *)0, 0); + fp->f_offset = auio.uio_offset; + VOP_UNLOCK(vp); + if (error) + return (error); + +#ifdef UNION +{ + extern int (**union_vnodeop_p)(); + extern struct vnode *union_lowervp __P((struct vnode *)); + + if ((uap->count == auio.uio_resid) && + (vp->v_op == union_vnodeop_p)) { + struct vnode *lvp; + + lvp = union_lowervp(vp); + if (lvp != NULLVP) { + VOP_LOCK(lvp); + error = VOP_OPEN(lvp, FREAD, fp->f_cred, p); + VOP_UNLOCK(lvp); + + if (error) { + vrele(lvp); + return (error); + } + fp->f_data = (caddr_t) lvp; + fp->f_offset = 0; + error = vn_close(vp, FREAD, fp->f_cred, p); + if (error) + return (error); + vp = lvp; + goto unionread; + } + } +} +#endif /* UNION */ + + if ((uap->count == auio.uio_resid) && + (vp->v_flag & VROOT) && + (vp->v_mount->mnt_flag & MNT_UNION)) { + struct vnode *tvp = vp; + vp = vp->v_mount->mnt_vnodecovered; + VREF(vp); + fp->f_data = (caddr_t) vp; + fp->f_offset = 0; + vrele(tvp); + goto unionread; + } + error = copyout((caddr_t)&loff, (caddr_t)uap->basep, sizeof(long)); + *retval = uap->count - auio.uio_resid; + return (error); +} + +/* + * Set the mode mask for creation of filesystem nodes. + */ +struct umask_args { + int newmask; +}; +mode_t /* XXX */ +umask(p, uap, retval) + struct proc *p; + struct umask_args *uap; + int *retval; +{ + register struct filedesc *fdp; + + fdp = p->p_fd; + *retval = fdp->fd_cmask; + fdp->fd_cmask = uap->newmask & ALLPERMS; + return (0); +} + +/* + * Void all references to file by ripping underlying filesystem + * away from vnode. + */ +struct revoke_args { + char *path; +}; +/* ARGSUSED */ +revoke(p, uap, retval) + struct proc *p; + register struct revoke_args *uap; + int *retval; +{ + register struct vnode *vp; + struct vattr vattr; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, p); + if (error = namei(&nd)) + return (error); + vp = nd.ni_vp; + if (vp->v_type != VCHR && vp->v_type != VBLK) { + error = EINVAL; + goto out; + } + if (error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) + goto out; + if (p->p_ucred->cr_uid != vattr.va_uid && + (error = suser(p->p_ucred, &p->p_acflag))) + goto out; + if (vp->v_usecount > 1 || (vp->v_flag & VALIASED)) + vgoneall(vp); +out: + vrele(vp); + return (error); +} + +/* + * Convert a user file descriptor to a kernel file entry. + */ +getvnode(fdp, fd, fpp) + struct filedesc *fdp; + struct file **fpp; + int fd; +{ + struct file *fp; + + if ((u_int)fd >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[fd]) == NULL) + return (EBADF); + if (fp->f_type != DTYPE_VNODE) + return (EINVAL); + *fpp = fp; + return (0); +} diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index d489d01dfaa..6a0450d6ed6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: vfs_vnops.c,v 1.12 1994/06/29 06:34:04 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id: vfs_vnops.c,v 1.11 1994/06/08 11:29:00 mycroft Exp $ + * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh index ba3360db722..456f68fce3a 100644 --- a/sys/kern/vnode_if.sh +++ b/sys/kern/vnode_if.sh @@ -33,7 +33,7 @@ copyright=' * SUCH DAMAGE. */ ' -SCRIPT_ID='$Id: vnode_if.sh,v 1.3 1994/06/15 18:13:31 gwr Exp $' +SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.4 1994/06/29 06:34:06 cgd Exp $' # Script to produce VFS front-end sugar. # diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index f3e18a3e9ef..2091fb9b1a6 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -1,3 +1,4 @@ +# $NetBSD: vnode_if.src,v 1.2 1994/06/29 06:34:07 cgd Exp $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. @@ -30,8 +31,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# from: @(#)vnode_if.src 8.3 (Berkeley) 2/3/94 -# $Id: vnode_if.src,v 1.1 1994/06/08 11:29:02 mycroft Exp $ +# @(#)vnode_if.src 8.3 (Berkeley) 2/3/94 # vop_lookup { IN struct vnode *dvp; diff --git a/sys/lib/libsa/if_ether.h b/sys/lib/libsa/if_ether.h index 3a794ed136e..b5bd28ea640 100644 --- a/sys/lib/libsa/if_ether.h +++ b/sys/lib/libsa/if_ether.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_ether.h,v 1.10 1994/06/29 06:37:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.h 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.h,v 1.9 1994/05/13 06:05:57 mycroft Exp $ + * @(#)if_ether.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index b294597f82d..d3ae588bfb4 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: dead_vnops.c,v 1.9 1994/06/29 06:34:12 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.8 1994/06/08 11:33:09 mycroft Exp $ + * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/miscfs/fdesc/fdesc.h b/sys/miscfs/fdesc/fdesc.h index 63ed3ce3906..880ab456076 100644 --- a/sys/miscfs/fdesc/fdesc.h +++ b/sys/miscfs/fdesc/fdesc.h @@ -1,3 +1,5 @@ +/* $NetBSD: fdesc.h,v 1.5 1994/06/29 06:34:14 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: fdesc.h,v 1.8 1993/04/06 15:28:33 jsp Exp - * from: @(#)fdesc.h 8.5 (Berkeley) 1/21/94 - * $Id: fdesc.h,v 1.4 1994/06/08 11:33:12 mycroft Exp $ + * @(#)fdesc.h 8.5 (Berkeley) 1/21/94 */ #ifdef KERNEL diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c index 03375a87be0..8fb07081960 100644 --- a/sys/miscfs/fdesc/fdesc_vfsops.c +++ b/sys/miscfs/fdesc/fdesc_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: fdesc_vfsops.c,v 1.13 1994/06/29 06:34:16 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: fdesc_vfsops.c,v 1.9 1993/04/06 15:28:33 jsp Exp - * from: @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 - * $Id: fdesc_vfsops.c,v 1.12 1994/06/08 11:33:13 mycroft Exp $ + * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 584b0ce443e..6914f136aad 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: fdesc_vnops.c,v 1.15 1994/06/29 06:34:18 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: fdesc_vnops.c,v 1.12 1993/04/06 16:17:17 jsp Exp - * from: @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 - * $Id: fdesc_vnops.c,v 1.14 1994/06/08 11:33:15 mycroft Exp $ + * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h index 800e1d512e3..96abbf3857c 100644 --- a/sys/miscfs/fifofs/fifo.h +++ b/sys/miscfs/fifofs/fifo.h @@ -1,3 +1,5 @@ +/* $NetBSD: fifo.h,v 1.8 1994/06/29 06:34:22 cgd Exp $ */ + /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)fifo.h 8.2 (Berkeley) 2/2/94 - * $Id: fifo.h,v 1.7 1994/06/08 11:33:16 mycroft Exp $ + * @(#)fifo.h 8.2 (Berkeley) 2/2/94 */ #ifdef FIFO diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index cec72fb9e36..93bf9886403 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: fifo_vnops.c,v 1.9 1994/06/29 06:34:24 cgd Exp $ */ + /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 - * $Id: fifo_vnops.c,v 1.8 1994/06/08 11:33:17 mycroft Exp $ + * @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/miscfs/kernfs/kernfs.h b/sys/miscfs/kernfs/kernfs.h index edd7dc006b4..59db758d75a 100644 --- a/sys/miscfs/kernfs/kernfs.h +++ b/sys/miscfs/kernfs/kernfs.h @@ -1,3 +1,5 @@ +/* $NetBSD: kernfs.h,v 1.8 1994/06/29 06:34:26 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kernfs.h 8.5 (Berkeley) 6/15/94 - * $Id: kernfs.h,v 1.7 1994/06/15 22:54:38 mycroft Exp $ + * @(#)kernfs.h 8.5 (Berkeley) 6/15/94 */ #define _PATH_KERNFS "/kern" /* Default mountpoint */ diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 69e814be380..42e90bbbfbb 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: kernfs_vfsops.c,v 1.18 1994/06/29 06:34:27 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kernfs_vfsops.c 8.5 (Berkeley) 6/15/94 - * $Id: kernfs_vfsops.c,v 1.17 1994/06/15 22:54:40 mycroft Exp $ + * @(#)kernfs_vfsops.c 8.5 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 41b926fa6e0..baaad906628 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: kernfs_vnops.c,v 1.27 1994/06/29 06:34:29 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)kernfs_vnops.c 8.9 (Berkeley) 6/15/94 - * $Id: kernfs_vnops.c,v 1.26 1994/06/15 22:54:43 mycroft Exp $ + * @(#)kernfs_vnops.c 8.9 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/nullfs/null.h b/sys/miscfs/nullfs/null.h index 917aa89f3e9..d8f5156a0e9 100644 --- a/sys/miscfs/nullfs/null.h +++ b/sys/miscfs/nullfs/null.h @@ -1,3 +1,5 @@ +/* $NetBSD: null.h,v 1.2 1994/06/29 06:34:31 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp - * from: @(#)null.h 8.2 (Berkeley) 1/21/94 - * $Id: null.h,v 1.1 1994/06/08 11:33:23 mycroft Exp $ + * @(#)null.h 8.2 (Berkeley) 1/21/94 */ struct null_args { diff --git a/sys/miscfs/nullfs/null_subr.c b/sys/miscfs/nullfs/null_subr.c index 959e7232ac8..231f62fc6a3 100644 --- a/sys/miscfs/nullfs/null_subr.c +++ b/sys/miscfs/nullfs/null_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: null_subr.c,v 1.2 1994/06/29 06:34:32 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp - * from: @(#)null_subr.c 8.4 (Berkeley) 1/21/94 - * $Id: null_subr.c,v 1.1 1994/06/08 11:33:24 mycroft Exp $ + * @(#)null_subr.c 8.4 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index c0772145285..641bfb133c4 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: null_vfsops.c,v 1.2 1994/06/29 06:34:33 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * * from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp * from: @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * from: @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 - * $Id: null_vfsops.c,v 1.1 1994/06/08 11:33:25 mycroft Exp $ + * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 6b778279093..00e1face5fa 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: null_vnops.c,v 1.2 1994/06/29 06:34:35 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)null_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: null_vnops.c,v 1.1 1994/06/08 11:33:26 mycroft Exp $ + * @(#)null_vnops.c 8.1 (Berkeley) 6/10/93 * * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 diff --git a/sys/miscfs/portal/portal.h b/sys/miscfs/portal/portal.h index 381b54de487..3ba213261fb 100644 --- a/sys/miscfs/portal/portal.h +++ b/sys/miscfs/portal/portal.h @@ -1,3 +1,5 @@ +/* $NetBSD: portal.h,v 1.4 1994/06/29 06:34:37 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: portal.h,v 1.3 1992/05/30 10:05:24 jsp Exp - * from: @(#)portal.h 8.4 (Berkeley) 1/21/94 - * $Id: portal.h,v 1.3 1994/06/08 11:33:28 mycroft Exp $ + * @(#)portal.h 8.4 (Berkeley) 1/21/94 */ struct portal_args { diff --git a/sys/miscfs/portal/portal_vfsops.c b/sys/miscfs/portal/portal_vfsops.c index e1faaa812b9..04c6b47b674 100644 --- a/sys/miscfs/portal/portal_vfsops.c +++ b/sys/miscfs/portal/portal_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: portal_vfsops.c,v 1.6 1994/06/29 06:34:39 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: portal_vfsops.c,v 1.5 1992/05/30 10:25:27 jsp Exp - * from: @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94 - * $Id: portal_vfsops.c,v 1.5 1994/06/08 11:33:29 mycroft Exp $ + * @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c index a94c5e5ef8c..1432a44ef30 100644 --- a/sys/miscfs/portal/portal_vnops.c +++ b/sys/miscfs/portal/portal_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: portal_vnops.c,v 1.6 1994/06/29 06:34:40 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: portal_vnops.c,v 1.4 1992/05/30 10:05:24 jsp Exp - * from: @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94 - * $Id: portal_vnops.c,v 1.5 1994/06/08 11:33:30 mycroft Exp $ + * @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/procfs/README b/sys/miscfs/procfs/README index 4132ad47a21..2b76d14534e 100644 --- a/sys/miscfs/procfs/README +++ b/sys/miscfs/procfs/README @@ -1,3 +1,5 @@ +/* $NetBSD: README,v 1.4 1994/06/29 06:34:43 cgd Exp $ */ + saute procfs lyonnais procfs supports two levels of directory. the filesystem root @@ -109,5 +111,3 @@ the debugger, the debugger should fork and the child should stop itself (with a self-inflicted SIGSTOP). the parent should do a "wait" then an "attach". as before, the child will hit a breakpoint on the first instruction in any newly exec'd image. - -$Id: README,v 1.3 1994/06/08 11:33:32 mycroft Exp $ diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index f674c5de2a6..cff8bc68a59 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,3 +1,5 @@ +/* $NetBSD: procfs.h,v 1.11 1994/06/29 06:34:44 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs.h 8.7 (Berkeley) 6/15/94 - * $Id: procfs.h,v 1.10 1994/06/15 22:59:02 mycroft Exp $ + * @(#)procfs.h 8.7 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/procfs/procfs_ctl.c b/sys/miscfs/procfs/procfs_ctl.c index 1f20f37241a..3564e234d1f 100644 --- a/sys/miscfs/procfs/procfs_ctl.c +++ b/sys/miscfs/procfs/procfs_ctl.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_ctl.c,v 1.12 1994/06/29 06:34:46 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94 - * $Id: procfs_ctl.c,v 1.11 1994/06/15 22:59:04 mycroft Exp $ + * @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_fpregs.c b/sys/miscfs/procfs/procfs_fpregs.c index 14e57744502..2acff34070a 100644 --- a/sys/miscfs/procfs/procfs_fpregs.c +++ b/sys/miscfs/procfs/procfs_fpregs.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_fpregs.c,v 1.3 1994/06/29 06:34:48 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_fpregs.c 8.2 (Berkeley) 6/15/94 - * $Id: procfs_fpregs.c,v 1.2 1994/06/15 22:59:05 mycroft Exp $ + * @(#)procfs_fpregs.c 8.2 (Berkeley) 6/15/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index cc7e47e061b..10d85060992 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_mem.c,v 1.6 1994/06/29 06:34:50 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 Sean Eric Fagan @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 - * $Id: procfs_mem.c,v 1.5 1994/06/15 22:59:06 mycroft Exp $ + * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/procfs/procfs_note.c b/sys/miscfs/procfs/procfs_note.c index a2f0fa68588..a57dda9ae56 100644 --- a/sys/miscfs/procfs/procfs_note.c +++ b/sys/miscfs/procfs/procfs_note.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_note.c,v 1.8 1994/06/29 06:34:53 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_note.c 8.2 (Berkeley) 1/21/94 - * $Id: procfs_note.c,v 1.7 1994/06/15 22:59:08 mycroft Exp $ + * @(#)procfs_note.c 8.2 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_regs.c b/sys/miscfs/procfs/procfs_regs.c index 3118667730c..e78e6c3a2e9 100644 --- a/sys/miscfs/procfs/procfs_regs.c +++ b/sys/miscfs/procfs/procfs_regs.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_regs.c,v 1.8 1994/06/29 06:34:54 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 - * $Id: procfs_regs.c,v 1.7 1994/06/15 22:59:09 mycroft Exp $ + * @(#)procfs_regs.c 8.4 (Berkeley) 6/15/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index 1a80fece978..84af85104e2 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_status.c,v 1.9 1994/06/29 06:34:56 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 - * $Id: procfs_status.c,v 1.8 1994/06/15 22:59:10 mycroft Exp $ + * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index ccf160e17b4..1390a71c5ee 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_subr.c,v 1.13 1994/06/29 06:34:57 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_subr.c 8.5 (Berkeley) 6/15/94 - * $Id: procfs_subr.c,v 1.12 1994/06/15 22:59:12 mycroft Exp $ + * @(#)procfs_subr.c 8.5 (Berkeley) 6/15/94 */ #include <sys/param.h> diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 46b72e59e19..a7588fd3b4a 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_vfsops.c,v 1.18 1994/06/29 06:34:58 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_vfsops.c 8.5 (Berkeley) 6/15/94 - * $Id: procfs_vfsops.c,v 1.17 1994/06/15 22:59:14 mycroft Exp $ + * @(#)procfs_vfsops.c 8.5 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index ccd4e806683..2facc1c9342 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: procfs_vnops.c,v 1.24 1994/06/29 06:35:00 cgd Exp $ */ + /* * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)procfs_vnops.c 8.8 (Berkeley) 6/15/94 - * $Id: procfs_vnops.c,v 1.23 1994/06/16 06:01:19 mycroft Exp $ + * @(#)procfs_vnops.c 8.8 (Berkeley) 6/15/94 */ /* diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index a21152e77c1..390dec239e2 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: spec_vnops.c,v 1.16 1994/06/29 06:35:03 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.15 1994/06/08 11:33:47 mycroft Exp $ + * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 */ #include <sys/param.h> diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index 7aec35cf3ff..fa28979ced4 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -1,3 +1,5 @@ +/* $NetBSD: specdev.h,v 1.8 1994/06/29 06:35:06 cgd Exp $ */ + /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)specdev.h 8.2 (Berkeley) 2/2/94 - * $Id: specdev.h,v 1.7 1994/06/08 11:33:48 mycroft Exp $ + * @(#)specdev.h 8.2 (Berkeley) 2/2/94 */ /* diff --git a/sys/miscfs/umapfs/umap.h b/sys/miscfs/umapfs/umap.h index 366152de135..a5beb13fbbb 100644 --- a/sys/miscfs/umapfs/umap.h +++ b/sys/miscfs/umapfs/umap.h @@ -1,3 +1,5 @@ +/* $NetBSD: umap.h,v 1.2 1994/06/29 06:35:09 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: @(#)null_vnops.c 1.5 (Berkeley) 7/10/92 - * from: @(#)umap.h 8.3 (Berkeley) 1/21/94 - * $Id: umap.h,v 1.1 1994/06/08 11:33:50 mycroft Exp $ + * @(#)umap.h 8.3 (Berkeley) 1/21/94 */ #define MAPFILEENTRIES 64 diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c index 451b4db46b8..f6042fe2f7b 100644 --- a/sys/miscfs/umapfs/umap_subr.c +++ b/sys/miscfs/umapfs/umap_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: umap_subr.c,v 1.2 1994/06/29 06:35:11 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: Id: lofs_subr.c, v 1.11 1992/05/30 10:05:43 jsp Exp - * from: @(#)umap_subr.c 8.6 (Berkeley) 1/26/94 - * $Id: umap_subr.c,v 1.1 1994/06/08 11:33:51 mycroft Exp $ + * @(#)umap_subr.c 8.6 (Berkeley) 1/26/94 */ #include <sys/param.h> diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index 1fbfb1c7e60..25c444a2193 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: umap_vfsops.c,v 1.2 1994/06/29 06:35:13 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +36,7 @@ * SUCH DAMAGE. * * from: @(#)null_vfsops.c 1.5 (Berkeley) 7/10/92 - * from: @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94 - * $Id: umap_vfsops.c,v 1.1 1994/06/08 11:33:53 mycroft Exp $ + * @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94 */ /* diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c index 34d33f27874..b96b15fdd06 100644 --- a/sys/miscfs/umapfs/umap_vnops.c +++ b/sys/miscfs/umapfs/umap_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: umap_vnops.c,v 1.2 1994/06/29 06:35:14 cgd Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,8 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94 - * $Id: umap_vnops.c,v 1.1 1994/06/08 11:33:54 mycroft Exp $ + * @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94 */ /* diff --git a/sys/miscfs/union/README b/sys/miscfs/union/README index 6729e89f0ba..be55a4f2460 100644 --- a/sys/miscfs/union/README +++ b/sys/miscfs/union/README @@ -1,8 +1,9 @@ +/* $NetBSD: README,v 1.3 1994/06/29 06:35:16 cgd Exp $ */ + If you plan on using union mounts, then you should consider replacing "libc/gen/opendir.c" in the C library with the file "libc.opendir.c" in this directory. The replacement version of opendir() automatically removes duplicate names when a union stack is encountered. You will then need to rebuild the C library and all commands. -from: @(#)README 8.1 (Berkeley) 2/15/94 -$Id: README,v 1.2 1994/06/15 23:07:54 mycroft Exp $ +@(#)README 8.1 (Berkeley) 2/15/94 diff --git a/sys/miscfs/union/libc.opendir.c b/sys/miscfs/union/libc.opendir.c index b691430424d..3ed3999df0d 100644 --- a/sys/miscfs/union/libc.opendir.c +++ b/sys/miscfs/union/libc.opendir.c @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char orig_sccsid[] = "from: @(#)opendir.c 8.2 (Berkeley) 2/12/94";*/ /*static char sccsid[] = "from: @(#)libc.opendir.c 8.2 (Berkeley) 6/15/94";*/ -static char *rcsid = "$Id: libc.opendir.c,v 1.2 1994/06/15 23:07:56 mycroft Exp $"; +static char *rcsid = "$NetBSD: libc.opendir.c,v 1.3 1994/06/29 06:35:18 cgd Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> diff --git a/sys/miscfs/union/union.h b/sys/miscfs/union/union.h index 2c8ab1f9721..681c480aed3 100644 --- a/sys/miscfs/union/union.h +++ b/sys/miscfs/union/union.h @@ -1,3 +1,5 @@ +/* $NetBSD: union.h,v 1.4 1994/06/29 06:35:19 cgd Exp $ */ + /* * Copyright (c) 1994 The Regents of the University of California. * Copyright (c) 1994 Jan-Simon Pendry. @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)union.h 8.5 (Berkeley) 5/17/94 - * $Id: union.h,v 1.3 1994/06/17 15:21:33 mycroft Exp $ + * @(#)union.h 8.5 (Berkeley) 5/17/94 */ struct union_args { diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index c104cfecf35..c8939acaa18 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: union_subr.c,v 1.4 1994/06/29 06:35:22 cgd Exp $ */ + /* * Copyright (c) 1994 Jan-Simon Pendry * Copyright (c) 1994 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)union_subr.c 8.9 (Berkeley) 5/17/94 - * $Id: union_subr.c,v 1.3 1994/06/17 15:21:35 mycroft Exp $ + * @(#)union_subr.c 8.9 (Berkeley) 5/17/94 */ #include <sys/param.h> diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index b6b319dd80a..37a262edbb1 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: union_vfsops.c,v 1.4 1994/06/29 06:35:24 cgd Exp $ */ + /* * Copyright (c) 1994 The Regents of the University of California. * Copyright (c) 1994 Jan-Simon Pendry. @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)union_vfsops.c 8.10 (Berkeley) 5/24/94 - * $Id: union_vfsops.c,v 1.3 1994/06/17 15:21:37 mycroft Exp $ + * @(#)union_vfsops.c 8.10 (Berkeley) 5/24/94 */ /* diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 171c4367a41..54466f91e52 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: union_vnops.c,v 1.4 1994/06/29 06:35:26 cgd Exp $ */ + /* * Copyright (c) 1992, 1993, 1994 The Regents of the University of California. * Copyright (c) 1992, 1993, 1994 Jan-Simon Pendry. @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)union_vnops.c 8.15 (Berkeley) 6/4/94 - * $Id: union_vnops.c,v 1.3 1994/06/17 15:21:39 mycroft Exp $ + * @(#)union_vnops.c 8.15 (Berkeley) 6/4/94 */ #include <sys/param.h> diff --git a/sys/msdosfs/bootsect.h b/sys/msdosfs/bootsect.h index f33c416402c..542a461e1e0 100644 --- a/sys/msdosfs/bootsect.h +++ b/sys/msdosfs/bootsect.h @@ -1,3 +1,5 @@ +/* $NetBSD: bootsect.h,v 1.4 1994/06/29 06:35:28 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: bootsect.h,v 1.3 1993/12/01 22:42:29 cgd Exp $ */ /* diff --git a/sys/msdosfs/bpb.h b/sys/msdosfs/bpb.h index 0f42472841c..7c66cdc45cd 100644 --- a/sys/msdosfs/bpb.h +++ b/sys/msdosfs/bpb.h @@ -1,3 +1,5 @@ +/* $NetBSD: bpb.h,v 1.3 1994/06/29 06:35:29 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: bpb.h,v 1.2 1994/03/03 00:51:30 paulus Exp $ */ /* diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h index 87d3b686099..d0f1c9fc03c 100644 --- a/sys/msdosfs/denode.h +++ b/sys/msdosfs/denode.h @@ -1,3 +1,5 @@ +/* $NetBSD: denode.h,v 1.4 1994/06/29 06:35:30 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: denode.h,v 1.3 1994/03/03 00:51:31 paulus Exp $ */ /* diff --git a/sys/msdosfs/direntry.h b/sys/msdosfs/direntry.h index 44fa4273dd3..b4722001581 100644 --- a/sys/msdosfs/direntry.h +++ b/sys/msdosfs/direntry.h @@ -1,3 +1,5 @@ +/* $NetBSD: direntry.h,v 1.4 1994/06/29 06:35:31 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: direntry.h,v 1.3 1994/04/25 03:50:04 cgd Exp $ */ /* diff --git a/sys/msdosfs/fat.h b/sys/msdosfs/fat.h index 23636cfd164..5dd26597814 100644 --- a/sys/msdosfs/fat.h +++ b/sys/msdosfs/fat.h @@ -1,3 +1,5 @@ +/* $NetBSD: fat.h,v 1.2 1994/06/29 06:35:33 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: fat.h,v 1.1 1993/08/13 11:35:33 cgd Exp $ */ /* diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c index 87375b05b50..73c80c76355 100644 --- a/sys/msdosfs/msdosfs_conv.c +++ b/sys/msdosfs/msdosfs_conv.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_conv.c,v 1.6 1994/06/29 06:35:35 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfs_conv.c,v 1.5 1994/04/25 03:50:05 cgd Exp $ */ /* diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index 393aa46629b..1047cbb6660 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_denode.c,v 1.5 1994/06/29 06:35:37 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfs_denode.c,v 1.4 1994/04/25 03:50:08 cgd Exp $ */ #include <sys/param.h> diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index eeae4a6e069..0132c194eba 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_fat.c,v 1.5 1994/06/29 06:35:38 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfs_fat.c,v 1.4 1994/04/21 07:48:58 cgd Exp $ */ /* diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c index 7502af2c1b7..cbeea418835 100644 --- a/sys/msdosfs/msdosfs_lookup.c +++ b/sys/msdosfs/msdosfs_lookup.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_lookup.c,v 1.10 1994/06/29 06:35:40 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfs_lookup.c,v 1.9 1994/04/25 03:50:10 cgd Exp $ */ #include <sys/param.h> diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index d3d5fd295f9..83cb019a3ec 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_vfsops.c,v 1.15 1994/06/29 06:35:42 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfs_vfsops.c,v 1.14 1994/04/25 03:50:12 cgd Exp $ */ #include <sys/param.h> diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index fb5d4fd8809..e543c49c06e 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfs_vnops.c,v 1.14 1994/06/29 06:35:44 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * msdosfs_vnops.c,v 1.1 1993/08/13 11:35:40 cgd Exp */ #include <sys/param.h> diff --git a/sys/msdosfs/msdosfsmount.h b/sys/msdosfs/msdosfsmount.h index 5898c36aafe..51030897314 100644 --- a/sys/msdosfs/msdosfsmount.h +++ b/sys/msdosfs/msdosfsmount.h @@ -1,3 +1,5 @@ +/* $NetBSD: msdosfsmount.h,v 1.4 1994/06/29 06:35:47 cgd Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -12,8 +14,6 @@ * any damages caused by this software. * * October 1992 - * - * $Id: msdosfsmount.h,v 1.3 1994/04/07 07:30:33 cgd Exp $ */ /* diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 796474feafb..92fcfd7f3ab 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,3 +1,5 @@ +/* $NetBSD: bpf.c,v 1.13 1994/06/29 06:35:52 cgd Exp $ */ + /* * Copyright (c) 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)bpf.c 8.2 (Berkeley) 3/28/94 - * $Id: bpf.c,v 1.12 1994/05/13 06:02:14 mycroft Exp $ + * @(#)bpf.c 8.2 (Berkeley) 3/28/94 */ #include "bpfilter.h" diff --git a/sys/net/bpf.h b/sys/net/bpf.h index f4494f34a4f..b3b358e5aa4 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -1,3 +1,5 @@ +/* $NetBSD: bpf.h,v 1.6 1994/06/29 06:35:54 cgd Exp $ */ + /* * Copyright (c) 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)bpf.h 8.1 (Berkeley) 6/10/93 - * $Id: bpf.h,v 1.5 1994/05/13 06:02:19 mycroft Exp $ + * @(#)bpf.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index 0fbb1aeaaa0..74f03b8e9e0 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -1,3 +1,5 @@ +/* $NetBSD: bpf_filter.c,v 1.6 1994/06/29 06:35:56 cgd Exp $ */ + /* * Copyright (c) 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 - * $Id: bpf_filter.c,v 1.5 1994/05/13 06:02:22 mycroft Exp $ + * @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h index 6f414589e23..0aef334b144 100644 --- a/sys/net/bpfdesc.h +++ b/sys/net/bpfdesc.h @@ -1,3 +1,5 @@ +/* $NetBSD: bpfdesc.h,v 1.9 1994/06/29 06:35:58 cgd Exp $ */ + /* * Copyright (c) 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93 - * $Id: bpfdesc.h,v 1.8 1994/05/13 06:02:24 mycroft Exp $ + * @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93 */ #include <sys/select.h> diff --git a/sys/net/if.c b/sys/net/if.c index e0b3ed515ef..d18a066cc2e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,3 +1,5 @@ +/* $NetBSD: if.c,v 1.16 1994/06/29 06:36:01 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.15 1994/05/13 06:02:26 mycroft Exp $ + * @(#)if.c 8.3 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/net/if.h b/sys/net/if.h index 27b862cf479..d9395785e2f 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,3 +1,5 @@ +/* $NetBSD: if.h,v 1.10 1994/06/29 06:36:04 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id: if.h,v 1.9 1994/05/13 06:02:29 mycroft Exp $ + * @(#)if.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h index c3217a13412..f3f61cde006 100644 --- a/sys/net/if_arp.h +++ b/sys/net/if_arp.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_arp.h,v 1.7 1994/06/29 06:36:07 cgd Exp $ */ + /* * Copyright (c) 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_arp.h 8.1 (Berkeley) 6/10/93 - * $Id: if_arp.h,v 1.6 1994/05/13 06:02:31 mycroft Exp $ + * @(#)if_arp.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h index 9ac9ec7ea61..7e998edb1bb 100644 --- a/sys/net/if_dl.h +++ b/sys/net/if_dl.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_dl.h,v 1.5 1994/06/29 06:36:10 cgd Exp $ */ + /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_dl.h 8.1 (Berkeley) 6/10/93 - * $Id: if_dl.h,v 1.4 1994/05/13 06:02:33 mycroft Exp $ + * @(#)if_dl.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 4424761360e..50e2add63af 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_ethersubr.c,v 1.9 1994/06/29 06:36:11 cgd Exp $ */ + /* * Copyright (c) 1982, 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/net/if_llc.h b/sys/net/if_llc.h index 6d705919ac2..3a6c2c2b49c 100644 --- a/sys/net/if_llc.h +++ b/sys/net/if_llc.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_llc.h,v 1.5 1994/06/29 06:36:13 cgd Exp $ */ + /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_llc.h 8.1 (Berkeley) 6/10/93 - * $Id: if_llc.h,v 1.4 1994/05/13 06:02:41 mycroft Exp $ + * @(#)if_llc.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index bc9f09bd11f..932c95ddd07 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_loop.c,v 1.12 1994/06/29 06:36:14 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 - * $Id: if_loop.c,v 1.11 1994/05/13 06:02:44 mycroft Exp $ + * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 209559856b0..dc1ab8f7aca 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_ppp.c,v 1.14 1994/06/29 06:36:16 cgd Exp $ */ + /* * if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver. * @@ -69,7 +71,6 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.13 1994/06/20 00:35:39 paulus Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "ppp.h" diff --git a/sys/net/if_ppp.h b/sys/net/if_ppp.h index 2bf47a8b9b7..7ca8f2ded66 100644 --- a/sys/net/if_ppp.h +++ b/sys/net/if_ppp.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_ppp.h,v 1.7 1994/06/29 06:36:19 cgd Exp $ */ + /* * if_ppp.h - Point-to-Point Protocol definitions. * @@ -15,8 +17,6 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id: if_ppp.h,v 1.6 1994/05/08 12:34:20 paulus Exp $ */ #ifndef _IF_PPP_H_ diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index dac08abb084..7246e64c2d4 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_sl.c,v 1.29 1994/06/29 06:36:22 cgd Exp $ */ + /* * Copyright (c) 1987, 1989, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $Id: if_sl.c,v 1.28 1994/05/13 06:02:53 mycroft Exp $ + * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 */ /* diff --git a/sys/net/if_slvar.h b/sys/net/if_slvar.h index 0ed11a24903..bf91485621b 100644 --- a/sys/net/if_slvar.h +++ b/sys/net/if_slvar.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_slvar.h,v 1.12 1994/06/29 06:36:24 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_slvar.h 8.3 (Berkeley) 2/1/94 - * $Id: if_slvar.h,v 1.11 1994/05/13 06:02:56 mycroft Exp $ + * @(#)if_slvar.h 8.3 (Berkeley) 2/1/94 */ /* diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 53b4f8a59dc..0312f6b71f6 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ + /* * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> * Nottingham University 1987. @@ -10,8 +12,6 @@ * roots in a similar driver written by Phil Cockcroft (formerly) at * UCL. This driver is based much more on read/write/select mode of * operation though. - * - * $Id: if_tun.c,v 1.13 1994/05/26 00:47:19 deraadt Exp $ */ #include "tun.h" diff --git a/sys/net/if_tun.h b/sys/net/if_tun.h index 52aa0243167..116c10d60b7 100644 --- a/sys/net/if_tun.h +++ b/sys/net/if_tun.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_tun.h,v 1.5 1994/06/29 06:36:27 cgd Exp $ */ + /* * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> * Nottingham University 1987. @@ -11,8 +13,7 @@ * UCL. This driver is based much more on read/write/select mode of * operation though. * - * from: $Header: if_tnreg.h,v 1.1.2.1 1992/07/16 22:39:16 friedl Exp - * $Id: if_tun.h,v 1.4 1994/05/03 23:02:09 deraadt Exp $ + * : $Header: if_tnreg.h,v 1.1.2.1 1992/07/16 22:39:16 friedl Exp */ #ifndef _NET_IF_TUN_H_ diff --git a/sys/net/if_types.h b/sys/net/if_types.h index 827feefd5c0..2bb00544229 100644 --- a/sys/net/if_types.h +++ b/sys/net/if_types.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_types.h,v 1.6 1994/06/29 06:36:29 cgd Exp $ */ + /* * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_types.h 8.2 (Berkeley) 4/20/94 - * $Id: if_types.h,v 1.5 1994/05/13 06:02:58 mycroft Exp $ + * @(#)if_types.h 8.2 (Berkeley) 4/20/94 */ /* diff --git a/sys/net/netisr.h b/sys/net/netisr.h index 466efd6454d..fccc2e09973 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -1,3 +1,5 @@ +/* $NetBSD: netisr.h,v 1.8 1994/06/29 06:36:31 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)netisr.h 8.1 (Berkeley) 6/10/93 - * $Id: netisr.h,v 1.7 1994/05/13 06:03:01 mycroft Exp $ + * @(#)netisr.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/radix.c b/sys/net/radix.c index 8281f6b2179..702b6a08a6d 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1,3 +1,5 @@ +/* $NetBSD: radix.c,v 1.7 1994/06/29 06:36:33 cgd Exp $ */ + /* * Copyright (c) 1988, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)radix.c 8.2 (Berkeley) 1/4/94 - * $Id: radix.c,v 1.6 1994/05/13 06:03:03 mycroft Exp $ + * @(#)radix.c 8.2 (Berkeley) 1/4/94 */ /* diff --git a/sys/net/radix.h b/sys/net/radix.h index 49fa818a4e1..fca4a5359a4 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -1,3 +1,5 @@ +/* $NetBSD: radix.h,v 1.5 1994/06/29 06:36:36 cgd Exp $ */ + /* * Copyright (c) 1988, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)radix.h 8.1 (Berkeley) 6/10/93 - * $Id: radix.h,v 1.4 1994/05/13 06:03:05 mycroft Exp $ + * @(#)radix.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NET_RADIX_H_ diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index 592771a7396..fbeddc4095b 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -1,3 +1,5 @@ +/* $NetBSD: raw_cb.c,v 1.7 1994/06/29 06:36:37 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_cb.c,v 1.6 1994/05/13 06:03:07 mycroft Exp $ + * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/net/raw_cb.h b/sys/net/raw_cb.h index 9e48c47fbc8..b494391456b 100644 --- a/sys/net/raw_cb.h +++ b/sys/net/raw_cb.h @@ -1,3 +1,5 @@ +/* $NetBSD: raw_cb.h,v 1.6 1994/06/29 06:36:39 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)raw_cb.h 8.1 (Berkeley) 6/10/93 - * $Id: raw_cb.h,v 1.5 1994/05/13 06:03:11 mycroft Exp $ + * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index c684fba30a3..6d12d0872e6 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -1,3 +1,5 @@ +/* $NetBSD: raw_usrreq.c,v 1.8 1994/06/29 06:36:40 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_usrreq.c,v 1.7 1994/05/13 06:03:13 mycroft Exp $ + * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/net/route.c b/sys/net/route.c index 1c8731ca029..151e68247c2 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,3 +1,5 @@ +/* $NetBSD: route.c,v 1.11 1994/06/29 06:36:42 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)route.c 8.2 (Berkeley) 11/15/93 - * $Id: route.c,v 1.10 1994/05/13 06:03:16 mycroft Exp $ + * @(#)route.c 8.2 (Berkeley) 11/15/93 */ #include <sys/param.h> diff --git a/sys/net/route.h b/sys/net/route.h index 49557172ec3..afb71529f97 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,3 +1,5 @@ +/* $NetBSD: route.h,v 1.6 1994/06/29 06:36:44 cgd Exp $ */ + /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)route.h 8.3 (Berkeley) 4/19/94 - * $Id: route.h,v 1.5 1994/05/13 06:03:19 mycroft Exp $ + * @(#)route.h 8.3 (Berkeley) 4/19/94 */ /* diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 31aa1daeab1..3ddcc0cca46 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,3 +1,5 @@ +/* $NetBSD: rtsock.c,v 1.11 1994/06/29 06:36:46 cgd Exp $ */ + /* * Copyright (c) 1988, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)rtsock.c 8.3 (Berkeley) 1/4/94 - * $Id: rtsock.c,v 1.10 1994/05/13 06:03:22 mycroft Exp $ + * @(#)rtsock.c 8.3 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/net/slcompress.c b/sys/net/slcompress.c index 50d6832c72d..485e2638f47 100644 --- a/sys/net/slcompress.c +++ b/sys/net/slcompress.c @@ -1,3 +1,5 @@ +/* $NetBSD: slcompress.c,v 1.9 1994/06/29 06:36:48 cgd Exp $ */ + /* * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)slcompress.c 8.2 (Berkeley) 4/16/94 - * $Id: slcompress.c,v 1.8 1994/05/13 06:03:25 mycroft Exp $ + * @(#)slcompress.c 8.2 (Berkeley) 4/16/94 */ /* diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h index 026867e426b..fde50ac2a29 100644 --- a/sys/net/slcompress.h +++ b/sys/net/slcompress.h @@ -1,3 +1,5 @@ +/* $NetBSD: slcompress.h,v 1.8 1994/06/29 06:36:51 cgd Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)slcompress.h 8.1 (Berkeley) 6/10/93 - * $Id: slcompress.h,v 1.7 1994/05/13 06:03:28 mycroft Exp $ + * @(#)slcompress.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/net/slip.h b/sys/net/slip.h index b88965a1c76..dac2d10dda9 100644 --- a/sys/net/slip.h +++ b/sys/net/slip.h @@ -1,3 +1,5 @@ +/* $NetBSD: slip.h,v 1.6 1994/06/29 06:36:53 cgd Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)slip.h 8.1 (Berkeley) 2/12/94 - * $Id: slip.h,v 1.5 1994/05/13 06:03:30 mycroft Exp $ + * @(#)slip.h 8.1 (Berkeley) 2/12/94 */ /* Ioctls operating on SLIP ttys. */ diff --git a/sys/netccitt/README.hdlc b/sys/netccitt/README.hdlc index 86f463fb9f5..b7bff73faf5 100644 --- a/sys/netccitt/README.hdlc +++ b/sys/netccitt/README.hdlc @@ -1,8 +1,9 @@ +/* $NetBSD: README.hdlc,v 1.4 1994/06/29 06:36:58 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * - * from: @(#)README.hdlc 8.1 (Berkeley) 6/10/93 - * $Id: README.hdlc,v 1.3 1994/05/13 06:04:08 mycroft Exp $ + * @(#)README.hdlc 8.1 (Berkeley) 6/10/93 * * X.25 HDLC DATA LINK LEVEL: * diff --git a/sys/netccitt/README.packet b/sys/netccitt/README.packet index e4c5cf18412..9d7cc5608f2 100644 --- a/sys/netccitt/README.packet +++ b/sys/netccitt/README.packet @@ -1,6 +1,7 @@ +/* $NetBSD: README.packet,v 1.4 1994/06/29 06:36:59 cgd Exp $ */ + /* - * from: @(#)README.packet 8.1 (Berkeley) 6/10/93 - * $Id: README.packet,v 1.3 1994/05/13 06:04:11 mycroft Exp $ + * @(#)README.packet 8.1 (Berkeley) 6/10/93 * * X.25 NETWORK PACKET LEVEL: * diff --git a/sys/netccitt/ccitt_proto.c b/sys/netccitt/ccitt_proto.c index a1f6fbef961..4e1e88bb6d0 100644 --- a/sys/netccitt/ccitt_proto.c +++ b/sys/netccitt/ccitt_proto.c @@ -1,3 +1,5 @@ +/* $NetBSD: ccitt_proto.c,v 1.5 1994/06/29 06:37:00 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ccitt_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: ccitt_proto.c,v 1.4 1994/05/13 06:04:13 mycroft Exp $ + * @(#)ccitt_proto.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/dll.h b/sys/netccitt/dll.h index 83dfb9e89f7..295f3570261 100644 --- a/sys/netccitt/dll.h +++ b/sys/netccitt/dll.h @@ -1,3 +1,5 @@ +/* $NetBSD: dll.h,v 1.2 1994/06/29 06:37:02 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -32,8 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)dll.h 8.1 (Berkeley) 6/10/93 - * $Id: dll.h,v 1.1 1994/05/13 06:04:14 mycroft Exp $ + * @(#)dll.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netccitt/hd_debug.c b/sys/netccitt/hd_debug.c index 8362938e237..e99a77eba2e 100644 --- a/sys/netccitt/hd_debug.c +++ b/sys/netccitt/hd_debug.c @@ -1,3 +1,5 @@ +/* $NetBSD: hd_debug.c,v 1.5 1994/06/29 06:37:05 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_debug.c,v 1.4 1994/05/13 06:04:16 mycroft Exp $ + * @(#)hd_debug.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/hd_input.c b/sys/netccitt/hd_input.c index 8901d815a3b..d9511c462a5 100644 --- a/sys/netccitt/hd_input.c +++ b/sys/netccitt/hd_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: hd_input.c,v 1.7 1994/06/29 06:37:07 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_input.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_input.c,v 1.6 1994/05/13 06:04:18 mycroft Exp $ + * @(#)hd_input.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/hd_output.c b/sys/netccitt/hd_output.c index 017884e92ff..d0e5ada43c1 100644 --- a/sys/netccitt/hd_output.c +++ b/sys/netccitt/hd_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: hd_output.c,v 1.5 1994/06/29 06:37:11 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_output.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_output.c,v 1.4 1994/05/13 06:04:19 mycroft Exp $ + * @(#)hd_output.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/hd_subr.c b/sys/netccitt/hd_subr.c index ad67b900dec..db8ec819296 100644 --- a/sys/netccitt/hd_subr.c +++ b/sys/netccitt/hd_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: hd_subr.c,v 1.5 1994/06/29 06:37:13 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_subr.c,v 1.4 1994/05/13 06:04:21 mycroft Exp $ + * @(#)hd_subr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/hd_timer.c b/sys/netccitt/hd_timer.c index 5ffdfd88f27..8f934ff5436 100644 --- a/sys/netccitt/hd_timer.c +++ b/sys/netccitt/hd_timer.c @@ -1,3 +1,5 @@ +/* $NetBSD: hd_timer.c,v 1.5 1994/06/29 06:37:15 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_timer.c,v 1.4 1994/05/13 06:04:23 mycroft Exp $ + * @(#)hd_timer.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/hd_var.h b/sys/netccitt/hd_var.h index 856068a621f..719d9e0120f 100644 --- a/sys/netccitt/hd_var.h +++ b/sys/netccitt/hd_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: hd_var.h,v 1.5 1994/06/29 06:37:16 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hd_var.h 8.1 (Berkeley) 6/10/93 - * $Id: hd_var.h,v 1.4 1994/05/13 06:04:24 mycroft Exp $ + * @(#)hd_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netccitt/hdlc.h b/sys/netccitt/hdlc.h index d9318a36622..ace9af41cc9 100644 --- a/sys/netccitt/hdlc.h +++ b/sys/netccitt/hdlc.h @@ -1,3 +1,5 @@ +/* $NetBSD: hdlc.h,v 1.5 1994/06/29 06:37:17 cgd Exp $ */ + /*- * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1991, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)hdlc.h 8.1 (Berkeley) 6/10/93 - * $Id: hdlc.h,v 1.4 1994/05/13 06:04:25 mycroft Exp $ + * @(#)hdlc.h 8.1 (Berkeley) 6/10/93 */ #ifndef ORDER4 diff --git a/sys/netccitt/if_x25subr.c b/sys/netccitt/if_x25subr.c index ec3e0a5f845..763469de404 100644 --- a/sys/netccitt/if_x25subr.c +++ b/sys/netccitt/if_x25subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_x25subr.c,v 1.6 1994/06/29 06:37:19 cgd Exp $ */ + /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_x25subr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_x25subr.c,v 1.5 1994/05/13 06:04:27 mycroft Exp $ + * @(#)if_x25subr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/llc_input.c b/sys/netccitt/llc_input.c index a8154c17314..1ee073b03dc 100644 --- a/sys/netccitt/llc_input.c +++ b/sys/netccitt/llc_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: llc_input.c,v 1.2 1994/06/29 06:37:21 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)llc_input.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_input.c,v 1.1 1994/05/13 06:04:29 mycroft Exp $ + * @(#)llc_input.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/llc_output.c b/sys/netccitt/llc_output.c index 079b8fc7c8d..70df6288398 100644 --- a/sys/netccitt/llc_output.c +++ b/sys/netccitt/llc_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: llc_output.c,v 1.2 1994/06/29 06:37:23 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)llc_output.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_output.c,v 1.1 1994/05/13 06:04:31 mycroft Exp $ + * @(#)llc_output.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/llc_subr.c b/sys/netccitt/llc_subr.c index 76231028b16..3cd27d90d19 100644 --- a/sys/netccitt/llc_subr.c +++ b/sys/netccitt/llc_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: llc_subr.c,v 1.2 1994/06/29 06:37:25 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)llc_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_subr.c,v 1.1 1994/05/13 06:04:33 mycroft Exp $ + * @(#)llc_subr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/llc_timer.c b/sys/netccitt/llc_timer.c index f8aa2e49bba..a404da99591 100644 --- a/sys/netccitt/llc_timer.c +++ b/sys/netccitt/llc_timer.c @@ -1,3 +1,5 @@ +/* $NetBSD: llc_timer.c,v 1.2 1994/06/29 06:37:26 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)llc_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_timer.c,v 1.1 1994/05/13 06:04:35 mycroft Exp $ + * @(#)llc_timer.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/llc_var.h b/sys/netccitt/llc_var.h index 98d22893f6d..82cdbe890bf 100644 --- a/sys/netccitt/llc_var.h +++ b/sys/netccitt/llc_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: llc_var.h,v 1.2 1994/06/29 06:37:27 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)llc_var.h 8.1 (Berkeley) 6/10/93 - * $Id: llc_var.h,v 1.1 1994/05/13 06:04:37 mycroft Exp $ + * @(#)llc_var.h 8.1 (Berkeley) 6/10/93 */ #ifdef __STDC__ diff --git a/sys/netccitt/pk.h b/sys/netccitt/pk.h index 2c0fbc11440..10b2fa218cf 100644 --- a/sys/netccitt/pk.h +++ b/sys/netccitt/pk.h @@ -1,3 +1,5 @@ +/* $NetBSD: pk.h,v 1.5 1994/06/29 06:37:29 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1992, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk.h 8.1 (Berkeley) 6/10/93 - * $Id: pk.h,v 1.4 1994/05/13 06:04:41 mycroft Exp $ + * @(#)pk.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netccitt/pk_acct.c b/sys/netccitt/pk_acct.c index 441c83ce3c1..5172a0bbd16 100644 --- a/sys/netccitt/pk_acct.c +++ b/sys/netccitt/pk_acct.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_acct.c,v 1.6 1994/06/29 06:37:30 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_acct.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_acct.c,v 1.5 1994/06/18 00:34:33 cgd Exp $ + * @(#)pk_acct.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_debug.c b/sys/netccitt/pk_debug.c index 052d314548f..f7a755d6061 100644 --- a/sys/netccitt/pk_debug.c +++ b/sys/netccitt/pk_debug.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_debug.c,v 1.5 1994/06/29 06:37:31 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_debug.c,v 1.4 1994/05/13 06:04:46 mycroft Exp $ + * @(#)pk_debug.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_input.c b/sys/netccitt/pk_input.c index 8b2d80c5f78..343c82c1fcb 100644 --- a/sys/netccitt/pk_input.c +++ b/sys/netccitt/pk_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_input.c,v 1.6 1994/06/29 06:37:33 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_input.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_input.c,v 1.5 1994/05/13 06:04:48 mycroft Exp $ + * @(#)pk_input.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_llcsubr.c b/sys/netccitt/pk_llcsubr.c index d520522dd81..76f64aabd91 100644 --- a/sys/netccitt/pk_llcsubr.c +++ b/sys/netccitt/pk_llcsubr.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_llcsubr.c,v 1.2 1994/06/29 06:37:34 cgd Exp $ */ + /* * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 @@ -36,8 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_llcsubr.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_llcsubr.c,v 1.1 1994/05/13 06:04:52 mycroft Exp $ + * @(#)pk_llcsubr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_output.c b/sys/netccitt/pk_output.c index b3fe932b463..1b5463dc894 100644 --- a/sys/netccitt/pk_output.c +++ b/sys/netccitt/pk_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_output.c,v 1.5 1994/06/29 06:37:36 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_output.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_output.c,v 1.4 1994/05/13 06:04:55 mycroft Exp $ + * @(#)pk_output.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_subr.c b/sys/netccitt/pk_subr.c index 85abe47e91d..f2fd4d535a5 100644 --- a/sys/netccitt/pk_subr.c +++ b/sys/netccitt/pk_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_subr.c,v 1.7 1994/06/29 06:37:38 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_subr.c,v 1.6 1994/05/13 06:04:58 mycroft Exp $ + * @(#)pk_subr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_timer.c b/sys/netccitt/pk_timer.c index 978cc9ad2a3..c078e23b652 100644 --- a/sys/netccitt/pk_timer.c +++ b/sys/netccitt/pk_timer.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_timer.c,v 1.5 1994/06/29 06:37:40 cgd Exp $ */ + /* * Copyright (c) Computing Centre, University of British Columbia, 1984 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_timer.c,v 1.4 1994/05/13 06:05:01 mycroft Exp $ + * @(#)pk_timer.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_usrreq.c b/sys/netccitt/pk_usrreq.c index a467e97fe79..ceacc4db93c 100644 --- a/sys/netccitt/pk_usrreq.c +++ b/sys/netccitt/pk_usrreq.c @@ -1,3 +1,5 @@ +/* $NetBSD: pk_usrreq.c,v 1.7 1994/06/29 06:37:41 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_usrreq.c,v 1.6 1994/05/13 06:05:03 mycroft Exp $ + * @(#)pk_usrreq.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netccitt/pk_var.h b/sys/netccitt/pk_var.h index ba570e81ef7..7d2f4f05d4d 100644 --- a/sys/netccitt/pk_var.h +++ b/sys/netccitt/pk_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: pk_var.h,v 1.5 1994/06/29 06:37:43 cgd Exp $ */ + /* * Copyright (c) Computing Centre, University of British Columbia, 1985 * Copyright (C) Computer Science Department IV, @@ -38,8 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)pk_var.h 8.1 (Berkeley) 6/10/93 - * $Id: pk_var.h,v 1.4 1994/05/13 06:05:04 mycroft Exp $ + * @(#)pk_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netccitt/x25.h b/sys/netccitt/x25.h index b202ddc2995..80220f4a0f3 100644 --- a/sys/netccitt/x25.h +++ b/sys/netccitt/x25.h @@ -1,3 +1,5 @@ +/* $NetBSD: x25.h,v 1.5 1994/06/29 06:37:45 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1992, 1993 @@ -37,8 +39,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)x25.h 8.1 (Berkeley) 6/10/93 - * $Id: x25.h,v 1.4 1994/05/13 06:05:06 mycroft Exp $ + * @(#)x25.h 8.1 (Berkeley) 6/10/93 */ #ifdef KERNEL diff --git a/sys/netccitt/x25acct.h b/sys/netccitt/x25acct.h index cd353ce5bfc..465df012f6c 100644 --- a/sys/netccitt/x25acct.h +++ b/sys/netccitt/x25acct.h @@ -1,3 +1,5 @@ +/* $NetBSD: x25acct.h,v 1.5 1994/06/29 06:37:46 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)x25acct.h 8.1 (Berkeley) 6/10/93 - * $Id: x25acct.h,v 1.4 1994/05/13 06:05:08 mycroft Exp $ + * @(#)x25acct.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netccitt/x25err.h b/sys/netccitt/x25err.h index f0cadf57503..a7da105cd20 100644 --- a/sys/netccitt/x25err.h +++ b/sys/netccitt/x25err.h @@ -1,3 +1,5 @@ +/* $NetBSD: x25err.h,v 1.5 1994/06/29 06:37:47 cgd Exp $ */ + /* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990, 1993 @@ -35,8 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)x25err.h 8.1 (Berkeley) 6/10/93 - * $Id: x25err.h,v 1.4 1994/05/13 06:05:10 mycroft Exp $ + * @(#)x25err.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h index b13acab569c..945e4dbd1cc 100644 --- a/sys/netinet/icmp_var.h +++ b/sys/netinet/icmp_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: icmp_var.h,v 1.7 1994/06/29 06:37:52 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 - * $Id: icmp_var.h,v 1.6 1994/05/13 06:05:53 mycroft Exp $ + * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/if_arp.c b/sys/netinet/if_arp.c index cadeceb10de..3ebd3650993 100644 --- a/sys/netinet/if_arp.c +++ b/sys/netinet/if_arp.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_arp.c,v 1.16 1994/06/29 06:37:54 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_arp.c,v 1.15 1994/06/21 03:54:27 chopps Exp $ + * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/if_arp.h b/sys/netinet/if_arp.h index 10f7dc2a159..0858b0a99a4 100644 --- a/sys/netinet/if_arp.h +++ b/sys/netinet/if_arp.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_arp.h,v 1.10 1994/06/29 06:37:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.h 8.1 (Berkeley) 6/10/93 - * $Id: if_arp.h,v 1.9 1994/05/13 06:05:57 mycroft Exp $ + * @(#)if_ether.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b2400f51a20..1b5d3a4d51d 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,3 +1,5 @@ +/* $NetBSD: if_ether.c,v 1.16 1994/06/29 06:37:54 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.15 1994/06/21 03:54:27 chopps Exp $ + * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 3a794ed136e..b5bd28ea640 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_ether.h,v 1.10 1994/06/29 06:37:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.h 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.h,v 1.9 1994/05/13 06:05:57 mycroft Exp $ + * @(#)if_ether.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/if_inarp.h b/sys/netinet/if_inarp.h index 7c433ee59b3..b80c960881d 100644 --- a/sys/netinet/if_inarp.h +++ b/sys/netinet/if_inarp.h @@ -1,3 +1,5 @@ +/* $NetBSD: if_inarp.h,v 1.10 1994/06/29 06:37:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)if_ether.h 8.1 (Berkeley) 6/10/93 - * $Id: if_inarp.h,v 1.9 1994/05/13 06:05:57 mycroft Exp $ + * @(#)if_ether.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 708c609776b..7562967908e 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,3 +1,5 @@ +/* $NetBSD: igmp.c,v 1.8 1994/06/29 06:37:56 cgd Exp $ */ + /* * Copyright (c) 1988 Stephen Deering. * Copyright (c) 1992, 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)igmp.c 8.1 (Berkeley) 7/19/93 - * $Id: igmp.c,v 1.7 1994/06/09 15:59:47 brezak Exp $ + * @(#)igmp.c 8.1 (Berkeley) 7/19/93 */ /* Internet Group Management Protocol (IGMP) routines. */ diff --git a/sys/netinet/igmp.h b/sys/netinet/igmp.h index f66153986ec..975a211f83e 100644 --- a/sys/netinet/igmp.h +++ b/sys/netinet/igmp.h @@ -1,3 +1,5 @@ +/* $NetBSD: igmp.h,v 1.4 1994/06/29 06:37:58 cgd Exp $ */ + /* * Copyright (c) 1988 Stephen Deering. * Copyright (c) 1992, 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)igmp.h 8.1 (Berkeley) 6/10/93 - * $Id: igmp.h,v 1.3 1994/05/13 06:06:00 mycroft Exp $ + * @(#)igmp.h 8.1 (Berkeley) 6/10/93 */ /* Internet Group Management Protocol (IGMP) definitions. */ diff --git a/sys/netinet/igmp_var.h b/sys/netinet/igmp_var.h index 7cf7c1655b3..39abf985917 100644 --- a/sys/netinet/igmp_var.h +++ b/sys/netinet/igmp_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: igmp_var.h,v 1.6 1994/06/29 06:37:59 cgd Exp $ */ + /* * Copyright (c) 1988 Stephen Deering. * Copyright (c) 1992, 1993 @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 - * $Id: igmp_var.h,v 1.5 1994/05/13 06:06:01 mycroft Exp $ + * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 */ /* diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 392f6ab3041..31fda85bf9b 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,3 +1,5 @@ +/* $NetBSD: in.c,v 1.14 1994/06/29 06:38:00 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in.c 8.2 (Berkeley) 11/15/93 - * $Id: in.c,v 1.13 1994/06/21 03:54:30 chopps Exp $ + * @(#)in.c 8.2 (Berkeley) 11/15/93 */ #include <sys/param.h> diff --git a/sys/netinet/in.h b/sys/netinet/in.h index b0c440cc84e..392f6061bc5 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,3 +1,5 @@ +/* $NetBSD: in.h,v 1.12 1994/06/29 06:38:03 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in.h 8.3 (Berkeley) 1/3/94 - * $Id: in.h,v 1.11 1994/05/14 06:25:32 cgd Exp $ + * @(#)in.h 8.3 (Berkeley) 1/3/94 */ /* diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c index be74395cabb..a0323083dff 100644 --- a/sys/netinet/in_cksum.c +++ b/sys/netinet/in_cksum.c @@ -1,3 +1,5 @@ +/* $NetBSD: in_cksum.c,v 1.9 1994/06/29 06:38:05 cgd Exp $ */ + /* * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - * $Id: in_cksum.c,v 1.8 1994/05/13 06:06:05 mycroft Exp $ + * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 837c380ff25..93e3863a3b2 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,3 +1,5 @@ +/* $NetBSD: in_pcb.c,v 1.11 1994/06/29 06:38:06 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_pcb.c 8.2 (Berkeley) 1/4/94 - * $Id: in_pcb.c,v 1.10 1994/05/13 06:06:07 mycroft Exp $ + * @(#)in_pcb.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 2ecdb147d11..8b3c70040ee 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,3 +1,5 @@ +/* $NetBSD: in_pcb.h,v 1.7 1994/06/29 06:38:08 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: in_pcb.h,v 1.6 1994/05/13 06:06:10 mycroft Exp $ + * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 7dd2f04b31e..62053f0f924 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,3 +1,5 @@ +/* $NetBSD: in_proto.c,v 1.9 1994/06/29 06:38:09 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: in_proto.c,v 1.8 1994/05/13 06:06:11 mycroft Exp $ + * @(#)in_proto.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netinet/in_systm.h b/sys/netinet/in_systm.h index 10bd86f297c..23cdbca547b 100644 --- a/sys/netinet/in_systm.h +++ b/sys/netinet/in_systm.h @@ -1,3 +1,5 @@ +/* $NetBSD: in_systm.h,v 1.6 1994/06/29 06:38:11 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_systm.h 8.1 (Berkeley) 6/10/93 - * $Id: in_systm.h,v 1.5 1994/05/13 06:06:13 mycroft Exp $ + * @(#)in_systm.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 432814d2ac5..7dd01685ee3 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: in_var.h,v 1.8 1994/06/29 06:38:13 cgd Exp $ */ + /* * Copyright (c) 1985, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)in_var.h 8.1 (Berkeley) 6/10/93 - * $Id: in_var.h,v 1.7 1994/05/13 06:06:14 mycroft Exp $ + * @(#)in_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h index 6d57a3bc211..460005a6865 100644 --- a/sys/netinet/ip.h +++ b/sys/netinet/ip.h @@ -1,3 +1,5 @@ +/* $NetBSD: ip.h,v 1.6 1994/06/29 06:38:14 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip.h 8.1 (Berkeley) 6/10/93 - * $Id: ip.h,v 1.5 1994/05/13 06:06:16 mycroft Exp $ + * @(#)ip.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index b18ff0f2563..06d7c292d83 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,3 +1,5 @@ +/* $NetBSD: ip_icmp.c,v 1.10 1994/06/29 06:38:16 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_icmp.c,v 1.9 1994/05/13 06:06:17 mycroft Exp $ + * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h index 1a839940a73..35a17ff5868 100644 --- a/sys/netinet/ip_icmp.h +++ b/sys/netinet/ip_icmp.h @@ -1,3 +1,5 @@ +/* $NetBSD: ip_icmp.h,v 1.6 1994/06/29 06:38:18 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_icmp.h,v 1.5 1994/05/13 06:06:19 mycroft Exp $ + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index a77c767b7de..376e5464cc7 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: ip_input.c,v 1.14 1994/06/29 06:38:19 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.13 1994/05/13 06:06:21 mycroft Exp $ + * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 006e25cac74..0aac27e68b8 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,3 +1,5 @@ +/* $NetBSD: ip_mroute.c,v 1.13 1994/06/29 06:38:22 cgd Exp $ */ + /* * Copyright (c) 1989 Stephen Deering * Copyright (c) 1992 Regents of the University of California. @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_mroute.c 7.4 (Berkeley) 11/19/92 - * $Id $ + * @(#)ip_mroute.c 7.4 (Berkeley) 11/19/92 */ /* diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h index ddbd50f6ca4..5e081215878 100644 --- a/sys/netinet/ip_mroute.h +++ b/sys/netinet/ip_mroute.h @@ -1,3 +1,5 @@ +/* $NetBSD: ip_mroute.h,v 1.6 1994/06/29 06:38:24 cgd Exp $ */ + /* * Copyright (c) 1989 Stephen Deering. * Copyright (c) 1992 Regents of the University of California. @@ -34,8 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_mroute.h 7.2 (Berkeley) 7/8/92 - * $Id $ + * @(#)ip_mroute.h 7.2 (Berkeley) 7/8/92 */ /* diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 75e4fe965a7..587201a9b00 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: ip_output.c,v 1.19 1994/06/29 06:38:27 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * find: @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $Id: ip_output.c,v 1.18 1994/05/13 06:06:26 mycroft Exp $ + * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index f50f8102f7d..babbe26a85b 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: ip_var.h,v 1.10 1994/06/29 06:38:29 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ip_var.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_var.h,v 1.9 1994/05/13 06:06:28 mycroft Exp $ + * @(#)ip_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 0c1c4936d53..a4146cb0fea 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,3 +1,5 @@ +/* $NetBSD: raw_ip.c,v 1.14 1994/06/29 06:38:31 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 - * $Id: raw_ip.c,v 1.13 1994/05/13 06:06:30 mycroft Exp $ + * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 */ #include <sys/param.h> diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 85b78239993..efbb3ff040b 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp.h,v 1.6 1994/06/29 06:38:34 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp.h,v 1.5 1994/05/13 06:06:32 mycroft Exp $ + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 */ typedef u_long tcp_seq; diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 1501fa21b3a..d4d0853f6e8 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_debug.c,v 1.8 1994/06/29 06:38:36 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_debug.c,v 1.7 1994/05/13 06:06:34 mycroft Exp $ + * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93 */ #ifdef TCPDEBUG diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h index 459ad4e772d..d0ca9100b3a 100644 --- a/sys/netinet/tcp_debug.h +++ b/sys/netinet/tcp_debug.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_debug.h,v 1.5 1994/06/29 06:38:38 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_debug.h,v 1.4 1994/05/13 06:06:35 mycroft Exp $ + * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93 */ struct tcp_debug { diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index 01602c54a9c..2f8b1e57153 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_fsm.h,v 1.5 1994/06/29 06:38:39 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_fsm.h,v 1.4 1994/05/13 06:06:36 mycroft Exp $ + * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 67cd9d5eee2..b5b95b3055f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_input.c,v 1.10 1994/06/29 06:38:40 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.9 1994/05/13 06:06:39 mycroft Exp $ + * @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 */ #ifndef TUBA_INCLUDE diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 6542aa59e3f..1347bc51b69 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_output.c,v 1.10 1994/06/29 06:38:42 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_output.c 8.3 (Berkeley) 12/30/93 - * $Id: tcp_output.c,v 1.9 1994/05/13 06:06:42 mycroft Exp $ + * @(#)tcp_output.c 8.3 (Berkeley) 12/30/93 */ #include <sys/param.h> diff --git a/sys/netinet/tcp_seq.h b/sys/netinet/tcp_seq.h index c5f3c759e41..dc230d79980 100644 --- a/sys/netinet/tcp_seq.h +++ b/sys/netinet/tcp_seq.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_seq.h,v 1.5 1994/06/29 06:38:44 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_seq.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_seq.h,v 1.4 1994/05/13 06:06:43 mycroft Exp $ + * @(#)tcp_seq.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 965f040530b..8ca2ecb6c38 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_subr.c,v 1.11 1994/06/29 06:38:46 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.10 1994/05/13 06:06:45 mycroft Exp $ + * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 */ #include <sys/param.h> diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index e4891142fc9..ec4150c61e3 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_timer.c,v 1.8 1994/06/29 06:38:48 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.c,v 1.7 1994/05/13 06:06:46 mycroft Exp $ + * @(#)tcp_timer.c 8.1 (Berkeley) 6/10/93 */ #ifndef TUBA_INCLUDE diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 2ebd262f9ce..3dca8d0a30c 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_timer.h,v 1.5 1994/06/29 06:38:49 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.h,v 1.4 1994/05/13 06:06:48 mycroft Exp $ + * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 1e637396d5a..69010eca531 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_usrreq.c,v 1.10 1994/06/29 06:38:52 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $Id: tcp_usrreq.c,v 1.9 1994/05/13 06:06:49 mycroft Exp $ + * @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 */ #include <sys/param.h> diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index df1192fefc7..ebcd88f28ef 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcp_var.h,v 1.9 1994/06/29 06:38:54 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcp_var.h 8.3 (Berkeley) 4/10/94 - * $Id: tcp_var.h,v 1.8 1994/05/13 06:06:51 mycroft Exp $ + * @(#)tcp_var.h 8.3 (Berkeley) 4/10/94 */ /* diff --git a/sys/netinet/tcpip.h b/sys/netinet/tcpip.h index 0e37a688a53..9fbfb2614ee 100644 --- a/sys/netinet/tcpip.h +++ b/sys/netinet/tcpip.h @@ -1,3 +1,5 @@ +/* $NetBSD: tcpip.h,v 1.5 1994/06/29 06:38:55 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)tcpip.h 8.1 (Berkeley) 6/10/93 - * $Id: tcpip.h,v 1.4 1994/05/13 06:06:52 mycroft Exp $ + * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h index bf91068e058..4015fc4fd57 100644 --- a/sys/netinet/udp.h +++ b/sys/netinet/udp.h @@ -1,3 +1,5 @@ +/* $NetBSD: udp.h,v 1.5 1994/06/29 06:38:56 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)udp.h 8.1 (Berkeley) 6/10/93 - * $Id: udp.h,v 1.4 1994/05/13 06:06:54 mycroft Exp $ + * @(#)udp.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 7f1faa73207..6b8622143cb 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,3 +1,5 @@ +/* $NetBSD: udp_usrreq.c,v 1.14 1994/06/29 06:38:57 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94 - * $Id: udp_usrreq.c,v 1.13 1994/05/13 06:06:56 mycroft Exp $ + * @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94 */ #include <sys/param.h> diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index beb8c6eb1c9..9aa5baa8e9d 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -1,3 +1,5 @@ +/* $NetBSD: udp_var.h,v 1.7 1994/06/29 06:38:58 cgd Exp $ */ + /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)udp_var.h 8.1 (Berkeley) 6/10/93 - * $Id: udp_var.h,v 1.6 1994/05/13 06:06:58 mycroft Exp $ + * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 */ /* diff --git a/sys/netiso/argo_debug.h b/sys/netiso/argo_debug.h index 796afefff63..79835769446 100644 --- a/sys/netiso/argo_debug.h +++ b/sys/netiso/argo_debug.h @@ -1,3 +1,5 @@ +/* $NetBSD: argo_debug.h,v 1.5 1994/06/29 06:39:02 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)argo_debug.h 8.1 (Berkeley) 6/10/93 - * $Id: argo_debug.h,v 1.4 1994/05/13 06:08:03 mycroft Exp $ + * @(#)argo_debug.h 8.1 (Berkeley) 6/10/93 */ /***************************************************************** diff --git a/sys/netiso/clnl.h b/sys/netiso/clnl.h index 4bc25817ab6..db912385a00 100644 --- a/sys/netiso/clnl.h +++ b/sys/netiso/clnl.h @@ -1,3 +1,5 @@ +/* $NetBSD: clnl.h,v 1.5 1994/06/29 06:39:04 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnl.h 8.1 (Berkeley) 6/10/93 - * $Id: clnl.h,v 1.4 1994/05/13 06:08:05 mycroft Exp $ + * @(#)clnl.h 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp.h b/sys/netiso/clnp.h index 186c68b9d08..b5ac6cf9af8 100644 --- a/sys/netiso/clnp.h +++ b/sys/netiso/clnp.h @@ -1,3 +1,5 @@ +/* $NetBSD: clnp.h,v 1.6 1994/06/29 06:39:05 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp.h 8.2 (Berkeley) 4/16/94 - * $Id: clnp.h,v 1.5 1994/05/13 06:08:07 mycroft Exp $ + * @(#)clnp.h 8.2 (Berkeley) 4/16/94 */ /*********************************************************** diff --git a/sys/netiso/clnp_debug.c b/sys/netiso/clnp_debug.c index fa4a234eefb..9c682a0f047 100644 --- a/sys/netiso/clnp_debug.c +++ b/sys/netiso/clnp_debug.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_debug.c,v 1.5 1994/06/29 06:39:07 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_debug.c,v 1.4 1994/05/13 06:08:10 mycroft Exp $ + * @(#)clnp_debug.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_er.c b/sys/netiso/clnp_er.c index 22878e07cbd..1c7634b30ae 100644 --- a/sys/netiso/clnp_er.c +++ b/sys/netiso/clnp_er.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_er.c,v 1.5 1994/06/29 06:39:08 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_er.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_er.c,v 1.4 1994/05/13 06:08:12 mycroft Exp $ + * @(#)clnp_er.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_frag.c b/sys/netiso/clnp_frag.c index 174b4582132..cc70063f483 100644 --- a/sys/netiso/clnp_frag.c +++ b/sys/netiso/clnp_frag.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_frag.c,v 1.5 1994/06/29 06:39:10 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_frag.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_frag.c,v 1.4 1994/05/13 06:08:13 mycroft Exp $ + * @(#)clnp_frag.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_input.c b/sys/netiso/clnp_input.c index 4e060b67816..980d82e2ce2 100644 --- a/sys/netiso/clnp_input.c +++ b/sys/netiso/clnp_input.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_input.c,v 1.7 1994/06/29 06:39:12 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_input.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_input.c,v 1.6 1994/05/13 06:08:15 mycroft Exp $ + * @(#)clnp_input.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_options.c b/sys/netiso/clnp_options.c index f4649468f7a..8779f180daf 100644 --- a/sys/netiso/clnp_options.c +++ b/sys/netiso/clnp_options.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_options.c,v 1.5 1994/06/29 06:39:14 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_options.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_options.c,v 1.4 1994/05/13 06:08:17 mycroft Exp $ + * @(#)clnp_options.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_output.c b/sys/netiso/clnp_output.c index 9670a1499c9..5c44e30dc08 100644 --- a/sys/netiso/clnp_output.c +++ b/sys/netiso/clnp_output.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_output.c,v 1.5 1994/06/29 06:39:15 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_output.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_output.c,v 1.4 1994/05/13 06:08:20 mycroft Exp $ + * @(#)clnp_output.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_raw.c b/sys/netiso/clnp_raw.c index aef8b27f4e2..77ee04aaf6a 100644 --- a/sys/netiso/clnp_raw.c +++ b/sys/netiso/clnp_raw.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_raw.c,v 1.5 1994/06/29 06:39:17 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_raw.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_raw.c,v 1.4 1994/05/13 06:08:22 mycroft Exp $ + * @(#)clnp_raw.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_stat.h b/sys/netiso/clnp_stat.h index 3fc3467663c..3cc5193aa51 100644 --- a/sys/netiso/clnp_stat.h +++ b/sys/netiso/clnp_stat.h @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_stat.h,v 1.5 1994/06/29 06:39:18 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_stat.h 8.1 (Berkeley) 6/10/93 - * $Id: clnp_stat.h,v 1.4 1994/05/13 06:08:24 mycroft Exp $ + * @(#)clnp_stat.h 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_subr.c b/sys/netiso/clnp_subr.c index 69e7c96ce85..5757ab70978 100644 --- a/sys/netiso/clnp_subr.c +++ b/sys/netiso/clnp_subr.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_subr.c,v 1.5 1994/06/29 06:39:22 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_subr.c,v 1.4 1994/05/13 06:08:26 mycroft Exp $ + * @(#)clnp_subr.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** diff --git a/sys/netiso/clnp_timer.c b/sys/netiso/clnp_timer.c index 1a8d1403a97..864ba8af545 100644 --- a/sys/netiso/clnp_timer.c +++ b/sys/netiso/clnp_timer.c @@ -1,3 +1,5 @@ +/* $NetBSD: clnp_timer.c,v 1.5 1994/06/29 06:39:24 cgd Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -30,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)clnp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_timer.c,v 1.4 1994/05/13 06:08:28 mycroft Exp $ + * @(#)clnp_timer.c 8.1 (Berkeley) 6/10/93 */ /*********************************************************** |
