aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-06-05 02:59:00 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-06-05 02:59:00 +0000
commit78e55a1f29558e8be54566ead1e7be8ab9d45273 (patch)
tree65fd45fa55d0cd3888b40a4f41dd3383616dfd74
parent885f2f31b4599f4bc7468278c783c1c30f1f86ed (diff)
downloadsrc-78e55a1f29558e8be54566ead1e7be8ab9d45273.tar.gz
src-78e55a1f29558e8be54566ead1e7be8ab9d45273.zip
This 3rd mega-commit should hopefully bring us back to where we were.
I can get it to `make world' succesfully, anyway!
Notes
Notes: svn path=/stable/2.1/; revision=16121
-rw-r--r--Makefile94
-rw-r--r--bin/Makefile2
-rw-r--r--bin/Makefile.inc10
-rw-r--r--bin/cp/cp.121
-rw-r--r--bin/cp/cp.c9
-rw-r--r--bin/cp/extern.h2
-rw-r--r--bin/cp/utils.c17
-rw-r--r--bin/csh/const.c4
-rw-r--r--bin/csh/csh.12
-rw-r--r--bin/csh/csh.c4
-rw-r--r--bin/csh/func.c7
-rw-r--r--bin/date/date.c4
-rw-r--r--bin/dd/dd.c2
-rw-r--r--bin/df/df.c5
-rw-r--r--bin/echo/echo.14
-rw-r--r--bin/echo/echo.c10
-rw-r--r--bin/ed/Makefile9
-rw-r--r--bin/ed/io.c4
-rw-r--r--bin/expr/Makefile2
-rw-r--r--bin/hostname/hostname.12
-rw-r--r--bin/ln/ln.c13
-rw-r--r--bin/ls/ls.c3
-rw-r--r--bin/ls/print.c9
-rw-r--r--bin/ls/util.c2
-rw-r--r--bin/mv/mv.117
-rw-r--r--bin/mv/mv.c23
-rw-r--r--bin/pax/ar_io.c1
-rw-r--r--bin/pax/ar_subs.c1
-rw-r--r--bin/pax/buf_subs.c1
-rw-r--r--bin/pax/cache.c1
-rw-r--r--bin/pax/cpio.c1
-rw-r--r--bin/pax/file_subs.c1
-rw-r--r--bin/pax/ftree.c1
-rw-r--r--bin/pax/gen_subs.c1
-rw-r--r--bin/pax/options.c1
-rw-r--r--bin/pax/pat_rep.c1
-rw-r--r--bin/pax/pax.c2
-rw-r--r--bin/pax/sel_subs.c1
-rw-r--r--bin/pax/tables.c1
-rw-r--r--bin/pax/tar.c1
-rw-r--r--bin/pax/tty_subs.c1
-rw-r--r--bin/ps/Makefile2
-rw-r--r--bin/ps/fmt.c1
-rw-r--r--bin/ps/keyword.c1
-rw-r--r--bin/ps/print.c7
-rw-r--r--bin/ps/ps.159
-rw-r--r--bin/ps/ps.c8
-rw-r--r--bin/rcp/rcp.c21
-rw-r--r--bin/rm/rm.116
-rw-r--r--bin/rm/rm.c7
-rw-r--r--bin/rmail/rmail.c2
-rw-r--r--bin/sh/Makefile3
-rw-r--r--bin/sh/bltin/bltin.h8
-rw-r--r--bin/sh/parser.c38
-rw-r--r--bin/stty/stty.16
-rw-r--r--bin/sync/sync.84
-rw-r--r--etc/etc.i386/MAKEDEV123
-rw-r--r--etc/etc.i386/rc.i38645
-rw-r--r--etc/hosts4
-rw-r--r--etc/inetd.conf2
-rw-r--r--etc/make.conf29
-rw-r--r--etc/mtree/BSD.include.dist6
-rw-r--r--etc/mtree/BSD.local.dist10
-rw-r--r--etc/mtree/BSD.usr.dist4
-rw-r--r--etc/mtree/BSD.var.dist2
-rwxr-xr-xetc/netstart35
-rw-r--r--etc/ppp/ppp.conf.iij6
-rw-r--r--etc/ppp/ppp.conf.sample26
-rw-r--r--etc/ppp/ppp.linkup.sample12
-rw-r--r--etc/profile10
-rw-r--r--etc/rc45
-rw-r--r--etc/rc.serial95
-rw-r--r--etc/security11
-rw-r--r--etc/services1
-rw-r--r--etc/sysconfig58
-rw-r--r--etc/syslog.conf2
-rw-r--r--etc/termcap.small2
-rw-r--r--etc/weekly38
-rw-r--r--games/Makefile1
-rw-r--r--games/adventure/done.c1
-rw-r--r--games/adventure/init.c2
-rw-r--r--games/adventure/io.c1
-rw-r--r--games/adventure/main.c1
-rw-r--r--games/adventure/save.c1
-rw-r--r--games/adventure/subr.c1
-rw-r--r--games/adventure/vocab.c1
-rw-r--r--games/adventure/wizard.c2
-rw-r--r--games/atc/Makefile2
-rw-r--r--games/backgammon/common_source/backgammon.c12
-rw-r--r--games/bcd/bcd.674
-rw-r--r--games/caesar/Makefile4
-rw-r--r--games/caesar/caesar.66
-rw-r--r--games/caesar/caesar.c34
-rw-r--r--games/caesar/rot13.sh2
-rw-r--r--games/canfield/canfield/Makefile1
-rw-r--r--games/cribbage/Makefile2
-rw-r--r--games/fish/Makefile2
-rw-r--r--games/fortune/Makefile10
-rw-r--r--games/fortune/datfiles/Makefile29
-rw-r--r--games/fortune/datfiles/fortunes6
-rw-r--r--games/fortune/datfiles/fortunes.sp.ok6
-rw-r--r--games/fortune/datfiles/fortunes26
-rw-r--r--games/fortune/fortune/fortune.62
-rw-r--r--games/hack/hack.version.c2
-rw-r--r--games/larn/Makefile4
-rw-r--r--games/larn/larn.64
-rw-r--r--games/mille/mille.62
-rw-r--r--games/mille/varpush.c2
-rw-r--r--games/morse/Makefile2
-rw-r--r--games/morse/morse.c365
-rw-r--r--games/phantasia/Makefile20
-rw-r--r--games/quiz/Makefile4
-rw-r--r--games/quiz/quiz.c7
-rw-r--r--games/robots/Makefile2
-rw-r--r--games/sail/pl_main.c5
-rw-r--r--games/snake/snake/Makefile1
-rw-r--r--games/snake/snake/snake.66
-rw-r--r--games/wargames/Makefile2
-rw-r--r--games/wump/Makefile2
-rw-r--r--gnu/Makefile1
-rw-r--r--gnu/include/Makefile2
-rw-r--r--gnu/lib/libg++/libiberty/vasprintf.c139
-rw-r--r--gnu/lib/libgmp/Makefile4
-rw-r--r--gnu/lib/libgmp/tests/Makefile18
-rw-r--r--gnu/lib/libreadline/Makefile2
-rw-r--r--gnu/lib/libreadline/complete.c17
-rw-r--r--gnu/lib/libreadline/display.c8
-rw-r--r--gnu/lib/libreadline/examples/fileman.c2
-rw-r--r--gnu/lib/libreadline/examples/manexamp.c2
-rw-r--r--gnu/lib/libreadline/funmap.c2
-rw-r--r--gnu/lib/libreadline/history.c16
-rw-r--r--gnu/lib/libreadline/history.h2
-rw-r--r--gnu/lib/libreadline/posixstat.h2
-rw-r--r--gnu/lib/libreadline/readline.34
-rw-r--r--gnu/lib/libreadline/readline.c14
-rw-r--r--gnu/lib/libreadline/readline.h2
-rw-r--r--gnu/lib/libreadline/tilde.c4
-rw-r--r--gnu/lib/libreadline/vi_mode.c4
-rw-r--r--gnu/lib/libregex/Makefile4
-rw-r--r--gnu/lib/libregex/test/Makefile4
-rw-r--r--gnu/lib/libregex/test/Makefile.in4
-rw-r--r--gnu/libexec/Makefile2
-rw-r--r--gnu/libexec/uucp/cu/Makefile3
-rw-r--r--gnu/libexec/uucp/uucico/Makefile3
-rw-r--r--gnu/libexec/uucp/uustat/Makefile3
-rw-r--r--gnu/libexec/uucp/uustat/uustat.12
-rw-r--r--gnu/usr.bin/Makefile2
-rw-r--r--gnu/usr.bin/as/Makefile2
-rw-r--r--gnu/usr.bin/as/Makefile.in16
-rw-r--r--gnu/usr.bin/as/as.12
-rw-r--r--gnu/usr.bin/as/hash.c6
-rw-r--r--gnu/usr.bin/awk/Makefile1
-rw-r--r--gnu/usr.bin/awk/awk.1104
-rw-r--r--gnu/usr.bin/awk/main.c6
-rw-r--r--gnu/usr.bin/bc/scan.c2
-rw-r--r--gnu/usr.bin/cc/cc/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc/cc.118
-rw-r--r--gnu/usr.bin/cc/cc/gcc.c2
-rw-r--r--gnu/usr.bin/cc/doc/invoke.texi17
-rw-r--r--gnu/usr.bin/cc/f77/Makefile1
-rw-r--r--gnu/usr.bin/cc/include/tm.h25
-rw-r--r--gnu/usr.bin/cc/libgcc/Makefile4
-rw-r--r--gnu/usr.bin/cpio/main.c6
-rw-r--r--gnu/usr.bin/cpio/util.c4
-rw-r--r--gnu/usr.bin/cvs/contrib/easy-import.pl142
-rw-r--r--gnu/usr.bin/cvs/doc/cvs.texinfo4
-rw-r--r--gnu/usr.bin/cvs/examples/loginfo2
-rw-r--r--gnu/usr.bin/diff/diff.115
-rw-r--r--gnu/usr.bin/gdb/bfd/sysdep.h2
-rw-r--r--gnu/usr.bin/gdb/bfd/trad-core.c22
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile14
-rw-r--r--gnu/usr.bin/gdb/gdb/freebsd-nat.c14
-rw-r--r--gnu/usr.bin/gdb/gdb/gdb.119
-rw-r--r--gnu/usr.bin/gdb/libiberty/Makefile2
-rw-r--r--gnu/usr.bin/gdb/libiberty/vasprintf.c139
-rw-r--r--gnu/usr.bin/grep/Makefile2
-rw-r--r--gnu/usr.bin/grep/grep.156
-rw-r--r--gnu/usr.bin/grep/grep.c229
-rw-r--r--gnu/usr.bin/grep/search.c2
-rw-r--r--gnu/usr.bin/groff/Makefile.cfg11
-rw-r--r--gnu/usr.bin/groff/Makefile.comm12
-rw-r--r--gnu/usr.bin/groff/Makefile.dev21
-rw-r--r--gnu/usr.bin/groff/Makefile.in4
-rw-r--r--gnu/usr.bin/groff/addftinfo/addftinfo.man1
-rw-r--r--gnu/usr.bin/groff/grodvi/Makefile2
-rw-r--r--gnu/usr.bin/groff/groff/Makefile2
-rw-r--r--gnu/usr.bin/groff/groff/groff.man7
-rw-r--r--gnu/usr.bin/groff/grops/Makefile2
-rw-r--r--gnu/usr.bin/groff/grops/grops.man4
-rw-r--r--gnu/usr.bin/groff/grotty/Makefile2
-rw-r--r--gnu/usr.bin/groff/grotty/grotty.man27
-rw-r--r--gnu/usr.bin/groff/indxbib/Makefile4
-rw-r--r--gnu/usr.bin/groff/libgroff/cmap.cc6
-rw-r--r--gnu/usr.bin/groff/libgroff/cset.cc6
-rw-r--r--gnu/usr.bin/groff/lkbib/Makefile2
-rw-r--r--gnu/usr.bin/groff/lookbib/Makefile2
-rw-r--r--gnu/usr.bin/groff/mm/Makefile7
-rw-r--r--gnu/usr.bin/groff/nroff/Makefile4
-rw-r--r--gnu/usr.bin/groff/pic/Makefile2
-rw-r--r--gnu/usr.bin/groff/refer/Makefile2
-rw-r--r--gnu/usr.bin/groff/tbl/Makefile2
-rw-r--r--gnu/usr.bin/groff/tfmtodit/Makefile2
-rw-r--r--gnu/usr.bin/groff/tmac/Makefile14
-rw-r--r--gnu/usr.bin/groff/tmac/tmac.doc.old6
-rw-r--r--gnu/usr.bin/groff/troff/Makefile6
-rw-r--r--gnu/usr.bin/groff/xditview/Makefile7
-rw-r--r--gnu/usr.bin/gzip/Makefile14
-rw-r--r--gnu/usr.bin/gzip/gzip.13
-rw-r--r--gnu/usr.bin/ld/ld.c11
-rw-r--r--gnu/usr.bin/ld/rtld/Makefile4
-rw-r--r--gnu/usr.bin/ld/rtld/rtld.c36
-rw-r--r--gnu/usr.bin/man/Makefile2
-rw-r--r--gnu/usr.bin/man/apropos/Makefile45
-rw-r--r--gnu/usr.bin/man/apropos/apropos.man14
-rw-r--r--gnu/usr.bin/man/apropos/apropos.sh84
-rw-r--r--gnu/usr.bin/man/catman/catman.17
-rw-r--r--gnu/usr.bin/man/catman/catman.perl4
-rw-r--r--gnu/usr.bin/man/lib/config.h_dist2
-rw-r--r--gnu/usr.bin/man/makewhatis/Makefile9
-rw-r--r--gnu/usr.bin/man/makewhatis/makewhatis.171
-rw-r--r--gnu/usr.bin/man/makewhatis/makewhatis.perl77
-rw-r--r--gnu/usr.bin/man/man/Makefile2
-rw-r--r--gnu/usr.bin/man/man/man.man2
-rw-r--r--gnu/usr.bin/man/manpath/Makefile5
-rw-r--r--gnu/usr.bin/man/manpath/manpath.config2
-rw-r--r--gnu/usr.bin/mkisofs/ChangeLog37
-rw-r--r--gnu/usr.bin/mkisofs/Makefile.in4
-rw-r--r--gnu/usr.bin/mkisofs/README8
-rw-r--r--gnu/usr.bin/mkisofs/defaults.h16
-rw-r--r--gnu/usr.bin/mkisofs/diag/Makefile16
-rw-r--r--gnu/usr.bin/mkisofs/diag/isodump.c16
-rw-r--r--gnu/usr.bin/mkisofs/diag/isovfy.c13
-rw-r--r--gnu/usr.bin/mkisofs/exclude.c3
-rw-r--r--gnu/usr.bin/mkisofs/mkisofs.875
-rw-r--r--gnu/usr.bin/mkisofs/mkisofs.c189
-rw-r--r--gnu/usr.bin/mkisofs/mkisofs.h22
-rw-r--r--gnu/usr.bin/mkisofs/rock.c2
-rw-r--r--gnu/usr.bin/mkisofs/tree.c189
-rw-r--r--gnu/usr.bin/mkisofs/write.c17
-rw-r--r--gnu/usr.bin/patch/EXTERN.h5
-rw-r--r--gnu/usr.bin/patch/INTERN.h5
-rw-r--r--gnu/usr.bin/patch/common.h5
-rw-r--r--gnu/usr.bin/patch/inp.c5
-rw-r--r--gnu/usr.bin/patch/inp.h5
-rw-r--r--gnu/usr.bin/patch/patch.14
-rw-r--r--gnu/usr.bin/patch/patch.c5
-rw-r--r--gnu/usr.bin/patch/pch.c4
-rw-r--r--gnu/usr.bin/patch/pch.h5
-rw-r--r--gnu/usr.bin/patch/util.h5
-rw-r--r--gnu/usr.bin/patch/version.c5
-rw-r--r--gnu/usr.bin/patch/version.h5
-rw-r--r--gnu/usr.bin/perl/eg/ADB2
-rw-r--r--gnu/usr.bin/perl/eg/changes2
-rw-r--r--gnu/usr.bin/perl/eg/dus2
-rw-r--r--gnu/usr.bin/perl/eg/findcp2
-rw-r--r--gnu/usr.bin/perl/eg/findtar2
-rw-r--r--gnu/usr.bin/perl/eg/g/gcp2
-rw-r--r--gnu/usr.bin/perl/eg/g/gcp.man2
-rw-r--r--gnu/usr.bin/perl/eg/g/ged2
-rw-r--r--gnu/usr.bin/perl/eg/g/gsh2
-rw-r--r--gnu/usr.bin/perl/eg/g/gsh.man2
-rw-r--r--gnu/usr.bin/perl/eg/muck.man2
-rw-r--r--gnu/usr.bin/perl/eg/myrup2
-rw-r--r--gnu/usr.bin/perl/eg/nih2
-rw-r--r--gnu/usr.bin/perl/eg/relink5
-rw-r--r--gnu/usr.bin/perl/eg/rename5
-rw-r--r--gnu/usr.bin/perl/eg/rmfrom2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_df2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_last2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_messages2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_passwd2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_ps2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_sudo2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scan_suid2
-rw-r--r--gnu/usr.bin/perl/eg/scan/scanner2
-rw-r--r--gnu/usr.bin/perl/eg/shmkill2
-rw-r--r--gnu/usr.bin/perl/eg/van/empty2
-rw-r--r--gnu/usr.bin/perl/eg/van/unvanish2
-rw-r--r--gnu/usr.bin/perl/eg/van/vanexp2
-rw-r--r--gnu/usr.bin/perl/eg/van/vanish2
-rw-r--r--gnu/usr.bin/perl/emacs/perldb.pl5
-rw-r--r--gnu/usr.bin/perl/lib/Makefile8
-rw-r--r--gnu/usr.bin/perl/lib/importenv.pl2
-rw-r--r--gnu/usr.bin/perl/lib/stat.pl2
-rw-r--r--gnu/usr.bin/perl/lib/validate.pl2
-rw-r--r--gnu/usr.bin/perl/perl/crypt.c2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/base/cond.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/base/if.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/base/lex.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/base/pat.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/base/term.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/cmd/elsif.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/cmd/for.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/cmd/mod.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/cmd/switch.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/cmd/while.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/comp/cmdopt.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/comp/decl.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/comp/multiline.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/comp/script.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/comp/term.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/argv.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/dup.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/inplace.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/pipe.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/print.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/io/tell.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/append.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/array.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/auto.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/chop.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/cond.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/delete.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/do.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/each.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/exec.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/exp.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/flip.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/fork.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/glob.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/index.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/int.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/join.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/list.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/local.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/magic.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/mkdir.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/oct.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/ord.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/pack.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/push.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/range.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/read.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/repeat.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/s.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/sleep.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/split.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/sprintf.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/study.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/substr.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/time.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/undef.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/unshift.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/vec.t2
-rwxr-xr-xgnu/usr.bin/perl/perl/t/op/write.t2
-rw-r--r--gnu/usr.bin/perl/x2p/Makefile4
-rw-r--r--gnu/usr.bin/perl/x2p/a2p.17
-rw-r--r--gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh2
-rwxr-xr-xgnu/usr.bin/rcs/rcstest193
-rw-r--r--gnu/usr.bin/send-pr/Makefile12
-rw-r--r--gnu/usr.bin/send-pr/send-pr.19
-rw-r--r--gnu/usr.bin/sort/Makefile9
-rw-r--r--gnu/usr.bin/sort/error.c111
-rw-r--r--gnu/usr.bin/sort/getopt.c271
-rw-r--r--gnu/usr.bin/sort/getopt.h12
-rw-r--r--gnu/usr.bin/sort/getopt1.c11
-rw-r--r--gnu/usr.bin/sort/long-options.c20
-rw-r--r--gnu/usr.bin/sort/long-options.h11
-rw-r--r--gnu/usr.bin/sort/sort.14
-rw-r--r--gnu/usr.bin/sort/sort.c1003
-rw-r--r--gnu/usr.bin/sort/system.h127
-rw-r--r--gnu/usr.bin/sort/version.c12
-rw-r--r--gnu/usr.bin/tar/Makefile1
-rw-r--r--gnu/usr.bin/tar/getdate.y4
-rw-r--r--gnu/usr.bin/tar/tar.113
-rw-r--r--gnu/usr.bin/tar/tar.c7
-rw-r--r--gnu/usr.bin/texinfo/Makefile.inc2
-rw-r--r--gnu/usr.bin/texinfo/info-files/Makefile2
-rw-r--r--gnu/usr.bin/texinfo/info-files/dir4
-rw-r--r--gnu/usr.bin/texinfo/info/info.13
-rw-r--r--gnu/usr.bin/texinfo/misc/Makefile4
-rw-r--r--gnu/usr.sbin/Makefile2
-rw-r--r--include/Makefile12
-rw-r--r--include/arpa/nameser.h5
-rw-r--r--include/arpa/telnet.h2
-rw-r--r--include/ctype.h56
-rw-r--r--include/db.h6
-rw-r--r--include/link.h8
-rw-r--r--include/mpool.h110
-rw-r--r--include/ndbm.h2
-rw-r--r--include/netdb.h6
-rw-r--r--include/protocols/routed.h109
-rw-r--r--include/resolv.h7
-rw-r--r--include/rpc/auth.h14
-rw-r--r--include/rpc/auth_unix.h4
-rw-r--r--include/rpc/clnt.h8
-rw-r--r--include/rpc/pmap_clnt.h4
-rw-r--r--include/rpc/pmap_prot.h4
-rw-r--r--include/rpc/pmap_rmt.h4
-rw-r--r--include/rpc/rpc.h4
-rw-r--r--include/rpc/rpc_msg.h4
-rw-r--r--include/rpc/svc.h6
-rw-r--r--include/rpc/svc_auth.h4
-rw-r--r--include/rpc/types.h4
-rw-r--r--include/rpc/xdr.h10
-rw-r--r--include/rpcsvc/Makefile2
-rw-r--r--include/rpcsvc/bootparam_prot.x2
-rw-r--r--include/rpcsvc/yp.x97
-rw-r--r--include/rpcsvc/yp_prot.h8
-rw-r--r--include/runetype.h23
-rw-r--r--include/signal.h18
-rw-r--r--include/stddef.h10
-rw-r--r--include/stdio.h10
-rw-r--r--include/stdlib.h10
-rw-r--r--include/strhash.h2
-rw-r--r--include/time.h7
-rw-r--r--include/unistd.h2
-rw-r--r--include/vis.h10
-rw-r--r--lib/Makefile29
-rw-r--r--lib/csu/i386/Makefile28
-rw-r--r--lib/csu/i386/c++rt0.c6
-rw-r--r--lib/csu/i386/crt0.c203
-rw-r--r--lib/libF77/README12
-rw-r--r--lib/libF77/Version.c13
-rw-r--r--lib/libF77/libF77.xsum31
-rw-r--r--lib/libF77/main.c24
-rw-r--r--lib/libF77/makefile18
-rw-r--r--lib/libF77/pow_di.c7
-rw-r--r--lib/libF77/pow_hh.c6
-rw-r--r--lib/libF77/pow_ii.c6
-rw-r--r--lib/libF77/pow_qq.c6
-rw-r--r--lib/libF77/pow_ri.c7
-rw-r--r--lib/libF77/pow_zi.c7
-rw-r--r--lib/libF77/s_cat.c80
-rw-r--r--lib/libF77/s_copy.c50
-rw-r--r--lib/libF77/signal_.c8
-rw-r--r--lib/libF77/system_.c28
-rw-r--r--lib/libI77/Notice2
-rw-r--r--lib/libI77/README16
-rw-r--r--lib/libI77/Version.c26
-rw-r--r--lib/libI77/backspace.c20
-rw-r--r--lib/libI77/dfe.c3
-rw-r--r--lib/libI77/due.c4
-rw-r--r--lib/libI77/fmt.h14
-rw-r--r--lib/libI77/fmtlib.c47
-rw-r--r--lib/libI77/iio.c6
-rw-r--r--lib/libI77/libI77.xsum46
-rw-r--r--lib/libI77/lio.h1
-rw-r--r--lib/libI77/lread.c50
-rw-r--r--lib/libI77/lwrite.c68
-rw-r--r--lib/libI77/open.c2
-rw-r--r--lib/libI77/rdfmt.c2
-rw-r--r--lib/libI77/rsfe.c8
-rw-r--r--lib/libI77/rsne.c47
-rw-r--r--lib/libI77/sfe.c12
-rw-r--r--lib/libI77/sue.c12
-rw-r--r--lib/libI77/wref.c36
-rw-r--r--lib/libI77/wrtfmt.c16
-rw-r--r--lib/libI77/wsle.c6
-rw-r--r--lib/libI77/wsne.c2
-rw-r--r--lib/libI77/xwsne.c4
-rw-r--r--lib/libc/Makefile6
-rw-r--r--lib/libc/compat-43/gethostid.34
-rw-r--r--lib/libc/compat-43/sigvec.28
-rw-r--r--lib/libc/db/btree/Makefile.inc4
-rw-r--r--lib/libc/db/btree/bt_close.c82
-rw-r--r--lib/libc/db/btree/bt_conv.c36
-rw-r--r--lib/libc/db/btree/bt_debug.c44
-rw-r--r--lib/libc/db/btree/bt_delete.c665
-rw-r--r--lib/libc/db/btree/bt_get.c141
-rw-r--r--lib/libc/db/btree/bt_open.c76
-rw-r--r--lib/libc/db/btree/bt_overflow.c26
-rw-r--r--lib/libc/db/btree/bt_page.c21
-rw-r--r--lib/libc/db/btree/bt_put.c106
-rw-r--r--lib/libc/db/btree/bt_search.c130
-rw-r--r--lib/libc/db/btree/bt_seq.c380
-rw-r--r--lib/libc/db/btree/bt_split.c52
-rw-r--r--lib/libc/db/btree/bt_utils.c103
-rw-r--r--lib/libc/db/btree/btree.h262
-rw-r--r--lib/libc/db/btree/extern.h14
-rw-r--r--lib/libc/db/doc/hash.usenix.ps2
-rw-r--r--lib/libc/db/doc/libtp.usenix.ps2
-rw-r--r--lib/libc/db/hash/extern.h24
-rw-r--r--lib/libc/db/hash/hash.c77
-rw-r--r--lib/libc/db/hash/hash.h125
-rw-r--r--lib/libc/db/hash/hash_bigkey.c76
-rw-r--r--lib/libc/db/hash/hash_buf.c28
-rw-r--r--lib/libc/db/hash/hash_log2.c12
-rw-r--r--lib/libc/db/hash/hash_page.c170
-rw-r--r--lib/libc/db/hash/hsearch.c4
-rw-r--r--lib/libc/db/hash/ndbm.c10
-rw-r--r--lib/libc/db/hash/page.h16
-rw-r--r--lib/libc/db/man/btree.311
-rw-r--r--lib/libc/db/man/hash.319
-rw-r--r--lib/libc/db/man/recno.326
-rw-r--r--lib/libc/db/mpool/mpool.c433
-rw-r--r--lib/libc/db/recno/extern.h4
-rw-r--r--lib/libc/db/recno/rec_close.c59
-rw-r--r--lib/libc/db/recno/rec_delete.c20
-rw-r--r--lib/libc/db/recno/rec_get.c103
-rw-r--r--lib/libc/db/recno/rec_open.c43
-rw-r--r--lib/libc/db/recno/rec_put.c57
-rw-r--r--lib/libc/db/recno/rec_search.c7
-rw-r--r--lib/libc/db/recno/rec_seq.c24
-rw-r--r--lib/libc/db/recno/rec_utils.c76
-rw-r--r--lib/libc/db/test/Makefile24
-rw-r--r--lib/libc/db/test/README41
-rw-r--r--lib/libc/db/test/dbtest.c213
-rw-r--r--lib/libc/db/test/run.test38
-rw-r--r--lib/libc/gen/Makefile.inc19
-rw-r--r--lib/libc/gen/assert.c1
-rw-r--r--lib/libc/gen/confstr.c1
-rw-r--r--lib/libc/gen/crypt.c19
-rw-r--r--lib/libc/gen/daemon.31
-rw-r--r--lib/libc/gen/disklabel.c24
-rw-r--r--lib/libc/gen/exec.32
-rw-r--r--lib/libc/gen/fstab.c17
-rw-r--r--lib/libc/gen/getbsize.32
-rw-r--r--lib/libc/gen/getcap.32
-rw-r--r--lib/libc/gen/getcap.c3
-rw-r--r--lib/libc/gen/getcwd.33
-rw-r--r--lib/libc/gen/getfsent.32
-rw-r--r--lib/libc/gen/getgrent.32
-rw-r--r--lib/libc/gen/getgrent.c6
-rw-r--r--lib/libc/gen/getgrouplist.c1
-rw-r--r--lib/libc/gen/getpagesize.c20
-rw-r--r--lib/libc/gen/getpass.32
-rw-r--r--lib/libc/gen/getpass.c72
-rw-r--r--lib/libc/gen/initgroups.c1
-rw-r--r--lib/libc/gen/isatty.c17
-rw-r--r--lib/libc/gen/ldexp.32
-rw-r--r--lib/libc/gen/nlist.c2
-rw-r--r--lib/libc/gen/opendir.c25
-rw-r--r--lib/libc/gen/psignal.32
-rw-r--r--lib/libc/gen/psignal.c2
-rw-r--r--lib/libc/gen/pwcache.34
-rw-r--r--lib/libc/gen/pwcache.c35
-rw-r--r--lib/libc/gen/setmode.c6
-rw-r--r--lib/libc/gen/sleep.c22
-rw-r--r--lib/libc/gen/sysconf.c2
-rw-r--r--lib/libc/gen/sysctl.38
-rw-r--r--lib/libc/gen/sysctl.c1
-rw-r--r--lib/libc/gen/syslog.310
-rw-r--r--lib/libc/gen/syslog.c80
-rw-r--r--lib/libc/gen/termios.c13
-rw-r--r--lib/libc/gen/ttyname.c111
-rw-r--r--lib/libc/gen/unvis.c1
-rw-r--r--lib/libc/gen/usleep.c21
-rw-r--r--lib/libc/gen/vis.c3
-rw-r--r--lib/libc/gmon/Makefile.inc1
-rw-r--r--lib/libc/i386/DEFS.h36
-rw-r--r--lib/libc/i386/SYS.h24
-rw-r--r--lib/libc/i386/gen/Makefile.inc1
-rw-r--r--lib/libc/i386/gen/_setjmp.S8
-rw-r--r--lib/libc/i386/gen/modf.S8
-rw-r--r--lib/libc/i386/gen/setjmp.S24
-rw-r--r--lib/libc/i386/gen/sigsetjmp.S36
-rw-r--r--lib/libc/i386/string/bcopy.S10
-rw-r--r--lib/libc/i386/string/memmove.S10
-rw-r--r--lib/libc/i386/sys/Ovfork.S38
-rw-r--r--lib/libc/i386/sys/brk.S29
-rw-r--r--lib/libc/i386/sys/cerror.S39
-rw-r--r--lib/libc/i386/sys/exect.S5
-rw-r--r--lib/libc/i386/sys/fork.S4
-rw-r--r--lib/libc/i386/sys/pipe.S4
-rw-r--r--lib/libc/i386/sys/ptrace.S9
-rw-r--r--lib/libc/i386/sys/sbrk.S45
-rw-r--r--lib/libc/i386/sys/setlogin.S6
-rw-r--r--lib/libc/i386/sys/sigpending.S4
-rw-r--r--lib/libc/i386/sys/sigprocmask.S11
-rw-r--r--lib/libc/i386/sys/sigreturn.S13
-rw-r--r--lib/libc/i386/sys/sigsuspend.S11
-rw-r--r--lib/libc/i386/sys/syscall.S5
-rw-r--r--lib/libc/locale/Makefile.inc10
-rw-r--r--lib/libc/locale/ansi.c7
-rw-r--r--lib/libc/locale/collate.c20
-rw-r--r--lib/libc/locale/euc.42
-rw-r--r--lib/libc/locale/euc.c2
-rw-r--r--lib/libc/locale/isupper.32
-rw-r--r--lib/libc/locale/none.c2
-rw-r--r--lib/libc/locale/rune.c166
-rw-r--r--lib/libc/locale/runetype.c46
-rw-r--r--lib/libc/locale/setlocale.c93
-rw-r--r--lib/libc/locale/table.c34
-rw-r--r--lib/libc/locale/tolower.c49
-rw-r--r--lib/libc/locale/toupper.c48
-rw-r--r--lib/libc/locale/utf2.42
-rw-r--r--lib/libc/locale/utf2.c2
-rw-r--r--lib/libc/net/Makefile.inc16
-rw-r--r--lib/libc/net/ether_addr.c2
-rw-r--r--lib/libc/net/ethers.34
-rw-r--r--lib/libc/net/gethostbydns.c153
-rw-r--r--lib/libc/net/gethostbyht.c49
-rw-r--r--lib/libc/net/gethostbynis.c19
-rw-r--r--lib/libc/net/getnetbydns.c160
-rw-r--r--lib/libc/net/getnetbyht.c20
-rw-r--r--lib/libc/net/getnetbynis.c51
-rw-r--r--lib/libc/net/getservent.c67
-rw-r--r--lib/libc/net/herror.c2
-rw-r--r--lib/libc/net/inet_addr.c78
-rw-r--r--lib/libc/net/inet_network.c4
-rw-r--r--lib/libc/net/linkaddr.36
-rw-r--r--lib/libc/net/rcmd.32
-rw-r--r--lib/libc/net/res_comp.c27
-rw-r--r--lib/libc/net/res_config.h3
-rw-r--r--lib/libc/net/res_debug.c102
-rw-r--r--lib/libc/net/res_init.c36
-rw-r--r--lib/libc/net/res_mkquery.c22
-rw-r--r--lib/libc/net/res_query.c32
-rw-r--r--lib/libc/net/res_send.c116
-rw-r--r--lib/libc/nls/catgets.33
-rw-r--r--lib/libc/nls/msgcat.c6
-rw-r--r--lib/libc/quad/Makefile.inc11
-rw-r--r--lib/libc/quad/quad.h7
-rw-r--r--lib/libc/regex/engine.c1
-rw-r--r--lib/libc/regex/regcomp.c10
-rw-r--r--lib/libc/regex/regerror.c2
-rw-r--r--lib/libc/rpc/Makefile.inc1
-rw-r--r--lib/libc/rpc/auth_none.c1
-rw-r--r--lib/libc/rpc/auth_unix.c8
-rw-r--r--lib/libc/rpc/bindresvport.32
-rw-r--r--lib/libc/rpc/bindresvport.c2
-rw-r--r--lib/libc/rpc/clnt_generic.c1
-rw-r--r--lib/libc/rpc/clnt_perror.c7
-rw-r--r--lib/libc/rpc/clnt_raw.c3
-rw-r--r--lib/libc/rpc/clnt_simple.c1
-rw-r--r--lib/libc/rpc/clnt_tcp.c9
-rw-r--r--lib/libc/rpc/clnt_udp.c7
-rw-r--r--lib/libc/rpc/get_myaddress.c1
-rw-r--r--lib/libc/rpc/getrpcent.32
-rw-r--r--lib/libc/rpc/getrpcent.c5
-rw-r--r--lib/libc/rpc/getrpcport.c1
-rw-r--r--lib/libc/rpc/pmap_clnt.c1
-rw-r--r--lib/libc/rpc/pmap_getmaps.c1
-rw-r--r--lib/libc/rpc/pmap_getport.c1
-rw-r--r--lib/libc/rpc/pmap_rmt.c20
-rw-r--r--lib/libc/rpc/rpc.310
-rw-r--r--lib/libc/rpc/rpc.52
-rw-r--r--lib/libc/rpc/rpc_callmsg.c3
-rw-r--r--lib/libc/rpc/rstat.18
-rw-r--r--lib/libc/rpc/rstat_svc.86
-rw-r--r--lib/libc/rpc/svc.c2
-rw-r--r--lib/libc/rpc/svc_auth_unix.c1
-rw-r--r--lib/libc/rpc/svc_raw.c2
-rw-r--r--lib/libc/rpc/svc_simple.c2
-rw-r--r--lib/libc/rpc/svc_tcp.c9
-rw-r--r--lib/libc/rpc/svc_udp.c2
-rw-r--r--lib/libc/stdio/Makefile.inc13
-rw-r--r--lib/libc/stdio/clrerr.c10
-rw-r--r--lib/libc/stdio/fclose.c12
-rw-r--r--lib/libc/stdio/fflush.c19
-rw-r--r--lib/libc/stdio/fgetc.c15
-rw-r--r--lib/libc/stdio/fgetpos.c15
-rw-r--r--lib/libc/stdio/fgets.c24
-rw-r--r--lib/libc/stdio/findfp.c4
-rw-r--r--lib/libc/stdio/fpurge.c28
-rw-r--r--lib/libc/stdio/fputc.c15
-rw-r--r--lib/libc/stdio/fputs.c15
-rw-r--r--lib/libc/stdio/fread.34
-rw-r--r--lib/libc/stdio/fread.c11
-rw-r--r--lib/libc/stdio/fscanf.c12
-rw-r--r--lib/libc/stdio/fseek.c28
-rw-r--r--lib/libc/stdio/ftell.c18
-rw-r--r--lib/libc/stdio/fwrite.c16
-rw-r--r--lib/libc/stdio/getc.c15
-rw-r--r--lib/libc/stdio/getchar.c15
-rw-r--r--lib/libc/stdio/gets.c5
-rw-r--r--lib/libc/stdio/mktemp.c1
-rw-r--r--lib/libc/stdio/printf.380
-rw-r--r--lib/libc/stdio/putc.c15
-rw-r--r--lib/libc/stdio/putchar.c15
-rw-r--r--lib/libc/stdio/puts.c15
-rw-r--r--lib/libc/stdio/putw.c15
-rw-r--r--lib/libc/stdio/rewind.c10
-rw-r--r--lib/libc/stdio/scanf.c12
-rw-r--r--lib/libc/stdio/setvbuf.c14
-rw-r--r--lib/libc/stdio/snprintf.c3
-rw-r--r--lib/libc/stdio/sprintf.c3
-rw-r--r--lib/libc/stdio/sscanf.c3
-rw-r--r--lib/libc/stdio/stdio.36
-rw-r--r--lib/libc/stdio/ungetc.c37
-rw-r--r--lib/libc/stdio/vfprintf.c40
-rw-r--r--lib/libc/stdio/vscanf.c15
-rw-r--r--lib/libc/stdio/vsnprintf.c2
-rw-r--r--lib/libc/stdio/vsprintf.c2
-rw-r--r--lib/libc/stdio/vsscanf.c3
-rw-r--r--lib/libc/stdlib/Makefile.inc5
-rw-r--r--lib/libc/stdlib/abort.c15
-rw-r--r--lib/libc/stdlib/getenv.c44
-rw-r--r--lib/libc/stdlib/heapsort.c3
-rw-r--r--lib/libc/stdlib/ldiv.32
-rw-r--r--lib/libc/stdlib/qsort.c12
-rw-r--r--lib/libc/stdlib/strhash.c2
-rw-r--r--lib/libc/stdtime/Makefile.inc1
-rw-r--r--lib/libc/stdtime/asctime.c1
-rw-r--r--lib/libc/stdtime/localtime.c130
-rw-r--r--lib/libc/stdtime/strftime.c28
-rw-r--r--lib/libc/stdtime/tzfile.56
-rw-r--r--lib/libc/string/Makefile.inc23
-rw-r--r--lib/libc/sys/Makefile.inc19
-rw-r--r--lib/libc/sys/_exit.22
-rw-r--r--lib/libc/sys/accept.225
-rw-r--r--lib/libc/sys/bind.222
-rw-r--r--lib/libc/sys/brk.28
-rw-r--r--lib/libc/sys/chown.23
-rw-r--r--lib/libc/sys/close.224
-rw-r--r--lib/libc/sys/connect.228
-rw-r--r--lib/libc/sys/dup.247
-rw-r--r--lib/libc/sys/execve.222
-rw-r--r--lib/libc/sys/flock.222
-rw-r--r--lib/libc/sys/fork.24
-rw-r--r--lib/libc/sys/fsync.226
-rw-r--r--lib/libc/sys/ftruncate.c16
-rw-r--r--lib/libc/sys/getdirentries.228
-rw-r--r--lib/libc/sys/getfh.22
-rw-r--r--lib/libc/sys/getgid.22
-rw-r--r--lib/libc/sys/getlogin.247
-rw-r--r--lib/libc/sys/getpeername.222
-rw-r--r--lib/libc/sys/getpid.22
-rw-r--r--lib/libc/sys/getrlimit.214
-rw-r--r--lib/libc/sys/getsockname.222
-rw-r--r--lib/libc/sys/getsockopt.270
-rw-r--r--lib/libc/sys/intro.279
-rw-r--r--lib/libc/sys/ioctl.222
-rw-r--r--lib/libc/sys/ktrace.24
-rw-r--r--lib/libc/sys/link.211
-rw-r--r--lib/libc/sys/listen.254
-rw-r--r--lib/libc/sys/lseek.c17
-rw-r--r--lib/libc/sys/madvise.211
-rw-r--r--lib/libc/sys/mincore.24
-rw-r--r--lib/libc/sys/mmap.224
-rw-r--r--lib/libc/sys/mprotect.24
-rw-r--r--lib/libc/sys/msync.24
-rw-r--r--lib/libc/sys/munmap.26
-rw-r--r--lib/libc/sys/open.222
-rw-r--r--lib/libc/sys/pipe.218
-rw-r--r--lib/libc/sys/ptrace.291
-rw-r--r--lib/libc/sys/quotactl.22
-rw-r--r--lib/libc/sys/read.247
-rw-r--r--lib/libc/sys/reboot.21
-rw-r--r--lib/libc/sys/rtprio.28
-rw-r--r--lib/libc/sys/setsid.22
-rw-r--r--lib/libc/sys/sigaction.228
-rw-r--r--lib/libc/sys/sigaltstack.26
-rw-r--r--lib/libc/sys/stat.22
-rw-r--r--lib/libc/sys/sync.26
-rw-r--r--lib/libc/sys/unlink.211
-rw-r--r--lib/libc/sys/utimes.22
-rw-r--r--lib/libc/sys/vfork.228
-rw-r--r--lib/libc/sys/wait.29
-rw-r--r--lib/libc/sys/write.247
-rw-r--r--lib/libc/xdr/xdr.34
-rw-r--r--lib/libc/xdr/xdr.c1
-rw-r--r--lib/libc/xdr/xdr_array.c1
-rw-r--r--lib/libc/xdr/xdr_mem.c2
-rw-r--r--lib/libc/xdr/xdr_rec.c1
-rw-r--r--lib/libc/xdr/xdr_reference.c2
-rw-r--r--lib/libcom_err/Makefile2
-rw-r--r--lib/libcom_err/com_err.32
-rw-r--r--lib/libcom_err/doc/com_err.texinfo6
-rw-r--r--lib/libcom_err/error_message.c6
-rw-r--r--lib/libcom_err/et_name.c2
-rw-r--r--lib/libcom_err/init_et.c6
-rw-r--r--lib/libcrypt/crypt.c4
-rw-r--r--lib/libcurses/Makefile2
-rw-r--r--lib/libdisk/Makefile4
-rw-r--r--lib/libedit/term.c6
-rw-r--r--lib/libedit/termcap.h52
-rw-r--r--lib/libf2c/Makefile2
-rw-r--r--lib/libforms/Makefile2
-rw-r--r--lib/libforms/bindings.c12
-rw-r--r--lib/libforms/examples/Makefile2
-rw-r--r--lib/libforms/objects.c18
-rw-r--r--lib/libkvm/kvm_proc.c19
-rw-r--r--lib/libncurses/TESTS/newdemo.c2
-rw-r--r--lib/libpcap/bpf_filter.c4
-rw-r--r--lib/libpcap/bpf_image.c2
-rw-r--r--lib/libpcap/etherent.c2
-rw-r--r--lib/libpcap/ethertype.h2
-rw-r--r--lib/libpcap/gencode.c2
-rw-r--r--lib/libpcap/gencode.h2
-rw-r--r--lib/libpcap/grammar.y2
-rw-r--r--lib/libpcap/inet.c2
-rw-r--r--lib/libpcap/nametoaddr.c2
-rw-r--r--lib/libpcap/optimize.c2
-rw-r--r--lib/libpcap/pcap-bpf.c2
-rw-r--r--lib/libpcap/pcap-dlpi.c2
-rw-r--r--lib/libpcap/pcap-int.h2
-rw-r--r--lib/libpcap/pcap-namedb.h2
-rw-r--r--lib/libpcap/pcap-nit.c2
-rw-r--r--lib/libpcap/pcap-nit.h2
-rw-r--r--lib/libpcap/pcap-pf.c2
-rw-r--r--lib/libpcap/pcap-pf.h2
-rw-r--r--lib/libpcap/pcap-snit.c2
-rw-r--r--lib/libpcap/pcap-snoop.c2
-rw-r--r--lib/libpcap/pcap.c2
-rw-r--r--lib/libpcap/pcap.h2
-rw-r--r--lib/libpcap/savefile.c2
-rw-r--r--lib/libpcap/scanner.l2
-rw-r--r--lib/libutil/setproctitle.c27
-rw-r--r--lib/msun/i387/e_exp.S1
-rw-r--r--libexec/bootpd/bootpd.82
-rw-r--r--libexec/bootpd/bootptab.52
-rw-r--r--sbin/slattach/Makefile2
-rw-r--r--sbin/slattach/slattach.82
-rw-r--r--share/doc/iso/ucb/program.nr4
-rw-r--r--share/doc/iso/wisc/appendix_a.nr2
-rw-r--r--share/doc/iso/wisc/appendix_b.nr2
-rw-r--r--share/doc/iso/wisc/debug.nr4
-rw-r--r--share/doc/iso/wisc/errors.nr4
-rw-r--r--share/doc/iso/wisc/parts.nr4
-rw-r--r--share/doc/iso/wisc/program.nr4
-rw-r--r--share/doc/iso/wiscman/cons.44
-rw-r--r--share/doc/iso/wiscman/if.4n4
-rw-r--r--share/doc/iso/wiscman/rvd.4p4
-rw-r--r--share/man/man4/snp.44
-rw-r--r--share/mk/Makefile2
-rw-r--r--share/mk/bsd.README46
-rw-r--r--share/mk/bsd.dep.mk73
-rw-r--r--share/mk/bsd.doc.mk18
-rw-r--r--share/mk/bsd.info.mk4
-rw-r--r--share/mk/bsd.kmod.mk153
-rw-r--r--share/mk/bsd.lib.mk89
-rw-r--r--share/mk/bsd.man.mk180
-rw-r--r--share/mk/bsd.own.mk170
-rw-r--r--share/mk/bsd.port.mk374
-rw-r--r--share/mk/bsd.port.subdir.mk99
-rw-r--r--share/mk/bsd.prog.mk33
-rw-r--r--share/mk/bsd.sgml.mk4
-rw-r--r--share/mk/bsd.subdir.mk53
-rw-r--r--share/mk/sys.mk31
-rw-r--r--sys/i386/boot/biosboot/boot.c2
-rw-r--r--sys/i386/i386/autoconf.c20
-rw-r--r--sys/i386/include/ansi.h22
-rw-r--r--sys/i386/isa/mse.c4
-rw-r--r--sys/i386/isa/qcam.c4
-rw-r--r--sys/i386/scsi/aic7xxx.c2
-rw-r--r--sys/kern/kern_lkm.c19
-rw-r--r--sys/kern/kern_prot.c2
-rw-r--r--sys/kern/uipc_socket.c11
-rw-r--r--sys/kern/uipc_socket2.c3
-rw-r--r--sys/miscfs/devfs/devfs_back.c2
-rw-r--r--sys/miscfs/devfs/devfs_front.c2
-rw-r--r--sys/miscfs/devfs/devfs_vfsops.c2
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c2
-rw-r--r--sys/miscfs/devfs/devfsdefs.h2
-rw-r--r--sys/miscfs/procfs/procfs_status.c16
-rw-r--r--sys/net/if_ethersubr.c2
-rw-r--r--sys/net/if_fddisubr.c1
-rw-r--r--sys/netinet/ip_fw.h2
-rw-r--r--sys/netiso/argo_debug.h6
-rw-r--r--sys/netiso/clnp.h6
-rw-r--r--sys/netiso/clnp_debug.c6
-rw-r--r--sys/netiso/clnp_er.c6
-rw-r--r--sys/netiso/clnp_frag.c6
-rw-r--r--sys/netiso/clnp_input.c6
-rw-r--r--sys/netiso/clnp_options.c6
-rw-r--r--sys/netiso/clnp_output.c6
-rw-r--r--sys/netiso/clnp_raw.c6
-rw-r--r--sys/netiso/clnp_stat.h6
-rw-r--r--sys/netiso/clnp_subr.c6
-rw-r--r--sys/netiso/clnp_timer.c6
-rw-r--r--sys/netiso/cons.h6
-rw-r--r--sys/netiso/cons_pcb.h6
-rw-r--r--sys/netiso/esis.h6
-rw-r--r--sys/netiso/if_cons.c6
-rw-r--r--sys/netiso/if_eon.c6
-rw-r--r--sys/netiso/iso.c6
-rw-r--r--sys/netiso/iso.h6
-rw-r--r--sys/netiso/iso_chksum.c6
-rw-r--r--sys/netiso/iso_pcb.c6
-rw-r--r--sys/netiso/iso_pcb.h6
-rw-r--r--sys/netiso/iso_proto.c6
-rw-r--r--sys/netiso/iso_snpac.c6
-rw-r--r--sys/netiso/iso_var.h6
-rw-r--r--sys/netiso/tp.trans2
-rw-r--r--sys/netiso/tp_clnp.h6
-rw-r--r--sys/netiso/tp_cons.c6
-rw-r--r--sys/netiso/tp_emit.c6
-rw-r--r--sys/netiso/tp_inet.c6
-rw-r--r--sys/netiso/tp_input.c6
-rw-r--r--sys/netiso/tp_ip.h6
-rw-r--r--sys/netiso/tp_iso.c6
-rw-r--r--sys/netiso/tp_meas.c6
-rw-r--r--sys/netiso/tp_output.c6
-rw-r--r--sys/netiso/tp_param.h6
-rw-r--r--sys/netiso/tp_pcb.c6
-rw-r--r--sys/netiso/tp_pcb.h6
-rw-r--r--sys/netiso/tp_seq.h6
-rw-r--r--sys/netiso/tp_stat.h6
-rw-r--r--sys/netiso/tp_states.init4
-rw-r--r--sys/netiso/tp_subr.c6
-rw-r--r--sys/netiso/tp_subr2.c6
-rw-r--r--sys/netiso/tp_timer.c6
-rw-r--r--sys/netiso/tp_timer.h6
-rw-r--r--sys/netiso/tp_tpdu.h6
-rw-r--r--sys/netiso/tp_trace.c6
-rw-r--r--sys/netiso/tp_trace.h6
-rw-r--r--sys/netiso/tp_user.h6
-rw-r--r--sys/netiso/tp_usrreq.c6
-rw-r--r--sys/netiso/xebec/debug.h4
-rw-r--r--sys/netiso/xebec/llparse.c4
-rw-r--r--sys/netiso/xebec/llparse.h4
-rw-r--r--sys/netiso/xebec/llscan.c4
-rw-r--r--sys/netiso/xebec/main.c4
-rw-r--r--sys/netiso/xebec/main.h4
-rw-r--r--sys/netiso/xebec/malloc.c4
-rw-r--r--sys/netiso/xebec/malloc.h4
-rw-r--r--sys/netiso/xebec/procs.c4
-rw-r--r--sys/netiso/xebec/procs.h4
-rw-r--r--sys/netiso/xebec/putdriver.c4
-rw-r--r--sys/netiso/xebec/sets.c4
-rw-r--r--sys/netiso/xebec/sets.h4
-rw-r--r--sys/netiso/xebec/test.trans2
-rw-r--r--sys/netiso/xebec/xebec.c4
-rw-r--r--sys/netiso/xebec/xebec.h4
-rw-r--r--sys/pci/if_fxp.c1
-rw-r--r--sys/sys/ipc.h18
-rw-r--r--sys/sys/link_aout.h8
-rw-r--r--sys/sys/link_elf.h8
-rw-r--r--sys/sys/sysctl.h14
-rw-r--r--sys/sys/types.h48
-rw-r--r--usr.bin/compile_et/compile_et.12
-rw-r--r--usr.bin/compile_et/compile_et.c2
-rw-r--r--usr.bin/compile_et/error_table.y2
-rw-r--r--usr.bin/compile_et/et_lex.lex.l2
-rw-r--r--usr.bin/compress/doc/revision.log9
-rw-r--r--usr.bin/ee/doc/new_curse.c4
-rw-r--r--usr.bin/ee/ee.c4
-rw-r--r--usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg2
-rw-r--r--usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg2
-rw-r--r--usr.bin/getopt/Makefile2
-rw-r--r--usr.bin/ipcs/ipcs.c8
-rw-r--r--usr.bin/lex/FlexLexer.h2
-rw-r--r--usr.bin/lex/ccl.c2
-rw-r--r--usr.bin/lex/dfa.c2
-rw-r--r--usr.bin/lex/ecs.c2
-rw-r--r--usr.bin/lex/flex.skl2
-rw-r--r--usr.bin/lex/flexdef.h2
-rw-r--r--usr.bin/lex/gen.c2
-rw-r--r--usr.bin/lex/initscan.c4
-rw-r--r--usr.bin/lex/lib/libmain.c2
-rw-r--r--usr.bin/lex/lib/libyywrap.c2
-rw-r--r--usr.bin/lex/main.c2
-rw-r--r--usr.bin/lex/misc.c2
-rw-r--r--usr.bin/lex/nfa.c2
-rw-r--r--usr.bin/lex/parse.y2
-rw-r--r--usr.bin/lex/scan.l2
-rw-r--r--usr.bin/lex/skel.c2
-rw-r--r--usr.bin/lex/sym.c2
-rw-r--r--usr.bin/lex/tblcmp.c2
-rw-r--r--usr.bin/lex/yylex.c2
-rw-r--r--usr.bin/modstat/Makefile2
-rw-r--r--usr.bin/netstat/iso.c4
-rw-r--r--usr.bin/rlogin/krcmd.c2
-rw-r--r--usr.bin/symorder/symorder.111
-rw-r--r--usr.bin/symorder/symorder.c52
-rw-r--r--usr.bin/w/w.c7
-rw-r--r--usr.sbin/ncrcontrol/ncrcontrol.c7
-rw-r--r--usr.sbin/pcvt/kbdio/kbdio.y7
-rw-r--r--usr.sbin/pcvt/kbdio/lex.l7
-rw-r--r--usr.sbin/pcvt/set2061/compiler.h2
-rw-r--r--usr.sbin/pcvt/vgaio/lex.l6
-rw-r--r--usr.sbin/pcvt/vgaio/vgaio.82
-rw-r--r--usr.sbin/pcvt/vgaio/vgaio.y6
-rw-r--r--usr.sbin/ppp/slcompress.h4
-rw-r--r--usr.sbin/rarpd/rarpd.82
-rw-r--r--usr.sbin/rarpd/rarpd.c2
-rw-r--r--usr.sbin/sendmail/cf/README2
-rwxr-xr-xusr.sbin/sendmail/contrib/expn.pl2
-rw-r--r--usr.sbin/slstat/slstat.c7
-rw-r--r--usr.sbin/tcpdump/tcpdump/addrtoname.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/addrtoname.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/appletalk.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/bootp.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/bpf_dump.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/decnet.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/ethertype.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/extract.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/fddi.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/interface.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/ipx.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/llc.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/md.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/nfsfh.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/ntp.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/os.h2
-rw-r--r--usr.sbin/tcpdump/tcpdump/parsenfsfh.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-arp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-atalk.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-bootp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-decnet.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-domain.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-egp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-ether.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-fddi.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-icmp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-ipx.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-isoclns.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-llc.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-nfs.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-ntp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-null.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-ospf.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-ppp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-rip.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-sl.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-sunrpc.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-tcp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-tftp.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/print-wb.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/tcpdump.c2
-rw-r--r--usr.sbin/tcpdump/tcpdump/util.c2
-rw-r--r--usr.sbin/tcpdump/tcpslice/gwtm2secs.c2
-rw-r--r--usr.sbin/tcpdump/tcpslice/search.c2
-rw-r--r--usr.sbin/tcpdump/tcpslice/tcpslice.12
-rw-r--r--usr.sbin/tcpdump/tcpslice/tcpslice.c2
-rw-r--r--usr.sbin/tcpdump/tcpslice/util.c2
-rw-r--r--usr.sbin/xntpd/kernel/chuinit.c2
-rw-r--r--usr.sbin/xntpd/kernel/clkinit.c2
-rw-r--r--usr.sbin/xntpd/parse/clk_trimtaip.c7
-rw-r--r--usr.sbin/xntpd/parse/clk_trimtsip.c5
1012 files changed, 6760 insertions, 11865 deletions
diff --git a/Makefile b/Makefile
index 84035bfea92e..b0357bde4fe1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,13 @@
-#
-# $Id: Makefile,v 1.79 1996/05/04 07:12:07 markm Exp $
+# $Id: Makefile,v 1.57.4.12 1996/05/21 15:44:17 jkh Exp $
#
# Make command line options:
-# -DCLOBBER will remove /usr/include
+# -DCLOBBER will remove /usr/include and MOST of /usr/lib
# -DMAKE_LOCAL to add ./local to the SUBDIR list
# -DMAKE_PORTS to add ./ports to the SUBDIR list
# -DMAKE_EBONES to build eBones (KerberosIV)
#
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
-# -DNOCLEAN do not clean at all
+# -DNOCLEAN to not clean anything at all
# -DNOCRYPT will prevent building of crypt versions
# -DNOLKM do not build loadable kernel modules
# -DNOOBJDIR do not run ``${MAKE} obj''
@@ -100,32 +99,15 @@ CLEANDIR= cleandir
.endif
.endif
-MK_FLAGS= -DNOMAN -DNOPROFILE
-
-world: hierarchy mk $(WORLD_CLEANDIST) bootstrap include-tools includes lib-tools libraries build-tools
+world: hierarchy mk $(WORLD_CLEANDIST) include-tools includes lib-tools libraries build-tools
@echo "--------------------------------------------------------------"
@echo " Rebuilding ${DESTDIR} The whole thing"
@echo "--------------------------------------------------------------"
@echo
${MAKE} depend all install
cd ${.CURDIR}/share/man && ${MAKE} makedb
- @[ -f /etc/Makefile ] && ${MAKE} -f /etc/Makefile world
@echo "make world completed on `date`"
-bootstrap:
- cd ${.CURDIR}/usr.bin/xlint && ${MAKE} ${MK_FLAGS} lint1 lint2 xlint
- cd ${.CURDIR}/usr.bin/xlint/lint1 && ${MAKE} ${MK_FLAGS} install
- cd ${.CURDIR}/usr.bin/xlint/lint2 && ${MAKE} ${MK_FLAGS} install
- cd ${.CURDIR}/usr.bin/xlint/xlint && ${MAKE} ${MK_FLAGS} install
-
-reinstall: hierarchy mk includes
- @echo "--------------------------------------------------------------"
- @echo " Reinstall ${DESTDIR} The whole thing"
- @echo "--------------------------------------------------------------"
- @echo
- ${MAKE} install
- cd ${.CURDIR}/share/man && ${MAKE} makedb
-
hierarchy:
@echo "--------------------------------------------------------------"
@echo " Making hierarchy"
@@ -268,95 +250,97 @@ lib-tools:
@echo "--------------------------------------------------------------"
@echo
cd ${.CURDIR}/usr.bin/xinstall && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/gnu/usr.bin/ld && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/ar && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/ranlib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/nm && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/lex/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/compile_et && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR} && \
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \
rm -f /usr/sbin/compile_et
cd ${.CURDIR}/usr.bin/mk_cmds && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
libraries:
@echo "--------------------------------------------------------------"
@echo " Rebuilding ${DESTDIR}/usr/lib"
@echo "--------------------------------------------------------------"
@echo
+.if defined(CLOBBER)
+ find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
+ xargs rm -rf
+.endif
.if exists(lib/libcompat)
cd ${.CURDIR}/lib/libcompat && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install
.endif
.if exists(lib/libncurses)
cd ${.CURDIR}/lib/libncurses && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install
.endif
.if exists(lib/libtermcap)
cd ${.CURDIR}/lib/libtermcap && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install
.endif
.if exists(gnu)
cd ${.CURDIR}/gnu/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
cd ${.CURDIR}/secure/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(lib)
cd ${.CURDIR}/lib/csu/i386 && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.endif
-.if exists(usr.sbin/lex/lib)
cd ${.CURDIR}/usr.bin/lex/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
-.endif
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
+ cd ${.CURDIR}/eBones/des && \
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/eBones/lib && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(usr.sbin/pcvt/keycap)
cd ${.CURDIR}/usr.sbin/pcvt/keycap && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.endif
include-tools:
@echo "--------------------------------------------------------------"
- @echo " Rebuild tools necessary to build the include files"
+ @echo " Rebuilding tools needed to build the includes"
@echo "--------------------------------------------------------------"
@echo
cd ${.CURDIR}/usr.bin/xinstall && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
- cd ${.CURDIR}/usr.bin/rpcgen && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
build-tools:
@echo "--------------------------------------------------------------"
- @echo " Rebuilding ${DESTDIR} C compiler, make, symorder, sgmlfmt and zic(8)"
+ @echo " Rebuilding ${DESTDIR} C compiler, make, sgmlfmt, and zic(8)"
@echo "--------------------------------------------------------------"
@echo
cd ${.CURDIR}/gnu/usr.bin/cc && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/make && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
- cd ${.CURDIR}/usr.bin/symorder && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/sgmlfmt && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/share/sgml && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
+ cd ${.CURDIR}/gnu/usr.bin/groff && \
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.sbin/zic && \
- ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
+ ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
.include <bsd.subdir.mk>
diff --git a/bin/Makefile b/bin/Makefile
index 1310471e6101..e2c4bcc8af20 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 5/31/93
# $Id: Makefile,v 1.2 1994/09/18 21:25:26 wollman Exp $
-SUBDIR= cat chmod cp csh date dd df domainname echo ed expr hostname \
+SUBDIR= cat chmod cp csh date dd df domainname echo ed expr hostname \
kill ln ls mkdir mv pax ps pwd rcp rm rmail rmdir sh sleep \
stty sync test
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
index 5e19e782632a..4760782bef05 100644
--- a/bin/Makefile.inc
+++ b/bin/Makefile.inc
@@ -2,13 +2,3 @@
BINDIR?= /bin
NOSHARED?= YES
-
-.if exists (${.CURDIR}/../../secure)
-
-.if exists(${.CURDIR}/../../secure/lib/libcipher/obj)
-CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher/obj
-.else
-CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher
-.endif
-
-.endif
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1
index 4841e41c666b..fad0c0acc72e 100644
--- a/bin/cp/cp.1
+++ b/bin/cp/cp.1
@@ -47,16 +47,14 @@
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
-.Op Fl f | i
-.Op Fl p
+.Op Fl fip
.Ar source_file target_file
.Nm cp
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
-.Op Fl f | i
-.Op Fl p
+.Op Fl fip
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -107,25 +105,18 @@ For each existing destination pathname, remove it and
create a new file, without prompting for confirmation
regardless of its permissions.
(The
-.Fl f
-option overrides any previous
.Fl i
-options.)
+option is ignored if the
+.Fl f
+option is specified.)
.It Fl i
Causes
.Nm cp
to write a prompt to the standard error output before copying a file
that would overwrite an existing file.
If the response from the standard input begins with the character
-.Sq Li y
-or
-.Sq Li Y ,
+.Sq Li y ,
the file copy is attempted.
-(The
-.Fl i
-option overrides any previous
-.Fl f
-options.)
.It Fl p
Causes
.Nm cp
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 8b69f83b415b..cfbcd5636f3a 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -86,7 +86,7 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
PATH_T to = { to.p_path, "" };
uid_t myuid;
-int Rflag, iflag, pflag, rflag, fflag;
+int Rflag, iflag, pflag, rflag;
int myumask;
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -104,7 +104,7 @@ main(argc, argv)
int Hflag, Lflag, Pflag, ch, fts_options, r;
char *target;
- Hflag = Lflag = Pflag = 0;
+ Hflag = Lflag = Pflag = Rflag = 0;
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
switch (ch) {
case 'H':
@@ -123,12 +123,10 @@ main(argc, argv)
Rflag = 1;
break;
case 'f':
- fflag = 1;
iflag = 0;
break;
case 'i':
- iflag = 1;
- fflag = 0;
+ iflag = isatty(fileno(stdin));
break;
case 'p':
pflag = 1;
@@ -136,6 +134,7 @@ main(argc, argv)
case 'r':
rflag = 1;
break;
+ case '?':
default:
usage();
break;
diff --git a/bin/cp/extern.h b/bin/cp/extern.h
index 6ca9910c3eb5..d97d76aa46d6 100644
--- a/bin/cp/extern.h
+++ b/bin/cp/extern.h
@@ -42,7 +42,7 @@ typedef struct {
extern PATH_T to;
extern uid_t myuid;
-extern int iflag, pflag, fflag, myumask;
+extern int iflag, pflag, myumask;
#include <sys/cdefs.h>
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 3d73c790a7c5..0f2c100c6a4b 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -86,21 +86,12 @@ copy_file(entp, dne)
checkch = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
- if (checkch != 'y' && checkch != 'Y') {
+ if (checkch != 'y') {
(void)close(from_fd);
return (0);
}
}
-
- if (fflag) {
- /* remove existing destination file name,
- * create a new file */
- (void)unlink(to.p_path);
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
- fs->st_mode & ~(S_ISUID | S_ISGID));
- } else
- /* overwrite existing destination file name */
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
+ to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
} else
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
@@ -290,7 +281,7 @@ void
usage()
{
(void)fprintf(stderr, "%s\n%s\n",
-"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target",
-" cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory");
+"usage: cp [-R [-H | -L | -P] [-fip] src target",
+" cp [-R [-H | -L | -P] [-fip] src1 ... srcN directory");
exit(1);
}
diff --git a/bin/csh/const.c b/bin/csh/const.c
index 0d6068b2d73f..7a6df42c26a6 100644
--- a/bin/csh/const.c
+++ b/bin/csh/const.c
@@ -47,9 +47,7 @@ Char STR0[] = { '0', '\0' };
Char STR1[] = { '1', '\0' };
Char STRHOME[] = { 'H', 'O', 'M', 'E', '\0' };
Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
-Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
-Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E', '\0' };
-Char STRLC_COLLATE[] = { 'L', 'C', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', '\0' };
+Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' };
Char STRLOGNAME[] = { 'L', 'O', 'G', 'N', 'A', 'M', 'E', '\0' };
Char STRLbrace[] = { '{', '\0' };
Char STRLparen[] = { '(', '\0' };
diff --git a/bin/csh/csh.1 b/bin/csh/csh.1
index 7400412ad7ad..7f179d85a466 100644
--- a/bin/csh/csh.1
+++ b/bin/csh/csh.1
@@ -1405,7 +1405,7 @@ of the names suffice.
.Pp
.It Ic login
Terminate a login shell, replacing it with an instance of
-.Pa /usr/bin/login.
+.Pa /bin/login.
This is one way to log off, included for compatibility with
.Xr sh 1 .
.Pp
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 727cf4641349..98a719b9c892 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -186,9 +186,7 @@ main(argc, argv)
AsciiOnly = k > 0377;
}
#else
- AsciiOnly = getenv("LANG") == NULL &&
- getenv("LC_ALL") == NULL &&
- getenv("LC_CTYPE") == NULL;
+ AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL;
#endif /* NLS */
/*
diff --git a/bin/csh/func.c b/bin/csh/func.c
index 445d42edab01..cdf191659309 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -967,8 +967,7 @@ dosetenv(v, t)
importpath(lp);
dohash(NULL, NULL);
}
- else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE) ||
- eq(vp, STRLC_ALL) || eq(vp, STRLC_COLLATE)) {
+ else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE)) {
#ifdef NLS
int k;
@@ -1016,8 +1015,7 @@ dounsetenv(v, t)
if (!Gmatch(name, *v))
continue;
maxi = 1;
- if (eq(name, STRLANG) || eq(name, STRLC_CTYPE) ||
- eq(name, STRLC_ALL) || eq(name, STRLC_COLLATE)) {
+ if (eq(name, STRLANG) || eq(name, STRLC_CTYPE)) {
#ifdef NLS
int k;
@@ -1027,7 +1025,6 @@ dounsetenv(v, t)
AsciiOnly = k > 0377;
#else
AsciiOnly = getenv("LANG") == NULL &&
- getenv("LC_ALL") == NULL &&
getenv("LC_CTYPE") == NULL;
#endif /* NLS */
}
diff --git a/bin/date/date.c b/bin/date/date.c
index 811cb9f88a34..af348ee15a92 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -54,7 +54,6 @@ static char sccsid[] = "@(#)date.c 8.1 (Berkeley) 5/31/93";
#include <string.h>
#include <syslog.h>
#include <unistd.h>
-#include <locale.h>
#include "extern.h"
@@ -80,7 +79,6 @@ main(argc, argv)
char *endptr;
int set_timezone;
- (void) setlocale(LC_TIME, "");
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
set_timezone = 0;
@@ -210,7 +208,7 @@ setthetime(p)
/* convert broken-down time to GMT clock time */
if ((tval = mktime(lt)) == -1)
- errx(1, "nonexistent time");
+ badformat();
/* set the time */
if (nflag || netsettime(tval)) {
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 55c4e76a06c8..89f3d3a207f0 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -61,7 +61,6 @@ static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <locale.h>
#include "dd.h"
#include "extern.h"
@@ -85,7 +84,6 @@ main(argc, argv)
int argc;
char *argv[];
{
- (void) setlocale(LC_CTYPE, "");
jcl(argv);
setup();
diff --git a/bin/df/df.c b/bin/df/df.c
index 701a9adac46c..d53fb960ee0f 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -386,7 +386,10 @@ ufs_df(file, maxwidth)
sfsp->f_blocks = sblock.fs_dsize;
sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
sblock.fs_cstotal.cs_nffree;
- sfsp->f_bavail = freespace(&sblock, sblock.fs_minfree);
+ sfsp->f_bavail = (sblock.fs_dsize * (100 - sblock.fs_minfree) / 100) -
+ (sblock.fs_dsize - sfsp->f_bfree);
+ if (sfsp->f_bavail < 0)
+ sfsp->f_bavail = 0;
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg;
sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
sfsp->f_fsid.val[0] = 0;
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1
index d045b3dcc67c..e97ac08c837c 100644
--- a/bin/echo/echo.1
+++ b/bin/echo/echo.1
@@ -55,9 +55,7 @@ output.
The following option is available:
.Bl -tag -width flag
.It Fl n
-Do not print the trailing newline character. This may also be
-achieved by appending `\ec' to the end of the string, as is done
-by iBCS2 compatible systems.
+Do not print the trailing newline character.
.El
.Pp
The
diff --git a/bin/echo/echo.c b/bin/echo/echo.c
index e604765e48a3..e12f0a6e9ee9 100644
--- a/bin/echo/echo.c
+++ b/bin/echo/echo.c
@@ -62,14 +62,8 @@ main(argc, argv)
else
nflag = 0;
- while (argv[0]) {
- int len = strlen(argv[0]);
-
- if (len >= 2 && !argv[1] && argv[0][len - 2] == '\\' && argv[0][len - 1] == 'c') {
- argv[0][len - 2] = '\0';
- nflag = 1;
- }
- (void)printf("%s", argv[0]);
+ while (*argv) {
+ (void)printf("%s", *argv);
if (*++argv)
putchar(' ');
}
diff --git a/bin/ed/Makefile b/bin/ed/Makefile
index fa13ceb61946..7da27f20079f 100644
--- a/bin/ed/Makefile
+++ b/bin/ed/Makefile
@@ -1,15 +1,8 @@
# $Id: Makefile,v 1.10 1994/12/18 15:15:10 jkh Exp $
PROG= ed
-SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
+SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
LINKS= ${BINDIR}/ed ${BINDIR}/red
MLINKS= ed.1 red.1
-.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
-DISTRIBUTION=des
-CFLAGS+=-DDES
-LDADD+= -L${CIPHEROBJDIR} -lcipher
-DPADD+= ${CIPHEROBJDIR}/libcipher.a
-.endif
-
.include <bsd.prog.mk>
diff --git a/bin/ed/io.c b/bin/ed/io.c
index 99e832acbb7b..f4b4f76ba17a 100644
--- a/bin/ed/io.c
+++ b/bin/ed/io.c
@@ -58,7 +58,7 @@ read_file(fn, n)
sprintf(errmsg, "cannot close input file");
return ERR;
}
- fprintf(stdout, !scripted ? "%lu\n" : "", size);
+ fprintf(stderr, !scripted ? "%lu\n" : "", size);
return current_addr - n;
}
@@ -173,7 +173,7 @@ write_file(fn, mode, n, m)
sprintf(errmsg, "cannot close output file");
return ERR;
}
- fprintf(stdout, !scripted ? "%lu\n" : "", size);
+ fprintf(stderr, !scripted ? "%lu\n" : "", size);
return n ? m - n + 1 : 0;
}
diff --git a/bin/expr/Makefile b/bin/expr/Makefile
index 63c0055d945d..71cf46a00383 100644
--- a/bin/expr/Makefile
+++ b/bin/expr/Makefile
@@ -7,7 +7,7 @@ CLEANFILES+= expr.c y.tab.h
expr.c:
${YACC} -d ${.IMPSRC}
- mv -f y.tab.c expr.c
+ mv y.tab.c expr.c
.include <bsd.prog.mk>
diff --git a/bin/hostname/hostname.1 b/bin/hostname/hostname.1
index 68548f748813..5493b2579a78 100644
--- a/bin/hostname/hostname.1
+++ b/bin/hostname/hostname.1
@@ -58,7 +58,7 @@ Trims off any domain information from the printed
name.
.El
.Sh SEE ALSO
-.Xr gethostname 3
+.Xr gethostname 2
.Sh HISTORY
The
.Nm hostname
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index b9c4f3f1eed5..69ae926cabce 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#include <string.h>
#include <unistd.h>
+int dirflag; /* Undocumented directory flag. */
int fflag; /* Unlink existing files. */
int sflag; /* Symbolic, not hard, link. */
/* System link call. */
@@ -71,8 +72,11 @@ main(argc, argv)
int ch, exitval;
char *sourcedir;
- while ((ch = getopt(argc, argv, "fs")) != EOF)
+ while ((ch = getopt(argc, argv, "Ffs")) != EOF)
switch (ch) {
+ case 'F':
+ dirflag = 1; /* XXX: deliberately undocumented. */
+ break;
case 'f':
fflag = 1;
break;
@@ -123,10 +127,9 @@ linkit(target, source, isdir)
warn("%s", target);
return (1);
}
- /* Only symbolic links to directories. */
- if (S_ISDIR(sb.st_mode)) {
- errno = EISDIR;
- warn("%s", target);
+ /* Only symbolic links to directories, unless -F option used. */
+ if (!dirflag && (sb.st_mode & S_IFMT) == S_IFDIR) {
+ warnx("%s: is a directory", target);
return (1);
}
}
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index a02b1fbf8a38..c125d678e543 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -58,7 +58,6 @@ static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <locale.h>
#include "ls.h"
#include "extern.h"
@@ -105,8 +104,6 @@ main(argc, argv)
int ch, fts_options, notused;
char *p;
- (void) setlocale(LC_ALL, "");
-
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
if (isatty(STDOUT_FILENO)) {
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == -1 ||
diff --git a/bin/ls/print.c b/bin/ls/print.c
index d6a2bc7d2354..54e76bbfa8d5 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94";
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <utmp.h>
#include "ls.h"
#include "extern.h"
@@ -107,12 +108,8 @@ printlong(dp)
if (f_flags)
(void)printf("%-*s ", dp->s_flags, np->flags);
if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode))
- if (minor(sp->st_rdev) > 255)
- (void)printf("%3d, 0x%08x ",
- major(sp->st_rdev), minor(sp->st_rdev));
- else
- (void)printf("%3d, %3d ",
- major(sp->st_rdev), minor(sp->st_rdev));
+ (void)printf("%3d, %3d ",
+ major(sp->st_rdev), minor(sp->st_rdev));
else if (dp->bcfile)
(void)printf("%*s%*qd ",
8 - dp->s_size, "", dp->s_size, sp->st_size);
diff --git a/bin/ls/util.c b/bin/ls/util.c
index d16ab6aa7a14..12679945cc8f 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -57,7 +57,7 @@ prcopy(src, dest, len)
char *src, *dest;
int len;
{
- unsigned char ch;
+ int ch;
while (len--) {
ch = *src++;
diff --git a/bin/mv/mv.1 b/bin/mv/mv.1
index 9ad2ea34d050..c79f74a3271c 100644
--- a/bin/mv/mv.1
+++ b/bin/mv/mv.1
@@ -77,25 +77,17 @@ The following options are available:
Do not prompt for confirmation before overwriting the destination
path.
(The
-.Fl f
-option overrides any previous
.Fl i
-options.)
+option is ignored if the
+.Fl f
+option is specified.)
.It Fl i
Causes
.Nm mv
to write a prompt to standard error before moving a file that would
overwrite an existing file.
-If the response from the standard input begins with the character
-.Sq Li y
-or
-.Sq Li Y ,
+If the response from the standard input begins with the character ``y'',
the move is attempted.
-(The
-.Fl i
-option overrides any previous
-.Fl f
-options.)
.El
.Pp
It is an error for either the
@@ -129,7 +121,6 @@ The
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr cp 1 ,
-.Xr rm 1 ,
.Xr symlink 7
.Sh STANDARDS
The
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index 1486052ddaa5..41c71bd12b4f 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -79,20 +79,21 @@ main(argc, argv)
int ch;
char path[MAXPATHLEN + 1];
- while ((ch = getopt(argc, argv, "fi")) != EOF)
+ while ((ch = getopt(argc, argv, "-if")) != EOF)
switch (ch) {
case 'i':
iflg = 1;
- fflg = 0;
break;
case 'f':
fflg = 1;
- iflg = 0;
break;
+ case '-': /* Undocumented; for compatibility. */
+ goto endarg;
+ case '?':
default:
usage();
}
- argc -= optind;
+endarg: argc -= optind;
argv += optind;
if (argc < 2)
@@ -151,13 +152,6 @@ do_move(from, to)
* make sure the user wants to clobber it.
*/
if (!fflg && !access(to, F_OK)) {
-
- /* prompt only if source exist */
- if (lstat(from, &sb) == -1) {
- warn("%s", from);
- return (1);
- }
-
ask = 0;
if (iflg) {
(void)fprintf(stderr, "overwrite %s? ", to);
@@ -173,7 +167,7 @@ do_move(from, to)
if (ask) {
if ((ch = getchar()) != EOF && ch != '\n')
while (getchar() != '\n');
- if (ch != 'y' && ch != 'Y')
+ if (ch != 'y')
return (0);
}
}
@@ -308,8 +302,7 @@ copy(from, to)
void
usage()
{
- (void)fprintf(stderr, "%s\n%s\n",
- "usage: mv [-f | -i] src target",
- " mv [-f | -i] src1 ... srcN directory");
+ (void)fprintf(stderr,
+"usage: mv [-if] src target;\n or: mv [-if] src1 ... srcN directory\n");
exit(1);
}
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index 827a02d2224d..9bf75662f15d 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -52,6 +52,7 @@ static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include "pax.h"
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
index 7777afb79f41..79cbe0338a9a 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
#include <signal.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c
index fa6f925ac3b1..1cca4138b270 100644
--- a/bin/pax/buf_subs.c
+++ b/bin/pax/buf_subs.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/cache.c b/bin/pax/cache.c
index 6ffe469ac7c4..5e8770fd70b5 100644
--- a/bin/pax/cache.c
+++ b/bin/pax/cache.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#include <sys/param.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index e3fd4f1a420d..f0b0586e7a33 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
#include <sys/stat.h>
#include <sys/param.h>
#include <string.h>
+#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c
index 107a1003329e..e8c6fd345d58 100644
--- a/bin/pax/file_subs.c
+++ b/bin/pax/file_subs.c
@@ -49,6 +49,7 @@ static char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93";
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <sys/uio.h>
#include <stdlib.h>
diff --git a/bin/pax/ftree.c b/bin/pax/ftree.c
index 375e62071693..36bdecf6ba35 100644
--- a/bin/pax/ftree.c
+++ b/bin/pax/ftree.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
#include <unistd.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <fts.h>
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index dc0d5a07280c..8fb957514b5d 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
+#include <ctype.h>
#include <utmp.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 53a9ad6b06a2..da5229829a06 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#include <sys/mtio.h>
#include <sys/param.h>
#include <stdio.h>
+#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index 451a9dfc0a2f..6c43f37ab191 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
+#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
index 5d5e31f21e68..6b9ee71d8ee6 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
@@ -57,7 +57,6 @@ static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
-#include <locale.h>
#include "pax.h"
#include "extern.h"
static int gen_init __P((void));
@@ -228,7 +227,6 @@ main(argc, argv)
char **argv;
#endif
{
- (void) setlocale(LC_TIME, "");
/*
* parse options, determine operational mode, general init
*/
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index e759bdb58dbc..2af13397a5af 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
#include <pwd.h>
#include <grp.h>
#include <stdio.h>
+#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
diff --git a/bin/pax/tables.c b/bin/pax/tables.c
index b0694176c06d..5cc749d9dd93 100644
--- a/bin/pax/tables.c
+++ b/bin/pax/tables.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
#include <sys/param.h>
#include <sys/fcntl.h>
#include <stdio.h>
+#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index a88f6585c090..48a6ebfda0b9 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#include <sys/param.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include "pax.h"
diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c
index 0c47facdca90..ef507c1808da 100644
--- a/bin/pax/tty_subs.c
+++ b/bin/pax/tty_subs.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
#include <sys/param.h>
#include <fcntl.h>
#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/ps/Makefile b/bin/ps/Makefile
index d7d3094bb65f..dea0ff4e821d 100644
--- a/bin/ps/Makefile
+++ b/bin/ps/Makefile
@@ -4,7 +4,7 @@
PROG= ps
SRCS= fmt.c keyword.c nlist.c print.c ps.c
CFLAGS+=-I/sys
-DPADD= ${LIBM} ${LIBKVM}
+DPADD= ${LIBMATH} ${LIBKVM}
LDADD= -lm -lkvm
BINGRP= kmem
BINMODE=2555
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c
index 8231c73850be..23d6adb6acc4 100644
--- a/bin/ps/fmt.c
+++ b/bin/ps/fmt.c
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
#include <sys/syslimits.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 4fb2bd28969f..3b2f5a3bdc7c 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -57,7 +57,6 @@ static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#ifdef NEWVM
#include <sys/ucred.h>
-#include <sys/user.h>
#include <sys/sysctl.h>
#endif
diff --git a/bin/ps/print.c b/bin/ps/print.c
index b1d76ee28c77..be2a4d089a4a 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -49,7 +49,6 @@ static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#ifdef NEWVM
#include <sys/ucred.h>
-#include <sys/user.h>
#include <sys/sysctl.h>
#include <vm/vm.h>
#else
@@ -419,7 +418,7 @@ wchan(k, ve)
(void)printf("%-*s", v->width, "-");
}
-#define pgtok(a) (((a)*getpagesize())/1024)
+#define pgtok(a) (((a)*NBPG)/1024)
void
vsize(k, ve)
@@ -575,7 +574,7 @@ getpmem(k)
/* XXX want pmap ptpages, segtab, etc. (per architecture) */
szptudot = UPAGES;
/* XXX don't have info about shared */
- fracmem = ((float)e->e_vm.vm_rssize + szptudot)/getpagesize()/mempages;
+ fracmem = ((float)e->e_vm.vm_rssize + szptudot)/CLSIZE/mempages;
#endif
return (100.0 * fracmem);
}
@@ -612,7 +611,7 @@ maxrss(k, ve)
v = ve->var;
#ifndef NEWVM /* not yet */
- if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/PAGE_SIZE))
+ if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/NBPG))
(void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_maxrss));
else
#endif
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index e77ab9975730..250df97815cf 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -186,29 +186,46 @@ fields to exceed 100%.
.It %mem
The percentage of real memory used by this process.
.It flags
-The flags associated with the process as in
+The flags (in hexadecimal) associated with the process as in
the include file
.Aq Pa sys/proc.h :
-.Bl -column P_NOCLDSTOP P_NOCLDSTOP
-.It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock"
-.It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal"
-.It Dv "P_INMEM" Ta No "0x00004 Loaded into memory"
-.It Dv "P_NOCLDSTOP" Ta No "0x00008 No SIGCHLD when children stop"
-.It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit"
-.It Dv "P_PROFIL" Ta No "0x00020 Has started profiling"
-.It Dv "P_SELECT" Ta No "0x00040 Selecting; wakeup/waiting danger"
-.It Dv "P_SINTR" Ta No "0x00080 Sleep is interruptible"
-.It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec"
-.It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping"
-.It Dv "P_TIMEOUT" Ta No "0x00400 Timing out during sleep"
-.It Dv "P_TRACED" Ta No "0x00800 Debugged process being traced"
-.It Dv "P_WAITED" Ta No "0x01000 Debugging process has waited for child"
-.It Dv "P_WEXIT" Ta No "0x02000 Working on exiting"
-.It Dv "P_EXEC" Ta No "0x04000 Process called exec"
-.It Dv "P_NOSWAP" Ta No "0x08000 Another flag to prevent swap out"
-.It Dv "P_PHYSIO" Ta No "0x10000 Doing physical I/O"
-.It Dv "P_OWEUPC" Ta No "0x20000 Owe process an addupc() call at next ast"
-.It Dv "P_SWAPPING" Ta No "0x40000 Process is being swapped"
+.Bl -column SNOCLDSTOP SNOCLDSTOP
+.It Dv "SLOAD" Ta No "0x0000001 in core"
+.It Dv "SSYS" Ta No "0x0000002 swapper or pager process"
+.It Dv "SLOCK" Ta No "0x0000004 process being swapped out"
+.It Dv "SSWAP" Ta No "0x0000008 save area flag"
+.It Dv "STRC" Ta No "0x0000010 process is being traced"
+.It Dv "SWTED" Ta No "0x0000020 another tracing flag"
+.It Dv "SSINTR" Ta No "0x0000040 sleep is interruptible"
+.It Dv "SKEEP" Ta No "0x0000100 another flag to prevent swap out"
+.It Dv "SOMASK" Ta No "0x0000200 restore old mask after taking signal"
+.It Dv "SWEXIT" Ta No "0x0000400 working on exiting"
+.It Dv "SPHYSIO" Ta No "0x0000800 doing physical"
+.Tn I/O
+.It Dv "SVFORK" Ta No "0x0001000 process resulted from"
+.Xr vfork 2
+.It Dv "SVFDONE" Ta No "0x0002000 another"
+.Xr vfork
+flag
+.It Dv "SNOVM" Ta No "0x0004000 no vm, parent in a"
+.Xr vfork
+.It Dv "SPAGV" Ta No "0x0008000 init data space on demand, from vnode"
+.It Dv "SSEQL" Ta No "0x0010000 user warned of sequential vm behavior"
+.It Dv "SUANOM" Ta No "0x0020000 user warned of random vm behavior"
+.It Dv "STIMO" Ta No "0x0040000 timing out during sleep"
+.It Dv "SNOCLDSTOP" Ta No "0x0080000 no"
+.Dv SIGCHLD
+when children stop
+.It Dv "SCTTY" Ta No "0x0100000 has a controlling terminal"
+.It Dv "SOWEUPC" Ta No "0x0200000 owe process an addupc() call at next ast"
+.\" the routine addupc is not documented in the man pages
+.It Dv "SSEL" Ta No "0x0400000 selecting; wakeup/waiting danger"
+.It Dv "SEXEC" Ta No "0x0800000 process called"
+.Xr exec 2
+.It Dv "SHPUX" Ta No "0x1000000 \\*(tNHP-UX\\*(sP process
+.Pq Dv HPUXCOMPAT
+.It Dv "SULOCK" Ta No "0x2000000 locked in core after swap error"
+.It Dv "SPTECHG" Ta No "0x4000000 pte's for process have changed"
.El
.It lim
The soft limit on memory used, specified via a call to
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 1684810314f7..0fe890abce87 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -57,15 +57,13 @@ static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
-#include <limits.h>
#include <nlist.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <locale.h>
#include <pwd.h>
+#include <unistd.h>
#include "ps.h"
@@ -118,9 +116,7 @@ main(argc, argv)
uid_t uid;
int all, ch, flag, i, fmt, lineno, nentries;
int prtheader, wflag, what, xflg;
- char *nlistf, *memf, *swapf, errbuf[_POSIX2_LINE_MAX];
-
- (void) setlocale(LC_ALL, "");
+ char *nlistf, *memf, *swapf, errbuf[256];
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 &&
ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 &&
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index 34c38a852bde..5cedc6cb41f0 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -69,11 +69,9 @@ static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
#include "extern.h"
#ifdef KERBEROS
-#include <des.h>
+#include <kerberosIV/des.h>
#include <kerberosIV/krb.h>
-#include "../../usr.bin/rlogin/krb.h"
-
char dst_realm_buf[REALM_SZ];
char *dest_realm = NULL;
int use_kerberos = 1;
@@ -592,21 +590,22 @@ sink(argc, argv)
if (ch == '\n')
*--cp = 0;
+#define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0');
cp = buf;
if (*cp == 'T') {
setimes++;
cp++;
- mtime.tv_sec = strtol(cp, &cp, 10);
- if (!cp || *cp++ != ' ')
+ getnum(mtime.tv_sec);
+ if (*cp++ != ' ')
SCREWUP("mtime.sec not delimited");
- mtime.tv_usec = strtol(cp, &cp, 10);
- if (!cp || *cp++ != ' ')
+ getnum(mtime.tv_usec);
+ if (*cp++ != ' ')
SCREWUP("mtime.usec not delimited");
- atime.tv_sec = strtol(cp, &cp, 10);
- if (!cp || *cp++ != ' ')
+ getnum(atime.tv_sec);
+ if (*cp++ != ' ')
SCREWUP("atime.sec not delimited");
- atime.tv_usec = strtol(cp, &cp, 10);
- if (!cp || *cp++ != '\0')
+ getnum(atime.tv_usec);
+ if (*cp++ != '\0')
SCREWUP("atime.usec not delimited");
(void)write(rem, "", 1);
continue;
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index 693c1cf35705..31aba2cfe6ce 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -118,26 +118,10 @@ removed.
If an error occurs,
.Nm rm
exits with a value >0.
-.Sh NOTE
-.Nm rm
-use
-.Xr getopt 3
-parsing routine. Getopt accept a
-.Sq Li --
-argument, which stop reading options, anything after this
-is not an option.
-So
-.Nm rm
-handle files whose names begins with a
-.Sq Li - .
-Example:
-
-``$ rm -- -filename''.
.Sh SEE ALSO
.Xr rmdir 1 ,
.Xr unlink 2 ,
.Xr fts 3 ,
-.Xr getopt 3 ,
.Xr symlink 7
.Sh BUGS
The
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 8df172f61cf0..ffe565505241 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -81,7 +81,7 @@ main(argc, argv)
{
int ch, rflag;
- rflag = 0;
+ Pflag = rflag = 0;
while ((ch = getopt(argc, argv, "dfiPRr")) != EOF)
switch(ch) {
case 'd':
@@ -102,6 +102,7 @@ main(argc, argv)
case 'r': /* Compatibility. */
rflag = 1;
break;
+ case '?':
default:
usage();
}
@@ -377,7 +378,7 @@ check(path, name, sp)
first = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
- return (first == 'y' || first == 'Y');
+ return (first == 'y');
}
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
@@ -409,6 +410,6 @@ void
usage()
{
- (void)fprintf(stderr, "usage: rm [-f | -i] [-dPRr] file ...\n");
+ (void)fprintf(stderr, "usage: rm [-dfiRr] file ...\n");
exit(1);
}
diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c
index b45ec457682e..d3f6221a211f 100644
--- a/bin/rmail/rmail.c
+++ b/bin/rmail/rmail.c
@@ -211,8 +211,6 @@ main(argc, argv)
/* Save off from user's address; the last one wins. */
for (p = addrp; *p && !isspace(*p); ++p);
*p = '\0';
- if (*addrp == '\0')
- addrp = "<>";
if (from_user != NULL)
free(from_user);
if ((from_user = strdup(addrp)) == NULL)
diff --git a/bin/sh/Makefile b/bin/sh/Makefile
index d703e92b082b..ac48c2ced455 100644
--- a/bin/sh/Makefile
+++ b/bin/sh/Makefile
@@ -23,9 +23,6 @@ CLEANFILES+=\
token.def: mktokens
sh ${.CURDIR}/mktokens
-${.CURDIR}/builtins:
- # just override the default rule
-
builtins.h builtins.c: ${.CURDIR}/mkbuiltins ${.CURDIR}/builtins
cd ${.CURDIR}; sh mkbuiltins
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index 0300d14ba626..ee25eba9c14b 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -60,10 +60,10 @@
#define fputs outstr
#define fflush flushout
#define INITARGS(argv)
-#define warnx(a, b, c) { \
- char buf[64]; \
- (void)snprintf(buf, sizeof(buf), a, b, c); \
- error(buf); \
+#define warnx(a, b, c) { \
+ char buf[64]; \
+ (void)snprintf(buf, sizeof(buf), a, b, c); \
+ error(buf); \
}
#else
#undef NULL
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index d96667350e3d..2ade7328d00c 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -150,12 +150,29 @@ list(nlflag) {
for (;;) {
switch (readtoken()) {
case TBACKGND:
+ if (n1->type == NCMD || n1->type == NPIPE) {
+ n1->ncmd.backgnd = 1;
+ } else if (n1->type == NREDIR) {
+ n1->type = NBACKGND;
+ } else {
+ n3 = (union node *)stalloc(sizeof (struct nredir));
+ n3->type = NBACKGND;
+ n3->nredir.n = n1;
+ n3->nredir.redirect = NULL;
+ n1 = n3;
+ }
+ goto tsemi;
case TNL:
- parseheredoc();
- if (nlflag)
- return n1;
+ tokpushback++;
/* fall through */
- case TSEMI:
+tsemi: case TSEMI:
+ if (readtoken() == TNL) {
+ parseheredoc();
+ if (nlflag)
+ return n1;
+ } else {
+ tokpushback++;
+ }
checkkwd = 2;
if (tokendlist[peektoken()])
return n1;
@@ -195,19 +212,6 @@ andor() {
} else if (t == TOR) {
t = NOR;
} else {
- if (t == TBACKGND) {
- if (n1->type == NCMD || n1->type == NPIPE) {
- n1->ncmd.backgnd = 1;
- } else if (n1->type == NREDIR) {
- n1->type = NBACKGND;
- } else {
- n3 = (union node *)stalloc(sizeof (struct nredir));
- n3->type = NBACKGND;
- n3->nredir.n = n1;
- n3->nredir.redirect = NULL;
- n1 = n3;
- }
- }
tokpushback++;
return n1;
}
diff --git a/bin/stty/stty.1 b/bin/stty/stty.1
index e582a16ae103..8de1d8da1a7f 100644
--- a/bin/stty/stty.1
+++ b/bin/stty/stty.1
@@ -160,10 +160,10 @@ Signal (do not signal)
on
break.
.It Cm ignpar Pq Fl ignpar
-Ignore (do not ignore) characters with parity
+Ignore (do not ignore) parity
errors.
.It Cm parmrk Pq Fl parmrk
-Mark (do not mark) characters with parity errors.
+Mark (do not mark) parity errors.
.It Cm inpck Pq Fl inpck
Enable (disable) input parity
checking.
@@ -235,7 +235,7 @@ output modes).
Map (do not map)
.Dv NL
to
-.Dv CR-NL
+.DV CR-NL
on output.
.It Cm oxtabs Pq Fl oxtabs
Expand (do not expand) tabs to spaces on output.
diff --git a/bin/sync/sync.8 b/bin/sync/sync.8
index 513b7016810c..33c20574a302 100644
--- a/bin/sync/sync.8
+++ b/bin/sync/sync.8
@@ -64,9 +64,9 @@ function call.
.Sh SEE ALSO
.Xr sync 2 ,
.Xr fsync 2 ,
-.Xr update 4 ,
.Xr halt 8 ,
-.Xr reboot 8
+.Xr reboot 8 ,
+.Xr update 8
.Sh HISTORY
A
.Nm sync
diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV
index fdba56c0d89d..c24e604fba73 100644
--- a/etc/etc.i386/MAKEDEV
+++ b/etc/etc.i386/MAKEDEV
@@ -36,14 +36,14 @@
# via the floppy disk controller)
#
# Disks:
-# wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...)
+# wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...)
# fd* "floppy" disk drives (3 1/2", 5 1/4")
-# sd* "SCSI disks"
-# cd* "SCSI CD-ROM disks"
-# mcd* "Mitsumi CD-ROM disks"
-# scd* "Sony CD-ROM disks"
-# matcd* "Matsushita (Panasonic) CD-ROM disks"
-# wcd* "IDE CD-ROM disks"
+# sd* "scsi disks"
+# cd* "scsi cdrom disks"
+# mcd* "mitsumi cdrom disks"
+# scd* "sony cdrom disks"
+# matcd* "Matsushita (panasonic) cdrom disks"
+# wcd* "IDE cdrom disks"
# vn* "vnode disks"
# od* "optical disks"
#
@@ -77,27 +77,25 @@
# worm* WORM driver
# pt* Processor Type (HP scanner, as one example)
#
-# PC-CARD (previously called PCMCIA) support
-# card* PC-CARD slots
-#
# Special purpose devices:
-# apm Advanced Power Management BIOS
# bpf* packet filter
# speaker pc speaker
# tw* xten power controller
-# snd* various sound cards
+# snd* various sound cards (generic entries)
+# gusmax A GUS MAX sound card (does various snd* entries)
+# pas16 A ProAudio Spectrum 16 card (does various snd* entries)
+# sb A sound blaster card (any type)
# pcaudio PCM audio driver
# socksys iBCS2 socket system driver
# vat VAT compatibility audio driver (requires snd*)
# gsc Genius GS-4500 hand scanner
# joy pc joystick
# tun Tunneling IP device
-# spigot Video Spigot video acquisition card
-# meteor* Matrox Meteor video acquisition card (pci)
-# qcam* Connectix QuickCam(tm) parallel port camera
+# spigot Video Spigot video aquisition card
+# meteor* Matrox Meteor video aquisition card (pci)
+# qcam* Connectix QuickCam parallel port camera
# isdn* ISDN devices
# labpc* National Instrument's Lab-PC and LAB-PC+
-# perfmon CPU performance-monitoring counters
#
# $Id: MAKEDEV,v 1.95.4.11 1996/05/04 07:18:45 pst Exp $
#
@@ -160,10 +158,6 @@ dkrawslice=1
# Control bit for SCSI
scsictl=536870912
-# Standard umasks
-disk_umask=037 # allow group operator to read disks
-tape_umask=017 # allow group operator to read/write tapes
-
for i
do
case $i in
@@ -171,28 +165,26 @@ case $i in
all)
sh MAKEDEV std # standard
sh MAKEDEV wd0 wd1 wd2 wd3 fd0 fd1 sd0 sd1 sd2 sd3 # bdev, disk
- sh MAKEDEV cd0 mcd0 scd0 matcd0 wcd0 # bdev, cdrom
+ sh MAKEDEV cd0 mcd0 scd0 matcd0 wcd0 # bdev, cdrom
sh MAKEDEV ft0 wt0 st0 # bdev, tape
sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial
sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial
sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
sh MAKEDEV pty0 ch0 tw0 bpf0 # cdev
- sh MAKEDEV perfmon speaker pcaudio psm0 mse0 # cdev
+ sh MAKEDEV speaker pcaudio psm0 mse0 # cdev
sh MAKEDEV vty4 # cdev
sh MAKEDEV tun0 # cdev
;;
std)
- rm -f console drum mem kmem null random urandom zero io tty klog
- rm -f stdin stdout stderr lkm
+ rm -f console drum mem kmem null zero io tty klog stdin stdout stderr
+ rm -f lkm
mknod console c 0 0; chmod 600 console; chown root.wheel console
mknod drum c 4 0; chmod 640 drum; chown root.kmem drum
mknod kmem c 2 1; chmod 640 kmem; chown root.kmem kmem
mknod mem c 2 0; chmod 640 mem; chown root.kmem mem
mknod null c 2 2; chmod 666 null; chown root.wheel null
- mknod random c 2 3; chmod 644 random; chown root.wheel random
- mknod urandom c 2 4; chmod 644 urandom; chown root.wheel urandom
mknod zero c 2 12; chmod 666 zero; chown root.wheel zero
- mknod io c 2 14; chmod 600 io; chown root.wheel io
+ mknod io c 2 14; chmod 640 io; chown root.kmem io
mknod tty c 1 0; chmod 666 tty; chown root.wheel tty
mknod klog c 7 0; chmod 600 klog; chown root.wheel klog
mknod stdin c 22 0; chmod 666 stdin; chown root.wheel stdin
@@ -219,7 +211,7 @@ mach-4)
# Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
wt*)
- umask $tape_umask
+ umask 7
u=`expr $i : '..\(.*\)'`
if [ x$u = x ]; then u=0; fi
rm -f r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
@@ -242,13 +234,13 @@ wt*)
;;
# Individual slices.
-od*s*|sd*s*|vn*s*|wd*s*)
- umask $disk_umask
+sd*s*|vn*s*|wd*s*|od*s*)
+ umask 37
case $i in
- od*s*) name=od; blk=20; chr=70;;
sd*s*) name=sd; blk=4; chr=13;;
wd*s*) name=wd; blk=0; chr=3;;
vn*s*) name=vn; blk=15; chr=43;;
+ od*s*) name=od; blk=20; chr=70;;
esac
unit=`expr $i : '..\([0-9]*\)s'`
slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
@@ -301,7 +293,7 @@ od*s*|sd*s*|vn*s*|wd*s*)
;;
fd*)
- umask $disk_umask
+ umask 2
unit=`expr $i : '..\(.*\)'`
name=fd; blk=2; chr=9
rm -f $name$unit* r$name$unit*
@@ -376,6 +368,7 @@ fd*)
# ln r${name}${unit}.360 r${name}${unit}48ds9
chgrp operator ${name}${unit}* r${name}${unit}*
+ chmod 640 ${name}${unit}* r${name}${unit}*
;;
*)
echo bad unit for disk in: $i
@@ -384,8 +377,9 @@ fd*)
umask 77
;;
+
ft*)
- umask $tape_umask
+ umask 2
unit=`expr $i : '..\(.*\)'`
name=ft; blk=2; chr=9
rm -f $name$unit* r$name$unit*
@@ -396,6 +390,7 @@ ft*)
ln ${name}${unit} ${name}${unit}a
ln r${name}${unit} r${name}${unit}a
chgrp operator ${name}${unit}* r${name}${unit}*
+ chmod 640 ${name}${unit}* r${name}${unit}*
;;
*)
echo bad unit for tape in: $i
@@ -404,13 +399,13 @@ ft*)
umask 77
;;
-od*|sd*|vn*|wd*)
- umask $disk_umask
+sd*|vn*|wd*|od*)
+ umask 37
case $i in
- od*) name=od; blk=20; chr=70;;
sd*) name=sd; blk=4; chr=13;;
- vn*) name=vn; blk=15; chr=43;;
wd*) name=wd; blk=0; chr=3;;
+ vn*) name=vn; blk=15; chr=43;;
+ od*) name=od; blk=20; chr=70;;
esac
unit=`expr $i : '..\(.*\)'`
case $unit in
@@ -420,7 +415,7 @@ od*|sd*|vn*|wd*)
sh MAKEDEV $name$unit$slicepartname
done
case $name in
- od|sd)
+ sd|od)
rm -f r${name}${unit}.ctl
mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl `
chmod 600 r${name}${unit}.ctl
@@ -478,6 +473,7 @@ worm*)
mknod r${name}${unit} c $chr ${unit}
rm -f r${name}${unit}.ctl
mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl `
+ chmod 600 r${name}${unit}.ctl
;;
# SCSI processor type driver
@@ -493,6 +489,7 @@ pt[0-9]*)
mknod ${name}${unit} c $chr $unit
rm -f ${name}${unit}.ctl
mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl `
+ chmod 600 ${name}${unit}.ctl
;;
pty*)
@@ -532,7 +529,7 @@ pty*)
;;
st*)
- umask $tape_umask
+ umask 2
unit=`expr $i : '..\(.*\)'`
chr=14
@@ -556,7 +553,10 @@ st*)
nrst${unit}.${mode} \
erst${unit}.${mode} \
st${unit}ctl.${mode}
- chmod 600 st${unit}ctl.${mode}
+ chmod 640 rst${unit}.${mode}\
+ nrst${unit}.${mode} \
+ erst${unit}.${mode}
+ chmod 660 st${unit}ctl.${mode}
done
rm -f rst${unit}.ctl
mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
@@ -574,7 +574,7 @@ st*)
;;
ch*)
- umask 37
+ umask 2
unit=`expr $i : '..\(.*\)'`
case $i in
ch*) name=ch; chr=17;;
@@ -584,6 +584,7 @@ ch*)
0|1|2|3|4|5|6)
mknod ${name}${unit} c $chr `expr $unit '*' 16 + 0`
chgrp operator ${name}${unit}
+ chmod 640 ${name}${unit}
rm -f r${name}${unit}.ctl
mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
chmod 600 r${name}${unit}.ctl
@@ -596,7 +597,7 @@ ch*)
;;
cd*|mcd*|scd*)
- umask $disk_umask
+ umask 2
case $i in
cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;;
mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;;
@@ -610,6 +611,7 @@ cd*|mcd*|scd*)
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
+ chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
case $name in
cd)
rm -f r${name}${unit}.ctl
@@ -890,8 +892,7 @@ mouse*)
if [ ! -c $name ]; then
$0 $name # make the appropriate device
fi
- rm -f mouse
- ln -s $name mouse
+ ln -fs $name mouse
;;
pcaudio)
@@ -913,7 +914,7 @@ socksys)
snd*)
#
# changes from Linux voxware
-# minor Linux FreeBSD
+# minor linux freebsd
# 8 sequencer2 (aka music0) music0
# 17 patmgr0 sequencer1
# 33 patmgr1 sequencer2
@@ -927,13 +928,13 @@ snd*)
umask $snd_security_hole
if [ $unit = "0" ] ; then
- rm -f mixer ; ln -s mixer$unit mixer
- rm -f sequencer ; ln -s sequencer$unit sequencer
- rm -f dsp ; ln -s dsp$unit dsp
- rm -f audio ; ln -s audio$unit audio
- rm -f dspW ; ln -s dspW$unit dspW
- rm -f music ; ln -s music$unit music
- rm -f pss ; ln -s pss$unit pss
+ ln -fs mixer$unit mixer
+ ln -fs sequencer$unit sequencer
+ ln -fs dsp$unit dsp
+ ln -fs audio$unit audio
+ ln -fs dspW$unit dspW
+ ln -fs music$unit music
+ ln -fs pss$unit pss
fi
rm -f mixer$unit # Mixer [ Control ]
@@ -969,6 +970,18 @@ snd*)
umask 77
;;
+# More specialized cases of snd driver.
+gusmax)
+ sh /dev/MAKEDEV snd0 snd1 snd2
+ ln -fs /dev/dsp2 /dev/dsp
+ ;;
+pas16)
+ sh /dev/MAKEDEV snd0 snd1
+ ;;
+sb)
+ sh /dev/MAKEDEV snd0
+ ;;
+
vat)
rm -f vatio
mknod vatio c 25 128
@@ -1023,6 +1036,7 @@ cronyx)
;;
joy)
+ umask 2
rm -f joy0 joy1
mknod joy0 c 51 0
mknod joy1 c 51 1
@@ -1047,7 +1061,6 @@ meteor?)
unit=`expr $i : 'meteor\(.*\)'`
rm -f meteor$unit
mknod meteor$unit c 67 $unit
- chown root.wheel meteor$unit
chmod 444 meteor$unit
;;
@@ -1164,10 +1177,6 @@ labpc*)
umask 77
;;
-perfmon)
- mknod perfmon c 2 32; chmod 640 perfmon; chown root.kmem perfmon
- ;;
-
local)
umask 0 # XXX should be elsewhere
sh MAKEDEV.local
diff --git a/etc/etc.i386/rc.i386 b/etc/etc.i386/rc.i386
index 0b98a9a71360..e872ca87de44 100644
--- a/etc/etc.i386/rc.i386
+++ b/etc/etc.i386/rc.i386
@@ -9,21 +9,19 @@ echo -n 'enabling FreeBSD/i386 options:'
# Start the SCO binary emulation if requested.
if [ "X${ibcs2}" = X"YES" ]; then
echo -n ' '; ibcs2
- # XXX BOGUS - ibcs2 script shouldn't make any output on success
+ # XXX BOUGS - ibcs2 script shouldn't make any output on success
fi
# Start the Linux binary emulation if requested.
if [ "X${linux}" = X"YES" ]; then
- echo -n ' '; linux
- # XXX BOGUS - Linux script shouldn't make any output on success
+ echo -n ' '; linux
+ # XXX BOGUS - linux script shouldn't make any output on success
fi
if [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then
echo -n ' xtend'; /usr/libexec/xtend
fi
-echo '.'
-
##########################################################################
####### Syscons section ########
##########################################################################
@@ -32,7 +30,20 @@ echo '.'
kbddev=/dev/ttyv0
viddev=/dev/ttyv0
-echo -n "configuring syscons:"
+# don't change these, they're modified below
+kbdadjust=NO
+vidadjust=NO
+
+[ "X${keymap}" != X"NO" -o "X${keyrate}" != X"NO" \
+ -o "X${keychange}" != X"NO" ] && kbdadjust=YES
+[ "X${scrnmap}" != X"NO" -o "X${font8x16}" != X"NO" -o \
+ "X${font8x14}" != X"NO" -o "X${font8x8}" != X"NO" -o \
+ "X${blanktime}" != X"NO" -o "X${cursor}" != X"NO" ] && vidadjust=YES
+
+[ "X${kbdadjust}" != X"NO" -o "X${vidadjust}" != X"NO" -o \
+ "X${saver}" != X"NO" ] && { echo; echo "configuring syscons:"; }
+
+[ "X${kbdadjust}" != X"NO" ] && echo -n ' [kbdcontrol:'
# keymap
if [ "X${keymap}" != X"NO" ]; then
@@ -55,6 +66,11 @@ if [ "X${keychange}" != X"NO" ]; then
done
fi
+[ "X${kbdadjust}" != X"NO" ] && echo ']'
+
+
+[ "X${vidadjust}" != X"NO" ] && echo -n ' [vidcontrol:'
+
# cursor type
if [ "X${cursor}" != X"NO" ]; then
echo -n ' cursor'; vidcontrol <${viddev} -c ${cursor}
@@ -85,20 +101,13 @@ if [ "X${blanktime}" != X"NO" ]; then
echo -n ' blank_time'; vidcontrol <${viddev} -t ${blanktime}
fi
+[ "X${vidadjust}" != X"NO" ] && echo ']'
+
# screen saver
if [ "X${saver}" != X"NO" ] ; then
- echo -n ' screensaver'
- modstat | grep _saver || \
- modload -u -o /tmp/saver_mod -q /lkm/${saver}_saver_mod.o
+ echo -n ' screensaver: '
+ modstat | grep _saver || modload -u -o /tmp/saver_mod -e \
+ saver_init -q /lkm/${saver}_saver_mod.o
fi
echo '.'
-
-# interrupts for /dev/random device
-if [ "X${rand_irqs}" != X"NO" ] ; then
- echo -n 'entropy source: '
- rndcontrol ${rand_irqs}
-fi
-
-echo '.' # probably bogus
-
diff --git a/etc/hosts b/etc/hosts
index 9ce3df033a6e..0799fa664465 100644
--- a/etc/hosts
+++ b/etc/hosts
@@ -8,12 +8,14 @@
#
#
127.0.0.1 localhost localhost.my.domain
+# for the no-configured-network case.
+127.0.0.1 myname.my.domain
#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
-# According to RFC 1918, you can use the following IP networks for
+# According to RFC 1597, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
diff --git a/etc/inetd.conf b/etc/inetd.conf
index 58486f0acc19..7460512f09d3 100644
--- a/etc/inetd.conf
+++ b/etc/inetd.conf
@@ -42,8 +42,6 @@ rkinit stream tcp nowait root /usr/libexec/rkinitd rkinitd
#rusersd/1-2 dgram rpc/udp wait root /usr/libexec/rpc.rusersd rpc.rusersd
#walld/1 dgram rpc/udp wait root /usr/libexec/rpc.rwalld rpc.rwalld
#pcnfsd/1-2 dgram rpc/udp wait root /usr/libexec/rpc.pcnfsd rpc.pcnfsd
-#rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad
-#sprayd/1 dgram rpc/udp wait root /usr/libexec/rpc.sprayd rpc.sprayd
#
# example entry for the pop3 server
#pop3 stream tcp nowait root /usr/local/libexec/popper popper
diff --git a/etc/make.conf b/etc/make.conf
index 63ac814e588d..c9cdcdf4f4e7 100644
--- a/etc/make.conf
+++ b/etc/make.conf
@@ -11,7 +11,7 @@
#
# One, and probably the most common, use could be:
#
-#CFLAGS= -O2 -m486 -pipe
+#CFLAGS= -O2 -m486 -pipe -fno-strength-reduce
#
# Another useful entry is
#
@@ -39,45 +39,26 @@
#NOMANCOMPRESS= true
#
#
-# If you do not want additional documentation (some of which are
-# a few hundred KB's) for ports to be installed:
-#
-#NOPORTDOCS= true
-#
-#
# Default format for system documentation, depends on your printer.
# Set this to "ascii" for simple printers or screen
#
#PRINTER= ps
#
#
-# How long to wait for a console keypress before booting the default kernel.
-# This value is approximately in milliseconds. Keypresses are accepted by the
-# BIOS before booting from disk, making it possible to give custom boot
-# parameters even when this is set to 0.
+# How many times to check if a key has been pressed before giving up and
+# booting the default kernel. 0 actually means check once, but saves the
+# loop overhead. This value is approximately in milliseconds.
#
#BOOTWAIT=0
#BOOTWAIT=30000
#
#
# By default, this points to /usr/X11R6 for XFree86 releases 3.0 or earlier.
-# If you have a XFree86 from before 3.0 that has the X distribution in
-# /usr/X386, you want to uncomment this.
+# If you have a XFree86 from before 3.0 you want to uncomment this.
#
#X11BASE= /usr/X386
#
#
-# If you have Motif on your system, uncomment this.
-#
-#HAVE_MOTIF= yes
-#
-# If the default location of the Motif library (specified below) is NOT
-# appropriate for you, uncomment this and change it to the correct value.
-# If your motif is in ${X11BASE}/lib, you don't need to touch this line.
-#
-#MOTIFLIB= -L${X11BASE}/lib -lXm
-#
-#
# Build `cc' using a dynamic internals library, rather than the default
# (static) one. This makes the compilers run slower (10-15%), but saves
# quite some diskspace.
diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist
index c0a20e28e5d5..1e98b13e2cdb 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -13,8 +13,14 @@
..
net
..
+ netccitt
+ ..
netinet
..
+ netiso
+ ..
+ netns
+ ..
nfs
..
objc
diff --git a/etc/mtree/BSD.local.dist b/etc/mtree/BSD.local.dist
index 98f61d736ec5..f9e52a602bd4 100644
--- a/etc/mtree/BSD.local.dist
+++ b/etc/mtree/BSD.local.dist
@@ -32,8 +32,6 @@
..
cat8 uname=man
..
- cat9 uname=man
- ..
catl uname=man
..
man1
@@ -52,16 +50,14 @@
..
man8
..
- man9
- ..
manl
..
+ skel
+ ..
..
sbin
..
share
- doc
- ..
nls
C
..
@@ -116,7 +112,5 @@
sv_SE.ISO_8859-1
..
..
- skel
- ..
..
..
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 6cbdbd88ea63..0f4db33b2bd1 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -43,8 +43,6 @@
..
hr_HR.ISO_8859-2
..
- ru_SU.KOI8-R
- ..
..
dict
..
@@ -181,6 +179,8 @@
..
sup
..
+ syscons
+ ..
..
/set type=dir uname=games gname=bin mode=0755
games uname=bin
diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist
index 95065ccdc045..870ac7f84219 100644
--- a/etc/mtree/BSD.var.dist
+++ b/etc/mtree/BSD.var.dist
@@ -34,7 +34,7 @@
..
mail uname=bin
..
- msgs uname=daemon
+ msgs uname=bin
..
preserve uname=bin
..
diff --git a/etc/netstart b/etc/netstart
index d0ad128e4c22..7abf70fb65e6 100755
--- a/etc/netstart
+++ b/etc/netstart
@@ -23,14 +23,9 @@ if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
domainname $defaultdomainname
fi
-# If IP filtering
-if [ -n "$firewall" -a "x$firewall" != "xNO" -a -f /etc/rc.firewall ] ; then
- sh /etc/rc.firewall
-fi
-
#
# XXX This is known to cause an error if /usr is nfs mounted since it
-# will not be available until after the network is up :-(. Once the
+# will not be avaliable until after the network is up :-(. Once the
# relocation of sysctl to /sbin is done that problem will go away.
#
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
@@ -54,20 +49,28 @@ if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
fi
# Set up any static routes. This should be done before router discovery.
-if [ "x${static_routes}" != "x" ]; then
- for i in ${static_routes}; do
- eval route_args=\$route_${i}
- route add ${route_args}
- done
-fi
+for i in ${static_routes}; do
+ eval route_args=\$route_${i}
+ route add ${route_args}
+done
if [ "x$gateway" != "xNO" ]; then
echo 'configuring host as a gateway.'
- sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
+ sysctl -w net.inet.ip.forwarding=1
fi
-if [ "x$router" != "xNO" ] ; then
- echo -n starting routing daemon:
- echo -n " ${router}"; ${router} ${routerflags}
+if [ "x$gated" != "xNO" -o "x$routedflags" != "xNO" ] ; then
+ echo -n starting routing daemons:
+
+ # $gated and $routedflags are imported from /etc/sysconfig.
+ # If $gated == YES, gated is used; otherwise routed.
+ # If $routedflags == NO, routed isn't run.
+
+ if [ "X${gated}" = X"YES" -a -r /etc/gated.conf ]; then
+ echo -n ' gated'; /usr/local/sbin/gated $gatedflags
+ elif [ "X${routedflags}" != X"NO" ]; then
+ echo -n ' routed'; routed $routedflags
+ fi
+
echo '.'
fi
diff --git a/etc/ppp/ppp.conf.iij b/etc/ppp/ppp.conf.iij
index 6c15bc9b20c3..4bc9c8321b78 100644
--- a/etc/ppp/ppp.conf.iij
+++ b/etc/ppp/ppp.conf.iij
@@ -2,7 +2,7 @@
#
# Examples to connect to IIJ Dialup PPP service
#
-# 1) On IIJ service, both user side and server side address can
+# 1) On IIJ servive, both user side and server side address can
# not be predicted by a customer. In this circumstance, you need
# some trick to use on-demand dialup. See iij-demand for example.
#
@@ -27,7 +27,7 @@ iij:
set timeout 0
dial
#
-# If you prefer to use PAP authentication, use this one.
+# If you prefer to use PAP authentification, use this one.
#
# % ppp iij-pap
#
@@ -41,7 +41,7 @@ iij-pap:
set openmode active
dial
#
-# Use "% ppp iij-chap" for CHAP authentication
+# Use "% ppp iij-chap" for CHAP authentification
#
iij-chap:
set phone 0332425701
diff --git a/etc/ppp/ppp.conf.sample b/etc/ppp/ppp.conf.sample
index 0da1cf9db987..1df362867a58 100644
--- a/etc/ppp/ppp.conf.sample
+++ b/etc/ppp/ppp.conf.sample
@@ -11,7 +11,7 @@
# Default setup. Executed always when PPP is invoked.
#
default:
- set device /dev/cuaa1
+ set device /dev/cua01
set speed 38400
disable lqr
deny lqr
@@ -36,15 +36,9 @@ simplesite:
set login "TIMEOUT 5 login:-\\r-login: ppp word: ppp"
set timeout 120
#
-# Multi-phone example
+# If peer reqires to use CHAP, don't forget to supply authname and authkey.
#
-multiphone:
- set phone 12345678:12345679:12345670:12345671
- set login "TIMEOUT 5 login:-\\r-login: ppp word: ppp"
-#
-# If peer requires to use CHAP, don't forget to supply authname and authkey.
-#
-# If you'd like to use CHAP to authentication peer, comment out the line
+# If you'd like to use CHAP to authentificate peer, comment out the line
# ``enable chap'' below. You also need to prepare /etc/ppp.secret.
#
# If remote system sends its system name within CHAP packet and it is
@@ -60,7 +54,7 @@ chapsite:
set authname MySystemName
set authkey OurSecretKey
#
-# To speak PAP is just similar to CHAP
+# To speak PAP is just smilar to CHAP
#
papsite:
set phone 12345678
@@ -82,8 +76,8 @@ ondemand:
set phone 1234567
set login "TIMEOUT 5 login:-\\r-login: ppp word: ppp"
set timeout 120
- set ifaddr 192.244.185.226 192.244.176.44 255.255.255.0
- add 0 0 192.244.176.44
+ set ifaddr 192.244.185.226 192.244.176.44
+ add 0 255.255.255.0 192.244.176.44
#
# Another on demand example
# If peer assign some IP address for us, and we can't predict it
@@ -93,8 +87,8 @@ pmdemend:
set phone 1234567
set login "TIMEOUT 5 login:-\\r-login: ppp word: ppp"
set timeout 120
- set ifaddr 0 192.244.176.44 255.255.255.0
- add 0 0 192.244.176.44
+ set ifaddr 0 192.244.176.44
+ add 0 255.255.255.0 192.244.176.44
#
# Example to validate incoming user with CHAP
# Invod as ``ppp -direct users'' from login script. User's system name
@@ -112,8 +106,8 @@ users:
# Example of Callback Request
#
# Here, we assume that peer will hangup the line and initiates a callback
-# after successful authentication. We simply use chat script capability
-# and wait for a "NO CARRIER" response from our modem.
+# after successful authentification. We simply use chat script capabiluty
+# and wait for a "NO CARRIRER" response from our modem.
#
# % ppp callback
#
diff --git a/etc/ppp/ppp.linkup.sample b/etc/ppp/ppp.linkup.sample
index 2328317d6fc1..f549b0e238b8 100644
--- a/etc/ppp/ppp.linkup.sample
+++ b/etc/ppp/ppp.linkup.sample
@@ -4,15 +4,15 @@
#
#
# This file is checked when PPP establishes network level connection.
-# PPP command searches label in this file in following way and order.
+# PPP command seaches label in this file in following way and order.
#
-# 1) At first, IP address assigned into our side is searched and execute
+# 1) At first, IP address assigned into our side is serched and execute
# associated command.
#
# 2) If it didn't found, then label name specified at startup time is
# searched.
#
-# 3) If given label name is not found, then label MYADDR is searched.
+# 3) If given label name is not found, then label MYADDR is serched.
#
# $Id: ppp.linkup.sample,v 1.1.1.1 1995/01/31 06:24:33 amurai Exp $
#
@@ -22,16 +22,16 @@
# to 192.244.176.0 network.
#
#192.244.176.32:
-# add 192.244.176.0 0 HISADDR
+# add 192.244.176.0 255.255.255.0 HISADDR
#
-# If we are invoked with an argument ``iij-demand'', then
+# If we are invked with an argument ``iij-demand'', then
# delete existing route entry and add peer as default gateway.
#
iij-demand:
delete ALL
add 0 0 HISADDR
#
-# Otherwise, simply add peer as default gateway.
+# Otherwide, simply add peer as default gateway.
#
MYADDR:
add 0 0 HISADDR
diff --git a/etc/profile b/etc/profile
index e868673d976e..69b96d1069df 100644
--- a/etc/profile
+++ b/etc/profile
@@ -2,10 +2,12 @@
# Uncomment this to give you the default 4.2 behavior, where disk
# information is shown in K-Blocks
# BLOCKSIZE=K; export BLOCKSIZE
-# Uncomment next line to activate Russian locale
+# Uncomment next line if you want to setup your 8-bit locale at program
+# startup automatically
+# See also rc and csh.login
+# ENABLE_STARTUP_LOCALE=; export ENABLE_STARTUP_LOCALE
+# Uncomment next line to activate russian locale
# LANG=ru_SU.KOI8-R; export LANG
-# Uncomment next line to activate Italian locale
+# Uncomment next line to activate italian locale
# LANG=it_IT.ISO_8859-1; export LANG
# For full locales list check /usr/share/locale/*
-# Read system messages
-# msgs -f
diff --git a/etc/rc b/etc/rc
index 2a2c98d6f7d9..a4e0290a63d1 100644
--- a/etc/rc
+++ b/etc/rc
@@ -84,6 +84,10 @@ if [ $? != 0 ]; then
exit 1
fi
+# If the machine runs wall CMOS clock (compatible with MSDOS),
+# activate following line by creating empty file /etc/wall_cmos_clock
+# If this file not exist, following line does nothing (assumed
+# the machine runs UTC CMOS clock). See adjkerntz(8) for details.
adjkerntz -i
# If there is a global system configuration file, suck it in.
@@ -116,7 +120,7 @@ rm -f /etc/nologin
rm -f /var/spool/lock/*
rm -rf /var/spool/uucp/.Temp/*
rm -f /dev/log
-(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
+(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
echo clearing /tmp
@@ -197,7 +201,7 @@ if [ "X${nis_serverflags}" != X"NO" ]; then
echo -n ' ypserv'; ypserv ${nis_serverflags}
if [ "X${yppasswddflags}" != X"NO" ]; then
- echo -n ' yppasswdd'; rpc.yppasswdd ${yppasswddflags}
+ echo -n ' yppasswdd'; yppasswdd ${yppasswddflags}
fi
fi
@@ -217,7 +221,7 @@ fi
if [ "X${nfs_server}" = X"YES" -a -r /etc/exports ]; then
echo -n ' mountd'
- if [ "X${weak_mountd_authentication}" = X"YES" ]; then
+ if [ "X${pcnfsd}" = X"YES" ]; then
mountd -n
else
mountd
@@ -230,18 +234,26 @@ if [ "X${nfs_client}" = X"YES" ]; then
fi
if [ "X${amdflags}" != X"NO" ]; then
- echo -n ' amd'
- amd ${amdflags} > /var/run/amd.pid
+ echo -n ' amd'; amd ${amdflags}
+fi
+
+# These should go elsewhere but netstart is too early and I don't
+# want to touch rc.local, so...
+if [ "X${pcnfsd}" = X"YES" -a -x /usr/local/libexec/rpc.pcnfsd ]; then
+ echo -n ' rpc.pcnfsd'; /usr/local/libexec/rpc.pcnfsd &
+fi
+
+if [ "X${apache_httpd}" = X"YES" -a -x /usr/local/sbin/httpd ]; then
+ echo -n ' apache httpd'; /usr/local/sbin/httpd &
fi
# Kerberos runs ONLY on the Kerberos server machine
if [ "X${kerberos_server}" = X"YES" ]; then
echo -n ' kerberos'; kerberos >> /var/log/kerberos.log &
echo -n ' kadmind'; \
- (sleep 20; kadmind -n >/dev/null 2>&1 &) &
+ (sleep 20; /usr/sbin/kadmind -n >/dev/null 2>&1 &) &
fi
-# IP multicast routing daemon
if [ "X${mrouted}" != X"NO" -a -x /usr/sbin/mrouted ]; then
echo -n ' mrouted'; mrouted ${mrouted}
fi
@@ -270,18 +282,13 @@ if [ "$virecovery" != '/var/tmp/vi.recover/recover.*' ]; then
fi
if [ "X${accounting}" = X"YES" -a -d /var/account ]; then
- echo 'turning on accounting'
- if [ ! -e /var/account/acct ]; then
- touch /var/account/acct
- fi
- accton /var/account/acct
+ echo 'turning on accounting'; accton /var/account/acct
fi
# Now start up miscellaneous daemons that don't belong anywhere else
#
echo -n standard daemons:
echo -n ' cron'; cron
-
if [ "X${lpd}" != X"NO" -a -x /usr/sbin/lpd ]; then
echo -n ' printer'; lpd
fi
@@ -289,7 +296,7 @@ fi
# $sendmail_flags is imported from /etc/sysconfig;
# if $sendmail_flags is something other than NO, sendmail is run.
if [ "X${sendmail_flags}" != X"NO" -a -r /etc/sendmail.cf ]; then
- echo -n ' sendmail'; /usr/sbin/sendmail ${sendmail_flags}
+ echo -n ' sendmail'; sendmail ${sendmail_flags}
fi
echo '.'
@@ -301,6 +308,7 @@ if [ -x /sbin/ldconfig ]; then
if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi
if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi
if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi
+ if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi
echo 'setting ldconfig path:' ${_LDC}
ldconfig ${_LDC}
fi
@@ -311,15 +319,6 @@ if [ -f /etc/rc.${arch} ]; then
. /etc/rc.${arch}
fi
-# for each valid dir in $local_startup, search for init scripts matching *.sh
-if [ "X${local_startup}" != X"NO" ]; then
- for dir in ${local_startup}; do
- [ -d ${dir} ] && for script in ${dir}/*.sh; do
- [ -x ${script} ] && ${script} start
- done
- done
-fi
-
# Do traditional (but rather obsolete) rc.local file if it exists.
[ -f /etc/rc.local ] && sh /etc/rc.local
diff --git a/etc/rc.serial b/etc/rc.serial
index 580e505846f8..f9671e2e9cbe 100644
--- a/etc/rc.serial
+++ b/etc/rc.serial
@@ -1,7 +1,4 @@
-#!/bin/sh
-# $Id$
-
-# Change some defaults for serial devices.
+# Change some defauls for serial devices.
# Standard defaults are:
# dtrwait 300 drainwait 0
# initial cflag from <sys/ttydefaults.h> = cread cs8 hupcl
@@ -14,73 +11,57 @@
default() {
# Reset everything changed by the other functions to initial defaults.
-
- ci=$1; shift # call in device identifier
- co=$1; shift # call out device identifier
-
for i in $*
do
- comcontrol /dev/tty$ci$i dtrwait 300 drainwait 0
- stty </dev/ttyi$ci$i -clocal crtscts hupcl 9600 reprint ^R
- stty </dev/ttyl$ci$i -clocal -crtscts -hupcl 0
- stty </dev/cuai$co$i -clocal crtscts hupcl 9600 reprint ^R
- stty </dev/cual$co$i -clocal -crtscts -hupcl 0
+ comcontrol /dev/ttyd$i dtrwait 300 drainwait 0
+ stty </dev/ttyid$i -clocal crtscts hupcl 9600 reprint ^R
+ stty </dev/ttyld$i -clocal -crtscts -hupcl 0
+ stty </dev/cuaia$i -clocal crtscts hupcl 9600 reprint ^R
+ stty </dev/cuala$i -clocal -crtscts -hupcl 0
done
}
maybe() {
# Special settings.
-
- ci=$1; shift
- co=$1; shift
-
for i in $*
do
# Don't use ^R; it breaks bash's ^R when typed ahead.
- stty </dev/ttyi$ci$i reprint undef
- stty </dev/cuai$co$i reprint undef
+ stty </dev/ttyid$i reprint undef
+ stty </dev/cuaia$i reprint undef
# Lock clocal off on dialin device for security.
- stty </dev/ttyl$ci$i clocal
+ stty </dev/ttyld$i clocal
# Lock the speeds to use old binaries that don't support them.
# Any legal speed works to lock the initial speed.
- stty </dev/ttyl$ci$i 300
- stty </dev/cual$co$i 300
+ stty </dev/ttyld$i 300
+ stty </dev/cuala$i 300
done
}
modem() {
# Modem that supports CTS and perhaps RTS handshaking.
-
- ci=$1; shift
- co=$1; shift
-
for i in $*
do
# may depend on modem
- comcontrol /dev/tty$ci$i dtrwait 100 drainwait 180
+ comcontrol /dev/ttyd$i dtrwait 100 drainwait 180
# Lock crtscts on.
# Speed reasonable for V42bis.
- stty </dev/ttyi$ci$i crtscts 57600
- stty </dev/ttyl$ci$i crtscts
- stty </dev/cuai$co$i crtscts 57600
- stty </dev/cual$co$i crtscts
+ stty </dev/ttyid$i crtscts 57600
+ stty </dev/ttyld$i crtscts
+ stty </dev/cuaia$i crtscts 57600
+ stty </dev/cuala$i crtscts
done
}
mouse() {
# Mouse on either callin or callout port.
-
- ci=$1; shift
- co=$1; shift
-
for i in $*
do
# Lock clocal on, hupcl off.
# Standard speed for Microsoft mouse.
- stty </dev/ttyi$ci$i clocal -hupcl 1200
- stty </dev/ttyl$ci$i clocal hupcl
- stty </dev/cuai$co$i clocal -hupcl 1200
- stty </dev/cual$co$i clocal hupcl
+ stty </dev/ttyid$i clocal -hupcl 1200
+ stty </dev/ttyld$i clocal hupcl
+ stty </dev/cuaia$i clocal -hupcl 1200
+ stty </dev/cuala$i clocal hupcl
done
}
@@ -91,37 +72,21 @@ terminal() {
# Also works for bidirectional communications to another pc
# provided at most one side runs getty.
# Same as modem() except we want a faster speed and no dtrwait.
-
- ci=$1; shift
- co=$1; shift
-
- modem $ci $co $*
+ modem $*
for i in $*
do
- comcontrol /dev/tty$ci$i dtrwait 0
- stty </dev/ttyi$ci$i 115200
- stty </dev/cuai$co$i 115200
+ comcontrol /dev/ttyd$i dtrwait 0
+ stty </dev/ttyid$i 115200
+ stty </dev/cuaia$i 115200
done
}
# Don't use anything from this file unless you have some buggy programs
# that require it.
-
+#
# Edit the functions and the examples to suit your system.
-# $1 is the call in device identifier, $2 is the call out device identifier
-# and the remainder of the line lists the device numbers.
-
-# Initialize assorted 8250-16550 (sio) ports.
-# maybe d a 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
-# mouse d a 2
-# modem d a 1
-# terminal d a 0
-
-# Initialize all ports on a Cyclades-8yo.
-# modem c c 0 1 2 3 4 5 6 7
-
-# Initialize all ports on a Cyclades-16ye.
-# modem c c 0 1 2 3 4 5 6 7 8 9 a b c d e f
-
-# Initialize all ports on a Digiboard 8.
-# modem D D 0 1 2 3 4 5 6 7
+#
+# maybe 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
+# mouse 2
+# modem 1
+# terminal 0
diff --git a/etc/security b/etc/security
index 7cf84ab35b7c..aae50b0536f2 100644
--- a/etc/security
+++ b/etc/security
@@ -4,7 +4,6 @@
# $Id: security,v 1.8 1995/05/27 01:37:44 ache Exp $
#
PATH=/sbin:/bin:/usr/bin
-LC_ALL=C; export LC_ALL
host=`hostname -s`
echo "Subject: $host security check output"
@@ -25,17 +24,11 @@ set $MP
while test $# -ge 1; do
mount=$1
shift
- find -X $mount -xdev -type f \
- \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
- \( -perm -u+s -or -perm -g+s \) | sort
+ find $mount -xdev \( -perm -u+s -or -perm -g+s \) | sort
done | xargs -n 20 ls -lgTd > $TMP
-if [ ! -f $LOG/setuid.today ] ; then
- echo "no $LOG/setuid.today"
- cp $TMP $LOG/setuid.today
-fi
if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
- echo "$host setuid diffs:"
+ echo "$host setuid/device diffs:"
diff -b $LOG/setuid.today $TMP
mv $LOG/setuid.today $LOG/setuid.yesterday
mv $TMP $LOG/setuid.today
diff --git a/etc/services b/etc/services
index 20877b1e0292..1a65d4792bcc 100644
--- a/etc/services
+++ b/etc/services
@@ -900,7 +900,6 @@ nfsd-keepalive 1110/udp #Client status info
supfiledbg 1127/tcp # for SUP
nfa 1155/tcp #Network File Access
nfa 1155/udp #Network File Access
-phone 1167/udp #conference calling
lupa 1212/tcp
lupa 1212/udp
nerv 1222/tcp #SNI R&D network
diff --git a/etc/sysconfig b/etc/sysconfig
index 808bcd754557..3b6c07f6cb9c 100644
--- a/etc/sysconfig
+++ b/etc/sysconfig
@@ -6,13 +6,6 @@
#
# $Id: sysconfig,v 1.14.4.8 1996/03/22 17:26:48 nate Exp $
-######################### Start Of Local Configuration Section ###########
-
-# Location of local startup directories.
-local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d"
-
-######################### End Of Local Configuration Section #############
-
######################### Start Of Syscons Section #######################
# Choose keyboard map from /usr/share/syscons/keymaps/* or NO if default.
@@ -46,7 +39,7 @@ blanktime=NO
# Set to screen saver desired: blank, green, snake, star (or NO for none)
saver=NO
-# General Russian setup for example:
+# General russian setup for example:
# (koi8-r keyboard with cp866 screen font mapped to koi8-r)
#
# keymap=ru.koi8-r
@@ -77,47 +70,31 @@ defaultdomainname=NO
#
tcp_extensions=YES
-# If you're running PCNFSD or anything else which requires mountd to allow
-# non-root requests for NFS mounts, set this to YES.
-weak_mountd_authentication=NO
-
#
# Set to the list of network devices on this host. You must have an
# ifconfig_${network_interface} line for each interface listed here.
# for example:
#
# network_interfaces="ed0 sl0 lo0"
-#
# ifconfig_ed0="inet 10.0.0.1 netmask 0xffffff00"
# ifconfig_sl0="inet 10.0.1.0 netmask 0xffffff00"
-# ifconfig_lo0="inet localhost"
#
network_interfaces="lo0"
-
ifconfig_lo0="inet localhost"
#
# Set to the list of route add lines for this host. You must have a
-# route_${static_routes} line for each static route listed here (unless
-# static_routes is set to "" - do NOT use ``NO'' to denote a lack of static
-# routes!).
+# route_${static_routes} line for each static route listed here.
#
-#static_routes="foo multicast"
-#route_foo="woofo woofo-gw"
-#route_multicast="224.0.0.0 -netmask 0xf0000000 -interface 10.0.0.1"
-static_routes=""
+static_routes="multicast loopback"
+route_multicast="224.0.0.0 -netmask 0xf0000000 -interface ${hostname}"
+route_loopback="${hostname} localhost"
# Set to the host you'd like set as your default router, or NO for none.
-# This is the same as adding a ``default'' entry to static_routes.
defaultrouter=NO
-# This is the routing daemon you want to use. Possible options are
-# currently NO (for none), `routed' and `gated'. Also see `routerflags'
-# for startup flags.
-router=routed
-
# These are the flags you'd like to start the routing daemon with
-routerflags=-q
+routedflags=-q
# mrouted flags, or NO if you don't want to start mrouted. Needs kernel
# options enabled before it will work.
@@ -132,7 +109,7 @@ xntpdflags="NO"
# this is inoperative unless xntpd is enabled; NO to disable
tickadjflags="-Aq"
-# Set to the site you'd like to synchronize your clock from (gatekeeper.dec.com,
+# Set to the site you'd like to syncronize your clock from (gatekeeper.dec.com,
# for example) or NO for no such site.
ntpdate="NO"
@@ -146,11 +123,8 @@ lpd=YES
# time in minutes. If set to NO, don't start sendmail at all.
sendmail_flags="-bd -q30m"
-# Set to appropriate flags if you want to use AMD. The commented-out entry
-# provides a reasonable default, using the sample amd.map config file from the
-# /usr/src/etc directory.
+# Set to appropriate flags if you want to use AMD
amdflags="NO"
-#amdflags="-a /net -c 1800 -k i386 -d my.domain -l syslog /host /etc/amd.map"
# Set to YES if this machine will be an NFS client
nfs_client=NO
@@ -161,14 +135,14 @@ nfs_server=NO
# Set to appropriate flags if you want to start NIS for a client
nis_clientflags="NO"
-# Name of host to ypset to, if no YP server on this wire
+# Set to host to ypset to if you need to do that
nis_ypsetflags="NO"
# Set to appropriate flags if you want to start NIS for a server
nis_serverflags="NO"
-# Set to appropriate flags for rpc.yppasswdd, if you wish to run it.
-# Typical flags might be "-t /var/yp/master.passwd -s -f"
+# Set to appropriate flags for yppasswdd, if you wish to run it.
+# Typical flags might be "-m /var/yp/master.passwd -s -f"
yppasswddflags="NO"
# Set to appropriate flags for named, if you have a full-time
@@ -203,13 +177,15 @@ kerberos_server=NO
# If you want this host to be a gateway, set to YES.
gateway=NO
-# If you want this host to be a firewall or otherwise filter IP, set to YES.
-firewall=NO
+# Set to YES if you want to run gated
+gated=NO
-# Set to YES if you wish to check quotas.
+# Set to YES if you wish to check quotas. NOTE: For now this probably
+# doesn't work and should be left disabled.
check_quotas=NO
-# Set to YES to turn on accounting.
+# Set to YES to turn on accounting. NOTE: For now this probably
+# doesn't work and should be left disabled.
accounting=NO
######################### End Of Netconfig Section #######################
diff --git a/etc/syslog.conf b/etc/syslog.conf
index c907ec7107e9..73d56b70a784 100644
--- a/etc/syslog.conf
+++ b/etc/syslog.conf
@@ -7,5 +7,3 @@ cron.* /var/cron/log
*.notice;auth.debug root
*.alert root
*.emerg *
-!startslip
-*.* /var/log/slip.log
diff --git a/etc/termcap.small b/etc/termcap.small
index 7a31985aaa83..400d1962f236 100644
--- a/etc/termcap.small
+++ b/etc/termcap.small
@@ -55,7 +55,7 @@ cons50|ansil|ansi80x50:\
:li#50:tc=cons25:
cons50-m|ansil-mono|ansi80x50-mono:\
:li#50:tc=cons25-m:
-# Syscons console with koi8-r Russian code table.
+# Syscons console with koi8-r russian code table.
cons25r|pc3r|ibmpc3r|cons25-koi8-r:\
:ac=q\200x\201m\204v\211j\205t\206n\212u\207l\202w\210k\203y\230z\231f\234~\225a\220h\221`^D.^Y-^XI^U0\215:\
:tc=cons25w:
diff --git a/etc/weekly b/etc/weekly
index 8d75322d3b49..125a98668f3e 100644
--- a/etc/weekly
+++ b/etc/weekly
@@ -1,7 +1,7 @@
#!/bin/sh -
#
# @(#)weekly 5.14 (Berkeley) 6/23/91
-# $Id$
+#
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH
@@ -36,11 +36,33 @@ echo "Subject: $host weekly run output"
# rm -rf $TDIR
#fi
-if [ -f /usr/libexec/uucp/clean.weekly ]; then
+if [ -f /usr/lib/uucp/clean.weekly ]; then
echo ""
echo "Cleaning up UUCP:"
- echo /usr/libexec/uucp/clean.weekly | su daemon
+ echo /usr/lib/uucp/clean.weekly | su daemon
fi
+echo ""
+
+echo "Rotating messages:"
+cd /var/log
+if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
+if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
+if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
+mv -f messages messages.0
+cp /dev/null messages
+chmod 644 messages
+kill -1 `cat /var/run/syslog.pid`
+cd /
+
+echo "Rotating cron log:"
+cd /var/cron
+if [ -f log.2 ]; then mv -f log.2 log.3; fi
+if [ -f log.1 ]; then mv -f log.1 log.2; fi
+if [ -f log.0 ]; then mv -f log.0 log.1; fi
+mv -f log log.0
+cp /dev/null log
+chmod 600 log
+cd /
echo ""
echo "Rebuilding locate database:"
@@ -54,14 +76,8 @@ echo ""
echo "Rebuilding whatis database:"
MANPATH=${MANPATH:-/usr/share/man:/usr/X11R6/man:/usr/local/man}
-makewhatis.local "${MANPATH}"
+makewhatis "${MANPATH}"
#echo ""
#echo "Reformatting manual pages:"
-#echo catman.local "${MANPATH}" | su -fm man
-
-echo ""
-echo "Cleaning up kernel database files:"
-kernel=`sysctl -n kern.bootfile`
-kernel=kvm_`basename ${kernel}`.db
-find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a -atime +7 -exec rm -f -- {} \;
+#echo catman "${MANPATH}" | su man
diff --git a/games/Makefile b/games/Makefile
index f342283519fc..15f5c81f4ad9 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -1,5 +1,4 @@
# @(#)Makefile 8.2 (Berkeley) 3/31/94
-# $Id$
# XXX missing: chess ching monop [copyright]
SUBDIR= adventure arithmetic atc backgammon battlestar bcd boggle bs caesar \
diff --git a/games/adventure/done.c b/games/adventure/done.c
index dcd8e335f202..fd286fd2d3e1 100644
--- a/games/adventure/done.c
+++ b/games/adventure/done.c
@@ -42,7 +42,6 @@ static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
/* Re-coding of advent in C: termination routines */
-#include <stdio.h>
#include "hdr.h"
score() /* sort of like 20000 */
diff --git a/games/adventure/init.c b/games/adventure/init.c
index 8236c52e04b3..137f3c8b8a17 100644
--- a/games/adventure/init.c
+++ b/games/adventure/init.c
@@ -43,9 +43,7 @@ static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
/* Re-coding of advent in C: data initialization */
#include <sys/types.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
#include "hdr.h"
int blklin = TRUE;
diff --git a/games/adventure/io.c b/games/adventure/io.c
index 0f7bd3fb263b..c6ae4fe5e87d 100644
--- a/games/adventure/io.c
+++ b/games/adventure/io.c
@@ -44,7 +44,6 @@ static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#include "hdr.h"
#include <stdio.h>
-#include <stdlib.h>
getin(wrd1,wrd2) /* get command from user */
diff --git a/games/adventure/main.c b/games/adventure/main.c
index 89629dfd12c3..6de4c37d0948 100644
--- a/games/adventure/main.c
+++ b/games/adventure/main.c
@@ -49,7 +49,6 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93";
/* Re-coding of advent in C: main program */
#include <sys/file.h>
-#include <signal.h>
#include <stdio.h>
#include "hdr.h"
diff --git a/games/adventure/save.c b/games/adventure/save.c
index 6501fbd5d80c..8dea684be8aa 100644
--- a/games/adventure/save.c
+++ b/games/adventure/save.c
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
#include <stdio.h>
-#include <stdlib.h>
#include "hdr.h"
struct savestruct
diff --git a/games/adventure/subr.c b/games/adventure/subr.c
index d723512c8740..3e2ef7b2dfdd 100644
--- a/games/adventure/subr.c
+++ b/games/adventure/subr.c
@@ -42,7 +42,6 @@ static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93";
/* Re-coding of advent in C: subroutines from main */
-#include <stdio.h>
# include "hdr.h"
/* Statement functions */
diff --git a/games/adventure/vocab.c b/games/adventure/vocab.c
index f5cfb3a4b47b..d060433640c7 100644
--- a/games/adventure/vocab.c
+++ b/games/adventure/vocab.c
@@ -42,7 +42,6 @@ static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93";
/* Re-coding of advent in C: data structure routines */
-#include <stdio.h>
# include "hdr.h"
dstroy(object)
diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c
index 0a18e265e494..4eaf055590f3 100644
--- a/games/adventure/wizard.c
+++ b/games/adventure/wizard.c
@@ -42,8 +42,6 @@ static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93";
/* Re-coding of advent in C: privileged operations */
-#include <sys/types.h>
-#include <stdio.h>
# include "hdr.h"
datime(d,t)
diff --git a/games/atc/Makefile b/games/atc/Makefile
index 80305a183347..e6433c4f73c8 100644
--- a/games/atc/Makefile
+++ b/games/atc/Makefile
@@ -12,7 +12,7 @@ CLEANFILES=grammar.c y.tab.h lex.c
HIDEGAME=hidegame
beforeinstall:
- (cd ${.CURDIR}/games; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 400 \
+ (cd ${.CURDIR}/games; install -c -o ${BINOWN} -g ${BINGRP} -m 400 \
${GAMES} ${DESTDIR}/usr/share/games/atc)
.include <bsd.prog.mk>
diff --git a/games/backgammon/common_source/backgammon.c b/games/backgammon/common_source/backgammon.c
index 6e00a5a2cc3a..1385fa7960ff 100644
--- a/games/backgammon/common_source/backgammon.c
+++ b/games/backgammon/common_source/backgammon.c
@@ -94,14 +94,14 @@ main()
srand(time(0));
go[5] = NIL;
fprintf(stdout, "Instructions? ");
- fgets(s, 100, stdin);
+ gets(s);
if(*s == 'y')
instructions();
putchar('\n');
fprintf(stdout, "Opponent's level: b - beginner,\n");
fprintf(stdout, "i - intermediate, e - expert? ");
level='e';
- fgets(s, 100, stdin);
+ gets(s);
if(*s == 'b')
level = 'b';
else if(*s == 'i')
@@ -109,12 +109,12 @@ main()
putchar('\n');
fprintf(stdout, "You will play brown.\n\n");
fprintf(stdout, "Would you like to roll your own dice? ");
- fgets(s, 100, stdin);
+ gets(s);
putchar('\n');
if(*s == 'y')
nobroll = 1;
fprintf(stdout, "Would you like to go first? ");
- fgets(s, 100, stdin);
+ gets(s);
putchar('\n');
if(*s == 'y')
goto nowhmove;
@@ -141,7 +141,7 @@ nowhmove:
retry:
fprintf(stdout, "\nYour roll is %d %d\n", die1, die2);
fprintf(stdout, "Move? ");
- fgets(s, 100, stdin);
+ gets(s);
switch(*s) {
case '\0': /* empty line */
fprintf(stdout, "Brown's move skipped.\n");
@@ -362,7 +362,7 @@ roll(who)
if(who == BROWN && nobroll) {
fprintf(stdout, "Roll? ");
- fgets(s, 10, stdin);
+ gets(s);
n = sscanf(s, "%d%d", &die1, &die2);
if(n != 2 || die1 < 1 || die1 > 6 || die2 < 1 || die2 > 6)
fprintf(stdout, "Illegal - I'll do it!\n");
diff --git a/games/bcd/bcd.6 b/games/bcd/bcd.6
index 42d12f93f4f0..62b47191a79c 100644
--- a/games/bcd/bcd.6
+++ b/games/bcd/bcd.6
@@ -45,18 +45,14 @@
.Nm ppt
.Op Ar string ...
.Nm morse
-.Op Fl p
-.Op Fl w Ar speed
-.Op Fl f Ar frequency
-.Op Fl s
-.Op Ar string ...
+.Op Fl s Ar string ...
.Sh DESCRIPTION
The commands
.Nm bcd ,
.Nm ppt
and
.Nm morse
-read the given input and reformat it in the form of punched cards,
+reads the given input and reformats it in the form of punched cards,
paper tape or morse code respectively.
Acceptable input are command line arguments or the standard input.
.Pp
@@ -66,70 +62,6 @@ Available option:
The
.Fl s
option for morse produces dots and dashes rather than words.
-.It Fl p
-Send morse the real way. This only works if your system has sound
-support and if the program understands your audio hardware.
-.It Fl w Ar speed
-Set the sending speed in words per minute. If not specified the default
-speed of 20 WPM is used.
-.It Fl f Ar frequency
-Set the sidetone frequency to something other than the default 600 Hz.
.El
-.Pp
-The
-.Fl w
-and
-.Fl f
-flags only work in conjunction with the
-.Fl p
-flag.
-.Pp
-Not all prosigns have corresponding characters. Use
-.Ql #
-for
-.Em AS ,
-.Ql @
-for
-.Em SK ,
-.Ql *
-for
-.Em VE
-and
-.Ql %
-for
-.Em BK .
-The more common prosigns are
-.Ql =
-for
-.Em BT ,
-.Ql (
-for
-.Em KN
-and
-.Ql +
-for
-.Em AR .
.Sh FILES
-.Bl -tag -width /dev/speaker -compact
-.It Pa /dev/speaker
-speaker device file
-.El
-.Sh ENVIRONMENT
-.Bl -tag -width LC_CTYPE
-.It Ev LC_CTYPE
-.It Ev LANG
-If one of these variables is set to a locale ending in
-.Ql KOI8-R ,
-characters with the high-order bit set are being interpreted as
-Cyrillic characters. In all other cases, they are being interpreted
-as belonging to the
-.Ql ISO_8859-1
-character set.
-.Sh HISTORY
-Sound support added by Lyndon Nerenberg (VE7TCP/VE6BBM) <lyndon@orthanc.com>.
-.Sh BUGS
-Does only understand a few European characters (namely German and
-French), but neither Asian ones, or the continental landline code.
-.Pp
-Sends a bit slower than it should due to system overhead. Some people
-would call this a feature.
+.SH HISTORY
diff --git a/games/caesar/Makefile b/games/caesar/Makefile
index b9e4bca7cf2e..13ff87d08dd9 100644
--- a/games/caesar/Makefile
+++ b/games/caesar/Makefile
@@ -6,10 +6,8 @@ DPADD= ${LIBM}
LDADD= -lm
MLINKS= caesar.6 rot13.6
-CFLAGS+= -Wall
-
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/rot13.sh ${DESTDIR}/usr/games/rot13
.include <bsd.prog.mk>
diff --git a/games/caesar/caesar.6 b/games/caesar/caesar.6
index 8c600c0d572e..cadcc0fdc3dd 100644
--- a/games/caesar/caesar.6
+++ b/games/caesar/caesar.6
@@ -36,20 +36,20 @@
.Os
.Sh NAME
.Nm caesar
-.Nd decrypt caesar ciphers
+.Nd decrypt caesar cyphers
.Sh SYNOPSIS
.Nm caesar
.Op Ar rotation
.Sh DESCRIPTION
The
.Nm caesar
-utility attempts to decrypt caesar ciphers using English letter frequency
+utility attempts to decrypt caesar cyphers using English letter frequency
statistics.
.Nm Caesar
reads from the standard input and writes to the standard output.
.Pp
The optional numerical argument
-.Ar rotation
+Ar rotation
may be used to specify a specific rotation value.
.Pp
The frequency (from most common to least) of English letters is as follows:
diff --git a/games/caesar/caesar.c b/games/caesar/caesar.c
index 749da50d7fb7..b0027860fded 100644
--- a/games/caesar/caesar.c
+++ b/games/caesar/caesar.c
@@ -40,28 +40,24 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93";
+static char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
-#include <errno.h>
#include <math.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include <unistd.h>
#define LINELENGTH 2048
#define ROTATE(ch, perm) \
- isascii(ch) ? ( \
isupper(ch) ? ('A' + (ch - 'A' + perm) % 26) : \
- islower(ch) ? ('a' + (ch - 'a' + perm) % 26) : ch) : ch
+ islower(ch) ? ('a' + (ch - 'a' + perm) % 26) : ch
/*
* letter frequencies (taken from some unix(tm) documentation)
@@ -73,15 +69,15 @@ double stdf[26] = {
2.62, 0.81, 1.88, 0.23, 2.07, 0.06,
};
-void printit();
-
-void main(argc, argv)
+main(argc, argv)
int argc;
char **argv;
{
- register int ch, dot, i, nread, winnerdot = 0;
+ extern int errno;
+ register int ch, dot, i, nread, winnerdot;
register char *inbuf;
int obs[26], try, winner;
+ char *malloc(), *strerror();
if (argc > 1)
printit(argv[1]);
@@ -103,13 +99,11 @@ void main(argc, argv)
exit(1);
}
for (i = nread; i--;) {
- ch = (unsigned char) inbuf[i];
- if (isascii(ch)) {
- if (islower(ch))
- ++obs[ch - 'a'];
- else if (isupper(ch))
- ++obs[ch - 'A'];
- }
+ ch = inbuf[i];
+ if (islower(ch))
+ ++obs[ch - 'a'];
+ else if (isupper(ch))
+ ++obs[ch - 'A'];
}
/*
@@ -132,7 +126,7 @@ void main(argc, argv)
for (;;) {
for (i = 0; i < nread; ++i) {
- ch = (unsigned char) inbuf[i];
+ ch = inbuf[i];
putchar(ROTATE(ch, winner));
}
if (nread < LINELENGTH)
@@ -145,7 +139,7 @@ void main(argc, argv)
exit(0);
}
-void printit(arg)
+printit(arg)
char *arg;
{
register int ch, rot;
diff --git a/games/caesar/rot13.sh b/games/caesar/rot13.sh
index b71300f959d2..93fb93557116 100644
--- a/games/caesar/rot13.sh
+++ b/games/caesar/rot13.sh
@@ -34,4 +34,4 @@
# @(#)rot13.sh 8.1 (Berkeley) 5/31/93
#
-/usr/games/caesar 13 $*
+caesar 13 $*
diff --git a/games/canfield/canfield/Makefile b/games/canfield/canfield/Makefile
index 7b60e2924ef9..ea503021a110 100644
--- a/games/canfield/canfield/Makefile
+++ b/games/canfield/canfield/Makefile
@@ -5,7 +5,6 @@ MAN6= canfield.6
DPADD= ${LIBCURSES} ${LIBTERMCAP} ${LIBCOMPAT}
LDADD= -lcurses -ltermcap -lcompat
HIDEGAME=hidegame
-MLINKS= canfield.6 cfscores.6
.include "../../Makefile.inc"
diff --git a/games/cribbage/Makefile b/games/cribbage/Makefile
index 5d93bf61b3c0..bb5ab6a13439 100644
--- a/games/cribbage/Makefile
+++ b/games/cribbage/Makefile
@@ -8,7 +8,7 @@ MAN6= cribbage.6
HIDEGAME=hidegame
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/cribbage.n \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/cribbage.n \
${DESTDIR}/usr/share/games/cribbage.instr
.include <bsd.prog.mk>
diff --git a/games/fish/Makefile b/games/fish/Makefile
index fa2e4195b784..a57454f4e2cd 100644
--- a/games/fish/Makefile
+++ b/games/fish/Makefile
@@ -5,7 +5,7 @@ MAN6= fish.6
HIDEGAME=hidegame
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fish.instr \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fish.instr \
${DESTDIR}/usr/share/games/fish.instr
.include <bsd.prog.mk>
diff --git a/games/fortune/Makefile b/games/fortune/Makefile
index d360284b29d3..70778cf00022 100644
--- a/games/fortune/Makefile
+++ b/games/fortune/Makefile
@@ -1,11 +1,15 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-SUBDIR= fortune
+SUBDIR= fortune
+
+.ifmake (clean) || (cleandir) || (obj)
+SUBDIR+=datfiles
+.endif
.if !make(install) && !make(distribute)
SUBDIR+=strfile
+.else
+SUBDIR+=datfiles
.endif
-SUBDIR+= datfiles
-
.include <bsd.subdir.mk>
diff --git a/games/fortune/datfiles/Makefile b/games/fortune/datfiles/Makefile
index 72786eeb2d02..14b3f9a77e86 100644
--- a/games/fortune/datfiles/Makefile
+++ b/games/fortune/datfiles/Makefile
@@ -15,37 +15,22 @@ TYPE= real
# THE FOURTH LINE
#TYPE= fake
-.if exists(${.CURDIR}/../../caesar/obj/caesar)
-CAESAR=${.CURDIR}/../../caesar/obj/caesar
-.elif exists(${.CURDIR}/../../caesar/caesar)
-CAESAR=${.CURDIR}/../../caesar/caesar
-.else
-CAESAR=/usr/games/caesar
-.endif
-
-.if exists(${.CURDIR}/../strfile/obj/strfile)
-STRFILE=${.CURDIR}/../strfile/obj/strfile
-.else
-STRFILE=${.CURDIR}/../strfile/strfile
-.endif
-
CLEANFILES+=${BLDS}
-all: ${SRCS} ${BLDS}
-
-install:
- (cd ${.CURDIR} && ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+install: ${SRCS} ${BLDS}
+ (cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${SRCS} ${DESTDIR}/usr/share/games/fortune)
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${BLDS} \
+ install -o ${BINOWN} -g ${BINGRP} -m 444 ${BLDS} \
${DESTDIR}/usr/share/games/fortune
fortunes.dat fortunes2.dat fortunes2-o.dat limerick.dat startrek.dat zippy.dat:
- ${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
+ ${.CURDIR}/../strfile/obj/strfile -rs \
+ ${.CURDIR}/${.TARGET:R} ${.TARGET}
fortunes-o.dat: fortunes-o
- ${STRFILE} -rsx fortunes-o ${.TARGET}
+ ${.CURDIR}/../strfile/obj/strfile -rsx fortunes-o ${.TARGET}
fortunes-o: fortunes-o.${TYPE}
- ${CAESAR} 13 < ${.ALLSRC} > ${.TARGET}
+ PATH=../../caesar:$$PATH ; caesar 13 < ${.ALLSRC} > ${.TARGET}
.include <bsd.prog.mk>
diff --git a/games/fortune/datfiles/fortunes b/games/fortune/datfiles/fortunes
index 6fdb71d4f5b4..2f69757157d0 100644
--- a/games/fortune/datfiles/fortunes
+++ b/games/fortune/datfiles/fortunes
@@ -5320,10 +5320,10 @@ of this thing with at least a cabin cruiser.
motto is: 'It is very difficult to disprove certain kinds of pain.'"
-- Dave Barry, "Pain and Suffering"
%
-Hier liegt ein Mann ganz ohnegleich;
-Im Leibe dick, an Suenden reich.
+Hier liegt ein Mann ganz obnegleich;
+Im Leibe dick, an Suden reich.
Wir haben ihn in das Grab gesteckt, Here lies a man with sundry flaws
-Weil es uns duenkt er sei verreckt. And numerous Sins upon his head;
+Weil es uns dunkt er sei verreckt. And numerous Sins upon his head;
We buried him today because
As far as we can tell, he's dead.
-- PDQ Bach's epitaph, as requested by his cousin Betty
diff --git a/games/fortune/datfiles/fortunes.sp.ok b/games/fortune/datfiles/fortunes.sp.ok
index 4e39cf029a65..e9fbace02ea2 100644
--- a/games/fortune/datfiles/fortunes.sp.ok
+++ b/games/fortune/datfiles/fortunes.sp.ok
@@ -1075,7 +1075,7 @@ Stoppard
Stormtroopers
Stretchy
Stult's
-Suenden
+Suden
Sulu
Sumeria
Summatra
@@ -1445,7 +1445,7 @@ drivel
drop't
dummkopfen
dumpster
-duenkt
+dunkt
e.g
ecamier
ee
@@ -1715,8 +1715,8 @@ nylleucylisoleucylarginylglutaminyllysylhistidylprolythreonylisoleucylprolyli
nylprolylprolylleucylglutaminylglycylphenylalanylglycylisoleucylserylalanylpro
obits
obius
+obnegleich
obscurantist
-ohnegleich
okay
ol;lkld;f;g;dd;po
oln
diff --git a/games/fortune/datfiles/fortunes2 b/games/fortune/datfiles/fortunes2
index bd52f56911c0..d4d297170dc0 100644
--- a/games/fortune/datfiles/fortunes2
+++ b/games/fortune/datfiles/fortunes2
@@ -20433,10 +20433,10 @@ Hideously disfigured by an ancient Indian curse?
Call (511) 338-0959 for an immediate appointment.
%
-Hier liegt ein Mann ganz ohnegleich;
-Im Leibe dick, an Suenden reich.
+Hier liegt ein Mann ganz obnegleich;
+Im Leibe dick, an Suden reich.
Wir haben ihn in das Grab gesteckt, Here lies a man with sundry flaws
-Weil es uns duenkt er sei verreckt. And numerous Sins upon his head;
+Weil es uns dunkt er sei verreckt. And numerous Sins upon his head;
We buried him today because
As far as we can tell, he's dead.
diff --git a/games/fortune/fortune/fortune.6 b/games/fortune/fortune/fortune.6
index 725817ced1f6..ad7d997585ef 100644
--- a/games/fortune/fortune/fortune.6
+++ b/games/fortune/fortune/fortune.6
@@ -169,4 +169,4 @@ fortune 50% funny 50% not
.El
.Sh SEE ALSO
.Xr regex 3 ,
-.Xr regcomp 3 ,
+.Xr regcmp 3 ,
diff --git a/games/hack/hack.version.c b/games/hack/hack.version.c
index 3ac6868c151a..81049ea0750a 100644
--- a/games/hack/hack.version.c
+++ b/games/hack/hack.version.c
@@ -1,6 +1,6 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.version.c - version 1.0.3 */
-/* $Header: hack.version.c,v 1.5 85/05/09 00:40:41 aeb Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/games/hack/hack.version.c,v 1.1.1.1 1994/09/04 04:02:54 jkh Exp $ */
#include "date.h"
diff --git a/games/larn/Makefile b/games/larn/Makefile
index 4aab5e708bff..78d3e102087a 100644
--- a/games/larn/Makefile
+++ b/games/larn/Makefile
@@ -62,8 +62,8 @@ LDADD= -ltermcap -lcompat
HIDEGAME=hidegame
beforeinstall:
- (cd ${.CURDIR}/datfiles; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} \
- -m 444 larnmaze larnopts larn.help \
+ (cd ${.CURDIR}/datfiles; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ larnmaze larnopts larn.help \
${DESTDIR}/usr/share/games/larn)
.include <bsd.prog.mk>
diff --git a/games/larn/larn.6 b/games/larn/larn.6
index e64ee6f4402c..6b4728150395 100644
--- a/games/larn/larn.6
+++ b/games/larn/larn.6
@@ -150,8 +150,8 @@ of the spell you are casting.
.Sh AUTHOR
Noah Morgan
.Sh FILES
-.Bl -tag -width "/var/games/larn/lscore12.0" -compact
-.It Pa /var/games/larn/lscore12.0
+.Bl -tag -width "/var/games/larn.scores" -compact
+.It Pa /var/games/larn.scores
Score file.
.It Pa ~/.larnopts
Options file.
diff --git a/games/mille/mille.6 b/games/mille/mille.6
index 29ae50b640cc..bcd1af68c4b4 100644
--- a/games/mille/mille.6
+++ b/games/mille/mille.6
@@ -105,7 +105,7 @@ Ken Arnold
.br
(The game itself is a product of Parker Brothers, Inc.)
.SH "SEE ALSO"
-curses(3),
+curses(3X),
.I "Screen Updating and Cursor Movement Optimization:"
.IR "A Library Package" ,
Ken Arnold
diff --git a/games/mille/varpush.c b/games/mille/varpush.c
index a81e340444a9..c31d833ba9e4 100644
--- a/games/mille/varpush.c
+++ b/games/mille/varpush.c
@@ -75,7 +75,7 @@ reg int (*func)(); {
char buf[80];
over:
printf("Debug file:");
- fgets(buf, 80, stdin);
+ gets(buf);
if ((outf = fopen(buf, "w")) == NULL) {
perror(buf);
goto over;
diff --git a/games/morse/Makefile b/games/morse/Makefile
index 444118974071..1d23a0a76812 100644
--- a/games/morse/Makefile
+++ b/games/morse/Makefile
@@ -3,6 +3,6 @@
PROG= morse
NOMAN= noman
HIDEGAME=hidegame
-CFLAGS += -DSPEAKER=\"/dev/speaker\"
.include <bsd.prog.mk>
+
diff --git a/games/morse/morse.c b/games/morse/morse.c
index a78e29fe313b..ca8a7a340e3b 100644
--- a/games/morse/morse.c
+++ b/games/morse/morse.c
@@ -31,11 +31,6 @@
* SUCH DAMAGE.
*/
-/*
- * Taught to send *real* morse by Lyndon Nerenberg (VE7TCP/VE6BBM)
- * <lyndon@orthanc.com>
- */
-
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1988, 1993\n\
@@ -48,319 +43,103 @@ static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93";
#include <stdio.h>
#include <ctype.h>
-#include <locale.h>
-#include <stdlib.h>
-
-#ifdef SPEAKER
-#include <machine/speaker.h>
-#include <fcntl.h>
-#endif
-
-struct morsetab {
- char inchar;
- char *morse;
-};
-
-static struct morsetab mtab[] = {
-
- /* letters */
-
- 'a', ".-",
- 'b', "-...",
- 'c', "-.-.",
- 'd', "-..",
- 'e', ".",
- 'f', "..-.",
- 'g', "--.",
- 'h', "....",
- 'i', "..",
- 'j', ".---",
- 'k', "-.-",
- 'l', ".-..",
- 'm', "--",
- 'n', "-.",
- 'o', "---",
- 'p', ".--.",
- 'q', "--.-",
- 'r', ".-.",
- 's', "...",
- 't', "-",
- 'u', "..-",
- 'v', "...-",
- 'w', ".--",
- 'x', "-..-",
- 'y', "-.--",
- 'z', "--..",
-
- /* digits */
-
- '0', "-----",
- '1', ".----",
- '2', "..---",
- '3', "...--",
- '4', "....-",
- '5', ".....",
- '6', "-....",
- '7', "--...",
- '8', "---..",
- '9', "----.",
-
- /* punctuation */
- ',', "--..--",
- '.', ".-.-.-",
- '?', "..--..",
- '/', "-..-.",
- '-', "-....-",
- '=', "-...-", /* BT */
- ':', "---...",
- ';', "-.-.-.",
- '(', "-.--.", /* KN */
- ')', "-.--.-",
- '$', "...-..-",
- '+', ".-.-.", /* AR */
-
- /* prosigns without already assigned values */
-
- '#', ".-...", /* AS */
- '@', "...-.-", /* SK */
- '*', "...-.", /* VE */
- '%', "-...-.-", /* BK */
-
- '\0', ""
-};
-
-
-static struct morsetab iso8859tab[] = {
- 'á', ".--.-",
- 'à', ".--.-",
- 'â', ".--.-",
- 'ä', ".-.-",
- 'ç', "-.-..",
- 'é', "..-..",
- 'è', "..-..",
- 'ê', "-..-.",
- 'ö', "---.",
- 'ü', "..--",
-
- '\0', ""
-};
-
-static struct morsetab koi8rtab[] = {
- /*
- * the cyrillic alphabet; you'll need a KOI8R font in order
- * to see the actual characters
- */
- 'Á', ".-", /* a */
- 'Â', "-...", /* be */
- '×', ".--", /* ve */
- 'Ç', "--.", /* ge */
- 'Ä', "-..", /* de */
- 'Å', ".", /* ye */
- 'Ö', "...-", /* she */
- 'Ú', "--..", /* ze */
- 'É', "..", /* i */
- 'Ê', ".---", /* i kratkoye */
- 'Ë', "-.-", /* ka */
- 'Ì', ".-..", /* el */
- 'Í', "--", /* em */
- 'Î', "-.", /* en */
- 'Ï', "---", /* o */
- 'Ð', ".--.", /* pe */
- 'Ò', ".-.", /* er */
- 'Ó', "...", /* es */
- 'Ô', "-", /* te */
- 'Õ', "..-", /* u */
- 'Æ', "..-.", /* ef */
- 'È', "....", /* kha */
- 'Ã', "-.-.", /* ce */
- 'Þ', "---.", /* che */
- 'Û', "----", /* sha */
- 'Ý', "--.-", /* shcha */
- 'Ù', "-.--", /* yi */
- 'Ø', "-..-", /* myakhkij znak */
- 'Ü', "..-..", /* ae */
- 'À', "..--", /* yu */
- 'Ñ', ".-.-", /* ya */
-
- '\0', ""
+static char
+ *digit[] = {
+ "-----",
+ ".----",
+ "..---",
+ "...--",
+ "....-",
+ ".....",
+ "-....",
+ "--...",
+ "---..",
+ "----.",
+},
+ *alph[] = {
+ ".-",
+ "-...",
+ "-.-.",
+ "-..",
+ ".",
+ "..-.",
+ "--.",
+ "....",
+ "..",
+ ".---",
+ "-.-",
+ ".-..",
+ "--",
+ "-.",
+ "---",
+ ".--.",
+ "--.-",
+ ".-.",
+ "...",
+ "-",
+ "..-",
+ "...-",
+ ".--",
+ "-..-",
+ "-.--",
+ "--..",
};
-void show(const char *), play(const char *), morse(char);
-
-static int pflag, sflag;
-static int wpm = 20; /* words per minute */
-#define FREQUENCY 600
-static int freq = FREQUENCY;
-
-#ifdef SPEAKER
-#define DASH_LEN 3
-#define CHAR_SPACE 3
-#define WORD_SPACE (7 - CHAR_SPACE - 1)
-static float dot_clock;
-int spkr;
-tone_t sound;
-#endif
+static int sflag;
-static struct morsetab *hightab = iso8859tab;
-
-int
-main(int argc, char **argv)
+main(argc, argv)
+ int argc;
+ char **argv;
{
- extern char *optarg;
- extern int optind;
- register int ch;
- register char *p;
+ extern char *optarg;
+ extern int optind;
+ register int ch;
+ register char *p;
- while ((ch = getopt(argc, argv, "spw:f:")) != EOF)
- switch ((char) ch) {
- case 'f':
- freq = atoi(optarg);
- break;
- case 'p':
- pflag = 1;
- break;
+ while ((ch = getopt(argc, argv, "s")) != EOF)
+ switch((char)ch) {
case 's':
sflag = 1;
break;
- case 'w':
- wpm = atoi(optarg);
- break;
case '?':
default:
- fputs("usage: morse [-s] [-p] [-w speed] [-f frequency] [string ...]\n", stderr);
- exit(1);
- }
- if (pflag && sflag) {
- fputs("morse: only one of -p and -s allowed\n", stderr);
- exit(1);
- }
- if (pflag && ((wpm < 1) || (wpm > 60))) {
- fputs("morse: insane speed\n", stderr);
- exit(1);
- }
- if (pflag && (freq == 0))
- freq = FREQUENCY;
-
- (void)setuid(getuid());
-#ifdef SPEAKER
- if (pflag) {
- if ((spkr = open(SPEAKER, O_WRONLY, 0)) == -1) {
- perror(SPEAKER);
+ fprintf(stderr, "usage: morse [string ...]");
exit(1);
}
- dot_clock = wpm / 2.4; /* dots/sec */
- dot_clock = 1 / dot_clock; /* duration of a dot */
- dot_clock = dot_clock / 2; /* dot_clock runs at twice */
- /* the dot rate */
- dot_clock = dot_clock * 100; /* scale for ioctl */
- }
-#endif
argc -= optind;
argv += optind;
- if((p = getenv("LC_CTYPE")) || (p = getenv("LANG"))) {
- if(strlen(p) >= strlen("KOI8-R") &&
- strcasecmp(&p[strlen(p) - strlen("KOI8-R")], "KOI8-R") == 0)
- hightab = koi8rtab;
- setlocale(LC_CTYPE, p);
- } else {
- setlocale(LC_CTYPE, "");
- }
-
- if (*argv) {
+ if (*argv)
do {
- for (p = *argv; *p; ++p) {
- morse((int) *p);
- }
- morse((int) ' ');
+ for (p = *argv; *p; ++p)
+ morse((int)*p);
} while (*++argv);
- } else {
- while ((ch = getchar()) != EOF)
- morse(ch);
- }
- exit(0);
+ else while ((ch = getchar()) != EOF)
+ morse(ch);
}
-void
-morse(char c)
+morse(c)
+ register int c;
{
- struct morsetab *m;
-
if (isalpha(c))
- c = tolower(c);
- if ((c == '\r') || (c == '\n'))
- c = ' ';
- if (c == ' ') {
- if (pflag) {
- play(" ");
- return;
- } else {
- show("");
- return;
- }
- }
- for (m = ((unsigned char)c < 0x80? mtab: hightab);
- m->inchar != '\0';
- m++) {
- if (m->inchar == c) {
- if (pflag) {
- play(m->morse);
- } else
- show(m->morse);
- }
- }
+ show(alph[c - (isupper(c) ? 'A' : 'a')]);
+ else if (isdigit(c))
+ show(digit[c - '0']);
+ else if (c == ',')
+ show("--..--");
+ else if (c == '.')
+ show(".-.-.-");
+ else if (isspace(c))
+ show(" ...\n");
}
-void
-show(const char *s)
+show(s)
+ register char *s;
{
if (sflag)
printf(" %s", s);
- else
- for (; *s; ++s)
- printf(" %s", *s == '.' ? "dit" : "dah");
- printf("\n");
-}
-
-void
-play(const char *s)
-{
-#ifdef SPEAKER
- const char *c;
-
- for (c = s; *c != '\0'; c++) {
- switch ((int) *c) {
- case '.':
- sound.frequency = freq;
- sound.duration = dot_clock;
- break;
- case '-':
- sound.frequency = freq;
- sound.duration = dot_clock * DASH_LEN;
- break;
- case ' ':
- sound.frequency = 0;
- sound.duration = dot_clock * WORD_SPACE;
- break;
- default:
- sound.duration = 0;
- }
- if (sound.duration) {
- if (ioctl(spkr, SPKRTONE, &sound) == -1) {
- perror("ioctl play");
- exit(1);
- }
- }
- sound.frequency = 0;
- sound.duration = dot_clock;
- if (ioctl(spkr, SPKRTONE, &sound) == -1) {
- perror("ioctl rest");
- exit(1);
- }
- }
- sound.frequency = 0;
- sound.duration = dot_clock * CHAR_SPACE;
- ioctl(spkr, SPKRTONE, &sound);
-#endif
+ else for (; *s; ++s)
+ printf(" %s", *s == '.' ? "dit" : "daw");
+ printf(",\n");
}
diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile
index 8e6ecccc10fb..7c6191679157 100644
--- a/games/phantasia/Makefile
+++ b/games/phantasia/Makefile
@@ -16,16 +16,16 @@ setup: phantglobs.o setup.o monsters.asc ${LIBM}
beforeinstall:
./setup -m ${.CURDIR}/monsters.asc
- ${INSTALL} -c -m 660 -o games -g bin gold ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin lastdead ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin mess ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin monsters ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin motd ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin characs ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin scoreboard ${DESTDIR}/var/games/phantasia
- ${INSTALL} -c -m 660 -o games -g bin void ${DESTDIR}/var/games/phantasia
-
-# Make Phantasia map. Change the map commands reflect your ${INSTALL}ation.
+ install -c -m 660 -o games -g bin gold ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin lastdead ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin mess ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin monsters ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin motd ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin characs ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin scoreboard ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin void ${DESTDIR}/var/games/phantasia
+
+# Make Phantasia map. Change the map commands reflect your installation.
# PLOTDEVICE is used for plotting the map. Change as appropriate.
map: map.c
diff --git a/games/quiz/Makefile b/games/quiz/Makefile
index fabca7f548bf..804464424ff6 100644
--- a/games/quiz/Makefile
+++ b/games/quiz/Makefile
@@ -10,7 +10,7 @@ CATS= africa america areas arith asia babies bard chinese collectives \
HIDEGAME=hidegame
beforeinstall:
- (cd ${.CURDIR}/datfiles; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} \
- -m 444 ${CATS} ${DESTDIR}/usr/share/games/quiz.db)
+ (cd ${.CURDIR}/datfiles; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${CATS} ${DESTDIR}/usr/share/games/quiz.db)
.include <bsd.prog.mk>
diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c
index 25ee3ed5f544..aa5f52783e6f 100644
--- a/games/quiz/quiz.c
+++ b/games/quiz/quiz.c
@@ -316,14 +316,11 @@ appdstr(s, tp, len)
if ((m = malloc(strlen(s) + len + 1)) == NULL)
err("%s", strerror(errno));
for (mp = m, sp = s; *mp++ = *sp++;);
- mp--;
if (*(mp - 1) == '\\')
--mp;
- memcpy(mp, tp, len);
- mp[len] = '\0';
- if (mp[len - 1] == '\n')
- mp[len - 1] = '\0';
+ while ((ch = *mp++ = *tp++) && ch != '\n');
+ *mp = '\0';
free(s);
return (m);
diff --git a/games/robots/Makefile b/games/robots/Makefile
index bded13469ba8..7e9af468a2f1 100644
--- a/games/robots/Makefile
+++ b/games/robots/Makefile
@@ -10,7 +10,7 @@ LDADD= -lcurses -ltermcap -lcompat
HIDEGAME=hidegame
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
${DESTDIR}/var/games/robots_roll
.include <bsd.prog.mk>
diff --git a/games/sail/pl_main.c b/games/sail/pl_main.c
index 02faa79390b5..7b1f457662c7 100644
--- a/games/sail/pl_main.c
+++ b/games/sail/pl_main.c
@@ -198,12 +198,11 @@ reprint:
else {
(void) printf("Your name, Captain? ");
(void) fflush(stdout);
- (void) fgets(captain, sizeof captain, stdin);
+ (void) gets(captain);
if (!*captain)
(void) strcpy(captain, "no name");
- else
- captain[strlen(captain) - 1] = '\0';
}
+ captain[sizeof captain - 1] = '\0';
Write(W_CAPTAIN, ms, 1, (int)captain, 0, 0, 0);
for (n = 0; n < 2; n++) {
char buf[10];
diff --git a/games/snake/snake/Makefile b/games/snake/snake/Makefile
index 8b96cfc8bc3c..7d79adf31f05 100644
--- a/games/snake/snake/Makefile
+++ b/games/snake/snake/Makefile
@@ -6,7 +6,6 @@ MAN6= snake.6
DPADD= ${LIBM} ${LIBTERMCAP} ${LIBCOMPAT}
LDADD= -lm -ltermcap -lcompat
HIDEGAME=hidegame
-MLINKS= snake.6 snscore.6
.include "../../Makefile.inc"
.include <bsd.prog.mk>
diff --git a/games/snake/snake/snake.6 b/games/snake/snake/snake.6
index 774153c56daa..14d86bfdb9fa 100644
--- a/games/snake/snake/snake.6
+++ b/games/snake/snake/snake.6
@@ -99,9 +99,9 @@ To see who wastes time playing snake, run
.I snscore .
.SH FILES
.nf
-.ta \w'/var/games/snakerawscores 'u
-/var/games/snakerawscores database of personal bests
-/var/games/snake.log log of games played
+.ta \w'/usr/games/lib/snakerawscores 'u
+/usr/games/lib/snakerawscores database of personal bests
+/usr/games/lib/snake.log log of games played
.DT
.fi
.SH BUGS
diff --git a/games/wargames/Makefile b/games/wargames/Makefile
index 56713f2d4852..6246697a3fbd 100644
--- a/games/wargames/Makefile
+++ b/games/wargames/Makefile
@@ -4,7 +4,7 @@ NOOBJ= noobj
all wargames clean cleandir depend lint tags:
install:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} wargames.sh \
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} wargames.sh \
${DESTDIR}/usr/games/wargames
.include <bsd.prog.mk>
diff --git a/games/wump/Makefile b/games/wump/Makefile
index a4ccedc53a29..de09ffb7c18d 100644
--- a/games/wump/Makefile
+++ b/games/wump/Makefile
@@ -5,7 +5,7 @@ MAN6= wump.6
HIDEGAME=hidegame
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/wump.info \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/wump.info \
${DESTDIR}/usr/share/games
.include <bsd.prog.mk>
diff --git a/gnu/Makefile b/gnu/Makefile
index 88925400f1cd..e6a8fd51ba4c 100644
--- a/gnu/Makefile
+++ b/gnu/Makefile
@@ -1,5 +1,4 @@
# @(#)Makefile 5.33.1.1 (Berkeley) 5/6/91
-# $Id$
SUBDIR= include lib libexec usr.bin usr.sbin
diff --git a/gnu/include/Makefile b/gnu/include/Makefile
index aa06524cf445..536fd55483d4 100644
--- a/gnu/include/Makefile
+++ b/gnu/include/Makefile
@@ -9,7 +9,7 @@ beforeinstall:
@${ECHO} installing ${FILES}
@-for i in ${FILES}; do \
cmp -s $$i ${DESTDIR}/usr/include/$$i || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
${DESTDIR}/usr/include/$$i; \
done
diff --git a/gnu/lib/libg++/libiberty/vasprintf.c b/gnu/lib/libg++/libiberty/vasprintf.c
new file mode 100644
index 000000000000..b3ba0ca6ca8c
--- /dev/null
+++ b/gnu/lib/libg++/libiberty/vasprintf.c
@@ -0,0 +1,139 @@
+/* Like vsprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller.
+ Copyright (C) 1994 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include <varargs.h>
+
+#ifdef TEST
+int global_total_width;
+#endif
+
+unsigned long strtoul ();
+char *malloc ();
+
+int
+vasprintf (result, format, args)
+ char **result;
+ char *format;
+ va_list args;
+{
+ char *p = format;
+ /* Add one to make sure that it is never zero, which might cause malloc
+ to return NULL. */
+ int total_width = strlen (format) + 1;
+ va_list ap = args;
+
+ while (*p != '\0')
+ {
+ if (*p++ == '%')
+ {
+ while (strchr ("-+ #0", *p))
+ ++p;
+ if (*p == '*')
+ {
+ ++p;
+ total_width += abs (va_arg (ap, int));
+ }
+ else
+ total_width += strtoul (p, &p, 10);
+ if (*p == '.')
+ {
+ ++p;
+ if (*p == '*')
+ {
+ ++p;
+ total_width += abs (va_arg (ap, int));
+ }
+ else
+ total_width += strtoul (p, &p, 10);
+ }
+ while (strchr ("hlL", *p))
+ ++p;
+ /* Should be big enough for any format specifier except %s. */
+ total_width += 30;
+ switch (*p)
+ {
+ case 'd':
+ case 'i':
+ case 'o':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'c':
+ va_arg (ap, int);
+ break;
+ case 'f':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ va_arg (ap, double);
+ break;
+ case 's':
+ total_width += strlen (va_arg (ap, char *));
+ break;
+ case 'p':
+ case 'n':
+ va_arg (ap, char *);
+ break;
+ }
+ }
+ }
+#ifdef TEST
+ global_total_width = total_width;
+#endif
+ *result = malloc (total_width);
+ if (*result != NULL)
+ return vsprintf (*result, format, args);
+ else
+ return 0;
+}
+
+#ifdef TEST
+void
+checkit (va_alist)
+ va_dcl
+{
+ va_list args;
+ char *format;
+ char *result;
+
+ va_start (args);
+ format = va_arg (args, char *);
+ vasprintf (&result, format, args);
+ if (strlen (result) < global_total_width)
+ printf ("PASS: ");
+ else
+ printf ("FAIL: ");
+ printf ("%d %s\n", global_total_width, result);
+}
+
+int
+main ()
+{
+ checkit ("%d", 0x12345678);
+ checkit ("%200d", 5);
+ checkit ("%.300d", 6);
+ checkit ("%100.150d", 7);
+ checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
+777777777777777777333333333333366666666666622222222222777777777777733333");
+ checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
+}
+#endif /* TEST */
diff --git a/gnu/lib/libgmp/Makefile b/gnu/lib/libgmp/Makefile
index d59fc244f5aa..5a880d21800e 100644
--- a/gnu/lib/libgmp/Makefile
+++ b/gnu/lib/libgmp/Makefile
@@ -53,10 +53,10 @@ cre-conv-tab: gmp-mparam.h
gmp-mparam.h: cre-mparam
./cre-mparam > tmp-${.TARGET}
- mv -f tmp-${.TARGET} ${.TARGET}
+ mv tmp-${.TARGET} ${.TARGET}
mp_bases.c: cre-conv-tab
./cre-conv-tab > tmp-${.TARGET}
- mv -f tmp-${.TARGET} ${.TARGET}
+ mv tmp-${.TARGET} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/gnu/lib/libgmp/tests/Makefile b/gnu/lib/libgmp/tests/Makefile
index 9d62bf6fe3d0..3d746685beb3 100644
--- a/gnu/lib/libgmp/tests/Makefile
+++ b/gnu/lib/libgmp/tests/Makefile
@@ -24,7 +24,7 @@ CC = gcc
TEST_LIBS = -lgmp
OPT = -O -g
-CFLAGS = -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../obj -I${.CURDIR}/../libgmp -I${.CURDIR}/../libgmp/obj $(OPT)
+CFLAGS = -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../obj -I${.CURDIR}/../libgmp/obj $(OPT)
TEST_SRCS = tst-mul.c tst-dm.c tst-dm_ui.c tst-mdm.c tst-mdm_ui.c tst-gcd.c \
tst-sqrtrem.c tst-convert.c
@@ -56,11 +56,11 @@ tst-convert: tst-convert.o $(TEST_LIBS)
$(TEST_PREFIX)clean:
rm -f $(TESTS) $(TEST_OBJS) core
-tst-convert.o : tst-convert.c gmp.h urandom.h
-tst-dm.o : tst-dm.c gmp.h urandom.h
-tst-dm_ui.o : tst-dm_ui.c gmp.h urandom.h
-tst-gcd.o : tst-gcd.c gmp.h urandom.h
-tst-mdm.o : tst-mdm.c gmp.h urandom.h
-tst-mdm_ui.o : tst-mdm_ui.c gmp.h urandom.h
-tst-mul.o : tst-mul.c gmp.h gmp-impl.h gmp-mparam.h longlong.h urandom.h
-tst-sqrtrem.o : tst-sqrtrem.c gmp.h urandom.h
+tst-convert.o : tst-convert.c ../gmp.h urandom.h
+tst-dm.o : tst-dm.c ../gmp.h urandom.h
+tst-dm_ui.o : tst-dm_ui.c ../gmp.h urandom.h
+tst-gcd.o : tst-gcd.c ../gmp.h urandom.h
+tst-mdm.o : tst-mdm.c ../gmp.h urandom.h
+tst-mdm_ui.o : tst-mdm_ui.c ../gmp.h urandom.h
+tst-mul.o : tst-mul.c ../gmp.h ../gmp-impl.h ../gmp-mparam.h ../longlong.h urandom.h
+tst-sqrtrem.o : tst-sqrtrem.c ../gmp.h urandom.h
diff --git a/gnu/lib/libreadline/Makefile b/gnu/lib/libreadline/Makefile
index 437464ab1d4d..4d511fd913d1 100644
--- a/gnu/lib/libreadline/Makefile
+++ b/gnu/lib/libreadline/Makefile
@@ -20,7 +20,7 @@ beforeinstall:
cd ${.CURDIR}; \
for m in ${HEADERS} ; do \
cmp -s $$m ${DESTDIR}/usr/include/readline/$$m || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
$$m ${DESTDIR}/usr/include/readline ; \
done
diff --git a/gnu/lib/libreadline/complete.c b/gnu/lib/libreadline/complete.c
index f219877a3aa2..2ef001cf8479 100644
--- a/gnu/lib/libreadline/complete.c
+++ b/gnu/lib/libreadline/complete.c
@@ -334,14 +334,14 @@ print_filename (to_print, full_pathname)
PUTX (*s);
}
return 0;
-#else
+#else
char *s, c, *new_full_pathname;
int extension_char = 0, slen, tlen;
for (s = to_print; *s; s++)
{
PUTX (*s);
- }
+ }
if (rl_filename_completion_desired && rl_visible_stats)
{
@@ -468,7 +468,7 @@ rl_complete_internal (what_to_do)
}
}
- if (rl_point == end && quote_char == '\0')
+ if (rl_point == end && found_quote == 0)
{
int quoted = 0;
/* We didn't find an unclosed quoted substring upon which to do
@@ -633,16 +633,7 @@ rl_complete_internal (what_to_do)
munge the array, deleting matches as it desires. */
if (rl_ignore_some_completions_function &&
our_func == (Function *)filename_completion_function)
- {
- (void)(*rl_ignore_some_completions_function)(matches);
- if (matches == 0 || matches[0] == 0)
- {
- if (matches)
- free (matches);
- ding ();
- return;
- }
- }
+ (void)(*rl_ignore_some_completions_function)(matches);
/* If we are doing completion on quoted substrings, and any matches
contain any of the completer_word_break_characters, then auto-
diff --git a/gnu/lib/libreadline/display.c b/gnu/lib/libreadline/display.c
index daf736ca1cd9..762b5052f770 100644
--- a/gnu/lib/libreadline/display.c
+++ b/gnu/lib/libreadline/display.c
@@ -166,7 +166,7 @@ static int visible_first_line_len = 0;
\002 (^B) end non-visible characters
all characters except \001 and \002 (following a \001) are copied to
the returned string; all characters except those between \001 and
- \002 are assumed to be `visible'. */
+ \002 are assumed to be `visible'. */
static char *
expand_prompt (pmt, lp)
@@ -187,7 +187,7 @@ expand_prompt (pmt, lp)
l = pmt ? strlen (pmt) : 0;
r = ret = xmalloc (l + 1);
-
+
for (rl = ignoring = 0, p = pmt; p && *p; p++)
{
/* This code strips the invisible character string markers
@@ -377,7 +377,7 @@ rl_redisplay ()
out += 4;
}
else
- line[out++] = c;
+ line[out++] = c;
}
#if defined (DISPLAY_TABS)
else if (c == '\t')
@@ -693,7 +693,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (old[0] && new[0])
old[0] = new[0];
}
-
+
/* Find first difference. */
for (ofd = old, nfd = new;
(ofd - old < omax) && *ofd && (*ofd == *nfd);
diff --git a/gnu/lib/libreadline/examples/fileman.c b/gnu/lib/libreadline/examples/fileman.c
index 3ecb9f184861..3256bf371e31 100644
--- a/gnu/lib/libreadline/examples/fileman.c
+++ b/gnu/lib/libreadline/examples/fileman.c
@@ -161,7 +161,7 @@ stripwhite (string)
for (s = string; whitespace (*s); s++)
;
-
+
if (*s == 0)
return (s);
diff --git a/gnu/lib/libreadline/examples/manexamp.c b/gnu/lib/libreadline/examples/manexamp.c
index 3496efa00e76..051dcbc10a02 100644
--- a/gnu/lib/libreadline/examples/manexamp.c
+++ b/gnu/lib/libreadline/examples/manexamp.c
@@ -56,7 +56,7 @@ invert_case_line (count, key)
}
else
direction = 1;
-
+
/* Find the end of the range to modify. */
end = start + (count * direction);
diff --git a/gnu/lib/libreadline/funmap.c b/gnu/lib/libreadline/funmap.c
index 9255974c9ce6..c37cf39ea276 100644
--- a/gnu/lib/libreadline/funmap.c
+++ b/gnu/lib/libreadline/funmap.c
@@ -170,7 +170,7 @@ rl_add_funmap_entry (name, function)
else
funmap =
(FUNMAP **)xrealloc (funmap, (funmap_size += 80) * sizeof (FUNMAP *));
-
+
funmap[funmap_entry] = (FUNMAP *)xmalloc (sizeof (FUNMAP));
funmap[funmap_entry]->name = name;
funmap[funmap_entry]->function = function;
diff --git a/gnu/lib/libreadline/history.c b/gnu/lib/libreadline/history.c
index 94c0ad51a3ee..a0a25603f419 100644
--- a/gnu/lib/libreadline/history.c
+++ b/gnu/lib/libreadline/history.c
@@ -332,8 +332,6 @@ history_search_internal (string, direction, anchored)
reverse = (direction < 0);
/* Take care of trivial cases first. */
- if (string == 0 || *string == '\0')
- return (-1);
if (!history_length || ((i == history_length) && !reverse))
return (-1);
@@ -864,7 +862,7 @@ history_set_pos (pos)
history_offset = pos;
return (1);
}
-
+
/* **************************************************************** */
/* */
@@ -998,7 +996,7 @@ get_history_event (string, caller_index, delimiting_quote)
{
entry = current_history ();
history_offset = history_length;
-
+
/* If this was a substring search, then remember the
string that we matched for word substitution. */
if (substring_okay)
@@ -1261,7 +1259,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
quoted_search_delimiter = string[i - 1];
event = get_history_event (string, &i, quoted_search_delimiter);
}
-
+
if (!event)
{
*ret_string = hist_error (string, start, i, EVENT_NOT_FOUND);
@@ -1583,7 +1581,7 @@ history_expand (hstring, output)
*output = savestring (hstring);
return (0);
}
-
+
/* Prepare the buffer for printing error messages. */
result = xmalloc (result_len = 256);
result[0] = '\0';
@@ -1652,7 +1650,7 @@ history_expand (hstring, output)
}
#endif /* SHELL */
}
-
+
if (string[i] != history_expansion_char)
{
free (result);
@@ -1970,7 +1968,7 @@ history_tokenize_internal (string, wind, indp)
return (result);
start = i;
-
+
if (member (string[i], "()\n"))
{
i++;
@@ -2151,7 +2149,7 @@ main ()
while (!done)
{
fprintf (stdout, "history%% ");
- t = fgets (line, 1024, stdin);
+ t = gets (line);
if (!t)
strcpy (line, "quit");
diff --git a/gnu/lib/libreadline/history.h b/gnu/lib/libreadline/history.h
index 6935efd20d13..d9d41315e9fa 100644
--- a/gnu/lib/libreadline/history.h
+++ b/gnu/lib/libreadline/history.h
@@ -67,7 +67,7 @@ extern HIST_ENTRY **history_list ();
/* Returns the number which says what history element we are now
looking at. */
extern int where_history ();
-
+
/* Return the history entry at the current position, as determined by
history_offset. If there is no entry there, return a NULL pointer. */
HIST_ENTRY *current_history ();
diff --git a/gnu/lib/libreadline/posixstat.h b/gnu/lib/libreadline/posixstat.h
index 7d1cece35257..ce123f8c3b83 100644
--- a/gnu/lib/libreadline/posixstat.h
+++ b/gnu/lib/libreadline/posixstat.h
@@ -114,7 +114,7 @@
/*
* POSIX 1003.1 5.6.1.2 <sys/stat.h> File Modes
*/
-
+
#if !defined (S_IRWXU)
# if !defined (S_IREAD)
# define S_IREAD 00400
diff --git a/gnu/lib/libreadline/readline.3 b/gnu/lib/libreadline/readline.3
index 7f8c2c3820c5..bbe9d9139542 100644
--- a/gnu/lib/libreadline/readline.3
+++ b/gnu/lib/libreadline/readline.3
@@ -22,8 +22,8 @@ readline \- get a line from a user with editing
.LP
.nf
.ft B
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <readline.h>
+#include <history.h>
.ft
.fi
.LP
diff --git a/gnu/lib/libreadline/readline.c b/gnu/lib/libreadline/readline.c
index 59fbc3274ec8..577f53661e99 100644
--- a/gnu/lib/libreadline/readline.c
+++ b/gnu/lib/libreadline/readline.c
@@ -216,12 +216,12 @@ int _rl_horizontal_scroll_mode = 0;
/* Non-zero means to display an asterisk at the starts of history lines
which have been modified. */
-int _rl_mark_modified_lines = 0;
+int _rl_mark_modified_lines = 0;
/* The style of `bell' notification preferred. This can be set to NO_BELL,
AUDIBLE_BELL, or VISIBLE_BELL. */
int _rl_bell_preference = AUDIBLE_BELL;
-
+
/* Line buffer and maintenence. */
char *rl_line_buffer = (char *)NULL;
int rl_line_buffer_len = 0;
@@ -995,15 +995,15 @@ readline_initialize_everything ()
t = getenv ("LC_CTYPE");
t1 = getenv ("LANG");
if (t && (strstr (t, "8859-1") != NULL || strstr (t, "8859_1") != NULL ||
- strstr (t, "KOI8-R") != NULL || strstr (t, "koi8-r") != NULL) ||
+ strstr (t, "KOI8-R") != NULL || strstr (t, "koi8-r") != NULL) ||
t1 && (strstr (t1, "8859-1") != NULL || strstr (t1, "8859_1") != NULL ||
- strstr (t1, "KOI8-R") != NULL || strstr (t1, "koi8-r") != NULL))
+ strstr (t1, "KOI8-R") != NULL || strstr (t1, "koi8-r") != NULL))
{
_rl_meta_flag = 1;
_rl_convert_meta_chars_to_ascii = 0;
_rl_output_meta_chars = 1;
}
-
+
/* Read in the init file. */
rl_read_init_file ((char *)NULL);
@@ -2110,7 +2110,7 @@ rl_quoted_insert (count, key)
int c;
c = rl_read_key ();
- return (rl_insert (count, c));
+ return (rl_insert (count, c));
}
/* Insert a tab character. */
@@ -2224,7 +2224,7 @@ rl_delete (count, invoking_key)
}
else
return (rl_delete_text (rl_point, rl_point + 1));
-
+
}
/* Delete all spaces and tabs around point. */
diff --git a/gnu/lib/libreadline/readline.h b/gnu/lib/libreadline/readline.h
index 652d8ca80a94..81328430a5e2 100644
--- a/gnu/lib/libreadline/readline.h
+++ b/gnu/lib/libreadline/readline.h
@@ -162,7 +162,7 @@ extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
/* List of characters which can be used to quote a substring of the line.
- Completion occurs on the entire substring, and within the substring
+ Completion occurs on the entire substring, and within the substring
rl_completer_word_break_characters are treated as any other character,
unless they also appear within this list. */
extern char *rl_completer_quote_characters;
diff --git a/gnu/lib/libreadline/tilde.c b/gnu/lib/libreadline/tilde.c
index 736f1e6b413e..a2693514e5de 100644
--- a/gnu/lib/libreadline/tilde.c
+++ b/gnu/lib/libreadline/tilde.c
@@ -23,7 +23,7 @@
# include <string.h>
#else /* !HAVE_STRING_H */
# include <strings.h>
-#endif /* !HAVE_STRING_H */
+#endif /* !HAVE_STRING_H */
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
@@ -316,7 +316,7 @@ main (argc, argv)
printf ("~expand: ");
fflush (stdout);
- if (!fgets(line, 512, stdin))
+ if (!gets (line))
strcpy (line, "done");
if ((strcmp (line, "done") == 0) ||
diff --git a/gnu/lib/libreadline/vi_mode.c b/gnu/lib/libreadline/vi_mode.c
index d0b931079c59..8ace8922da68 100644
--- a/gnu/lib/libreadline/vi_mode.c
+++ b/gnu/lib/libreadline/vi_mode.c
@@ -174,7 +174,7 @@ rl_vi_redo (count, c)
return (0);
}
-
+
/* Yank the nth arg from the previous line into this line at point. */
rl_vi_yank_arg (count, key)
int count, key;
@@ -886,7 +886,7 @@ rl_vi_delete (count, key)
end = rl_end;
rl_kill_text (rl_point, end);
-
+
if (rl_point > 0 && rl_point == rl_end)
rl_backward (1);
return (0);
diff --git a/gnu/lib/libregex/Makefile b/gnu/lib/libregex/Makefile
index a88856be998e..355aaf57893c 100644
--- a/gnu/lib/libregex/Makefile
+++ b/gnu/lib/libregex/Makefile
@@ -1,4 +1,4 @@
-# $Header: /home/ncvs/src/gnu/lib/libregex/Makefile,v 1.14 1995/03/12 23:21:29 ache Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/lib/libregex/Makefile,v 1.14 1995/03/12 23:21:29 ache Exp $
LIB= gnuregex
@@ -10,7 +10,7 @@ SUBDIR+= doc
beforeinstall:
cmp -s ${.CURDIR}/regex.h ${DESTDIR}/usr/include/gnuregex.h || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/regex.h ${DESTDIR}/usr/include/gnuregex.h
.include <bsd.lib.mk>
diff --git a/gnu/lib/libregex/test/Makefile b/gnu/lib/libregex/test/Makefile
index 977c5d291851..84ebfcb2211a 100644
--- a/gnu/lib/libregex/test/Makefile
+++ b/gnu/lib/libregex/test/Makefile
@@ -1,5 +1,3 @@
-# $Id$
-
# Generated automatically from Makefile.in by configure.
# Makefile for regex testing.
#
@@ -67,7 +65,7 @@ regex: $(regex_o) $(common_o) $(test_o) main.o
dregex.o: ../regex.c ../regex.h
rm -f $@
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
- mv -f regex.o $@
+ mv regex.o $@
# iregex is the interactive regex.
iregex: $(common_o) $(regex_o) iregex.o
diff --git a/gnu/lib/libregex/test/Makefile.in b/gnu/lib/libregex/test/Makefile.in
index 7b56b32c1ba8..fea1f10e1753 100644
--- a/gnu/lib/libregex/test/Makefile.in
+++ b/gnu/lib/libregex/test/Makefile.in
@@ -1,5 +1,3 @@
-# $Id$
-
# Makefile for regex testing.
#
# Copyright (C) 1992 Free Software Foundation, Inc.
@@ -66,7 +64,7 @@ regex: $(regex_o) $(common_o) $(test_o) main.o
dregex.o: ../regex.c ../regex.h
rm -f $@
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
- mv -f regex.o $@
+ mv regex.o $@
# iregex is the interactive regex.
iregex: $(common_o) $(regex_o) iregex.o
diff --git a/gnu/libexec/Makefile b/gnu/libexec/Makefile
index 1744c529be51..a6bc1c9d278f 100644
--- a/gnu/libexec/Makefile
+++ b/gnu/libexec/Makefile
@@ -1,5 +1,5 @@
# $Id: Makefile,v 1.2 1995/01/31 09:29:38 wpaul Exp $
-SUBDIR= uucp
+SUBDIR= uucp ypxfr
.include <bsd.subdir.mk>
diff --git a/gnu/libexec/uucp/cu/Makefile b/gnu/libexec/uucp/cu/Makefile
index de8599ca7d32..ed239827b683 100644
--- a/gnu/libexec/uucp/cu/Makefile
+++ b/gnu/libexec/uucp/cu/Makefile
@@ -3,8 +3,7 @@
BINDIR= $(bindir)
BINOWN= $(owner)
-BINGRP= dialer
-BINMODE= 6555
+BINMODE= 4555
PROG= cu
SRCS= cu.c prot.c log.c chat.c conn.c copy.c
diff --git a/gnu/libexec/uucp/uucico/Makefile b/gnu/libexec/uucp/uucico/Makefile
index 82349dc27b7d..96fe4ac41b41 100644
--- a/gnu/libexec/uucp/uucico/Makefile
+++ b/gnu/libexec/uucp/uucico/Makefile
@@ -3,8 +3,7 @@
BINDIR= $(libxdir)
BINOWN= $(owner)
-BINGRP= dialer
-BINMODE= 6555
+BINMODE= 4555
PROG= uucico
SRCS= uucico.c trans.c send.c rec.c xcmd.c prot.c protg.c protf.c \
diff --git a/gnu/libexec/uucp/uustat/Makefile b/gnu/libexec/uucp/uustat/Makefile
index f45e6a108403..e8814db10668 100644
--- a/gnu/libexec/uucp/uustat/Makefile
+++ b/gnu/libexec/uucp/uustat/Makefile
@@ -3,8 +3,7 @@
BINDIR= $(bindir)
BINOWN= $(owner)
-BINGRP= dialer
-BINMODE= 6555
+BINMODE= 4555
PROG= uustat
SRCS= uustat.c util.c log.c copy.c
diff --git a/gnu/libexec/uucp/uustat/uustat.1 b/gnu/libexec/uucp/uustat/uustat.1
index f3e2cbaaa879..14e98a762159 100644
--- a/gnu/libexec/uucp/uustat/uustat.1
+++ b/gnu/libexec/uucp/uustat/uustat.1
@@ -545,7 +545,7 @@ configuration file, so these are only approximations.
/var/spool/uucp -
UUCP spool directory.
.SH SEE ALSO
-ps(1), rmail(8), uucp(1), uux(1), uucico(8), uuxqt(8)
+ps(1), rmail(1), uucp(1), uux(1), uucico(8), uuxqt(8)
.SH AUTHOR
Ian Lance Taylor
(ian@airs.com)
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile
index da9e62d3696b..ca63802ed06f 100644
--- a/gnu/usr.bin/Makefile
+++ b/gnu/usr.bin/Makefile
@@ -2,6 +2,6 @@
SUBDIR= as awk bc cc cpio cvs dc dialog diff diff3 gdb \
grep groff gzip ld man mkisofs patch perl ptx rcs sdiff send-pr \
- sort tar texinfo
+ sort tar texinfo yppush
.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/as/Makefile b/gnu/usr.bin/as/Makefile
index 50e4ac8cad08..879a48078122 100644
--- a/gnu/usr.bin/as/Makefile
+++ b/gnu/usr.bin/as/Makefile
@@ -27,6 +27,8 @@ SRCS+= app.c as.c atof-generic.c bignum-copy.c \
CFLAGS+= -I$(.CURDIR) ${ADDINCLUDE} -I$(.CURDIR)/config \
-DOLD_GAS -DSIGTY=void -Derror=as_fatal \
-DSUB_SEGMENT_ALIGN=4 -DFREEBSD_AOUT
+DPADD+= ${LIBGNUMALLOC}
+LDADD+= -lgnumalloc
CONF_HEADERS= targ-cpu.h obj-format.h host.h targ-env.h
diff --git a/gnu/usr.bin/as/Makefile.in b/gnu/usr.bin/as/Makefile.in
index b91bb3322bbf..9e7645856d4b 100644
--- a/gnu/usr.bin/as/Makefile.in
+++ b/gnu/usr.bin/as/Makefile.in
@@ -1,5 +1,3 @@
-# $Id$
-
# Makefile for GNU Assembler
# Copyright (C) 1987-1992 Free Software Foundation, Inc.
@@ -308,7 +306,7 @@ targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \
doc: $(srcdir)/as.info
$(srcdir)/as.info: $(srcdir)/doc/as.texinfo
- (cd doc; make as.info; mv -f as.info $srcdir)
+ (cd doc; make as.info; mv as.info $srcdir)
clean:
(cd doc ; $(MAKE) clean)
@@ -371,17 +369,17 @@ bootstrap3: force
# Copy the object files from a particular stage into a subdirectory.
stage1: force
-mkdir stage1
- -mv -f $(STAGESTUFF) stage1
+ -mv $(STAGESTUFF) stage1
if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
stage2: force
-mkdir stage2
- -mv -f $(STAGESTUFF) stage2
+ -mv $(STAGESTUFF) stage2
if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
stage3: force
-mkdir stage3
- -mv -f $(STAGESTUFF) stage3
+ -mv $(STAGESTUFF) stage3
if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
against=stage2
@@ -390,15 +388,15 @@ comparison: force
for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
de-stage1: force
- - (cd stage1 ; rm -f as ; mv -f * ..)
+ - (cd stage1 ; rm as ; mv -f * ..)
- rmdir stage1
de-stage2: force
- - (cd stage2 ; rm -f as ; mv -f * ..)
+ - (cd stage2 ; rm as ; mv -f * ..)
- rmdir stage2
de-stage3: force
- - (cd stage3 ; rm -f as ; mv -f * ..)
+ - (cd stage3 ; rm as ; mv -f * ..)
- rmdir stage3
#In GNU Make, ignore whether `stage*' exists.
diff --git a/gnu/usr.bin/as/as.1 b/gnu/usr.bin/as/as.1
index 66f7ee5004b0..57e2dc1f9b9e 100644
--- a/gnu/usr.bin/as/as.1
+++ b/gnu/usr.bin/as/as.1
@@ -3,7 +3,7 @@
.TH as 1 "21 January 1992" "cygnus support" "GNU Development Tools"
.SH NAME
-as \- the portable GNU assembler.
+GNU as \- the portable GNU assembler.
.SH SYNOPSIS
.na
diff --git a/gnu/usr.bin/as/hash.c b/gnu/usr.bin/as/hash.c
index 70068ea81ab9..e8b82d2030f6 100644
--- a/gnu/usr.bin/as/hash.c
+++ b/gnu/usr.bin/as/hash.c
@@ -837,7 +837,7 @@ main()
for (;;)
{
printf("hash_test command: ");
- fgets(answer, 100, stdin);
+ gets(answer);
command = answer[0];
if (isupper(command)) command = tolower(command); /* ecch! */
switch (command)
@@ -929,7 +929,7 @@ char * description;
char * malloc();
printf(" %s : ",description);
- fgets(answer, 100, stdin);
+ gets(answer);
/* will one day clean up answer here */
retval = malloc(strlen(answer)+1);
if (!retval)
@@ -967,7 +967,7 @@ whattable() /* determine number: what hash table to use */
for (;;)
{
printf(" what hash table (%d:%d) ? ",0,TABLES-1);
- fgets(answer, 100, stdin);
+ gets(answer);
sscanf(answer,"%d",&number);
if (number >= 0 && number<TABLES)
{
diff --git a/gnu/usr.bin/awk/Makefile b/gnu/usr.bin/awk/Makefile
index 1fa87cc9c8ce..690eacf1c286 100644
--- a/gnu/usr.bin/awk/Makefile
+++ b/gnu/usr.bin/awk/Makefile
@@ -11,3 +11,4 @@ DPADD+= ${LIBGNUREGEX} ${LIBM}
LDADD+= -lgnuregex -lm
.include <bsd.prog.mk>
+#.include "../../usr.bin/Makefile.inc"
diff --git a/gnu/usr.bin/awk/awk.1 b/gnu/usr.bin/awk/awk.1
index 1b58bec9acbe..a98c99d1608b 100644
--- a/gnu/usr.bin/awk/awk.1
+++ b/gnu/usr.bin/awk/awk.1
@@ -1,11 +1,11 @@
.ds PX \s-1POSIX\s+1
.ds UX \s-1UNIX\s+1
.ds AN \s-1ANSI\s+1
-.TH AWK 1 "Apr 18 1994" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 18 1994" "Free Software Foundation" "Utility Commands"
.SH NAME
-awk \- GNU awk pattern scanning and processing language
+gawk \- pattern scanning and processing language
.SH SYNOPSIS
-.B awk
+.B gawk
[ POSIX or GNU style options ]
.B \-f
.I program-file
@@ -13,7 +13,7 @@ awk \- GNU awk pattern scanning and processing language
.B \-\^\-
] file .\^.\^.
.br
-.B awk
+.B gawk
[ POSIX or GNU style options ]
[
.B \-\^\-
@@ -35,7 +35,7 @@ of \*(UX
also provides some GNU-specific extensions.
.PP
The command line consists of options to
-.I awk
+.I gawk
itself, the AWK program text (if not supplied via the
.B \-f
or
@@ -57,7 +57,7 @@ for \*(PX mandated features. Other implementations of the AWK language
are likely to only accept the traditional one letter options.
.PP
Following the \*(PX standard,
-.IR awk -specific
+.IR gawk -specific
options are supplied via arguments to the
.B \-W
option. Multiple
@@ -135,9 +135,9 @@ flag sets the maximum record size. These two flags and the
option are from the AT&T Bell Labs research version of \*(UX
.IR awk .
They are ignored by
-.IR awk ,
+.IR gawk ,
since
-.I awk
+.I gawk
has no pre-defined limits.
.TP \w'\fB\-\^\-copyright\fR'u+1n
.PD 0
@@ -148,7 +148,7 @@ has no pre-defined limits.
Run in
.I compatibility
mode. In compatibility mode,
-.I awk
+.I gawk
behaves identically to \*(UX
.IR awk ;
none of the GNU-specific extensions are recognized.
@@ -268,10 +268,10 @@ will be recognized in the same argument.
.PD
.B \-\^\-version
Print version information for this particular copy of
-.I awk
+.I gawk
on the error output.
This is useful mainly for knowing if the current copy of
-.I awk
+.I gawk
on your system
is up to date with respect to whatever the Free Software Foundation
is distributing.
@@ -341,10 +341,10 @@ all variable assignments specified via the
.B \-v
option are performed.
Next,
-.I awk
+.I gawk
compiles the program into an internal form.
Then,
-.I awk
+.I gawk
executes the code in the
.B BEGIN
block(s) (if any),
@@ -353,7 +353,7 @@ each file named in the
.B ARGV
array.
If there are no files named on the command line,
-.I awk
+.I gawk
reads the standard input.
.PP
If a filename on the command line has the form
@@ -374,11 +374,11 @@ a single data file.
If the value of a particular element of
.B ARGV
is empty (\fB""\fR),
-.I awk
+.I gawk
skips over it.
.PP
For each line in the input,
-.I awk
+.I gawk
tests to see if it matches any
.I pattern
in the AWK program.
@@ -388,7 +388,7 @@ is executed.
The patterns are tested in the order they occur in the program.
.PP
Finally, after all the input is exhausted,
-.I awk
+.I gawk
executes the code in the
.B END
block(s) (if any).
@@ -403,7 +403,7 @@ runs; these will be described as needed and summarized below.
.SS Fields
.PP
As each input line is read,
-.I awk
+.I gawk
splits the line into
.IR fields ,
using the value of the
@@ -429,7 +429,7 @@ If the
.B FIELDWIDTHS
variable is set to a space separated list of numbers, each field is
expected to have fixed width, and
-.I awk
+.I gawk
will split up the record using the specified widths. The value of
.B FS
is ignored.
@@ -480,7 +480,7 @@ AWK's built-in variables are:
.TP \w'\fBFIELDWIDTHS\fR'u+1n
.B ARGC
The number of command line arguments (does not include options to
-.IR awk ,
+.IR gawk ,
or the program source).
.TP
.B ARGIND
@@ -506,12 +506,12 @@ The array is indexed by the environment variables, each element being
the value of that variable (e.g., \fBENVIRON["HOME"]\fP might be
.BR /u/arnold ).
Changing this array does not affect the environment seen by programs which
-.I awk
+.I gawk
spawns via redirection or the
.B system()
function.
(This may change in a future version of
-.IR awk .)
+.IR gawk .)
.\" but don't hold your breath...
.TP
.B ERRNO
@@ -528,14 +528,14 @@ a string describing the error.
.TP
.B FIELDWIDTHS
A white-space separated list of fieldwidths. When set,
-.I awk
+.I gawk
parses the input into fields of fixed width, instead of using the
value of the
.B FS
variable as the field separator.
The fixed field width facility is still experimental; expect the
semantics to change as
-.I awk
+.I gawk
evolves over time.
.TP
.B FILENAME
@@ -605,7 +605,7 @@ The input record separator, by default a newline.
is exceptional in that only the first character of its string
value is used for separating records.
(This will probably change in a future release of
-.IR awk .)
+.IR gawk .)
If
.B RS
is set to the null string, then records are separated by
@@ -739,7 +739,7 @@ Two strings are compared, of course, as strings.
According to the \*(PX standard, even if two strings are
numeric strings, a numeric comparison is performed. However, this is
clearly incorrect, and
-.I awk
+.I gawk
does not do this.
.PP
Uninitialized variables have the numeric value 0 and the string value ""
@@ -1246,13 +1246,13 @@ into a file,
or via
.B getline
from a file,
-.I awk
+.I gawk
recognizes certain special filenames internally. These filenames
allow access to open file descriptors inherited from
-.IR awk 's
+.IR gawk 's
parent process (usually the shell).
Other special filenames provide access information about the running
-.B awk
+.B gawk
process.
The filenames are:
.TP \w'\fB/dev/stdout\fR'u+1n
@@ -1468,7 +1468,7 @@ Non-alphabetic characters are left unchanged.
.PP
Since one of the primary uses of AWK programs is processing log files
that contain time stamp information,
-.I awk
+.I gawk
provides the following two functions for obtaining time stamps and
formatting them.
.PP
@@ -1496,11 +1496,11 @@ guaranteed to be available.
A public-domain version of
.IR strftime (3)
and a man page for it are shipped with
-.IR awk ;
+.IR gawk ;
if that version was used to build
-.IR awk ,
+.IR gawk ,
then all of the conversions described in that man page are available to
-.IR awk.
+.IR gawk.
.SS String Constants
.PP
String constants in AWK are sequences of characters enclosed
@@ -1643,12 +1643,12 @@ Addison-Wesley, 1988. ISBN 0-201-07981-X.
Edition 0.15, published by the Free Software Foundation, 1993.
.SH POSIX COMPATIBILITY
A primary goal for
-.I awk
+.I gawk
is compatibility with the \*(PX standard, as well as with the
latest version of \*(UX
.IR awk .
To this end,
-.I awk
+.I gawk
incorporates the following user visible
features which are not described in the AWK book,
but are part of
@@ -1679,7 +1679,7 @@ The
option for implementation specific features is from the \*(PX standard.
.PP
When processing arguments,
-.I awk
+.I gawk
uses the special option ``\fB\-\^\-\fP'' to signal the end of
arguments.
In compatibility mode, it will warn about, but otherwise ignore,
@@ -1696,7 +1696,7 @@ has it return the seed it was using, to allow keeping track
of random number sequences. Therefore
.B srand()
in
-.I awk
+.I gawk
also returns its current seed.
.PP
Other new features are:
@@ -1711,7 +1711,7 @@ array; the
and
.BR \ev
escape sequences (done originally in
-.I awk
+.I gawk
and fed back into AT&T's); the
.B tolower()
and
@@ -1726,13 +1726,13 @@ has some extensions to \*(PX
They are described in this section. All the extensions described here
can be disabled by
invoking
-.I awk
+.I gawk
with the
.B "\-W compat"
option.
.PP
The following features of
-.I awk
+.I gawk
are not available in
\*(PX
.IR awk .
@@ -1800,7 +1800,7 @@ or
when closing a file or pipe, respectively.
.PP
When
-.I awk
+.I gawk
is invoked with the
.B "\-W compat"
option,
@@ -1818,7 +1818,7 @@ has been specified.
.ig
.PP
If
-.I awk
+.I gawk
was compiled for debugging, it will
accept the following additional options:
.TP
@@ -1833,13 +1833,13 @@ or
.IR bison (1)
debugging output during program parsing.
This option should only be of interest to the
-.I awk
+.I gawk
maintainers, and may not even be compiled into
-.IR awk .
+.IR gawk .
..
.SH HISTORICAL FEATURES
There are two features of historical AWK implementations that
-.I awk
+.I gawk
supports.
First, it is possible to call the
.B length()
@@ -1863,7 +1863,7 @@ a = length($0)
.RE
.PP
This feature is marked as ``deprecated'' in the \*(PX standard, and
-.I awk
+.I gawk
will issue a warning about its use if
.B "\-W lint"
is specified on the command line.
@@ -1887,14 +1887,14 @@ has not been specified.
If
.B POSIXLY_CORRECT
exists in the environment, then
-.I awk
+.I gawk
behaves exactly as if
.B \-\-posix
had been specified on the command line.
If
.B \-\-lint
has been specified,
-.I awk
+.I gawk
will issue a warning message to this effect.
.SH BUGS
The
@@ -1910,9 +1910,9 @@ and the associated
and
.B /dev/stderr
files, you may get different output from
-.I awk
+.I gawk
than you would get on a system without those files. When
-.I awk
+.I gawk
interprets these files internally, it synchronizes output to the standard
output with output to
.BR /dev/stdout ,
@@ -1921,11 +1921,11 @@ open files.
Caveat Emptor.
.SH VERSION INFORMATION
This man page documents
-.IR awk ,
+.IR gawk ,
version 2.15.
.PP
Starting with the 2.15 version of
-.IR awk ,
+.IR gawk ,
the
.BR \-c ,
.BR \-V ,
diff --git a/gnu/usr.bin/awk/main.c b/gnu/usr.bin/awk/main.c
index 1f483bcd6bc5..ff9426e501fb 100644
--- a/gnu/usr.bin/awk/main.c
+++ b/gnu/usr.bin/awk/main.c
@@ -23,9 +23,6 @@
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "getopt.h"
#include "awk.h"
#include "patchlevel.h"
@@ -145,9 +142,6 @@ char **argv;
extern int opterr;
extern char *optarg;
-#ifdef __FreeBSD__
- (void) setlocale(LC_CTYPE, "");
-#endif
#ifdef __EMX__
_response(&argc, &argv);
_wildcard(&argc, &argv);
diff --git a/gnu/usr.bin/bc/scan.c b/gnu/usr.bin/bc/scan.c
index 6bff4516deb5..94f1aedaa3d1 100644
--- a/gnu/usr.bin/bc/scan.c
+++ b/gnu/usr.bin/bc/scan.c
@@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* scanner skeleton version:
- * $Header: /home/ncvs/src/gnu/usr.bin/bc/scan.c,v 1.1.1.1 1993/06/19 00:26:18 paul Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/bc/scan.c,v 1.2 1995/05/30 04:49:02 rgrimes Exp $
*/
#define FLEX_SCANNER
diff --git a/gnu/usr.bin/cc/cc/Makefile b/gnu/usr.bin/cc/cc/Makefile
index 6ac463f8cbc7..e796b5353315 100644
--- a/gnu/usr.bin/cc/cc/Makefile
+++ b/gnu/usr.bin/cc/cc/Makefile
@@ -8,6 +8,6 @@ BINDIR= /usr/bin
.PATH: ${.CURDIR}/../cc_int
SRCS+= obstack.c version.c
LINKS= ${BINDIR}/cc ${BINDIR}/gcc
-MLINKS= cc.1 gcc.1 cc.1 c++.1 cc.1 g++.1
+MLINKS= cc.1 gcc.1
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/cc/cc/cc.1 b/gnu/usr.bin/cc/cc/cc.1
index 88d1d58b5715..dc5d5b2bf432 100644
--- a/gnu/usr.bin/cc/cc/cc.1
+++ b/gnu/usr.bin/cc/cc/cc.1
@@ -438,17 +438,7 @@ in the following sections.
\-m486
\-mno\-486
\-msoft\-float
-\-mrtd
-\-mregparm
-\-msvr3\-shlib
-\-mno\-ieee\-fp
\-mno\-fp\-ret\-in\-387
-\-mfancy\-math\-387
-\-mno\-wide\-multiply
-\-mdebug\-addr
-\-mno\-move
-\-mprofiler\-epilogue
-\-reg\-alloc=LIST
.Sp
.I HPPA Options
.br
@@ -3500,7 +3490,6 @@ assembler files (with a `\|\c
These `\|\c
.B \-m\c
\&\|' options are defined for the Intel 80386 family of computers:
-.TP
.B \-m486
.TP
.B \-mno\-486
@@ -3537,11 +3526,6 @@ The option `\|\c
.B \-mno-fp-ret-in-387\c
\&\|' causes such values to be returned
in ordinary CPU registers instead.
-.TP
-.B \-mprofiler-epilogue
-.TP
-.B \-mno-profiler-epilogue
-Generate extra code to write profile information for function exits.
.PP
These `\|\c
.B \-m\c
@@ -4077,7 +4061,7 @@ if available, else
.B /tmp\c
\&).
.SH "SEE ALSO"
-cpp(1), as(1), ld(1), gdb(1).
+cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
.br
.RB "`\|" gcc "\|', `\|" cpp \|',
.RB "`\|" as "\|', `\|" ld \|',
diff --git a/gnu/usr.bin/cc/cc/gcc.c b/gnu/usr.bin/cc/cc/gcc.c
index 43ea4a7ade2d..152c579d9a44 100644
--- a/gnu/usr.bin/cc/cc/gcc.c
+++ b/gnu/usr.bin/cc/cc/gcc.c
@@ -720,7 +720,7 @@ static struct compiler default_compilers[] =
{"@f2c",
"f2c %{checksubscripts:-C} %{I2} %{onetrip} %{honorcase:-U} %{u} %{w}\
%{ANSIC:-A} %{a} %{C++}\
- %{c} %{E} %{ec} %{ext} %{f} %{72} %{g} %{h} %{i2} %{kr} %{krd}\
+ %{c} %{E} %{ec} %{ext} %{f} %{72} %{g} %{h} %{i2} %{kr}\
%{P} %{p} %{r} %{r8} %{s} %{w8} %{z} %{N*}\
%i %{!pipe: -o %g.c} %{pipe:-o -}|\n",
"cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
diff --git a/gnu/usr.bin/cc/doc/invoke.texi b/gnu/usr.bin/cc/doc/invoke.texi
index 54534a031a75..d3fc4f382589 100644
--- a/gnu/usr.bin/cc/doc/invoke.texi
+++ b/gnu/usr.bin/cc/doc/invoke.texi
@@ -274,10 +274,9 @@ in addition to the above:
-mstats -G @var{num} -nocpp
@emph{i386 Options}
--m486 -mno-486 -mno-fancy-math-387
--mno-fp-ret-in-387 -mno-ieee-fp -mno-wide-multiply
--mprofiler-epilogue -msoft-float -msvr3-shlib
--mreg-alloc=@var{list}
+-m486 -mieee-fp -mno-486 -mno-fancy-math-387
+-mno-fp-ret-in-387 -msoft-float -msvr3-shlib
+-mno-wide-multiply -mreg-alloc=@var{list}
@emph{HPPA Options}
-mdisable-fpregs -mdisable-indexing -mjump-in-delay
@@ -3482,8 +3481,8 @@ These @samp{-m} options are defined for the i386 family of computers:
Control whether or not code is optimized for a 486 instead of an
386. Code generated for an 486 will run on a 386 and vice versa.
-@item -mno-ieee-fp
-@itemx -mieee-fp
+@item -mieee-fp
+@itemx -m-no-ieee-fp
Control whether or not the compiler uses IEEE floating point
comparisons. These handle correctly the case where the result of a
comparison is unordered.
@@ -3530,12 +3529,6 @@ Control whether GNU CC uses the @code{mul} and @code{imul} that produce
64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
long} multiplies and 32-bit division by constants.
-@item -mprofiler-epilogue
-@itemx -mno-profiler-epilogue
-Generate extra code to write profile information for function exits.
-This option has no effect except in combination with @samp{-g} or
-@samp{-pg}.
-
@item -mreg-alloc=@var{regs}
Control the default allocation order of integer registers. The
string @var{regs} is a series of letters specifing a register. The
diff --git a/gnu/usr.bin/cc/f77/Makefile b/gnu/usr.bin/cc/f77/Makefile
index e7ed05100edb..04f667bd98bd 100644
--- a/gnu/usr.bin/cc/f77/Makefile
+++ b/gnu/usr.bin/cc/f77/Makefile
@@ -5,5 +5,6 @@
PROG = f77
SRCS = f77.c
BINDIR= /usr/bin
+NOMAN= 1
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/cc/include/tm.h b/gnu/usr.bin/cc/include/tm.h
index 14aa504879b5..440d509cefae 100644
--- a/gnu/usr.bin/cc/include/tm.h
+++ b/gnu/usr.bin/cc/include/tm.h
@@ -27,21 +27,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Get perform_* macros to build libgcc.a. */
#include "i386/perform.h"
-#define MASK_PROFILER_EPILOGUE 010000000000
-
-#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE)
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
- { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \
- { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE},
-
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-#define STARTFILE_SPEC \
- "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-
#define INCLUDE_DEFAULTS { \
{ "/usr/include", 0 }, \
{ "/usr/include/g++", 1 }, \
@@ -92,16 +80,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
fprintf (FILE, "\tcall mcount\n"); \
}
+#if 0 /* not ready for this; it should be decided at compile time */
#define FUNCTION_PROFILER_EPILOGUE(FILE) \
{ \
- if (TARGET_PROFILER_EPILOGUE) \
- { \
- if (flag_pic) \
- fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall mexitcount\n"); \
- } \
+ if (flag_pic) \
+ fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
+ else \
+ fprintf (FILE, "\tcall mexitcount\n"); \
}
+#endif
/* Override the default comment-starter of "/". */
diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile
index e6024eb06e5d..45a301df0fef 100644
--- a/gnu/usr.bin/cc/libgcc/Makefile
+++ b/gnu/usr.bin/cc/libgcc/Makefile
@@ -17,12 +17,12 @@ P2OBJS=${LIB2OBJS:.o=.po}
${LIB1OBJS}: libgcc1.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
${LIB2OBJS}: libgcc2.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.if !defined(NOPIC)
${LIB1SOBJS}: libgcc1.c
diff --git a/gnu/usr.bin/cpio/main.c b/gnu/usr.bin/cpio/main.c
index 9346b780bed1..78b5fc53145f 100644
--- a/gnu/usr.bin/cpio/main.c
+++ b/gnu/usr.bin/cpio/main.c
@@ -23,9 +23,6 @@
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "filetypes.h"
#include "system.h"
#include "cpiohdr.h"
@@ -461,9 +458,6 @@ main (argc, argv)
program_name = argv[0];
umask (0);
-#ifdef __FreeBSD__
- (void) setlocale (LC_ALL, "");
-#endif
#ifdef __TURBOC__
_fmode = O_BINARY; /* Put stdin and stdout in binary mode. */
#endif
diff --git a/gnu/usr.bin/cpio/util.c b/gnu/usr.bin/cpio/util.c
index 7204af7d37da..e2e1c1e86697 100644
--- a/gnu/usr.bin/cpio/util.c
+++ b/gnu/usr.bin/cpio/util.c
@@ -784,9 +784,9 @@ get_next_reel (tape_des)
fprintf (tty_out, "%s%d%s", new_media_message_with_number, reel_number,
new_media_message_after_number);
else if (archive_name)
- fprintf (tty_out, "Found end of volume. Load next volume and press RETURN. ");
+ fprintf (tty_out, "Found end of tape. Load next tape and press RETURN. ");
else
- fprintf (tty_out, "Found end of volume. To continue, type device/file name when ready.\n");
+ fprintf (tty_out, "Found end of tape. To continue, type device/file name when ready.\n");
fflush (tty_out);
diff --git a/gnu/usr.bin/cvs/contrib/easy-import.pl b/gnu/usr.bin/cvs/contrib/easy-import.pl
index 3c0b7b5e75a1..3ba452b7fb46 100644
--- a/gnu/usr.bin/cvs/contrib/easy-import.pl
+++ b/gnu/usr.bin/cvs/contrib/easy-import.pl
@@ -22,7 +22,7 @@ sub scan_opts
$dont_do_it = "-n" if $opt_n;
if($opt_v) {
- print STDERR '$Source: /home/ncvs/src/gnu/usr.bin/cvs/contrib/easy-import.pl,v $ $Revision: 1.5 $' . "\n"; # 'emacs kludge
+ print STDERR '$Source: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/cvs/contrib/easy-import.pl,v $ $Revision: 1.5 $' . "\n"; # 'emacs kludge
exit 0;
}
die "usage: $0 [-v] [-n] [moduledir]\n" .
@@ -162,20 +162,20 @@ sub cvs_init
sub lsmodules
{
# list all known CVS modules
- local(%rv, $mname, $mpath, $_);
+ local(@rv, $mname, $_);
- %rv = ();
+ @rv = ();
open(CVS, "cvs co -c|");
while($_ = <CVS>) {
chop;
- ($mname,$mpath) = split;
+ ($mname) = split;
next if $mname eq "";
- $rv{$mname} = $mpath;
+ @rv = (@rv, $mname);
}
close(CVS);
- return %rv;
+ return @rv;
}
@@ -259,65 +259,56 @@ $area = "$rep/$selected";
print "\n${so}[Working on:${se} ${us}$area${ue}${so}]${se}\n";
-%cvsmods = &lsmodules();
-
for(;;) {
$| = 1;
- print "${so}Gimme the module name:${se} ";
+ print "${so}Enter the module path:${se} $area/";
$| = 0;
- $modname = <>;
- chop $modname;
- if ($modname eq "") {
- print "\a${us}You cannot use an empty module name.${ue}\n";
+ $modpath = <>;
+ chop $modpath;
+ if ($modpath eq "") {
+ print "\a${us}You cannot use an empty module path.${ue}\n";
next;
}
- last if !$cvsmods{$modname};
- print "\a${us}This module name does already exist;\n" .
- "do you intend to create a vendor-branch import?${ue}: ";
- $rep = <>;
- if ($rep =~ /\s*[yY]/) {
- ($area,$modpath) = split(/\//,$cvsmods{$modname},2);
- $branchimport = 1;
- last;
- }
- print "${us}Choose another name.${ue}\n";
+ last if ! -d "$cvsroot/$area/$modpath";
+ print "\a${us}This module path does already exist; " .
+ "choose another one.${ue}\n";
}
-if(!$branchimport) {
- for(;;) {
- $| = 1;
- print "${so}Enter the module path:${se} $area/";
- $| = 0;
- $modpath = <>;
- chop $modpath;
- if ($modpath eq "") {
- print "\a${us}You cannot use an empty module path.${ue}\n";
- next;
- }
- last if ! -d "$cvsroot/$area/$modpath";
- print "\a${us}This module path does already exist; " .
- "choose another one.${ue}\n";
- }
+@newdirs = ();
+$dir1 = "$cvsroot/$area";
+$dir2 = "$area";
+@newdirs = (@newdirs, "$dir2") if ! -d $dir1;
- @newdirs = ();
- $dir1 = "$cvsroot/$area";
- $dir2 = "$area";
-
+foreach $ele (split(/\//, $modpath)) {
+ $dir1 = "$dir1/$ele";
+ $dir2 = "$dir2/$ele";
@newdirs = (@newdirs, "$dir2") if ! -d $dir1;
+}
- foreach $ele (split(/\//, $modpath)) {
- $dir1 = "$dir1/$ele";
- $dir2 = "$dir2/$ele";
- @newdirs = (@newdirs, "$dir2") if ! -d $dir1;
- }
+print "${so}You're going to create the following new directories:${se}\n";
+
+&list(@newdirs);
- print "${so}You're going to create the following new directories:${se}\n";
+@cvsmods = &lsmodules();
- &list(@newdirs);
+for(;;) {
+ $| = 1;
+ print "${so}Gimme the module name:${se} ";
+ $| = 0;
+ $modname = <>;
+ chop $modname;
+ if ($modname eq "") {
+ print "\a${us}You cannot use an empty module name.${ue}\n";
+ next;
+ }
+ last if !&contains($modname, @cvsmods);
+ print "\a${us}This module name does already exist; " .
+ "choose another one.${ue}\n";
}
+
for(;;) {
$| = 1;
print "${so}Enter a \`vendor\' tag (e. g. the authors ID):${se} ";
@@ -343,38 +334,37 @@ print "${so}This is your last chance to interrupt, " .
$| = 0;
<>;
-if (!$branchimport) {
- $mod = "";
- foreach $tmp (sort(keys(%cvsmods))) {
- if($tmp gt $modname) {
- $mod = $tmp;
- last;
- }
- }
- if($mod eq "") {
- # we are going to append our module
- $cmd = "\$\na\n";
- } else {
- # we can insert it
- $cmd = "/^${mod}[ \t]/\ni\n";
+$mod = "";
+foreach $tmp (@cvsmods) {
+ if($tmp gt $modname) {
+ $mod = $tmp;
+ last;
}
+}
+
+if($mod eq "") {
+ # we are going to append our module
+ $cmd = "\$\na\n";
+} else {
+ # we can insert it
+ $cmd = "/^${mod}[ \t]/\ni\n";
+}
- print "${so}Checking out the modules database...${se}\n";
- system("cvs co modules") && die "${us}failed.\n${ue}";
+print "${so}Checking out the modules database...${se}\n";
+system("cvs co modules") && die "${us}failed.\n${ue}";
- print "${so}Inserting new module...${se}\n";
- open(ED, "|ed modules/modules") || die "${us}Cannot start ed${ue}\n";
- print(ED "${cmd}${modname}" . ' ' x (16 - length($modname)) .
- "$area/${modpath}\n.\nw\nq\n");
- close(ED);
+print "${so}Inserting new module...${se}\n";
+open(ED, "|ed modules/modules") || die "${us}Cannot start ed${ue}\n";
+print(ED "${cmd}${modname}" . ' ' x (16 - length($modname)) .
+ "$area/${modpath}\n.\nw\nq\n");
+close(ED);
- print "${so}Commiting new modules database...${se}\n";
- system("cvs $dont_do_it commit -m \" " .
- "${modname} --> $area/${modpath}\" modules")
- && die "Commit failed\n";
+print "${so}Commiting new modules database...${se}\n";
+system("cvs $dont_do_it commit -m \" " .
+ "${modname} --> $area/${modpath}\" modules")
+ && die "Commit failed\n";
- system("cvs $dont_do_it -Q release -d modules");
-}
+system("cvs $dont_do_it -Q release -d modules");
print "${so}Importing source. Enter a commit message in the editor.${se}\n";
diff --git a/gnu/usr.bin/cvs/doc/cvs.texinfo b/gnu/usr.bin/cvs/doc/cvs.texinfo
index ef125f524b6e..b3404d5825aa 100644
--- a/gnu/usr.bin/cvs/doc/cvs.texinfo
+++ b/gnu/usr.bin/cvs/doc/cvs.texinfo
@@ -1647,11 +1647,7 @@ int main(int argc,
gencode();
else
fprintf(stderr, "No code generated.\n");
-<<<<<<< driver.c
- exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
-=======
exit(!!nerr);
->>>>>>> 1.6
@}
@end example
diff --git a/gnu/usr.bin/cvs/examples/loginfo b/gnu/usr.bin/cvs/examples/loginfo
index 0c338249ce63..e9c25e064612 100644
--- a/gnu/usr.bin/cvs/examples/loginfo
+++ b/gnu/usr.bin/cvs/examples/loginfo
@@ -1,5 +1,5 @@
#
-#ident "@(#)cvs/examples:$Name$:$Id$"
+# $CVSid: @(#)loginfo 1.5 92/03/31 $
#
# The "loginfo" file is used to control where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which is tested
diff --git a/gnu/usr.bin/diff/diff.1 b/gnu/usr.bin/diff/diff.1
index 4acd3c9ac44d..e16f6d98dcfa 100644
--- a/gnu/usr.bin/diff/diff.1
+++ b/gnu/usr.bin/diff/diff.1
@@ -309,6 +309,9 @@ Use
to output a line taken from just the first file in
if-then-else format.
.TP
+.B \-p
+Show which C function each change is in.
+.TP
.B \-P
When comparing directories, if a file appears only in the second
directory of the two, treat it as present but empty in the other.
@@ -322,25 +325,25 @@ to paginate it.
Report only whether the files differ, not the details of the
differences.
.TP
+.B \-r
+When comparing directories, recursively compare any subdirectories
+found.
+.TP
.B \-\-rcs
Output RCS-format diffs; like
.B \-f
except that each command
specifies the number of lines affected.
.TP
-.B \-r
-.br
-.ns
-.TP
.B \-\-recursive
When comparing directories, recursively compare any subdirectories
found.
.TP
-.B \-s
+.B \-\-report\-identical\-files
.br
.ns
.TP
-.B \-\-report\-identical\-files
+.B \-s
Report when two files are the same.
.TP
.BI "\-S " file
diff --git a/gnu/usr.bin/gdb/bfd/sysdep.h b/gnu/usr.bin/gdb/bfd/sysdep.h
index 5e989eb230f7..f57363b66aba 100644
--- a/gnu/usr.bin/gdb/bfd/sysdep.h
+++ b/gnu/usr.bin/gdb/bfd/sysdep.h
@@ -19,7 +19,7 @@
#define SEEK_SET 0
#define SEEK_CUR 1
-#define HOST_PAGE_SIZE PAGE_SIZE
+#define HOST_PAGE_SIZE NBPG
#define HOST_MACHINE_ARCH bfd_arch_i386
#define HOST_TEXT_START_ADDR USRTEXT
diff --git a/gnu/usr.bin/gdb/bfd/trad-core.c b/gnu/usr.bin/gdb/bfd/trad-core.c
index 78a70a737416..dc3d84380f17 100644
--- a/gnu/usr.bin/gdb/bfd/trad-core.c
+++ b/gnu/usr.bin/gdb/bfd/trad-core.c
@@ -117,7 +117,7 @@ trad_unix_core_file_p (abfd)
bfd_set_error (bfd_error_system_call);
return 0;
}
- if (PAGE_SIZE * (UPAGES + u.u_dsize
+ if (NBPG * (UPAGES + u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- u.u_tsize
#endif
@@ -127,7 +127,7 @@ trad_unix_core_file_p (abfd)
return 0;
}
#ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE
- if (PAGE_SIZE * (UPAGES + u.u_dsize + u.u_ssize)
+ if (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
#ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED
/* Some systems write the file too big. */
+ TRAD_CORE_EXTRA_SIZE_ALLOWED
@@ -187,26 +187,26 @@ trad_unix_core_file_p (abfd)
core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
- core_datasec (abfd)->_raw_size = PAGE_SIZE * u.u_dsize
+ core_datasec (abfd)->_raw_size = NBPG * u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- - PAGE_SIZE * u.u_tsize
+ - NBPG * u.u_tsize
#endif
;
- core_stacksec (abfd)->_raw_size = PAGE_SIZE * u.u_ssize;
- core_regsec (abfd)->_raw_size = PAGE_SIZE * UPAGES; /* Larger than sizeof struct u */
+ core_stacksec (abfd)->_raw_size = NBPG * u.u_ssize;
+ core_regsec (abfd)->_raw_size = NBPG * UPAGES; /* Larger than sizeof struct u */
/* What a hack... we'd like to steal it from the exec file,
since the upage does not seem to provide it. FIXME. */
#ifdef HOST_DATA_START_ADDR
core_datasec (abfd)->vma = HOST_DATA_START_ADDR;
#else
- core_datasec (abfd)->vma = HOST_TEXT_START_ADDR + (PAGE_SIZE * u.u_tsize);
+ core_datasec (abfd)->vma = HOST_TEXT_START_ADDR + (NBPG * u.u_tsize);
#endif
#ifdef HOST_STACK_START_ADDR
core_stacksec (abfd)->vma = HOST_STACK_START_ADDR;
#else
- core_stacksec (abfd)->vma = HOST_STACK_END_ADDR - (PAGE_SIZE * u.u_ssize);
+ core_stacksec (abfd)->vma = HOST_STACK_END_ADDR - (NBPG * u.u_ssize);
#endif
/* This is tricky. As the "register section", we give them the entire
@@ -225,10 +225,10 @@ trad_unix_core_file_p (abfd)
using minor trickery to get around the offset-or-absolute-addr problem. */
core_regsec (abfd)->vma = 0 - (int) u.u_ar0;
- core_datasec (abfd)->filepos = PAGE_SIZE * UPAGES;
- core_stacksec (abfd)->filepos = (PAGE_SIZE * UPAGES) + PAGE_SIZE * u.u_dsize
+ core_datasec (abfd)->filepos = NBPG * UPAGES;
+ core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- - PAGE_SIZE * u.u_tsize
+ - NBPG * u.u_tsize
#endif
;
core_regsec (abfd)->filepos = 0; /* Register segment is the upage */
diff --git a/gnu/usr.bin/gdb/gdb/Makefile b/gnu/usr.bin/gdb/gdb/Makefile
index d1513bb6fb62..68a86ae5395b 100644
--- a/gnu/usr.bin/gdb/gdb/Makefile
+++ b/gnu/usr.bin/gdb/gdb/Makefile
@@ -1,5 +1,3 @@
-# $Id$
-
PROG = gdb
BINDIR= /usr/bin
CLEANFILES+= y.tab.h c-exp.tab.c ch-exp.tab.c m2-exp.tab.c
@@ -26,24 +24,24 @@ c-exp.tab.c: $(.CURDIR)/c-exp.y
sed -e '/extern.*malloc/d' -e '/extern.*realloc/d' -e '/extern.*free/d' \
-e '/include.*malloc.h/d' -e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' < y.tab.c > c-exp.new
- rm -f y.tab.c
- mv -f c-exp.new ./c-exp.tab.c
+ rm y.tab.c
+ mv c-exp.new ./c-exp.tab.c
ch-exp.tab.c: $(.CURDIR)/ch-exp.y
yacc -d -p ch_ $(.CURDIR)/ch-exp.y
sed -e '/extern.*malloc/d' -e '/extern.*realloc/d' -e '/extern.*free/d' \
-e '/include.*malloc.h/d' -e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' < y.tab.c > ch-exp.new
- rm -f y.tab.c
- mv -f ch-exp.new ./ch-exp.tab.c
+ rm y.tab.c
+ mv ch-exp.new ./ch-exp.tab.c
m2-exp.tab.c: $(.CURDIR)/m2-exp.y
yacc -d -p m2_ $(.CURDIR)/m2-exp.y
sed -e '/extern.*malloc/d' -e '/extern.*realloc/d' -e '/extern.*free/d' \
-e '/include.*malloc.h/d' -e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' < y.tab.c > m2-exp.new
- rm -f y.tab.c
- mv -f m2-exp.new ./m2-exp.tab.c
+ rm y.tab.c
+ mv m2-exp.new ./m2-exp.tab.c
CFLAGS+= -I$(.CURDIR)/. -I${DESTDIR}/usr/include/readline -I$(.CURDIR)/../bfd
diff --git a/gnu/usr.bin/gdb/gdb/freebsd-nat.c b/gnu/usr.bin/gdb/gdb/freebsd-nat.c
index ebf7db75d261..5a3935474ef2 100644
--- a/gnu/usr.bin/gdb/gdb/freebsd-nat.c
+++ b/gnu/usr.bin/gdb/gdb/freebsd-nat.c
@@ -480,7 +480,7 @@ kvtophys (fd, addr)
CORE_ADDR addr;
{
CORE_ADDR v;
- unsigned int pte;
+ struct pte pte;
static CORE_ADDR PTD = -1;
CORE_ADDR current_ptd;
@@ -526,18 +526,18 @@ CORE_ADDR addr;
/*
* Read the first-level page table (ptd).
*/
- v = current_ptd + ((unsigned)addr >> PDRSHIFT) * sizeof pte;
- if (physrd(fd, v, (char *)&pte, sizeof pte) < 0 || (pte&PG_V) == 0)
+ v = current_ptd + ((unsigned)addr >> PD_SHIFT) * sizeof pte;
+ if (physrd(fd, v, (char *)&pte, sizeof pte) < 0 || pte.pg_v == 0)
return (~0);
/*
* Read the second-level page table.
*/
- v = (pte&PG_FRAME) + ((addr >> PAGE_SHIFT)&(NPTEPG-1)) * sizeof pte;
- if (physrd(fd, v, (char *) &pte, sizeof(pte)) < 0 || (pte&PG_V) == 0)
+ v = i386_ptob(pte.pg_pfnum) + ((addr&PT_MASK) >> PG_SHIFT) * sizeof pte;
+ if (physrd(fd, v, (char *) &pte, sizeof(pte)) < 0 || pte.pg_v == 0)
return (~0);
- addr = (pte & PG_FRAME) + (addr & PAGE_MASK);
+ addr = i386_ptob(pte.pg_pfnum) + (addr & PGOFSET);
#if 0
printf("vtophys(%x) -> %x\n", oldaddr, addr);
#endif
@@ -605,7 +605,7 @@ kernel_core_file_hook(fd, addr, buf, len)
break;
}
/* we can't read across a page boundary */
- i = min(len, PAGE_SIZE - (addr & PAGE_MASK));
+ i = min(len, NBPG - (addr & PGOFSET));
if ((cc = physrd(fd, paddr, cp, i)) <= 0) {
bzero(cp, len);
return (cp - buf);
diff --git a/gnu/usr.bin/gdb/gdb/gdb.1 b/gnu/usr.bin/gdb/gdb/gdb.1
index 0245ec81cc8c..2a2af1f9a0e6 100644
--- a/gnu/usr.bin/gdb/gdb/gdb.1
+++ b/gnu/usr.bin/gdb/gdb/gdb.1
@@ -11,8 +11,6 @@ gdb \- The GNU Debugger
.RB "[\|" \-help "\|]"
.RB "[\|" \-nx "\|]"
.RB "[\|" \-q "\|]"
-.RB "[\|" \-k "\|]"
-.RB "[\|" \-w "\|]"
.RB "[\|" \-batch "\|]"
.RB "[\|" \-cd=\c
.I dir\c
@@ -283,23 +281,6 @@ command options and arguments have been processed.
messages are also suppressed in batch mode.
.TP
-.B \-kernel
-.TP
-.B \-k
-Puts GDB into kernel debugging mode. If no executable file is specified then
-/kernel is used. If no core file is specified then /dev/mem is
-used. Crash dumps can be examined by specifying both an executable and
-a core file.
-
-.TP
-.B \-wcore
-.TP
-.B \-w
-This flag is only effective when debugging a "live" kernel. It makes the
-core file (/dev/mem) writable so that kernel variables can be changed
-during a debugging session. Use this with caution !
-
-.TP
.B \-batch
Run in batch mode. Exit with status \c
.B 0\c
diff --git a/gnu/usr.bin/gdb/libiberty/Makefile b/gnu/usr.bin/gdb/libiberty/Makefile
index 838781295e82..2bc6abfab4a7 100644
--- a/gnu/usr.bin/gdb/libiberty/Makefile
+++ b/gnu/usr.bin/gdb/libiberty/Makefile
@@ -1,7 +1,7 @@
LIB= iberty
SRCS= argv.c basename.c concat.c cplus-dem.c fdmatch.c getopt.c \
getopt1.c ieee-float.c obstack.c spaces.c strerror.c strsignal.c \
- xmalloc.c
+ vasprintf.c xmalloc.c
CFLAGS+= -I$(.CURDIR)/../gdb/.
NOPROFILE=no
diff --git a/gnu/usr.bin/gdb/libiberty/vasprintf.c b/gnu/usr.bin/gdb/libiberty/vasprintf.c
new file mode 100644
index 000000000000..b3ba0ca6ca8c
--- /dev/null
+++ b/gnu/usr.bin/gdb/libiberty/vasprintf.c
@@ -0,0 +1,139 @@
+/* Like vsprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller.
+ Copyright (C) 1994 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include <varargs.h>
+
+#ifdef TEST
+int global_total_width;
+#endif
+
+unsigned long strtoul ();
+char *malloc ();
+
+int
+vasprintf (result, format, args)
+ char **result;
+ char *format;
+ va_list args;
+{
+ char *p = format;
+ /* Add one to make sure that it is never zero, which might cause malloc
+ to return NULL. */
+ int total_width = strlen (format) + 1;
+ va_list ap = args;
+
+ while (*p != '\0')
+ {
+ if (*p++ == '%')
+ {
+ while (strchr ("-+ #0", *p))
+ ++p;
+ if (*p == '*')
+ {
+ ++p;
+ total_width += abs (va_arg (ap, int));
+ }
+ else
+ total_width += strtoul (p, &p, 10);
+ if (*p == '.')
+ {
+ ++p;
+ if (*p == '*')
+ {
+ ++p;
+ total_width += abs (va_arg (ap, int));
+ }
+ else
+ total_width += strtoul (p, &p, 10);
+ }
+ while (strchr ("hlL", *p))
+ ++p;
+ /* Should be big enough for any format specifier except %s. */
+ total_width += 30;
+ switch (*p)
+ {
+ case 'd':
+ case 'i':
+ case 'o':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'c':
+ va_arg (ap, int);
+ break;
+ case 'f':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ va_arg (ap, double);
+ break;
+ case 's':
+ total_width += strlen (va_arg (ap, char *));
+ break;
+ case 'p':
+ case 'n':
+ va_arg (ap, char *);
+ break;
+ }
+ }
+ }
+#ifdef TEST
+ global_total_width = total_width;
+#endif
+ *result = malloc (total_width);
+ if (*result != NULL)
+ return vsprintf (*result, format, args);
+ else
+ return 0;
+}
+
+#ifdef TEST
+void
+checkit (va_alist)
+ va_dcl
+{
+ va_list args;
+ char *format;
+ char *result;
+
+ va_start (args);
+ format = va_arg (args, char *);
+ vasprintf (&result, format, args);
+ if (strlen (result) < global_total_width)
+ printf ("PASS: ");
+ else
+ printf ("FAIL: ");
+ printf ("%d %s\n", global_total_width, result);
+}
+
+int
+main ()
+{
+ checkit ("%d", 0x12345678);
+ checkit ("%200d", 5);
+ checkit ("%.300d", 6);
+ checkit ("%100.150d", 7);
+ checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
+777777777777777777333333333333366666666666622222222222777777777777733333");
+ checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
+}
+#endif /* TEST */
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile
index 0cfcf6b2d44c..a7811a3c656c 100644
--- a/gnu/usr.bin/grep/Makefile
+++ b/gnu/usr.bin/grep/Makefile
@@ -2,7 +2,7 @@ PROG= grep
SRCS= dfa.c grep.c getopt.c kwset.c obstack.c search.c
CFLAGS+=-DGREP -DHAVE_STRING_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_UNISTD_H=1 \
-DHAVE_GETPAGESIZE=1 -DHAVE_MEMCHR=1 -DHAVE_STRERROR=1 \
- -DHAVE_VALLOC=1 -DHAVE_MMAP=1 -DHAVE_FTS=1
+ -DHAVE_VALLOC=1
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
${BINDIR}/grep ${BINDIR}/fgrep
diff --git a/gnu/usr.bin/grep/grep.1 b/gnu/usr.bin/grep/grep.1
index 22e96e8b7cdd..27c6b0e419d2 100644
--- a/gnu/usr.bin/grep/grep.1
+++ b/gnu/usr.bin/grep/grep.1
@@ -3,13 +3,22 @@
grep, egrep, fgrep \- print lines matching a pattern
.SH SYNOPOSIS
.B grep
-[\-[AB] num]
-[\-HRPS]
-[\-CEFGLVabchilnqsvwx]
-[\-e expr]
-[\-f file]
-files...
-
+[
+.BR \- [[ AB "] ]\c"
+.I "num"
+]
+[
+.BR \- [ CEFGVBchilnsvwx ]
+]
+[
+.B \-e
+]
+.I pattern
+|
+.BI \-f file
+] [
+.I files...
+]
.SH DESCRIPTION
.PP
.B Grep
@@ -93,9 +102,6 @@ Print the version number of
to standard error. This version number should
be included in all bug reports (see below).
.TP
-.B \-a
-Don't search in binary files.
-.TP
.B \-b
Print the byte offset within the input file before
each line of output.
@@ -159,36 +165,6 @@ characters are letters, digits, and the underscore.
.TP
.B \-x
Select only those matches that exactly match the whole line.
-
-.PP
-Following options only avaible if compiled with FTS library:
-.PD 0
-.TP
-.BI \-H
-If the
-.I \-R
-option is specified, symbolic links on the command line
-are followed. (Symbolic links encountered in the tree traversal
-are not followed.)
-.TP
-
-.BI \-L
-If the
-.I \-R
-option is specified, all symbolic links are followed.
-.TP
-
-.BI \-P
-If the
-.I \-R
-option is specified, no symbolic links are followed.
-.TP
-
-.BI \-R
-Search in the file hierarchies
-rooted in the files instead of just the files themselves.
-.TP
-
.PD
.SH "REGULAR EXPRESSIONS"
.PP
diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c
index 2576e3dab758..dc3329853307 100644
--- a/gnu/usr.bin/grep/grep.c
+++ b/gnu/usr.bin/grep/grep.c
@@ -19,9 +19,6 @@
#include <errno.h>
#include <stdio.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#ifndef errno
extern int errno;
@@ -56,7 +53,6 @@ extern char *memchr();
#include <unistd.h>
#else
#define O_RDONLY 0
-#define STDIN_FILENO 0
extern int open(), read(), close();
#endif
@@ -95,16 +91,6 @@ memchr(vp, c, n)
}
#endif
-/* traverse a file hierarchy library */
-#ifdef HAVE_FTS
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fts.h>
-#endif
-
-/* don't search in binary files */
-int aflag;
-
/* Define flags declared in grep.h. */
char *matcher;
int match_icase;
@@ -510,40 +496,6 @@ grepbuf(beg, lim)
return nlines;
}
-
-/*
- * try to guess if fd belong to a binary file
- */
-
-int isBinaryFile(fd)
- int fd;
-{
-#define BINARY_BUF_LEN 32
- static unsigned char buf[BINARY_BUF_LEN];
- int i, n;
-
- /* pipe, socket, fifo */
- if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1)
- return(0);
-
- if ((n =(int) read(fd, buf, (size_t)BINARY_BUF_LEN)) == -1)
- return(0);
-
- /* look for non-printable chars */
- for(i = 0; i < n; i++)
- if (!isprint(buf[i]) && !isspace(buf[i]))
- return(1);
-
- /* reset fd to begin of file */
- if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1)
- return(0);
-
-
- return(0);
-}
-
-
-
/* Search a given file. Return a count of lines printed. */
static int
grep(fd)
@@ -553,10 +505,6 @@ grep(fd)
size_t residue, save;
char *beg, *lim;
- /* skip binary files */
- if (aflag && isBinaryFile(fd))
- return(0);
-
reset(fd);
totalcc = 0;
@@ -617,15 +565,8 @@ grep(fd)
static char version[] = "GNU grep version 2.0";
-#ifdef HAVE_FTS
-#define USAGE \
-"usage: %s [-[AB] <num>] [-HRPS] [-CEFGLVabchilnqsvwx]\n\
- [-e <expr>] [-f file] [files ...]\n"
-#else
#define USAGE \
-"usage: %s [-[AB] <num>] [-CEFGLVabchilnqsvwx]\n\
- [-e <expr>] [-f file] [files ...]\n"
-#endif
+ "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
static void
usage()
@@ -664,16 +605,7 @@ main(argc, argv)
FILE *fp;
extern char *optarg;
extern int optind;
-#ifdef HAVE_FTS
- int Rflag, Hflag, Pflag, Lflag;
- FTS *ftsp;
- FTSENT *ftsent;
- int fts_options;
-#endif
-#ifdef __FreeBSD__
- (void) setlocale(LC_CTYPE, "");
-#endif
prog = argv[0];
if (prog && strrchr(prog, '/'))
prog = strrchr(prog, '/') + 1;
@@ -686,20 +618,9 @@ main(argc, argv)
list_files = 0;
suppress_errors = 0;
matcher = NULL;
- aflag = 0;
-#ifdef HAVE_FTS
- Rflag = Hflag = Pflag = Lflag = 0;
-#endif
-
- while ((opt = getopt(argc, argv,
-
-#ifndef HAVE_FTS
-"0123456789A:B:CEFGVX:abce:f:hiLlnqsvwxy"
-#else
-"0123456789A:B:CEFGHLPRSVX:abce:f:hiLlnqsvwxy?"
-#endif
-)) != EOF)
+ while ((opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy"))
+ != EOF)
switch (opt)
{
case '0':
@@ -751,34 +672,6 @@ main(argc, argv)
fatal("matcher already specified", 0);
matcher = optarg;
break;
-
-#ifdef HAVE_FTS
- /* symbolic links on the command line are followed */
- case 'H':
- Hflag = 1;
- Lflag = Pflag = 0;
- break;
-
- /* no symbolic links are followed */
- case 'P':
- Pflag = 1;
- Hflag = Lflag = 0;
- break;
-
- /* traverse file hierarchies */
- case 'R':
- Rflag = 1;
- break;
-
- /* all symbolic links are followed */
- case 'S':
- Lflag = 1;
- Hflag = Pflag = 0;
- break;
-#endif
- case 'a':
- aflag = 1;
- break;
case 'b':
out_byte = 1;
break;
@@ -876,126 +769,12 @@ main(argc, argv)
(*compile)(keys, keycc);
-#ifndef HAVE_FTS
if (argc - optind > 1 && !no_filenames)
-#else
- if ((argc - optind > 1 || Rflag) && !no_filenames)
-#endif
out_file = 1;
status = 1;
-#if HAVE_FTS
- if (Rflag) {
- fts_options = FTS_PHYSICAL | FTS_NOCHDIR;
-
- if (Hflag)
- fts_options |= FTS_COMFOLLOW;
-
- if (Lflag) {
- fts_options |= FTS_LOGICAL;
- fts_options &= ~FTS_PHYSICAL;
- }
-
- if (Pflag) {
- fts_options &= ~FTS_LOGICAL & ~FTS_COMFOLLOW;
- fts_options |= FTS_PHYSICAL;
- }
- }
-
- if (Rflag && optind < argc) {
- int i;
-
- /* replace "-" with "/dev/stdin" */
- for (i = optind; i < argc; i++)
- if (strcmp(argv[i], "-") == 0)
- *(argv + i) = "/dev/stdin";
-
- if ((ftsp = fts_open(argv + optind, fts_options,
- (int(*)())NULL)) == NULL) {
- if (!suppress_errors)
- error("", errno);
- } else {
-
- while((ftsent = fts_read(ftsp)) != NULL) {
- filename = ftsent->fts_accpath;
-
- switch(ftsent->fts_info) {
-
- /* regular file */
- case FTS_F:
- break;
-
- /* directory */
- case FTS_D:
- case FTS_DC:
- case FTS_DP:
- continue; break;
-
- /* errors */
- case FTS_DNR:
- error(filename, errno);
- continue; break;
-
- case FTS_ERR:
- case FTS_NS:
- error(filename, ftsent->fts_errno);
- continue; break;
-
- /* dead symlink */
- case FTS_SLNONE:
- continue; break;
-
- /* symlink, don't skip */
- case FTS_SL:
- break;
-
- default:
- /*
- if (!suppress_errors)
- fprintf(stderr, "%s: ignored\n", filename);
- continue; break;
- */
-
- }
-
- if ((desc = open(filename, O_RDONLY)) == -1) {
- error(filename, errno);
- continue;
- }
-
- count = grep(desc);
- if (count_matches)
- {
- if (out_file)
- printf("%s:", filename);
- printf("%d\n", count);
- }
- if (count)
- {
- status = 0;
- if (list_files == 1)
- printf("%s\n", filename);
- }
- else if (list_files == -1)
- printf("%s\n", filename);
-
- if (desc != STDIN_FILENO)
- close(desc);
- }
-
- if (fts_close(ftsp) == -1)
- error("fts_close", errno);
- }
-
- /* ! Rflag */
- } else
-
-#endif /* HAVE_FTS */
-
- /* search in file names from arguments, not from stdin */
if (optind < argc)
-
while (optind < argc)
{
desc = strcmp(argv[optind], "-") ? open(argv[optind], O_RDONLY) : 0;
@@ -1027,8 +806,6 @@ main(argc, argv)
close(desc);
++optind;
}
-
- /* read input from stdin */
else
{
filename = "(standard input)";
diff --git a/gnu/usr.bin/grep/search.c b/gnu/usr.bin/grep/search.c
index 5e17d034abbe..2b8933805c9a 100644
--- a/gnu/usr.bin/grep/search.c
+++ b/gnu/usr.bin/grep/search.c
@@ -46,7 +46,7 @@ extern char *memchr();
#define bcopy(s, d, n) memcpy((d), (s), (n))
#endif
-#if defined(isascii) && !defined(__FreeBSD__)
+#ifdef isascii
#define ISALNUM(C) (isascii(C) && isalnum(C))
#define ISUPPER(C) (isascii(C) && isupper(C))
#else
diff --git a/gnu/usr.bin/groff/Makefile.cfg b/gnu/usr.bin/groff/Makefile.cfg
index 0c7adc565ddd..406e24ee2813 100644
--- a/gnu/usr.bin/groff/Makefile.cfg
+++ b/gnu/usr.bin/groff/Makefile.cfg
@@ -1,6 +1,5 @@
-# $Id$
-
BINDIR?= /usr/bin
+SHAREDIR?= /usr/share
SHELL= /bin/sh
# Define `page' to be letter if your PostScript printer uses 8.5x11
@@ -90,13 +89,13 @@ CFLAGS+=$(DEFINES)
.y.o:
$(YACC) $(YFLAGS) $(.IMPSRC)
- mv -f y.tab.c $(.PREFIX).cc
- mv -f y.tab.h $(.PREFIX).tab.h
+ mv y.tab.c $(.PREFIX).cc
+ mv y.tab.h $(.PREFIX).tab.h
${CXX} ${CXXFLAGS} -c $(.PREFIX).cc -o ${.TARGET}
.y.cc:
$(YACC) $(YFLAGS) $(.IMPSRC)
- mv -f y.tab.c $(.PREFIX).cc
- mv -f y.tab.h $(.PREFIX).tab.h
+ mv y.tab.c $(.PREFIX).cc
+ mv y.tab.h $(.PREFIX).tab.h
.SUFFIXES: .man .1 .2 .3 .4 .5 .6 .7 .8
diff --git a/gnu/usr.bin/groff/Makefile.comm b/gnu/usr.bin/groff/Makefile.comm
index 9e6f15ee5937..b3d24af39c54 100644
--- a/gnu/usr.bin/groff/Makefile.comm
+++ b/gnu/usr.bin/groff/Makefile.comm
@@ -1,5 +1,3 @@
-# $Id$
-
# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
#
@@ -95,14 +93,14 @@ extraclean:
else \
$(YACC) $(YACCFLAGS) $<; \
fi
- mv -f y.tab.c $@
+ mv y.tab.c $@
# Avoid ending up with two versions of $(YTABH).
if test -n "$(YTABH)"; then \
if test -f $(srcdir)/$(YTABH); then \
rm -f $(YTABH); \
- mv -f y.tab.h $(srcdir)/$(YTABH); \
+ mv y.tab.h $(srcdir)/$(YTABH); \
else \
- mv -f y.tab.h $(YTABH); \
+ mv y.tab.h $(YTABH); \
fi; \
fi
@@ -219,7 +217,7 @@ uninstall_dev:
.PHONY: depend_src
depend_src: depend.temp
- mv -f depend.temp Makefile.dep
+ mv depend.temp Makefile.dep
depend.temp: FORCE
> depend.temp;
@@ -229,7 +227,7 @@ depend.temp: FORCE
|| $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp
if test -n "$(YTABH)"; then \
sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \
- mv -f depend.temp1 depend.temp; \
+ mv depend.temp1 depend.temp; \
fi
.PHONY: TAGS_src
diff --git a/gnu/usr.bin/groff/Makefile.dev b/gnu/usr.bin/groff/Makefile.dev
index 2aa71f87e116..4f6948fb19d6 100644
--- a/gnu/usr.bin/groff/Makefile.dev
+++ b/gnu/usr.bin/groff/Makefile.dev
@@ -13,15 +13,18 @@ FONTMODE?= 444
all: $(FONTFILES)
-.for f in $(FONTFILES)
-.if exists($f)
-beforeinstall: $f
-.else
-beforeinstall: $(.CURDIR)/$f
+.if !target(maninstall)
+maninstall:
+ @echo -n
+.endif
+
+.if !target(install)
+install:
+ for f in $(FONTFILES); do \
+ ff=$$f; test -f $$f || ff=${.CURDIR}/$$f || true; \
+ install -c -o $(FONTOWN) -g $(FONTGRP) -m $(FONTMODE) $$ff \
+ $(DESTDIR)$(DEVICEDIR)/$$f; \
+ done
.endif
-.endfor
-beforeinstall:
- $(INSTALL) -c -o $(FONTOWN) -g $(FONTGRP) -m $(FONTMODE) \
- ${.ALLSRC} $(DESTDIR)$(DEVICEDIR)
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/Makefile.in b/gnu/usr.bin/groff/Makefile.in
index 723798716348..321fc2ef19d6 100644
--- a/gnu/usr.bin/groff/Makefile.in
+++ b/gnu/usr.bin/groff/Makefile.in
@@ -1,5 +1,3 @@
-# $Id$
-
# Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
#
@@ -340,7 +338,7 @@ dist:
done; \
rm -f Makefile; \
$(LN_S) $$srcdir/Makefile.init Makefile
- mv -f tmp groff-$(version)
+ mv tmp groff-$(version)
tar cfh - groff-$(version) | gzip -c >groff-$(version).tar.gz
rm -fr groff-$(version)
diff --git a/gnu/usr.bin/groff/addftinfo/addftinfo.man b/gnu/usr.bin/groff/addftinfo/addftinfo.man
index 0b6b796a7497..4c92477c7b8b 100644
--- a/gnu/usr.bin/groff/addftinfo/addftinfo.man
+++ b/gnu/usr.bin/groff/addftinfo/addftinfo.man
@@ -79,6 +79,7 @@ If a parameter is not specified the default will be used.
The defaults are chosen to have the reasonable values for
a Times font.
.SH "SEE ALSO"
+.BR font (5)
.BR groff_font (@MAN5EXT@),
.BR groff (@MAN1EXT@),
.BR groff_char (@MAN7EXT@)
diff --git a/gnu/usr.bin/groff/grodvi/Makefile b/gnu/usr.bin/groff/grodvi/Makefile
index de4a71258fc3..9dafc47937bf 100644
--- a/gnu/usr.bin/groff/grodvi/Makefile
+++ b/gnu/usr.bin/groff/grodvi/Makefile
@@ -4,7 +4,7 @@ PROG= grodvi
SRCS= dvi.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBDRIVER} ${LIBGROFF} -lm
-DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBMATH}
MANDEPEND= grodvi.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/groff/Makefile b/gnu/usr.bin/groff/groff/Makefile
index 9539f700d560..6499244622c6 100644
--- a/gnu/usr.bin/groff/groff/Makefile
+++ b/gnu/usr.bin/groff/groff/Makefile
@@ -4,7 +4,7 @@ PROG= groff
SRCS= groff.cc pipeline.c
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBGROFF} -lm
-DPADD+= ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBGROFF} ${LIBMATH}
MANDEPEND= groff.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/groff/groff.man b/gnu/usr.bin/groff/groff/groff.man
index 40961ccc256f..a1a337ac05f6 100644
--- a/gnu/usr.bin/groff/groff/groff.man
+++ b/gnu/usr.bin/groff/groff/groff.man
@@ -83,9 +83,6 @@ For typewriter-like devices
.TP
.B latin1
For typewriter-like devices using the ISO Latin-1 character set.
-.TP
-.B koi8-r
-For typewriter-like devices using the russian KOI8-R character set.
.LP
The postprocessor to be used for a device is specified by the
.B postpro
@@ -347,7 +344,7 @@ The most recent released version of groff is always available for
anonymous ftp from prep.ai.mit.edu (18.71.0.38) in the directory
pub/gnu.
.SH "SEE ALSO"
-.\" .BR grog (@MAN1EXT@),
+.BR grog (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
.BR @g@tbl (@MAN1EXT@),
.BR @g@pic (@MAN1EXT@),
@@ -357,7 +354,7 @@ pub/gnu.
.BR grops (@MAN1EXT@),
.BR grodvi (@MAN1EXT@),
.BR grotty (@MAN1EXT@),
-.\" .BR gxditview (@MAN1EXT@),
+.BR gxditview (@MAN1EXT@),
.BR groff_font (@MAN5EXT@),
.BR groff_out (@MAN5EXT@),
.BR groff_ms (@MAN7EXT@),
diff --git a/gnu/usr.bin/groff/grops/Makefile b/gnu/usr.bin/groff/grops/Makefile
index 7b68bc18d22c..3716f18484c7 100644
--- a/gnu/usr.bin/groff/grops/Makefile
+++ b/gnu/usr.bin/groff/grops/Makefile
@@ -4,7 +4,7 @@ PROG= grops
SRCS= ps.cc psrm.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBDRIVER} ${LIBGROFF} -lm
-DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBMATH}
MANDEPEND= grops.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/grops/grops.man b/gnu/usr.bin/groff/grops/grops.man
index 1f4947ebf863..7a2d0bd90fb8 100644
--- a/gnu/usr.bin/groff/grops/grops.man
+++ b/gnu/usr.bin/groff/grops/grops.man
@@ -609,7 +609,7 @@ The input to
must be in the format output by
.BR @g@troff (@MAN1EXT@).
This is described in
-.BR groff_out (@MAN5EXT@).
+.BR groff_out (@MAN1EXT@).
In addition the device and font description files for the device used
must meet certain requirements.
The device and font description files supplied for
@@ -808,7 +808,7 @@ Macros to undo the effect of
.BI /tmp/grops XXXXXX
Temporary file.
.SH "SEE ALSO"
-.\" .BR afmtodit (@MAN1EXT@),
+.BR afmtodit (@MAN1EXT@),
.BR groff (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
.BR psbb (@MAN1EXT@),
diff --git a/gnu/usr.bin/groff/grotty/Makefile b/gnu/usr.bin/groff/grotty/Makefile
index 18bd9ba18bab..d9d1ab287127 100644
--- a/gnu/usr.bin/groff/grotty/Makefile
+++ b/gnu/usr.bin/groff/grotty/Makefile
@@ -4,7 +4,7 @@ PROG= grotty
SRCS= tty.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBDRIVER} ${LIBGROFF} -lm
-DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBDRIVER} ${LIBGROFF} ${LIBMATH}
MANDEPEND= grotty.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/grotty/grotty.man b/gnu/usr.bin/groff/grotty/grotty.man
index 9e7d31c90544..6b7e7471dbd3 100644
--- a/gnu/usr.bin/groff/grotty/grotty.man
+++ b/gnu/usr.bin/groff/grotty/grotty.man
@@ -22,8 +22,7 @@ should invoked by using the
.B groff
command
with a
-.BR \-Tascii ,
-.B \-Tkoi8-r
+.B \-Tascii
or
.B \-Tlatin1
option.
@@ -102,8 +101,7 @@ Search the directory
for font and device description files;
.I name
is the name of the device, usually
-.BR ascii ,
-.B koi8-r
+.B ascii
or
.BR latin1 .
.TP
@@ -152,18 +150,28 @@ characters.
Print the version number.
.SH FILES
.TP
-.B @FONTDIR@/dev\fIname\fB/DESC
+.B @FONTDIR@/devascii/DESC
Device description file for
-.I name
+.B ascii
device.
.TP
-.BI @FONTDIR@/dev\fIname\fB/ F
+.B @FONTDIR@/devascii/ F
Font description file for font
.I F
of
-.I name
+.B ascii device.
+.TP
+.B @FONTDIR@/devlatin1/DESC
+Device description file for
+.B latin1
device.
.TP
+.B @FONTDIR@/devlatin1/ F
+Font description file for font
+.I F
+of
+.B latin1 device.
+.TP
.B @MACRODIR@/tmac.tty
Macros for use with
.BR grotty .
@@ -192,4 +200,5 @@ cannot be printed.
.BR groff_font (@MAN5EXT@),
.BR groff_char (@MAN7EXT@),
.BR ul (1),
-.BR more (1)
+.BR more (1),
+.BR less (1)
diff --git a/gnu/usr.bin/groff/indxbib/Makefile b/gnu/usr.bin/groff/indxbib/Makefile
index 0508c6675a4a..be2bb8f2b30a 100644
--- a/gnu/usr.bin/groff/indxbib/Makefile
+++ b/gnu/usr.bin/groff/indxbib/Makefile
@@ -4,7 +4,7 @@ PROG= indxbib
SRCS= indxbib.cc dirnamemax.c signal.c
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBBIB} ${LIBGROFF} -lm
-DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBMATH}
MANDEPEND= indxbib.1
CLEANFILES+= ${MANDEPEND}
@@ -14,7 +14,7 @@ CLEANFILES+= ${MANDEPEND}
# Sigh... Hardcode it. - jkh
#
afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/eign \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/eign \
${DESTDIR}${SHAREDIR}/dict
.include "../Makefile.cfg"
diff --git a/gnu/usr.bin/groff/libgroff/cmap.cc b/gnu/usr.bin/groff/libgroff/cmap.cc
index 7c35253a483c..640f4bfecb05 100644
--- a/gnu/usr.bin/groff/libgroff/cmap.cc
+++ b/gnu/usr.bin/groff/libgroff/cmap.cc
@@ -19,9 +19,6 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <ctype.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "cmap.h"
cmap cmlower(CMAP_BUILTIN);
@@ -52,9 +49,6 @@ cmap_init::cmap_init()
if (initialised)
return;
initialised = 1;
-#ifdef __FreeBSD__
- (void) setlocale(LC_CTYPE, "");
-#endif
for (int i = 0; i <= UCHAR_MAX; i++) {
cmupper.v[i] = ISASCII(i) && islower(i) ? toupper(i) : i;
cmlower.v[i] = ISASCII(i) && isupper(i) ? tolower(i) : i;
diff --git a/gnu/usr.bin/groff/libgroff/cset.cc b/gnu/usr.bin/groff/libgroff/cset.cc
index c720d1b9eed8..1319aa77edbe 100644
--- a/gnu/usr.bin/groff/libgroff/cset.cc
+++ b/gnu/usr.bin/groff/libgroff/cset.cc
@@ -19,9 +19,6 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <ctype.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "cset.h"
cset csalpha(CSET_BUILTIN);
@@ -89,9 +86,6 @@ cset_init::cset_init()
if (initialised)
return;
initialised = 1;
-#ifdef __FreeBSD__
- (void) setlocale(LC_CTYPE, "");
-#endif
for (int i = 0; i <= UCHAR_MAX; i++) {
csalpha.v[i] = ISASCII(i) && isalpha(i);
csupper.v[i] = ISASCII(i) && isupper(i);
diff --git a/gnu/usr.bin/groff/lkbib/Makefile b/gnu/usr.bin/groff/lkbib/Makefile
index d00f0f688975..c7e8d2a506ee 100644
--- a/gnu/usr.bin/groff/lkbib/Makefile
+++ b/gnu/usr.bin/groff/lkbib/Makefile
@@ -4,7 +4,7 @@ PROG= lkbib
SRCS= lkbib.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBBIB} ${LIBGROFF} -lm
-DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBMATH}
MANDEPEND= lkbib.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/lookbib/Makefile b/gnu/usr.bin/groff/lookbib/Makefile
index fb1a65c87f66..dde1c71e2a2b 100644
--- a/gnu/usr.bin/groff/lookbib/Makefile
+++ b/gnu/usr.bin/groff/lookbib/Makefile
@@ -4,7 +4,7 @@ PROG= lookbib
SRCS= lookbib.cc
CFLAGS+= -I$(.CURDIR)/../include
LDADD+= $(LIBBIB) $(LIBGROFF) -lm
-DPADD+= $(LIBBIB) $(LIBGROFF) $(LIBM)
+DPADD+= $(LIBBIB) $(LIBGROFF) $(LIBMATH)
MANDEPEND= lookbib.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/mm/Makefile b/gnu/usr.bin/groff/mm/Makefile
index 9023bb85ba21..f2ea0b35639e 100644
--- a/gnu/usr.bin/groff/mm/Makefile
+++ b/gnu/usr.bin/groff/mm/Makefile
@@ -13,9 +13,9 @@ MANDEPEND= ${MAN7}
CLEANFILES+= ${MANDEPEND}
afterinstall:
- ${INSTALL} -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
+ install -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
$(.CURDIR)/tmac.m $(DESTDIR)$(TMACDIR)/tmac.m
- ${INSTALL} -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
+ install -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
$(.CURDIR)/tmac.m $(DESTDIR)$(TMACDIR)/tmac.mse
test -d $(DESTDIR)$(TMACDIR)/mm || mkdir $(DESTDIR)$(TMACDIR)/mm
@@ -23,7 +23,8 @@ afterinstall:
chmod 755 $(DESTDIR)$(TMACDIR)/mm
for f in $(FILES); do \
- $(INSTALL) -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
+ rm -f $(DESTDIR)$(TMACDIR)/mm/$$f; \
+ install -c -o $(TMACOWN) -g $(TMACGRP) -m $(TMACMODE) \
$(.CURDIR)/mm/$$f $(DESTDIR)$(TMACDIR)/mm/$$f; \
done
for f in $(LOCALE); do \
diff --git a/gnu/usr.bin/groff/nroff/Makefile b/gnu/usr.bin/groff/nroff/Makefile
index 6758dd4b9c57..8998b2daf8ca 100644
--- a/gnu/usr.bin/groff/nroff/Makefile
+++ b/gnu/usr.bin/groff/nroff/Makefile
@@ -4,9 +4,9 @@ MANDEPEND= nroff.1
CLEANFILES+= ${MANDEPEND}
afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
$(.CURDIR)/nroff.sh $(DESTDIR)$(BINDIR)/nroff
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
$(.CURDIR)/psroff.sh $(DESTDIR)$(BINDIR)/psroff
.include <../Makefile.cfg>
diff --git a/gnu/usr.bin/groff/pic/Makefile b/gnu/usr.bin/groff/pic/Makefile
index 5a0e171050e9..90ef8d7bf3eb 100644
--- a/gnu/usr.bin/groff/pic/Makefile
+++ b/gnu/usr.bin/groff/pic/Makefile
@@ -5,7 +5,7 @@ SRCS= lex.cc main.cc object.cc common.cc troff.cc tex.cc
OBJS= pic.o
CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBGROFF} -lm
-DPADD+= ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBGROFF} ${LIBMATH}
MANDEPEND= pic.1
CLEANFILES+= pic.cc pic.tab.h ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/refer/Makefile b/gnu/usr.bin/groff/refer/Makefile
index ac8d5f059e53..c82327adf424 100644
--- a/gnu/usr.bin/groff/refer/Makefile
+++ b/gnu/usr.bin/groff/refer/Makefile
@@ -5,7 +5,7 @@ SRCS= command.cc ref.cc refer.cc token.cc
OBJS= label.o
CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBBIB} ${LIBGROFF} -lm
-DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBBIB} ${LIBGROFF} ${LIBMATH}
MANDEPEND= refer.1
CLEANFILES+= label.cc label.tab.h ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/tbl/Makefile b/gnu/usr.bin/groff/tbl/Makefile
index bdf9431dc914..c58e90e3f7d1 100644
--- a/gnu/usr.bin/groff/tbl/Makefile
+++ b/gnu/usr.bin/groff/tbl/Makefile
@@ -4,7 +4,7 @@ PROG= tbl
SRCS= main.cc table.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBGROFF} -lm
-DPADD+= ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBGROFF} ${LIBMATH}
MANDEPEND= tbl.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/tfmtodit/Makefile b/gnu/usr.bin/groff/tfmtodit/Makefile
index 541398642ab4..d75c12f6ea33 100644
--- a/gnu/usr.bin/groff/tfmtodit/Makefile
+++ b/gnu/usr.bin/groff/tfmtodit/Makefile
@@ -4,7 +4,7 @@ PROG= tfmtodit
SRCS= tfmtodit.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBGROFF} -lm
-DPADD+= ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBGROFF} ${LIBMATH}
MANDEPEND= tfmtodit.1
CLEANFILES+= ${MANDEPEND}
diff --git a/gnu/usr.bin/groff/tmac/Makefile b/gnu/usr.bin/groff/tmac/Makefile
index c4b310ea3f0e..2c88f3b856cb 100644
--- a/gnu/usr.bin/groff/tmac/Makefile
+++ b/gnu/usr.bin/groff/tmac/Makefile
@@ -6,8 +6,8 @@ TMACMODE?= 444
TMACDIR?= /usr/share/tmac
MDOCDIR?= ${TMACDIR}/mdoc
-MAN7= groff_ms.7 me.7
-MLINKS= groff_ms.7 ms.7 me.7 groff_me.7
+MAN7= groff_ms.7 me.7
+MLINKS= groff_ms.7 ms.7
LINKS= ${TMACDIR}/tmac.andoc ${TMACDIR}/tmac.an
MANDEPEND= ${MAN7}
@@ -22,26 +22,26 @@ MDOCFILES= doc-common doc-ditroff doc-nroff doc-syms
beforeinstall:
for f in ${FILES}; do \
- ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
+ install -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
${.CURDIR}/$$f ${DESTDIR}${TMACDIR}; \
done
sed -f ${.CURDIR}/strip.sed ${.CURDIR}/tmac.an >tmac.groff_an
- ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
+ install -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
tmac.groff_an ${DESTDIR}${TMACDIR}
for f in ${STRIPFILES}; do \
rm -f temp; \
sed -f ${.CURDIR}/strip.sed ${.CURDIR}/$$f >temp; \
- ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
+ install -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
temp ${DESTDIR}${TMACDIR}/$$f; \
done
for f in ${MDOCFILES}; do \
rm -f temp; \
sed -f ${.CURDIR}/strip.sed ${.CURDIR}/$$f >temp; \
- ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
+ install -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
temp ${DESTDIR}${MDOCDIR}/$$f; \
done
test -f ${DESTDIR}${TMACDIR}/man.local || \
- ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
+ install -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
${.CURDIR}/man.local ${DESTDIR}${TMACDIR}
.include "../Makefile.cfg"
diff --git a/gnu/usr.bin/groff/tmac/tmac.doc.old b/gnu/usr.bin/groff/tmac/tmac.doc.old
index df44cc3c8fcd..51a0ec0053a5 100644
--- a/gnu/usr.bin/groff/tmac/tmac.doc.old
+++ b/gnu/usr.bin/groff/tmac/tmac.doc.old
@@ -315,9 +315,9 @@
. if "\\$3"" \{\
. \" Volume Title if none given
. if \\$2>=1 .if \\$2<=8 \{\
-. ds vT FreeBSD Reference Manual
-. if \\$2>1 .if \\$2<6 .ds vT FreeBSD Programmer's Manual
-. if "\\$2"8" .ds vT FreeBSD System Manager's Manual
+. ds vT UNIX Reference Manual
+. if \\$2>1 .if \\$2<6 .ds vT UNIX Programmer's Manual
+. if "\\$2"8" .ds vT UNIX System Manager's Manual
. \}
. if "\\$2"unass" .ds vT DRAFT
. if "\\$2"draft" .ds vT DRAFT
diff --git a/gnu/usr.bin/groff/troff/Makefile b/gnu/usr.bin/groff/troff/Makefile
index f51d93afc23e..61a237c8eccc 100644
--- a/gnu/usr.bin/groff/troff/Makefile
+++ b/gnu/usr.bin/groff/troff/Makefile
@@ -3,7 +3,7 @@ SRCS= env.cc node.cc input.cc div.cc symbol.cc dictionary.cc reg.cc \
number.cc majorminor.cc
CFLAGS+= -I${.CURDIR}/../include
LDADD+= ${LIBGROFF} -lm
-DPADD+= ${LIBGROFF} ${LIBM}
+DPADD+= ${LIBGROFF} ${LIBMATH}
MANDEPEND= troff.1
CLEANFILES+= majorminor.cc ${MANDEPEND}
@@ -17,9 +17,9 @@ majorminor.cc: ${.CURDIR}/../VERSION
\"`sed -e 's/^[^.]*\.\([0-9]*\).*$$/\1/' ${.CURDIR}/../VERSION`\"\; >>$@
afterinstall:
- ${INSTALL} -c -o bin -g bin -m 444 ${.CURDIR}/hyphen.us \
+ install -c -o bin -g bin -m 444 ${.CURDIR}/hyphen.us \
${DESTDIR}${tmacdir}/hyphen.us
- ${INSTALL} -c -o bin -g bin -m 444 ${.CURDIR}/hyphen.us-ru \
+ install -c -o bin -g bin -m 444 ${.CURDIR}/hyphen.us-ru \
${DESTDIR}${tmacdir}/hyphen.us-ru
.include "../Makefile.cfg"
diff --git a/gnu/usr.bin/groff/xditview/Makefile b/gnu/usr.bin/groff/xditview/Makefile
index b3453e5603d6..66d93178b668 100644
--- a/gnu/usr.bin/groff/xditview/Makefile
+++ b/gnu/usr.bin/groff/xditview/Makefile
@@ -15,14 +15,13 @@ CFLAGS+= -I${X11BASE}/include -DFONTPATH=\"$(fontpath)\"
SRCS+= xditview.c Dvi.c draw.c font.c lex.c page.c parse.c \
XFontName.c DviChar.c device.c
LDDESTDIR+= -L${X11BASE}/lib
-LDADD+= -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -lm
+LDADD+= -lXaw -lXmu -lXt -lXext -lX11 -lm
DPADD+= ${X11BASE}/lib/libXaw.a ${X11BASE}/lib/libXmu.a \
- ${X11BASE}/lib/libXt.a ${X11BASE}/lib/libSM.a \
- ${X11BASE}/lib/libICE.a ${X11BASE}/lib/libXext.a \
+ ${X11BASE}/lib/libXt.a ${X11BASE}/lib/libXext.a \
${X11BASE}/lib/libX11.a
afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/GXditview.ad \
${DESTDIR}${X11BASE}/lib/X11/app-defaults/GXditview
.endif
diff --git a/gnu/usr.bin/gzip/Makefile b/gnu/usr.bin/gzip/Makefile
index a646372be7a3..e6f86523e47e 100644
--- a/gnu/usr.bin/gzip/Makefile
+++ b/gnu/usr.bin/gzip/Makefile
@@ -1,24 +1,18 @@
# @(#)Makefile 5.3 (Berkeley) 5/12/90
-# $Id$
PROG= gzip
SRCS= gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c \
crypt.c lzw.c unlzw.c unlzh.c unpack.c getopt.c match.S
-MAN1= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1 zgrep.1
+MAN1= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1
CFLAGS+=-DASMV -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1
MLINKS= gzip.1 gunzip.1 gzip.1 zcat.1 gzip.1 gzcat.1
-MLINKS+= zgrep.1 zfgrep.1 zgrep.1 zegrep.1
-MLINKS+= zdiff.1 zcmp.1
LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip
LINKS+= ${BINDIR}/gzip ${BINDIR}/gzcat
LINKS+= ${BINDIR}/gzip ${BINDIR}/zcat
-LINKS+= ${BINDIR}/zgrep ${BINDIR}/zegrep
-LINKS+= ${BINDIR}/zgrep ${BINDIR}/zfgrep
-LINKS+= ${BINDIR}/zdiff ${BINDIR}/zcmp
NOSHARED=yes
-beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+afterinstall:
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/zforce ${.CURDIR}/gzexe ${.CURDIR}/znew \
${.CURDIR}/zmore ${.CURDIR}/zdiff ${.CURDIR}/zgrep \
${DESTDIR}${BINDIR}
@@ -26,7 +20,7 @@ beforeinstall:
match.o: ${.CURDIR}/match.S
$(CPP) ${.CURDIR}/match.S >_match.s
$(CC) -c _match.s
- mv -f _match.o match.o
+ mv _match.o match.o
rm -f _match.s
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gzip/gzip.1 b/gnu/usr.bin/gzip/gzip.1
index 5304d30b44ea..084dffd5e123 100644
--- a/gnu/usr.bin/gzip/gzip.1
+++ b/gnu/usr.bin/gzip/gzip.1
@@ -367,7 +367,8 @@ explicit command line parameters. For example:
On Vax/VMS, the name of the environment variable is GZIP_OPT, to
avoid a conflict with the symbol set for invocation of the program.
.SH "SEE ALSO"
-znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), compress(1)
+znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1),
+pack(1), compact(1)
.SH "DIAGNOSTICS"
Exit status is normally 0;
if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index 2500143c3d34..1a04825659eb 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -3593,17 +3593,6 @@ write_file_syms(entry, syms_written_addr)
if (!(lsp->flags & LS_WRITE))
continue;
- if (discard_locals == DISCARD_ALL ||
- discard_locals == DISCARD_L && lsp->flags & LS_L_SYMBOL) {
- /*
- * The user wants to discard this symbol, but it
- * is referenced by a relocation. We can still
- * save some file space by suppressing the unique
- * renaming of the symbol.
- */
- lsp->flags &= ~LS_RENAME;
- }
-
if (p->n_un.n_strx == 0)
name = NULL;
else if (!(lsp->flags & LS_RENAME))
diff --git a/gnu/usr.bin/ld/rtld/Makefile b/gnu/usr.bin/ld/rtld/Makefile
index 5a0d03c4fe72..b5c26468623f 100644
--- a/gnu/usr.bin/ld/rtld/Makefile
+++ b/gnu/usr.bin/ld/rtld/Makefile
@@ -26,8 +26,8 @@ realinstall:
:
-chflags noschg ${DESTDIR}${BINDIR}/${PROG}
-ln -f ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/${PROG}.old
- mv -f ${DESTDIR}${BINDIR}/${PROG}.new ${DESTDIR}${BINDIR}/${PROG}
+ mv ${DESTDIR}${BINDIR}/${PROG}.new ${DESTDIR}${BINDIR}/${PROG}
chflags schg ${DESTDIR}${BINDIR}/${PROG}
- -rm -f ${DESTDIR}${BINDIR}/${PROG}.old
+ -rm ${DESTDIR}${BINDIR}/${PROG}.old
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c
index 666c10a3772b..f3ceee150d15 100644
--- a/gnu/usr.bin/ld/rtld/rtld.c
+++ b/gnu/usr.bin/ld/rtld/rtld.c
@@ -88,8 +88,6 @@ struct somap_private {
struct so_map *spd_parent;
struct so_list *spd_children;
struct so_map *spd_prev;
- dev_t spd_dev;
- ino_t spd_ino;
int spd_refcount;
int spd_flags;
#define RTLD_MAIN 0x01
@@ -493,41 +491,17 @@ map_object(path, sodp, parent)
struct so_map *parent;
{
struct so_map *smp;
- struct stat statbuf;
if(path == NULL) /* Special case for the main program itself */
smp = link_map_head;
else {
- /*
- * Check whether the shared object is already mapped.
- * We check first for an exact match by pathname. That
- * will detect the usual case. If no match is found by
- * pathname, then stat the file, and check for a match by
- * device and inode. That will detect the less common case
- * involving multiple links to the same library.
- */
+ /* Check whether the shared object is already mapped */
for(smp = link_map_head; smp != NULL; smp = smp->som_next) {
if(!(LM_PRIVATE(smp)->spd_flags & (RTLD_MAIN|RTLD_RTLD))
&& smp->som_path != NULL
&& strcmp(smp->som_path, path) == 0)
break;
}
- if(smp == NULL) { /* Check for a match by device and inode */
- if (stat(path, &statbuf) == -1) {
- generror ("cannot stat \"%s\" : %s",
- path, strerror(errno));
- return NULL;
- }
- for (smp = link_map_head; smp != NULL;
- smp = smp->som_next) {
- struct somap_private *smpp = LM_PRIVATE(smp);
-
- if (!(smpp->spd_flags & (RTLD_MAIN | RTLD_RTLD))
- && smpp->spd_ino == statbuf.st_ino
- && smpp->spd_dev == statbuf.st_dev)
- break;
- }
- }
}
if (smp == NULL) { /* We must map the object */
@@ -615,14 +589,6 @@ map_object(path, sodp, parent)
smpp->a_text = hdr.a_text;
smpp->a_data = hdr.a_data;
smpp->a_bss = hdr.a_bss;
-
- /*
- * Save the device and inode, so we can detect multiple links
- * to the same library. Note, if we reach this point, then
- * statbuf is guaranteed to have been filled in.
- */
- smpp->spd_dev = statbuf.st_dev;
- smpp->spd_ino = statbuf.st_ino;
}
LM_PRIVATE(smp)->spd_refcount++;
diff --git a/gnu/usr.bin/man/Makefile b/gnu/usr.bin/man/Makefile
index 2529d8dbd491..9e5955885307 100644
--- a/gnu/usr.bin/man/Makefile
+++ b/gnu/usr.bin/man/Makefile
@@ -5,6 +5,6 @@
# distribution.
#
-SUBDIR = lib man manpath apropos makewhatis catman
+SUBDIR = lib man manpath apropos whatis makewhatis catman
.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/man/apropos/Makefile b/gnu/usr.bin/man/apropos/Makefile
index 25dd83046268..f1a2b0566f3b 100644
--- a/gnu/usr.bin/man/apropos/Makefile
+++ b/gnu/usr.bin/man/apropos/Makefile
@@ -1,9 +1,44 @@
# $Id: Makefile,v 1.8 1994/08/28 18:33:42 bde Exp $
-SHPROG= apropos
+.if exists(${.CURDIR}/obj)
+MAN1= ${.CURDIR}/obj/apropos.1
+TARG= ${.CURDIR}/obj/apropos
+.else
+MAN1= ${.CURDIR}/apropos.1
+TARG= ${.CURDIR}/apropos
+.endif
-MLINKS= apropos.1 whatis.1
-LINKS= ${BINDIR}/apropos ${BINDIR}/whatis
+MANDEPEND= ${MAN1}
-.include "../../Makefile.inc"
-.include "../Makefile.shprog"
+CLEANFILES+= ${TARG} ${MAN1}
+
+all: ${TARG} ${MAN1}
+
+depend rcsfreeze tags all:
+ @echo -n
+
+${TARG}: ${.CURDIR}/apropos.sh
+ sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
+ -e 's,%pager%,${pager},' \
+ ${.CURDIR}/apropos.sh > ${.TARGET}
+
+${MAN1}: ${.CURDIR}/apropos.man
+ sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
+ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
+ -e 's,%manpath_config_file%,${manpath_config_file},' \
+ ${.CURDIR}/apropos.man > ${.TARGET}
+
+install: ${TARG} maninstall
+ install -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin
+
+.include "../Makefile.inc"
+
+.if make(maninstall) || make(install)
+.if !defined(NOMAN)
+.include <bsd.man.mk>
+.elif !target(maninstall)
+maninstall:
+.endif
+.endif
+
+.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/man/apropos/apropos.man b/gnu/usr.bin/man/apropos/apropos.man
index 62b7d7a9d044..3bb3e17d617e 100644
--- a/gnu/usr.bin/man/apropos/apropos.man
+++ b/gnu/usr.bin/man/apropos/apropos.man
@@ -1,4 +1,4 @@
-.\" Man page for apropos an whatis
+.\" Man page for apropos
.\"
.\" Copyright (c) 1990, 1991, John W. Eaton.
.\"
@@ -15,19 +15,13 @@
.TH apropos 1 "Jan 15, 1991"
.LO 1
.SH NAME
-apropos, whatis \- search the whatis database
+apropos \- search the whatis database for strings
.SH SYNOPSIS
.BI apropos
keyword ...
-
-.BI whatis
-keyword ...
.SH DESCRIPTION
-.B apropos
-searches a set of database files containing short descriptions
+apropos searches a set of database files containing short descriptions
of system commands for keywords and displays the result on the
standard output.
-.B whatis
-display only complete word matches.
.SH "SEE ALSO"
-man(1), makewhatis(1).
+whatis(1), man(1).
diff --git a/gnu/usr.bin/man/apropos/apropos.sh b/gnu/usr.bin/man/apropos/apropos.sh
index 91b77c2530f0..070b8481c1ed 100644
--- a/gnu/usr.bin/man/apropos/apropos.sh
+++ b/gnu/usr.bin/man/apropos/apropos.sh
@@ -13,64 +13,52 @@
# Department of Chemical Engineering
# The University of Texas at Austin
# Austin, Texas 78712
-#
-# rewritten by Wolfram Schneider, Berlin, Feb 1996
-#
-# $Id$
-
-PATH=/bin:/usr/bin:$PATH
-db=whatis # name of whatis data base
-grepopt=''
+PATH=/usr/local/bin:/bin:/usr/ucb:/usr/bin
-# argument test
-case $# in 0)
- echo "usage: `basename $0` keyword ..." >&2
- exit 1
- ;;
-esac
+libdir=%libdir%
-case "$0" in
- *whatis) grepopt='-w';; # run as whatis(1)
- *) grepopt='';; # otherwise run as apropos(1)
-esac
+if [ $# = 0 ]
+then
+ echo "usage: `basename $0` keyword ..."
+ exit 1
+fi
-# test manpath
manpath=`%bindir%/manpath -q | tr : '\040'`
-case X"$manpath" in X)
- echo "`basename $0`: manpath is null, use \"/usr/share/man\"" >&2
- manpath=/usr/share/man
- ;;
-esac
+if [ "$manpath" = "" ]
+then
+ echo "whatis: manpath is null"
+ exit 1
+fi
-# reset $PAGER if $PAGER is empty
-case X"$PAGER" in X)
- PAGER="%pager%"
- ;;
-esac
+if [ "$PAGER" = "" ]
+then
+ PAGER="%pager%"
+fi
-# search for existing */whatis databases
-mandir=''
-for d in $manpath
+while [ $1 ]
do
- if [ -f "$d/$db" -a -r "$d/$db" ]
- then
- mandir="$mandir $d/$db"
- fi
-done
+ found=0
+ for d in $manpath /usr/lib
+ do
+ if [ -f $d/whatis ]
+ then
+ grep -i "$1" $d/whatis
+ status=$?
+ if [ "$status" = "0" ]
+ then
+ found=1
+ fi
+ fi
+ done
-case X"$mandir" in X)
- echo "`basename $0`: no whatis databases in $manpath" >&2
- exit 1
-esac
+ if [ "$found" = "0" ]
+ then
+ echo "$1: nothing appropriate"
+ fi
-
-for manpage
-do
- if grep -hi $grepopt "$manpage" $mandir; then :
- else
- echo "$manpage: nothing appropriate"
- fi
+ shift
done | $PAGER
+exit
diff --git a/gnu/usr.bin/man/catman/catman.1 b/gnu/usr.bin/man/catman/catman.1
index 1ac287b06589..9731974d77e5 100644
--- a/gnu/usr.bin/man/catman/catman.1
+++ b/gnu/usr.bin/man/catman/catman.1
@@ -125,13 +125,6 @@ or
.Sh FEATURES
Very fast if all man pages already formatted.
-Does not support the
-.Fl w
-option as some other systems do. Use
-.Xr makewhatis 1
-to rebuild the
-.Ql whatis
-database.
.Sh BUGS
.Xr man 1
is a setuid program. Be careful that user
diff --git a/gnu/usr.bin/man/catman/catman.perl b/gnu/usr.bin/man/catman/catman.perl
index d0723290f1ff..cc6dc7628d6d 100644
--- a/gnu/usr.bin/man/catman/catman.perl
+++ b/gnu/usr.bin/man/catman/catman.perl
@@ -237,7 +237,7 @@ sub parse_subdir {
next if $file eq "." || $file eq "..";
# fo_09-o.bar0
- if ($file !~ /^[\w\-\+\[\.]+\.\w+$/) {
+ if ($file !~ /^[\w\-\[\.]+\.\w+$/) {
&garbage("$mandir/$file", "Assume garbage")
unless -d "$mandir/$file";
next;
@@ -294,7 +294,7 @@ sub parse_subdir {
foreach $file (readdir(D)) {
next if $file =~ /^(\.|\.\.)$/; # skip current and parent directory
- if ($file !~ /^[\w\-\+\[\.]+\.\w+$/) {
+ if ($file !~ /^[\w\-\[\.]+\.\w+$/) {
&garbage("$catdir/$file", "Assume garbage")
unless -d "$catdir/$file";
next;
diff --git a/gnu/usr.bin/man/lib/config.h_dist b/gnu/usr.bin/man/lib/config.h_dist
index 4900c4d4a050..3438e6f0082a 100644
--- a/gnu/usr.bin/man/lib/config.h_dist
+++ b/gnu/usr.bin/man/lib/config.h_dist
@@ -170,7 +170,7 @@
#ifndef MANPATH_MAIN
static char *std_sections[] =
{
- "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "9", "p", "o", NULL
+ "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "p", "o", NULL
};
#endif
diff --git a/gnu/usr.bin/man/makewhatis/Makefile b/gnu/usr.bin/man/makewhatis/Makefile
index 7849d739de10..644a3a59b6ed 100644
--- a/gnu/usr.bin/man/makewhatis/Makefile
+++ b/gnu/usr.bin/man/makewhatis/Makefile
@@ -1,16 +1,7 @@
MAN1= makewhatis.1
-MAN8= makewhatis.local.8
-MLINKS= makewhatis.local.8 catman.local.8
-
-libexecdir=/usr/libexec
-LINKS=${libexecdir}/makewhatis.local ${libexecdir}/catman.local
beforeinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/makewhatis.perl ${DESTDIR}${BINDIR}/makewhatis
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/makewhatis.local.sh \
- ${DESTDIR}${libexecdir}/makewhatis.local
-
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.1 b/gnu/usr.bin/man/makewhatis/makewhatis.1
index 71f69eb434fb..ec48e1a534cc 100644
--- a/gnu/usr.bin/man/makewhatis/makewhatis.1
+++ b/gnu/usr.bin/man/makewhatis/makewhatis.1
@@ -1,5 +1,5 @@
.\"
-.\" (c) Copyright 1995 Wolfram Schneider, Berlin. All rights reserved.
+.\" (c) Copyright 1995 Wolfram Schneider. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -41,27 +41,26 @@
.Nd create whatis database
.Sh SYNOPSIS
-.Nm
-.Op Fl a | Fl append
-.Op Fl h | Fl help
+.Nm makewhatis
.Op Fl i | Fl indent Ar column
.Op Fl n | Fl name Ar name
.Op Fl o | Fl outfile Ar file
.Op Fl v | Fl verbose
+.Op Fl h | Fl help
.Op Ar directories ...
.Sh DESCRIPTION
-.Nm
+.Nm Makewhatis
extracts the name and a short description from unformatted manpages
and creates the
.Xr whatis 1
database.
-.Nm
+.Nm Makewhatis
can read gzip'ed manpages.
.Ar Directory
names a directory containing manpage subdirectories
-.Pq named Pa man.+ .
+.Pq named Pa man[0-8] .
Colons are treated as spaces, hence
.Ic makewhatis $MANPATH
or
@@ -70,31 +69,8 @@ are allowed.
.Sh OPTIONS
.Bl -tag -width Ds
-.It Fl a , Fl append
-Append mode. Don't delete old entries in whatis database. Note:
-the new database will be sorted without repeated lines and
-.Nm
-does not check if old entries are valid.
-
.It Fl h , Fl help
Print options and exit.
-
-.It Fl i , Fl indent Ar column
-Justify description strings to
-.Ar column Pq default 24 .
-
-.It Fl n , Fl name Ar name
-Use
-.Ar name
-instead of
-.Pa whatis Ns .
-
-.It Fl o , Fl outfile Ar file
-Write all output to
-.Ar file
-instead of
-.Pa dirname/whatis Ns .
-
.It Fl v, Fl verbose
Issue more warnings
.Pq to stderr .
@@ -105,8 +81,22 @@ for an uncompressed page,
for a compressed page, and
.Ql +
for a link.
-.El
+.It Fl i , Fl indent Ar column
+Justify description strings to
+.Ar column Pq default 24 .
+
+.It Fl o , Fl outfile Ar file
+Write all output to
+.Ar file
+instead of
+.Pa dirname/whatis Ns .
+
+.It Fl n , Fl name Ar name
+Use
+.Ar name
+instead of
+.Pa whatis Ns .
.Sh EXAMPLES
.Pp
@@ -118,7 +108,8 @@ Create whatis database for all directories in your
.Ic makewhatis -outfile /tmp/mywhatis /usr/local/man $HOME/man
.Pp
Create whatis database
-.Pa /tmp/mywhatis .
+.Pa /tmp/mywhatis
+\&.
Traverse directories
.Pa /usr/local/man
and
@@ -142,19 +133,16 @@ May be useful for Solaris.
whatis database
.It Pa /etc/weekly
run
-.Nm makewhatis.local
+.Nm
every week
.El
.Sh SEE ALSO
-.Xr apropos 1 ,
-.Xr catman 1 ,
-.Xr sort 1 ,
-.Xr makewhatis.local 1 ,
.Xr man 1 ,
+.Xr whatis 1 ,
+.Xr apropos 1 ,
.Xr manpath 1 ,
-.Xr uniq 1 ,
-.Xr whatis 1 .
+.Xr catman 1 .
.Sh HISTORY
This
@@ -162,5 +150,6 @@ This
command appeared in FreeBSD 2.1.
.Sh AUTHOR
-Wolfram Schneider, Berlin.
-
+Wolfram Schneider
+.Aq wosch@cs.tu-berlin.de ,
+Germany
diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.perl b/gnu/usr.bin/man/makewhatis/makewhatis.perl
index e6a7748d0eba..c0fa966bb931 100644
--- a/gnu/usr.bin/man/makewhatis/makewhatis.perl
+++ b/gnu/usr.bin/man/makewhatis/makewhatis.perl
@@ -61,38 +61,14 @@ sub open_output {
}
$tmp = $whatisdb; # for signals
+ if (!open(A, "> $whatisdb")) {
+ die "$whatisdb: $!\n" if $outfile;
- # Array of all entries
- @a = ();
-
-
- # Append mode
- if ($append) {
- local($file) = $whatisdb;
- $file =~ s/\.tmp$// if !$outfile;
-
- if (open(A, "$file")) {
- warn "Open $file for append mode\n" if $verbose;
- while(<A>) {
- push(@a, $_);
- }
- close A;
- }
-
- else {
- warn "$whatisdb: $!\n" if lstat($file) && $verbose; #
- }
- undef $file;
+ warn "$whatisdb: $!\n"; $err++; return 0;
}
-
+ @a = ();
warn "Open $whatisdb\n" if $verbose;
- if (!open(A, "> $whatisdb")) {
- die "$whatisdb: $!\n" if $outfile;
-
- warn "$whatisdb: $!\n"; $err++; return 0;
- }
-
select A;
return 1;
}
@@ -107,21 +83,21 @@ sub close_output {
if ($success) { # success
# uniq
+ @b = ();
warn "\n" if $verbose && $pointflag;
warn "sort -u > $whatisdb\n" if $verbose;
foreach $i (sort @a) {
if ($i ne $last) {
push(@b, $i);
+ $counter++;
}
$last =$i;
}
-
- $counter = $#b + 1;
print @b; close A; select STDOUT;
if (!$outfile) {
+ rename($whatisdb, $w);
warn "Rename $whatisdb to $w\n" if $verbose;
- rename($whatisdb, $w) || warn "rename $whatisdb $w\n";
$counter_all += $counter;
warn "$counter entries in $w\n" if $verbose;
} else {
@@ -244,9 +220,8 @@ sub ext {
sub name {
local($name) = @_;
- $name =~ s=.*/==;
- $name =~ s=$ext$==o;
- $name =~ s=\.[^\.]+$==;
+ $name =~ s/.*\///g;
+ $name =~ s/\.[^.]*$//;
return "$name";
}
@@ -275,9 +250,6 @@ sub out {
$man =~ s/[,. ]+$//;
$man =~ s/,/($extension),/g;
$man .= "($extension)";
-
- &manpagename;
-
$desc =~ s/^[ \t]+//;
for($i = length($man); $i < $indent && $desc; $i++) {
@@ -290,33 +262,6 @@ sub out {
}
}
-# The filename of manual page is not a keyword.
-# This is bad, because you don't find the manpage
-# whith: $ man <section> <keyword>
-#
-# Add filename if a) filename is not a keyword and b) no keyword(s)
-# exist as file in same mansection
-#
-sub manpagename {
- foreach (split(/,\s+/, $man)) {
- s/\(.+//;
- # filename is keyword
- return if $name eq $_;
- }
-
- local($f) = $file; $f =~ s%/*[^/]+$%%; # dirname
- local($e) = $file; $e =~ s/$ext$//; $e =~ s%.*(\.[^.]+)$%$1%; # .1
-
- foreach (split(/,\s+/, $man)) {
- s/\(.+//;
-
- # a keyword exist as file
- return if -e "$f/$_$e" || -e "$f/$_$e$ext";
- }
-
- $man = "$name($extension), $man";
-}
-
# looking for NAME
sub manual {
local($file) = @_;
@@ -435,12 +380,11 @@ sub variables {
$indent = 24; # indent for description
$outfile = 0; # Don't write to ./whatis
$whatis_name = "whatis"; # Default name for DB
- $append = 0; # Don't delete old entries
# if no argument for directories given
@defaultmanpath = ( '/usr/share/man' );
- $ext = '.gz'; # extension
+ $ext = ".gz"; # extension
umask(022);
$err = 0; # exit code
@@ -478,7 +422,6 @@ sub parse {
elsif (/^--?(o|outfile)$/) { $outfile = $argv[0]; shift @argv }
elsif (/^--?(f|format|i|indent)$/) { $i = $argv[0]; shift @argv }
elsif (/^--?(n|name)$/) { $whatis_name = $argv[0];shift @argv }
- elsif (/^--?(a|append)$/) { $append = 1 }
else { &usage }
}
diff --git a/gnu/usr.bin/man/man/Makefile b/gnu/usr.bin/man/man/Makefile
index 1807455e219d..5eafd803f00e 100644
--- a/gnu/usr.bin/man/man/Makefile
+++ b/gnu/usr.bin/man/man/Makefile
@@ -18,10 +18,8 @@ DPADD+= ${MAN1}
CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF
CFLAGS+= -DDO_COMPRESS -DALT_SYSTEMS -DSETREUID -DCATMODE=0664
CLEANFILES+= ${MAN1}
-MANDEPEND+= ${MAN1}
${MAN1}: ${.CURDIR}/man.man
- @${ECHO} echo Making ${.TARGET:T} from ${.ALLSRC:T}; \
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
diff --git a/gnu/usr.bin/man/man/man.man b/gnu/usr.bin/man/man/man.man
index 7556c58d3074..bddfc028b7f7 100644
--- a/gnu/usr.bin/man/man/man.man
+++ b/gnu/usr.bin/man/man/man.man
@@ -127,7 +127,7 @@ the man page. By default,
.B %pager%
is used.
.SH "SEE ALSO"
-apropos(1), whatis(1), manpath(1), more(1), groff(1).
+apropos(1), whatis(1), manpath(1), less(1), groff(1).
.SH BUGS
The
.B \-t
diff --git a/gnu/usr.bin/man/manpath/Makefile b/gnu/usr.bin/man/manpath/Makefile
index 6633d6c1bd04..970f442a58f3 100644
--- a/gnu/usr.bin/man/manpath/Makefile
+++ b/gnu/usr.bin/man/manpath/Makefile
@@ -17,17 +17,14 @@ DPADD+= ${MAN1}
CFLAGS+= -DMAIN -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS
CFLAGS+= -DALT_SYSTEMS -I${.CURDIR}/../lib -I${.CURDIR}/../lib/obj
CLEANFILES+= ${MAN1}
-MANDEPEND+= ${MAN1}
${MAN1}: ${.CURDIR}/manpath.man
- @${ECHO} Making ${.TARGET:T} from ${.ALLSRC:T}; \
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
${.CURDIR}/manpath.man > ${MAN1}
afterinstall:
- ${INSTALL} -c -o bin -g bin -m 644 ${.CURDIR}/manpath.config \
- ${DESTDIR}${manpath_config_file}.sample
+ install -c -o bin -g bin -m 644 ${.CURDIR}/manpath.config ${DESTDIR}${manpath_config_file}.sample
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/man/manpath/manpath.config b/gnu/usr.bin/man/manpath/manpath.config
index 91aac298531e..b43c7a6aee27 100644
--- a/gnu/usr.bin/man/manpath/manpath.config
+++ b/gnu/usr.bin/man/manpath/manpath.config
@@ -16,7 +16,7 @@
#
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/man
-#MANDATORY_MANPATH /usr/X386/man
+MANDATORY_MANPATH /usr/X386/man
MANDATORY_MANPATH /usr/X11R6/man
#
# set up PATH to MANPATH mapping
diff --git a/gnu/usr.bin/mkisofs/ChangeLog b/gnu/usr.bin/mkisofs/ChangeLog
index 8dc41be1ffc9..b31a554e7d31 100644
--- a/gnu/usr.bin/mkisofs/ChangeLog
+++ b/gnu/usr.bin/mkisofs/ChangeLog
@@ -1,39 +1,4 @@
-Sun Feb 26 01:52:06 1995 Eric Youngdale (eric@largo)
-
- * Add patches from Ross Biro to allow you to merge arbitrary
- trees into the image. This is not compiled in by default but
- you need to add -DADD_FILES when compiling.
-
-Fri Feb 17 02:29:03 1995 Paul Eggert <eggert@twinsun.com>
-
- * tree.c: Port to Solaris 2.4. Prefer <sys/mkdev.h> if
- HASMKDEV. Cast unknown integer types to unsigned long and
- print them with %lu or %lx.
-
-Thu Jan 26 15:25:00 1995 H. Peter Anvin (hpa@yggdrasil.com)
-
- * mkisofs.c: Substitute underscore for leading dot in non-Rock
- Ridge filenames, since MS-DOS cannot read files whose names
- begin with a period.
-
-Mon Jan 16 18:31:41 1995 Eric Youngdale (eric@aib.com)
-
- * rock.c (generate_rock_ridge_attributes): Only use ROOT
- record for symlinks if we are at the start of the symlink.
- Otherwise just generate an empty entry.
-
-Mon Jan 16 16:19:50 1995 Eric Youngdale (eric@aib.com)
-
- * diag/isodump.c: Use isonum_733 instead of trying to dereference
- pointers when trying to decode 733 numbers in the iso9660 image.
-
- * diag/isovfy.c: Likewise.
-
- * write.c: Always assign an extent number, even for zero length
- files. A zero length file with a NULL extent is apparently dropped
- by many readers.
-
-Wed Jan 11 13:46:50 1995 Eric Youngdale (eric@aib.com)
+Wed Jan 11 13:46:50 1995 Eric Youngdale (eric@localhost)
* mkisofs.c: Modify extension record to conform to IEEE P1282
specifications. This is commented out right now, but a trivial
diff --git a/gnu/usr.bin/mkisofs/Makefile.in b/gnu/usr.bin/mkisofs/Makefile.in
index dceb17c2c483..dd0d318acc5f 100644
--- a/gnu/usr.bin/mkisofs/Makefile.in
+++ b/gnu/usr.bin/mkisofs/Makefile.in
@@ -43,9 +43,7 @@ mkisofs.o: mkisofs.c iso9660.h mkisofs.h exclude.h
clean:
/bin/rm -f *.o core mkisofs *~ #*#
- (cd diag/; make clean)
- (cd cdwrite/; make clean)
dist:
- tar -cvf - README Configure Makefile.in make.com TODO COPYING ChangeLog *.8 *.c *.h diag cdwrite.old cdwrite-1.5 | gzip > mkisofs-1.04.tar.gz
+ tar -cvf - README Configure Makefile.in make.com TODO COPYING ChangeLog *.8 *.c *.h diag | gzip > mkisofs-1.02.tar.gz
diff --git a/gnu/usr.bin/mkisofs/README b/gnu/usr.bin/mkisofs/README
index f2f415f66215..f71e2d7ff7c8 100644
--- a/gnu/usr.bin/mkisofs/README
+++ b/gnu/usr.bin/mkisofs/README
@@ -1,8 +1,3 @@
-Note:
- There is a feature which can be optionally compiled into
-mkisofs that allows you to merge arbitrary directory trees into the
-image you are creating. You need to compile with -DADD_FILES for my
-changes to take effect. Thanks to Ross Biro biro@yggdrasil.com.
This program requires a lot of virtual memory to run since it
builds all of the directories in memory. The exact requirements
@@ -10,9 +5,6 @@ depend upon a lot of things, but for Rock Ridge discs 12Mb would not
be unreasonable. Without RockRidge and without the translation
tables, the requirements would be considerably less.
- The cdwrite utility is maintained separately from mkisofs by
-yggdrasil.com. It is enclosed here as a convenience, since the two programs
-are often useful together.
*****************************
Notes for version 1.2.
diff --git a/gnu/usr.bin/mkisofs/defaults.h b/gnu/usr.bin/mkisofs/defaults.h
index 03960d1471ab..27b258cbddc0 100644
--- a/gnu/usr.bin/mkisofs/defaults.h
+++ b/gnu/usr.bin/mkisofs/defaults.h
@@ -11,24 +11,12 @@
#define ABSTRACT_DEFAULT NULL
#define VOLSET_ID_DEFAULT NULL
#define VOLUME_ID_DEFAULT "CDROM"
-
#ifdef __FreeBSD__
#define SYSTEM_ID_DEFAULT "FreeBSD"
-#endif
-
+#else
#ifdef __QNX__
#define SYSTEM_ID_DEFAULT "QNX"
-#endif
-
-#ifdef __linux__
+#else
#define SYSTEM_ID_DEFAULT "LINUX"
#endif
-
-
-#ifdef __osf__
-#define SYSTEM_ID_DEFAULT "OSF"
-#endif
-
-#ifndef SYSTEM_ID_DEFAULT
-#define SYSTEM_ID_DEFAULT "UNKNOWNSYS"
#endif
diff --git a/gnu/usr.bin/mkisofs/diag/Makefile b/gnu/usr.bin/mkisofs/diag/Makefile
index e6f3a12f117f..1aefdf68d418 100644
--- a/gnu/usr.bin/mkisofs/diag/Makefile
+++ b/gnu/usr.bin/mkisofs/diag/Makefile
@@ -1,16 +1,10 @@
-#CC = gcc
-CC = cc -traditional
-
-all: dump isodump isovfy
-
-isoinfo:isoinfo.c
- ${CC} -g -o isoinfo isoinfo.c
+all: dump isodump isovfy
dump:dump.c
- ${CC} -o dump dump.c
+ gcc -o dump dump.c
isodump:isodump.c
- ${CC} -o isodump isodump.c
+ gcc -o isodump isodump.c
isovfy:isovfy.c
- ${CC} -o isovfy isovfy.c
+ gcc -o isovfy isovfy.c
clean:
- rm -f dump isodump isovfy isoinfo
+ rm dump isodump isovfy
diff --git a/gnu/usr.bin/mkisofs/diag/isodump.c b/gnu/usr.bin/mkisofs/diag/isodump.c
index 442c6ed466f2..49ef4b91299d 100644
--- a/gnu/usr.bin/mkisofs/diag/isodump.c
+++ b/gnu/usr.bin/mkisofs/diag/isodump.c
@@ -52,7 +52,7 @@ isonum_731 (char * p)
int
-isonum_733 (unsigned char * p)
+isonum_733 (char * p)
{
return (isonum_731 (p));
}
@@ -104,7 +104,7 @@ struct iso_directory_record {
unsigned char interleave [ISODCL (28, 28)]; /* 711 */
unsigned char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
unsigned char name_len [ISODCL (33, 33)]; /* 711 */
- unsigned char name [1];
+ unsigned char name [0];
};
#ifdef USE_TERMIOS
@@ -285,15 +285,13 @@ int
dump_rr(struct iso_directory_record * idr)
{
int len;
- unsigned char * pnt;
+ char * pnt;
len = idr->length[0] & 0xff;
len -= sizeof(struct iso_directory_record);
- len += sizeof(idr->name);
len -= idr->name_len[0];
- pnt = (unsigned char *) idr;
+ pnt = (char *) idr;
pnt += sizeof(struct iso_directory_record);
- pnt -= sizeof(idr->name);
pnt += idr->name_len[0];
if((idr->name_len[0] & 1) == 0){
pnt++;
@@ -320,9 +318,9 @@ showblock(int flag){
if(idr->length[0] == 0) break;
printf("%3d ", idr->length[0]);
printf("[%2d] ", idr->volume_sequence_number[0]);
- printf("%5x ", isonum_733(idr->extent));
- printf("%8d ", isonum_733(idr->size));
- printf ((idr->flags[0] & 2) ? "*" : " ");
+ printf("%5x ", *((unsigned int *) idr->extent));
+ printf("%8d ", *((unsigned int *) idr->size));
+ printf ((idr->flags[0] & 2) ? "*" : " ");
if(idr->name_len[0] == 1 && idr->name[0] == 0)
printf(". ");
else if(idr->name_len[0] == 1 && idr->name[0] == 1)
diff --git a/gnu/usr.bin/mkisofs/diag/isovfy.c b/gnu/usr.bin/mkisofs/diag/isovfy.c
index eb52c914689c..43e13895ee10 100644
--- a/gnu/usr.bin/mkisofs/diag/isovfy.c
+++ b/gnu/usr.bin/mkisofs/diag/isovfy.c
@@ -112,7 +112,7 @@ isonum_732 (char * p)
}
int
-isonum_733 (unsigned char * p)
+isonum_733 (char * p)
{
return (isonum_731 (p));
}
@@ -312,14 +312,14 @@ check_tree(int file_addr, int file_size, int parent_addr){
else if(idr->name_len[0] == 1 && idr->name[0] == 0) {
iline += sprintf(&lbuffer[iline],". ");
rflag = 0;
- if(orig_file_addr !=isonum_733(idr->extent))
+ if(orig_file_addr !=*((unsigned int *) idr->extent))
iline += sprintf(&lbuffer[iline],"***** Directory has null extent.", goof++);
if(i1)
iline += sprintf(&lbuffer[iline],"***** . not first entry.", rr_goof++);
} else if(idr->name_len[0] == 1 && idr->name[0] == 1) {
iline += sprintf(&lbuffer[iline],".. ");
rflag = 0;
- if(parent_file_addr !=isonum_733(idr->extent))
+ if(parent_file_addr !=*((unsigned int *) idr->extent))
iline += sprintf(&lbuffer[iline],"***** Directory has null extent.", goof++);
if(i1 != 1)
iline += sprintf(&lbuffer[iline],"***** .. not second entry.", rr_goof++);
@@ -332,10 +332,7 @@ check_tree(int file_addr, int file_size, int parent_addr){
};
if(size && extent == 0) iline += sprintf(&lbuffer[iline],"****Extent==0, size != 0", goof++);
-#if 0
- /* This is apparently legal. */
if(size == 0 && extent) iline += sprintf(&lbuffer[iline],"****Extent!=0, size == 0", goof++);
-#endif
if(idr->flags[0] & 0xfd)
iline += sprintf(&lbuffer[iline],"Flags=(%x) ", idr->flags[0], goof++);
@@ -364,8 +361,8 @@ check_tree(int file_addr, int file_size, int parent_addr){
- if(rflag && (idr->flags[0] & 2)) check_tree((isonum_733(idr->extent)) << 11,
- isonum_733(idr->size),
+ if(rflag && (idr->flags[0] & 2)) check_tree((*((unsigned int *) idr->extent)) << 11,
+ *((unsigned int *) idr->size),
orig_file_addr << 11);
i += buffer[i];
i1++;
diff --git a/gnu/usr.bin/mkisofs/exclude.c b/gnu/usr.bin/mkisofs/exclude.c
index c20ea2848534..99c66bd4e03b 100644
--- a/gnu/usr.bin/mkisofs/exclude.c
+++ b/gnu/usr.bin/mkisofs/exclude.c
@@ -29,7 +29,8 @@ char * fn;
return;
}
- excl[i] = (char *) malloc(strlen(fn)+1);
+
+ excl[i] = malloc(strlen(fn)+1);
if (! excl[i]) {
fprintf(stderr,"Can't allocate memory for excluded filename\n");
return;
diff --git a/gnu/usr.bin/mkisofs/mkisofs.8 b/gnu/usr.bin/mkisofs/mkisofs.8
index d05909bf537e..8eb29ec3a7a6 100644
--- a/gnu/usr.bin/mkisofs/mkisofs.8
+++ b/gnu/usr.bin/mkisofs/mkisofs.8
@@ -1,5 +1,5 @@
.\" -*- nroff -*-
-.TH MKISOFS 8 "January 1995" "Version 1.04"
+.TH MKISOFS 8 "August 1993" "Version 1.03"
.SH NAME
mkisofs \- create a iso9660 filesystem with optional Rock Ridge attributes.
.SH SYNOPSIS
@@ -32,12 +32,6 @@ mkisofs \- create a iso9660 filesystem with optional Rock Ridge attributes.
.B \-l
]
[
-.B \-L
-]
-[
-.B \-L
-]
-[
.B \-V
]
[
@@ -45,10 +39,6 @@ mkisofs \- create a iso9660 filesystem with optional Rock Ridge attributes.
.I volid
]
[
-.B \-i
-.I include-list
-]
-[
.B \-p
.I preparer
]
@@ -98,76 +88,49 @@ example of this would be the files foo.bar and
foo.bar.~1~ - the file foo.bar.~1~ would be written as FOO.000;1 and the file
foo.bar would be written as FOO.BAR;1
.PP
-Note that
-.B mkisofs
-is not designed to communicate with the writer directly. Most writers
-have proprietary command sets which vary from one manufacturer to
-another, and you need a specialized tool to actually burn the disk.
-The cdwrite utility that comes with mkisofs is capable of communicating
-with Phillips drives (newer versions of cdwrite should be available from
-Yggdrasil). Most writers come with some version of DOS software
-that allows a direct image copy of an iso9660 image to the writer.
-.PP
-Also you should know that most cd writers are very particular about timing.
-Once you start to burn a disc, you cannot let their buffer empty before you
-are done, or you will end up with a corrupt disc. Thus it is critical
-that you be able to maintain an uninterupted data stream to the writer
-for the entire time that the disc is being written.
-.PP
.br
.B path
is the path of the directory tree to be copied into the iso9660 filesystem.
.SH OPTIONS
.TP
-.I \-a
+.I -a
Include all files on the iso9660 filesystem. Normally files that contain the
characters '~' or '#' will not be included (these are typically backup files
for editors under unix).
.TP
-.I \-A application_id
+.I -A application_id
Specifies a text string that will be written into the volume header.
This should describe the application that will be on the disc. There
is space on the disc for 128 characters of information. This parameter can
also be set in the file .mkisofsrc with APPL=id. If specified in both
places, the command line version is used.
.TP
-.I \-d
+.I -d
Omit trailing period from files that do not have a period. This violates the
ISO9660 standard, but it happens to work on many systems. Use with caution.
.TP
-.I \-D
+.I -D
Do not use deep directory relocation, and instead just pack them in the
way we see them. This violates the ISO9660 standard, but it works on many
systems. Use with caution.
.TP
-.I \-f
+.I -f
Follow symbolic links when generating the filesystem. When this option is not
in use, symbolic links will be entered using Rock Ridge if enabled, otherwise
the file will be ignored.
.TP
-.I \-i include-list
-Use the specified file as a list of files to add to the directory tree.
-This is useful for quickly repacking a CD while adding files to it.
-The format of this file is path1/file=path2 where path1 is the directory
-in the ISO9660 file system where file should appear and path2 is the
-where to find the file.
-.TP
-.I \-l
+.I -l
Allow full 32 character filenames. Normally the ISO9660 filename will be in an
8.3 format which is compatible with MS-DOS, even though the ISO9660 standard
allows filenames of up to 32 characters. If you use this option, the disc may
be difficult to use on a MS-DOS system, but this comes in handy on some other
systems (such as the Amiga). Use with caution.
.TP
-.I \-L
-Allow filenames to begin with a period. Ususally, a leading dot is
-replaced with an underscore in order to maintain MS-DOS compatibility.
-.TP
-.I \-N
+.I -N
Omit version numbers from ISO9660 file names. This may violate the ISO9660
standard, but no one really uses the version numbers anyway. Use with caution.
.TP
-.I \-o filename
+.I -o filename
is the name of the file to which the iso9660 filesystem image should be
written. This can be a disk file, a tape drive, or it can correspond directly
to the device name of the optical disc writer. If not specified, stdout is
@@ -175,7 +138,7 @@ to the device name of the optical disc writer. If not specified, stdout is
disk drive, in which case the disk partition can be mounted and examined to
ensure that the premastering was done correctly.
.TP
-.I \-P publisher_id
+.I -P publisher_id
Specifies a text string that will be written into the volume header.
This should describe the publisher of the CDROM, usually with a
mailing address and phone number. There is space on the disc for 128
@@ -183,7 +146,7 @@ characters of information. This parameter can also be set in the file
.mkisofsrc with PUBL=. If specified in both places, the command line
version is used.
.TP
-.I \-p preparer_id
+.I -p preparer_id
Specifies a text string that will be written into the volume header.
This should describe the preparer of the CDROM, usually with a mailing
address and phone number. There is space on the disc for 128
@@ -191,26 +154,26 @@ characters of information. This parameter can also be set in the file
.mkisofsrc with PREP=. If specified in both places, the command
line version is used.
.TP
-.I \-R
+.I -R
Generate SUSP and RR records using the Rock Ridge protocol to further describe
the files on the iso9660 filesystem.
.TP
-.I \-T
+.I -T
Generate a file TRANS.TBL in each directory on the CDROM, which can be used
on non-Rock Ridge capable systems to help establish the correct file names.
There is also information present in the file that indicates the major and
minor numbers for block and character devices, and each symlink has the name of
the link file given.
.TP
-.I \-V volid
+.I -V volid
Specifies the volume ID to be written into the master block. This
parameter can also be set in the file .mkisofsrc with VOLI=id. If
specified in both places, the command line version is used.
.TP
-.I \-v
+.I -v
Verbose execution.
.TP
-.I \-x path
+.I -x path
Exclude
.I path
from being written to CDROM.
@@ -220,9 +183,9 @@ given as command line argument and the path relative to this directory.
Multiple paths may be excluded (up to 1000).
Example:
-mkisofs \-o cd \-x /local/dir1 \-x /local/dir2 /local
+mkisofs -o cd -x /local/dir1 -x /local/dir2 /local
.TP
-.I \-z
+.I -z
Generate special SUSP records for transparently compressed files. This is
only of use and interest for hosts that support transparent decompression.
This is an experimental feature, and no hosts yet support this, but there
@@ -252,7 +215,7 @@ filesystem. The name mkisofs is probably a bit of a misnomer, since it
not only creates the filesystem, but it also populates it as well.
.PP
.br
-Eric Youngdale <eric@aib.com> wrote both the linux isofs9660 filesystem
+Eric Youngdale <ericy@cais.com> wrote both the linux isofs9660 filesystem
and the mkisofs utility, and is currently maintaining them. The copyright for
the mkisofs utility is held by Yggdrasil Computing, Incorporated.
.SH BUGS
diff --git a/gnu/usr.bin/mkisofs/mkisofs.c b/gnu/usr.bin/mkisofs/mkisofs.c
index e1948caf5c0f..4cfed7861eeb 100644
--- a/gnu/usr.bin/mkisofs/mkisofs.c
+++ b/gnu/usr.bin/mkisofs/mkisofs.c
@@ -20,8 +20,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */
-
#include "mkisofs.h"
#include <assert.h>
@@ -56,7 +54,7 @@
struct directory * root = NULL;
-static char version_string[] = "mkisofs v1.04";
+static char version_string[] = "mkisofs v1.03";
FILE * discimage;
unsigned int next_extent = 0;
@@ -92,7 +90,6 @@ int omit_version_number = 0; /* May violate iso9660, but noone uses vers*/
int RR_relocation_depth = 6; /* Violates iso9660, but most systems work */
int full_iso9660_filenames = 0; /* Used with Amiga. Disc will not work with
DOS */
-int allow_leading_dots = 0; /* DOS cannot read names with leading dots */
struct rcopts{
char * tag;
@@ -188,7 +185,7 @@ void usage(){
fprintf(stderr,"Usage:\n");
fprintf(stderr,
"mkisofs [-o outfile] [-R] [-V volid] [-v] [-a] \
-[-T]\n [-l] [-d] [-V] [-D] [-L] [-p preparer] \
+[-T]\n [-l] [-d] [-V] [-D] [-p preparer] \
[-P publisher] [ -A app_id ] [-z] \
[-x path -x path ...] path\n");
exit(1);
@@ -283,15 +280,9 @@ int FDECL3(iso9660_file_length,const char*, name, struct directory_entry *, sres
if(current_length < 30) *result++ = (islower(*pnt) ? toupper(*pnt) : *pnt);
} else { /* Dos style filenames */
if(*pnt == '.') {
- if (!chars_before_dot && !allow_leading_dots) {
- /* DOS can't read files with dot first */
- chars_before_dot++;
- if (result) *result++ = '_'; /* Substitute underscore */
- } else {
- if (seen_dot) {ignore++; continue;}
- if(result) *result++ = '.';
- seen_dot++;
- }
+ if (seen_dot) {ignore++; continue;}
+ if(result) *result++ = '.';
+ seen_dot++;
} else if (seen_dot) {
if(chars_after_dot < 3) {
chars_after_dot++;
@@ -376,154 +367,6 @@ int FDECL3(iso9660_file_length,const char*, name, struct directory_entry *, sres
return chars_before_dot + chars_after_dot + seen_dot + extra;
}
-#ifdef ADD_FILES
-
-struct file_adds *root_file_adds = NULL;
-
-void
-FDECL2(add_one_file, char *, addpath, char *, path )
-{
- char *cp;
- char *name;
- struct file_adds *f;
- struct file_adds *tmp;
-
- f = root_file_adds;
- tmp = NULL;
-
- name = rindex (addpath, PATH_SEPARATOR);
- if (name == NULL) {
- name = addpath;
- } else {
- name++;
- }
-
- cp = strtok (addpath, SPATH_SEPARATOR);
-
- while (cp != NULL && strcmp (name, cp)) {
- if (f == NULL) {
- root_file_adds = e_malloc (sizeof *root_file_adds);
- f=root_file_adds;
- f->name = NULL;
- f->child = NULL;
- f->next = NULL;
- f->add_count = 0;
- f->adds = NULL;
- f->used = 0;
- }
- if (f->child) {
- for (tmp = f->child; tmp->next != NULL; tmp =tmp->next) {
- if (strcmp (tmp->name, cp) == 0) {
- f = tmp;
- goto next;
- }
- }
- if (strcmp (tmp->name, cp) == 0) {
- f=tmp;
- goto next;
- }
- /* add a new node. */
- tmp->next = e_malloc (sizeof (*tmp->next));
- f=tmp->next;
- f->name = strdup (cp);
- f->child = NULL;
- f->next = NULL;
- f->add_count = 0;
- f->adds = NULL;
- f->used = 0;
- } else {
- /* no children. */
- f->child = e_malloc (sizeof (*f->child));
- f = f->child;
- f->name = strdup (cp);
- f->child = NULL;
- f->next = NULL;
- f->add_count = 0;
- f->adds = NULL;
- f->used = 0;
-
- }
- next:
- cp = strtok (NULL, SPATH_SEPARATOR);
- }
- /* Now f if non-null points to where we should add things */
- if (f == NULL) {
- root_file_adds = e_malloc (sizeof *root_file_adds);
- f=root_file_adds;
- f->name = NULL;
- f->child = NULL;
- f->next = NULL;
- f->add_count = 0;
- f->adds = NULL;
- }
-
- /* Now f really points to where we should add this name. */
- f->add_count++;
- f->adds = realloc (f->adds, sizeof (*f->adds)*f->add_count);
- f->adds[f->add_count-1].path = strdup (path);
- f->adds[f->add_count-1].name = strdup (name);
-}
-
-void
-FDECL3(add_file_list, int, argc, char **,argv, int, ind)
-{
- char *ptr;
- char *dup_arg;
-
- while (ind < argc) {
- dup_arg = strdup (argv[ind]);
- ptr = index (dup_arg,'=');
- if (ptr == NULL) {
- free (dup_arg);
- return;
- }
- *ptr = 0;
- ptr++;
- add_one_file (dup_arg, ptr);
- free (dup_arg);
- ind++;
- }
-}
-void
-FDECL1(add_file, char *, filename)
-{
- char buff[1024];
- FILE *f;
- char *ptr;
- char *p2;
- int count=0;
-
- if (strcmp (filename, "-") == 0) {
- f = stdin;
- } else {
- f = fopen (filename, "r");
- if (f == NULL) {
- perror ("fopen");
- exit (1);
- }
- }
- while (fgets (buff, 1024, f)) {
- count++;
- ptr = buff;
- while (isspace (*ptr)) ptr++;
- if (*ptr==0) continue;
- if (*ptr=='#') continue;
-
- if (ptr[strlen(ptr)-1]== '\n') ptr[strlen(ptr)-1]=0;
- p2 = index (ptr, '=');
- if (p2 == NULL) {
- fprintf (stderr, "Error in line %d: %s\n", count, buff);
- exit (1);
- }
- *p2 = 0;
- p2++;
- add_one_file (ptr, p2);
- }
- if (f != stdin) fclose (f);
-}
-
-#endif
-
int FDECL2(main, int, argc, char **, argv){
char * outfile;
struct directory_entry de;
@@ -531,9 +374,6 @@ int FDECL2(main, int, argc, char **, argv){
struct stat statbuf;
char * scan_tree;
int c;
-#ifdef ADD_FILES
- char *add_file_file = NULL;
-#endif
if (argc < 2)
usage();
@@ -542,7 +382,7 @@ int FDECL2(main, int, argc, char **, argv){
read_rcfile(argv[0]);
outfile = NULL;
- while ((c = getopt(argc, argv, "i:o:V:RfvaTp:P:x:dDlLNzA:")) != EOF)
+ while ((c = getopt(argc, argv, "o:V:RfvaTp:P:x:dDlNzA:")) != EOF)
switch (c)
{
case 'p':
@@ -575,9 +415,6 @@ int FDECL2(main, int, argc, char **, argv){
case 'l':
full_iso9660_filenames++;
break;
- case 'L':
- allow_leading_dots++;
- break;
case 'N':
omit_version_number++;
break;
@@ -613,11 +450,6 @@ int FDECL2(main, int, argc, char **, argv){
case 'x':
exclude(optarg);
break;
- case 'i':
-#ifdef ADD_FILES
- add_file_file = optarg;
- break;
-#endif
default:
usage();
exit(1);
@@ -646,13 +478,6 @@ int FDECL2(main, int, argc, char **, argv){
scan_tree = argv[optind];
-#ifdef ADD_FILES
- if (add_file_file) {
- add_file(add_file_file);
- }
- add_file_list (argc, argv, optind+1);
-#endif
-
if(!scan_tree){
usage();
exit(1);
@@ -674,7 +499,7 @@ int FDECL2(main, int, argc, char **, argv){
#else
extension_record = generate_rr_extension_record("IEEE_P1282",
"THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS",
- "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION.", &extension_record_size);
+ "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT,PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION.", &extension_record_size);
#endif
};
diff --git a/gnu/usr.bin/mkisofs/mkisofs.h b/gnu/usr.bin/mkisofs/mkisofs.h
index efdd8a8356e4..e17bb848a9cd 100644
--- a/gnu/usr.bin/mkisofs/mkisofs.h
+++ b/gnu/usr.bin/mkisofs/mkisofs.h
@@ -19,9 +19,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */
-
-#include <sys/types.h>
#include <stdio.h>
/* This symbol is used to indicate that we do not have things like
@@ -43,6 +40,7 @@
#endif
#include <string.h>
+#include <sys/types.h>
#include <sys/stat.h>
#ifdef linux
@@ -102,7 +100,6 @@ struct directory_entry{
unsigned int priority;
char * name;
char * table;
- char * whole_name;
struct directory * filedir;
struct directory_entry * parent_rec;
unsigned int flags;
@@ -144,23 +141,6 @@ struct deferred{
unsigned int flags;
};
-#ifdef ADD_FILES
-struct file_adds {
- char *name;
- struct file_adds *child;
- struct file_adds *next;
- int add_count;
- int used;
- struct dirent de;
- struct {
- char *path;
- char *name;
- } *adds;
-};
-extern struct file_adds *root_file_adds;
-
-#endif
-
extern void DECL(sort_n_finish,(struct directory *));
extern int goof;
extern struct directory * root;
diff --git a/gnu/usr.bin/mkisofs/rock.c b/gnu/usr.bin/mkisofs/rock.c
index f3361cef32df..dfa774f02057 100644
--- a/gnu/usr.bin/mkisofs/rock.c
+++ b/gnu/usr.bin/mkisofs/rock.c
@@ -279,7 +279,7 @@ int deep_opt;
nchar -= 1;
} else if(cpnt[0] == 0){
if(MAYBE_ADD_CE_ENTRY(2)) add_CE_entry();
- Rock[ipnt++] = (cpnt == &symlink_buff[0] ? SL_ROOT : 0);
+ Rock[ipnt++] = SL_ROOT;
Rock[ipnt++] = 0; /* length is zero */
lenval += 2;
} else {
diff --git a/gnu/usr.bin/mkisofs/tree.c b/gnu/usr.bin/mkisofs/tree.c
index 5060c41a1740..c07c52e12eaf 100644
--- a/gnu/usr.bin/mkisofs/tree.c
+++ b/gnu/usr.bin/mkisofs/tree.c
@@ -20,21 +20,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */
-
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#ifndef VMS
-#if defined(HASSYSMACROS) && !defined(HASMKDEV)
-#include <sys/sysmacros.h>
-#endif
#include <unistd.h>
-#ifdef HASMKDEV
-#include <sys/types.h>
-#include <sys/mkdev.h>
+#ifdef HASSYSMACROS
+#include <sys/sysmacros.h>
#endif
#else
#include <sys/file.h>
@@ -481,89 +475,6 @@ void finish_cl_pl_entries(){
d_entry = d_entry->next;
};
}
-
-#ifdef ADD_FILES
-/* This function looks up additions. */
-char *
-FDECL3(look_up_addition,char **, newpath, char *,path, struct dirent **,de) {
- char *dup_path;
- char *cp;
- struct file_adds *f;
- struct file_adds *tmp;
-
- f=root_file_adds;
- if (!f) return NULL;
-
- /* I don't trust strtok */
- dup_path = strdup (path);
-
- cp = strtok (dup_path, SPATH_SEPARATOR);
- while (cp != NULL) {
- for (tmp = f->child; tmp != NULL; tmp=tmp->next) {
- if (strcmp (tmp->name, cp) == 0) break;
- }
- if (tmp == NULL) {
- /* no match */
- free (dup_path);
- return (NULL);
- }
- f = tmp;
- cp = strtok(NULL, SPATH_SEPARATOR);
- }
- free (dup_path);
-
- /* looks like we found something. */
- if (tmp->used >= tmp->add_count) return (NULL);
-
- *newpath = tmp->adds[tmp->used].path;
- tmp->used++;
- *de = &(tmp->de);
- return (tmp->adds[tmp->used-1].name);
-
-}
-
-/* This function lets us add files from outside the standard file tree.
- It is useful if we want to duplicate a cd, but add/replace things.
- We should note that the real path will be used for exclusions. */
-
-struct dirent *
-FDECL3(readdir_add_files, char **, pathp, char *,path, DIR *, dir){
- struct dirent *de;
-
- char *addpath;
- char *name;
-
- de = readdir (dir);
- if (de) {
- return (de);
- }
-
- name=look_up_addition (&addpath, path, &de);
-
- if (!name) {
- return;
- }
-
- *pathp=addpath;
-
- /* Now we must create the directory entry. */
- /* fortuneately only the name seems to matter. */
- /*
- de->d_ino = -1;
- de->d_off = 0;
- de->d_reclen = strlen (name);
- */
- strncpy (de->d_name, name, NAME_MAX);
- de->d_name[NAME_MAX]=0;
- return (de);
-
-}
-#else
-struct dirent *
-FDECL3(readdir_add_files, char **, pathp, char *,path, DIR *, dir){
- return (readdir (dir));
-}
-#endif
/*
* This function scans the directory tree, looking for files, and it makes
* note of everything that is found. We also begin to construct the ISO9660
@@ -582,7 +493,6 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
char * cpnt;
int new_reclen;
int deep_flag;
- char *old_path;
current_dir = opendir(path);
d_entry = NULL;
@@ -590,9 +500,7 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
/* Apparently NFS sometimes allows you to open the directory, but
then refuses to allow you to read the contents. Allow for this */
- old_path = path;
-
- if(current_dir) d_entry = readdir_add_files(&path, old_path, current_dir);
+ if(current_dir) d_entry = readdir(current_dir);
if(!current_dir || !d_entry) {
fprintf(stderr,"Unable to open directory %s\n", path);
@@ -670,7 +578,7 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
/* The first time through, skip this, since we already asked for
the first entry when we opened the directory. */
- if(dflag) d_entry = readdir_add_files(&path, old_path, current_dir);
+ if(dflag) d_entry = readdir(current_dir);
dflag++;
if(!d_entry) break;
@@ -721,11 +629,10 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
if(S_ISLNK(lstatbuf.st_mode)){
- /* Here we decide how to handle the symbolic links. Here
- we handle the general case - if we are not following
- links or there is an error, then we must change
- something. If RR is in use, it is easy, we let RR
- describe the file. If not, then we punt the file. */
+ /* Here we decide how to handle the symbolic links. Here we
+ handle the general case - if we are not following links or there is an
+ error, then we must change something. If RR is in use, it is easy, we
+ let RR describe the file. If not, then we punt the file. */
if((status || !follow_links)){
if(use_RockRidge){
@@ -745,50 +652,35 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
};
}
- if( follow_links
- && S_ISDIR(statbuf.st_mode) )
- {
- if( strcmp(d_entry->d_name, ".")
- && strcmp(d_entry->d_name, "..") )
- {
- if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)))
- {
- if(!use_RockRidge)
- {
- fprintf(stderr, "Already cached directory seen (%s)\n",
- whole_path);
- continue;
- }
- statbuf.st_size = 0;
- STAT_INODE(statbuf) = UNCACHED_INODE;
- statbuf.st_dev = (dev_t) UNCACHED_DEVICE;
- statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG;
+ /* Here we handle a different kind of case. Here we have a symlink,
+ but we want to follow symlinks. If we run across a directory loop,
+ then we need to pretend that we are not following symlinks for this file.
+ If this is the first time we have seen this, then make this seem
+ as if there was no symlink there in the first place */
+
+ else if(strcmp(d_entry->d_name, ".") &&
+ strcmp(d_entry->d_name, "..")) {
+ if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))){
+ fprintf(stderr, "Infinite loop detected (%s)\n", whole_path);
+ if(!use_RockRidge) continue;
+ statbuf.st_size = 0;
+ STAT_INODE(statbuf) = UNCACHED_INODE;
+ statbuf.st_dev = (dev_t) UNCACHED_DEVICE;
+ statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG;
} else {
- lstatbuf = statbuf;
- add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
- }
- }
- }
- }
+ lstatbuf = statbuf;
+ add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
+ };
+ };
+ };
- /*
- * Add directories to the cache so that we don't waste space even
- * if we are supposed to be following symlinks.
- */
- if( follow_links
- && strcmp(d_entry->d_name, ".")
- && strcmp(d_entry->d_name, "..")
- && S_ISDIR(statbuf.st_mode) )
- {
- add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
- }
#ifdef VMS
if(!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX &&
statbuf.st_fab_rfm != FAB$C_STMLF)) {
fprintf(stderr,"Warning - file %s has an unsupported VMS record"
" format (%d)\n",
whole_path, statbuf.st_fab_rfm);
- }
+ };
#endif
if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))){
@@ -799,15 +691,11 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
/* Add this so that we can detect directory loops with hard links.
If we are set up to follow symlinks, then we skip this checking. */
- if( !follow_links
- && S_ISDIR(lstatbuf.st_mode)
- && strcmp(d_entry->d_name, ".")
- && strcmp(d_entry->d_name, "..") )
- {
+ if(!follow_links && S_ISDIR(lstatbuf.st_mode) && strcmp(d_entry->d_name, ".") &&
+ strcmp(d_entry->d_name, "..")) {
if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) {
- fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n",
- whole_path, (unsigned long) statbuf.st_dev,
- (unsigned long) STAT_INODE(statbuf));
+ fprintf(stderr,"Directory loop - fatal goof (%s %x %d).\n",
+ whole_path, statbuf.st_dev, STAT_INODE(statbuf));
exit(1);
};
add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
@@ -839,7 +727,6 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
s_entry->table = NULL;
s_entry->name = strdup(d_entry->d_name);
- s_entry->whole_name = strdup (whole_path);
s_entry->filedir = this_dir;
s_entry->isorec.flags[0] = 0;
@@ -923,20 +810,18 @@ FDECL2(scan_directory_tree,char *, path, struct directory_entry *, de){
break;
#ifndef NON_UNIXFS
case S_IFBLK:
- sprintf(buffer,"B\t%s\t%lu %lu\n",
+ sprintf(buffer,"B\t%s\t%d %d\n",
s_entry->name,
- (unsigned long) major(statbuf.st_rdev),
- (unsigned long) minor(statbuf.st_rdev));
+ major(statbuf.st_rdev), minor(statbuf.st_rdev));
break;
case S_IFIFO:
sprintf(buffer,"P\t%s\n",
s_entry->name);
break;
case S_IFCHR:
- sprintf(buffer,"C\t%s\t%lu %lu\n",
+ sprintf(buffer,"C\t%s\t%d %d\n",
s_entry->name,
- (unsigned long) major(statbuf.st_rdev),
- (unsigned long) minor(statbuf.st_rdev));
+ major(statbuf.st_rdev), minor(statbuf.st_rdev));
break;
case S_IFLNK:
readlink(whole_path, symlink_buff, sizeof(symlink_buff));
diff --git a/gnu/usr.bin/mkisofs/write.c b/gnu/usr.bin/mkisofs/write.c
index 64b4a3ce593c..3a98a3907624 100644
--- a/gnu/usr.bin/mkisofs/write.c
+++ b/gnu/usr.bin/mkisofs/write.c
@@ -376,7 +376,11 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt){
dwpnt->name = NULL;
} else {
dwpnt->table = NULL;
- strcpy(whole_path, s_entry->whole_name);
+ strcpy(whole_path, s_entry->filedir->whole_name);
+#ifndef VMS
+ if(strlen(whole_path)) strcat(whole_path, "/");
+#endif
+ strcat(whole_path, s_entry->name);
dwpnt->name = strdup(whole_path);
};
dwpnt->next = NULL;
@@ -403,15 +407,8 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt){
fprintf(stderr,"Reported file size is %d extents\n", s_entry->size);
exit(1);
};
- } else {
- /*
- * This is for zero-length files. If we leave the extent 0,
- * then we get screwed, because many readers simply drop files
- * that have an extent of zero. Thus we leave the size 0,
- * and just assign the extent number.
- */
- set_733(s_entry->isorec.extent, last_extent);
- }
+ } else
+ set_733(s_entry->isorec.extent, 0);
};
};
};
diff --git a/gnu/usr.bin/patch/EXTERN.h b/gnu/usr.bin/patch/EXTERN.h
index 96dd888a933d..be56db25fdba 100644
--- a/gnu/usr.bin/patch/EXTERN.h
+++ b/gnu/usr.bin/patch/EXTERN.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/EXTERN.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/EXTERN.h,v 1.2 1995/05/30 05:02:26 rgrimes Exp $
*
* $Log: EXTERN.h,v $
+ * Revision 1.2 1995/05/30 05:02:26 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/INTERN.h b/gnu/usr.bin/patch/INTERN.h
index b718b1d4cc9f..706717082c58 100644
--- a/gnu/usr.bin/patch/INTERN.h
+++ b/gnu/usr.bin/patch/INTERN.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/INTERN.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/INTERN.h,v 1.2 1995/05/30 05:02:27 rgrimes Exp $
*
* $Log: INTERN.h,v $
+ * Revision 1.2 1995/05/30 05:02:27 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/common.h b/gnu/usr.bin/patch/common.h
index 4bb99e024819..11f48cd10338 100644
--- a/gnu/usr.bin/patch/common.h
+++ b/gnu/usr.bin/patch/common.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/common.h,v 1.2 1993/09/22 16:51:03 rich Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/common.h,v 1.3 1995/05/30 05:02:30 rgrimes Exp $
*
* $Log: common.h,v $
+ * Revision 1.3 1995/05/30 05:02:30 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.2 1993/09/22 16:51:03 rich
* Increaed the fixed static buffer sizes and maximum hunk size that
* otherwise causes the XFree86 1.3 patch set to fail.
diff --git a/gnu/usr.bin/patch/inp.c b/gnu/usr.bin/patch/inp.c
index e8e1531776df..015138cfc019 100644
--- a/gnu/usr.bin/patch/inp.c
+++ b/gnu/usr.bin/patch/inp.c
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.2 1995/01/12 22:09:39 hsu Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/inp.c,v 1.3 1995/05/30 05:02:31 rgrimes Exp $
*
* $Log: inp.c,v $
+ * Revision 1.3 1995/05/30 05:02:31 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.2 1995/01/12 22:09:39 hsu
* Fix bug that created new files even when running in -C check mode.
* Reviewed by: phk
diff --git a/gnu/usr.bin/patch/inp.h b/gnu/usr.bin/patch/inp.h
index ea07ee89d8a1..07b42b9cdc7a 100644
--- a/gnu/usr.bin/patch/inp.h
+++ b/gnu/usr.bin/patch/inp.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/inp.h,v 1.2 1995/05/30 05:02:33 rgrimes Exp $
*
* $Log: inp.h,v $
+ * Revision 1.2 1995/05/30 05:02:33 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/patch.1 b/gnu/usr.bin/patch/patch.1
index edc690f13516..eb7578d76c11 100644
--- a/gnu/usr.bin/patch/patch.1
+++ b/gnu/usr.bin/patch/patch.1
@@ -1,6 +1,6 @@
.\" -*- nroff -*-
.rn '' }`
-'\" $Header: /home/ncvs/src/gnu/usr.bin/patch/patch.1,v 1.4 1994/02/25 21:45:59 phk Exp $
+'\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/patch.1,v 1.4 1994/02/25 21:45:59 phk Exp $
'\"
'\" $Log: patch.1,v $
.\" Revision 1.4 1994/02/25 21:45:59 phk
@@ -211,7 +211,7 @@ Only context diffs have lines like that, but if there is an \*(L"Index:\*(R"
line in the leading garbage,
.I patch
will try to use the file name from that line.
-The Index line, if present, takes precedence over the context diff header.
+The context diff header takes precedence over an Index line.
If no file name can be intuited from the leading garbage, you will be asked
for the name of the file to patch.
.PP
diff --git a/gnu/usr.bin/patch/patch.c b/gnu/usr.bin/patch/patch.c
index b03d065af555..8f3e84c9a95f 100644
--- a/gnu/usr.bin/patch/patch.c
+++ b/gnu/usr.bin/patch/patch.c
@@ -1,5 +1,5 @@
char rcsid[] =
- "$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.5 1995/01/12 22:09:40 hsu Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/patch.c,v 1.6 1995/05/30 05:02:34 rgrimes Exp $";
/* patch - a program to apply diffs to original files
*
@@ -9,6 +9,9 @@ char rcsid[] =
* money off of it, or pretend that you wrote it.
*
* $Log: patch.c,v $
+ * Revision 1.6 1995/05/30 05:02:34 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.5 1995/01/12 22:09:40 hsu
* Fix bug that created new files even when running in -C check mode.
* Reviewed by: phk
diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c
index a607f67641cb..9d0ebca7675a 100644
--- a/gnu/usr.bin/patch/pch.c
+++ b/gnu/usr.bin/patch/pch.c
@@ -1,4 +1,4 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.5.4.2 1996/04/11 10:33:45 markm Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/pch.c,v 1.5.4.2 1996/04/11 10:33:45 markm Exp $
*
* $Log: pch.c,v $
* Revision 1.5.4.2 1996/04/11 10:33:45 markm
@@ -373,6 +373,8 @@ intuit_diff_type()
else
filearg[0] = savestr(newname);
}
+ else if (indname)
+ filearg[0] = savestr(indname);
else if (oldname)
filearg[0] = savestr(oldname);
else if (newname)
diff --git a/gnu/usr.bin/patch/pch.h b/gnu/usr.bin/patch/pch.h
index 49670816989f..a8d07f89bf8a 100644
--- a/gnu/usr.bin/patch/pch.h
+++ b/gnu/usr.bin/patch/pch.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/pch.h,v 1.2 1995/05/30 05:02:36 rgrimes Exp $
*
* $Log: pch.h,v $
+ * Revision 1.2 1995/05/30 05:02:36 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/util.h b/gnu/usr.bin/patch/util.h
index c56b4c304004..84f1ca47fcbf 100644
--- a/gnu/usr.bin/patch/util.h
+++ b/gnu/usr.bin/patch/util.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/util.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/util.h,v 1.2 1995/05/30 05:02:38 rgrimes Exp $
*
* $Log: util.h,v $
+ * Revision 1.2 1995/05/30 05:02:38 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/version.c b/gnu/usr.bin/patch/version.c
index dfd2e9a6bb86..4c95e5be2485 100644
--- a/gnu/usr.bin/patch/version.c
+++ b/gnu/usr.bin/patch/version.c
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/version.c,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/version.c,v 1.2 1995/05/30 05:02:39 rgrimes Exp $
*
* $Log: version.c,v $
+ * Revision 1.2 1995/05/30 05:02:39 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/patch/version.h b/gnu/usr.bin/patch/version.h
index f59ee261e639..498050c3dea5 100644
--- a/gnu/usr.bin/patch/version.h
+++ b/gnu/usr.bin/patch/version.h
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/version.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/patch/version.h,v 1.2 1995/05/30 05:02:40 rgrimes Exp $
*
* $Log: version.h,v $
+ * Revision 1.2 1995/05/30 05:02:40 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
* b-maked patch-2.10
*
diff --git a/gnu/usr.bin/perl/eg/ADB b/gnu/usr.bin/perl/eg/ADB
index 09b93c302aae..39c58d99e2a0 100644
--- a/gnu/usr.bin/perl/eg/ADB
+++ b/gnu/usr.bin/perl/eg/ADB
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/ADB,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/ADB,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
# This script is only useful when used in your crash directory.
diff --git a/gnu/usr.bin/perl/eg/changes b/gnu/usr.bin/perl/eg/changes
index 9835e1b6ddc2..b82efda0861e 100644
--- a/gnu/usr.bin/perl/eg/changes
+++ b/gnu/usr.bin/perl/eg/changes
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/changes,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/changes,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
($dir, $days) = @ARGV;
$dir = '/' if $dir eq '';
diff --git a/gnu/usr.bin/perl/eg/dus b/gnu/usr.bin/perl/eg/dus
index 94c648bd7626..ccab061d6227 100644
--- a/gnu/usr.bin/perl/eg/dus
+++ b/gnu/usr.bin/perl/eg/dus
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/dus,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/dus,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# This script does a du -s on any directories in the current directory that
# are not mount points for another filesystem.
diff --git a/gnu/usr.bin/perl/eg/findcp b/gnu/usr.bin/perl/eg/findcp
index 47e443820d88..39f7ba4830b0 100644
--- a/gnu/usr.bin/perl/eg/findcp
+++ b/gnu/usr.bin/perl/eg/findcp
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/findcp,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/findcp,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# This is a wrapper around the find command that pretends find has a switch
# of the form -cp host:destination. It presumes your find implements -ls.
diff --git a/gnu/usr.bin/perl/eg/findtar b/gnu/usr.bin/perl/eg/findtar
index a60f10f76c32..046e48f83fbb 100644
--- a/gnu/usr.bin/perl/eg/findtar
+++ b/gnu/usr.bin/perl/eg/findtar
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/findtar,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/findtar,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# findtar takes find-style arguments and spits out a tarfile on stdout.
# It won't work unless your find supports -ls and your tar the I flag.
diff --git a/gnu/usr.bin/perl/eg/g/gcp b/gnu/usr.bin/perl/eg/g/gcp
index 3e44a9cf182b..f5045d8fd3ef 100644
--- a/gnu/usr.bin/perl/eg/g/gcp
+++ b/gnu/usr.bin/perl/eg/g/gcp
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/g/gcp,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/g/gcp,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
# Here is a script to do global rcps. See man page.
diff --git a/gnu/usr.bin/perl/eg/g/gcp.man b/gnu/usr.bin/perl/eg/g/gcp.man
index 8985742fa473..21f15d625d30 100644
--- a/gnu/usr.bin/perl/eg/g/gcp.man
+++ b/gnu/usr.bin/perl/eg/g/gcp.man
@@ -1,4 +1,4 @@
-.\" $Header: /home/cvs/386BSD/ports/lang/perl/eg/g/gcp.man,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/g/gcp.man,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
.TH GCP 1C "13 May 1988"
.SH NAME
gcp \- global file copy
diff --git a/gnu/usr.bin/perl/eg/g/ged b/gnu/usr.bin/perl/eg/g/ged
index d296a84c913a..f6fb91a1b88f 100644
--- a/gnu/usr.bin/perl/eg/g/ged
+++ b/gnu/usr.bin/perl/eg/g/ged
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/g/ged,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/g/ged,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
# Does inplace edits on a set of files on a set of machines.
#
diff --git a/gnu/usr.bin/perl/eg/g/gsh b/gnu/usr.bin/perl/eg/g/gsh
index 3322a02ff74f..14e0ae08f119 100644
--- a/gnu/usr.bin/perl/eg/g/gsh
+++ b/gnu/usr.bin/perl/eg/g/gsh
@@ -1,6 +1,6 @@
#! /usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/g/gsh,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/g/gsh,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
# Do rsh globally--see man page
diff --git a/gnu/usr.bin/perl/eg/g/gsh.man b/gnu/usr.bin/perl/eg/g/gsh.man
index 00eafb66d8c2..5bc5a175a834 100644
--- a/gnu/usr.bin/perl/eg/g/gsh.man
+++ b/gnu/usr.bin/perl/eg/g/gsh.man
@@ -1,4 +1,4 @@
-.\" $Header: /home/cvs/386BSD/ports/lang/perl/eg/g/gsh.man,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/g/gsh.man,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
.TH GSH 8 "13 May 1988"
.SH NAME
gsh \- global shell
diff --git a/gnu/usr.bin/perl/eg/muck.man b/gnu/usr.bin/perl/eg/muck.man
index 1b45ee0325c0..0e44926a5e0d 100644
--- a/gnu/usr.bin/perl/eg/muck.man
+++ b/gnu/usr.bin/perl/eg/muck.man
@@ -1,4 +1,4 @@
-.\" $Header: /home/cvs/386BSD/ports/lang/perl/eg/muck.man,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/muck.man,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
.TH MUCK 1 "10 Jan 1989"
.SH NAME
muck \- make usage checker
diff --git a/gnu/usr.bin/perl/eg/myrup b/gnu/usr.bin/perl/eg/myrup
index b3185896ef98..813a4693ace7 100644
--- a/gnu/usr.bin/perl/eg/myrup
+++ b/gnu/usr.bin/perl/eg/myrup
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/myrup,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/myrup,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# This was a customization of ruptime requested by someone here who wanted
# to be able to find the least loaded machine easily. It uses the
diff --git a/gnu/usr.bin/perl/eg/nih b/gnu/usr.bin/perl/eg/nih
index a376142cdd75..5058dbe0806e 100644
--- a/gnu/usr.bin/perl/eg/nih
+++ b/gnu/usr.bin/perl/eg/nih
@@ -1,7 +1,7 @@
eval "exec /usr/bin/perl -Spi.bak $0 $*"
if $running_under_some_shell;
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/nih,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/nih,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# This script makes #! scripts directly executable on machines that don't
# support #!. It edits in place any scripts mentioned on the command line.
diff --git a/gnu/usr.bin/perl/eg/relink b/gnu/usr.bin/perl/eg/relink
index 69956c9a6738..1484f3da40b7 100644
--- a/gnu/usr.bin/perl/eg/relink
+++ b/gnu/usr.bin/perl/eg/relink
@@ -2,9 +2,12 @@
'di';
'ig00';
#
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/relink,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/relink,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
#
# $Log: relink,v $
+# Revision 1.1.1.1 1994/09/10 06:27:47 gclarkii
+# Initial import of Perl 4.046 bmaked
+#
# Revision 1.1.1.1 1993/08/23 21:29:43 nate
# PERL!
#
diff --git a/gnu/usr.bin/perl/eg/rename b/gnu/usr.bin/perl/eg/rename
index b568406f8603..64d9a595669e 100644
--- a/gnu/usr.bin/perl/eg/rename
+++ b/gnu/usr.bin/perl/eg/rename
@@ -2,9 +2,12 @@
'di';
'ig00';
#
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/rename,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/rename,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
#
# $Log: rename,v $
+# Revision 1.1.1.1 1994/09/10 06:27:47 gclarkii
+# Initial import of Perl 4.046 bmaked
+#
# Revision 1.1.1.1 1993/08/23 21:29:43 nate
# PERL!
#
diff --git a/gnu/usr.bin/perl/eg/rmfrom b/gnu/usr.bin/perl/eg/rmfrom
index 0c8fa2c86aaf..8c05ba55b955 100644
--- a/gnu/usr.bin/perl/eg/rmfrom
+++ b/gnu/usr.bin/perl/eg/rmfrom
@@ -1,6 +1,6 @@
#!/usr/bin/perl -n
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/rmfrom,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/rmfrom,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# A handy (but dangerous) script to put after a find ... -print.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_df b/gnu/usr.bin/perl/eg/scan/scan_df
index 688738710a53..3904fa7bb2ed 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_df
+++ b/gnu/usr.bin/perl/eg/scan/scan_df
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_df,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_df,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This report points out filesystems that are in danger of overflowing.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_last b/gnu/usr.bin/perl/eg/scan/scan_last
index 6621120d3e44..3fef9b679ab0 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_last
+++ b/gnu/usr.bin/perl/eg/scan/scan_last
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_last,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_last,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This reports who was logged on at weird hours
diff --git a/gnu/usr.bin/perl/eg/scan/scan_messages b/gnu/usr.bin/perl/eg/scan/scan_messages
index a28cda858a17..d5e6999cfae2 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_messages
+++ b/gnu/usr.bin/perl/eg/scan/scan_messages
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_messages,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_messages,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This prints out extraordinary console messages. You'll need to customize.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_passwd b/gnu/usr.bin/perl/eg/scan/scan_passwd
index f9c53c7d2385..938f86d979ee 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_passwd
+++ b/gnu/usr.bin/perl/eg/scan/scan_passwd
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_passwd,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_passwd,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This scans passwd file for security holes.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_ps b/gnu/usr.bin/perl/eg/scan/scan_ps
index b0480d544c30..890039136889 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_ps
+++ b/gnu/usr.bin/perl/eg/scan/scan_ps
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_ps,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_ps,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This looks for looping processes.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_sudo b/gnu/usr.bin/perl/eg/scan/scan_sudo
index a95a6092b467..09813cee0244 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_sudo
+++ b/gnu/usr.bin/perl/eg/scan/scan_sudo
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_sudo,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_sudo,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# Analyze the sudo log.
diff --git a/gnu/usr.bin/perl/eg/scan/scan_suid b/gnu/usr.bin/perl/eg/scan/scan_suid
index a730e0aaee16..2d5d6b64c70c 100644
--- a/gnu/usr.bin/perl/eg/scan/scan_suid
+++ b/gnu/usr.bin/perl/eg/scan/scan_suid
@@ -1,6 +1,6 @@
#!/usr/bin/perl -P
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scan_suid,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scan_suid,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# Look for new setuid root files.
diff --git a/gnu/usr.bin/perl/eg/scan/scanner b/gnu/usr.bin/perl/eg/scan/scanner
index f773e87e8f8a..5b24dc6c03ba 100644
--- a/gnu/usr.bin/perl/eg/scan/scanner
+++ b/gnu/usr.bin/perl/eg/scan/scanner
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/scan/scanner,v 1.1.1.1 1993/08/23 21:29:44 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/scan/scanner,v 1.1.1.1 1994/09/10 06:27:48 gclarkii Exp $
# This runs all the scan_* routines on all the machines in /etc/ghosts.
# We run this every morning at about 6 am:
diff --git a/gnu/usr.bin/perl/eg/shmkill b/gnu/usr.bin/perl/eg/shmkill
index e8d1b11b3630..967edee3d0d6 100644
--- a/gnu/usr.bin/perl/eg/shmkill
+++ b/gnu/usr.bin/perl/eg/shmkill
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/shmkill,v 1.1.1.1 1993/08/23 21:29:43 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/shmkill,v 1.1.1.1 1994/09/10 06:27:47 gclarkii Exp $
# A script to call from crontab periodically when people are leaving shared
# memory sitting around unattached.
diff --git a/gnu/usr.bin/perl/eg/van/empty b/gnu/usr.bin/perl/eg/van/empty
index ee656e68563f..61b606a42614 100644
--- a/gnu/usr.bin/perl/eg/van/empty
+++ b/gnu/usr.bin/perl/eg/van/empty
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/van/empty,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/van/empty,v 1.1.1.1 1994/09/10 06:27:49 gclarkii Exp $
# This script empties a trashcan.
diff --git a/gnu/usr.bin/perl/eg/van/unvanish b/gnu/usr.bin/perl/eg/van/unvanish
index 50459821546b..2e6655a4362e 100644
--- a/gnu/usr.bin/perl/eg/van/unvanish
+++ b/gnu/usr.bin/perl/eg/van/unvanish
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/van/unvanish,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/van/unvanish,v 1.1.1.1 1994/09/10 06:27:50 gclarkii Exp $
sub it {
if ($olddir ne '.') {
diff --git a/gnu/usr.bin/perl/eg/van/vanexp b/gnu/usr.bin/perl/eg/van/vanexp
index 79b78854d54c..e494cf5d4180 100644
--- a/gnu/usr.bin/perl/eg/van/vanexp
+++ b/gnu/usr.bin/perl/eg/van/vanexp
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/van/vanexp,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/van/vanexp,v 1.1.1.1 1994/09/10 06:27:50 gclarkii Exp $
# This is for running from a find at night to expire old .deleteds
diff --git a/gnu/usr.bin/perl/eg/van/vanish b/gnu/usr.bin/perl/eg/van/vanish
index b79776a4ebdc..20a5d39bd463 100644
--- a/gnu/usr.bin/perl/eg/van/vanish
+++ b/gnu/usr.bin/perl/eg/van/vanish
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/eg/van/vanish,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/eg/van/vanish,v 1.1.1.1 1994/09/10 06:27:50 gclarkii Exp $
sub it {
if ($olddir ne '.') {
diff --git a/gnu/usr.bin/perl/emacs/perldb.pl b/gnu/usr.bin/perl/emacs/perldb.pl
index 7c9e6513ea0c..eaecb2251b7d 100644
--- a/gnu/usr.bin/perl/emacs/perldb.pl
+++ b/gnu/usr.bin/perl/emacs/perldb.pl
@@ -3,7 +3,7 @@ package DB;
# modified Perl debugger, to be run from Emacs in perldb-mode
# Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
-$header = '$Header: /home/cvs/386BSD/ports/lang/perl/emacs/perldb.pl,v 1.1.1.1 1993/08/23 21:29:46 nate Exp $';
+$header = '$Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/emacs/perldb.pl,v 1.1.1.1 1994/09/10 06:27:50 gclarkii Exp $';
#
# This file is automatically included if you do perl -d.
# It's probably not useful to include this yourself.
@@ -13,6 +13,9 @@ $header = '$Header: /home/cvs/386BSD/ports/lang/perl/emacs/perldb.pl,v 1.1.1.1 1
# have a breakpoint. It also inserts a do 'perldb.pl' before the first line.
#
# $Log: perldb.pl,v $
+# Revision 1.1.1.1 1994/09/10 06:27:50 gclarkii
+# Initial import of Perl 4.046 bmaked
+#
# Revision 1.1.1.1 1993/08/23 21:29:46 nate
# PERL!
#
diff --git a/gnu/usr.bin/perl/lib/Makefile b/gnu/usr.bin/perl/lib/Makefile
index 158cbfa26c42..387824ba0708 100644
--- a/gnu/usr.bin/perl/lib/Makefile
+++ b/gnu/usr.bin/perl/lib/Makefile
@@ -2,14 +2,14 @@ PLIBDIR= ${DESTDIR}/usr/share/perl
PLIB+= abbrev.pl assert.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl
PLIB+= chat2.pl complete.pl ctime.pl dumpvar.pl exceptions.pl fastcwd.pl
-PLIB+= find.pl finddepth.pl flush.pl getcwd.pl gethostname.pl getopts.pl
-PLIB+= importenv.pl look.pl newgetopt.pl open2.pl perldb.pl pwd.pl
-PLIB+= shellwords.pl stat.pl syslog.pl termcap.pl timelocal.pl validate.pl
+PLIB+= find.pl finddepth.pl flush.pl getcwd.pl getopts.pl importenv.pl
+PLIB+= look.pl newgetopt.pl open2.pl perldb.pl pwd.pl shellwords.pl
+PLIB+= stat.pl syslog.pl termcap.pl timelocal.pl validate.pl
NOOBJ=
install:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PLIB} ${PLIBDIR}
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PLIB} ${PLIBDIR}
clean:
cleandir:
diff --git a/gnu/usr.bin/perl/lib/importenv.pl b/gnu/usr.bin/perl/lib/importenv.pl
index c9ad330b6d03..002d760add5e 100644
--- a/gnu/usr.bin/perl/lib/importenv.pl
+++ b/gnu/usr.bin/perl/lib/importenv.pl
@@ -1,4 +1,4 @@
-;# $Header: /home/cvs/386BSD/ports/lang/perl/lib/importenv.pl,v 1.1.1.1 1993/08/23 21:29:53 nate Exp $
+;# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/lib/importenv.pl,v 1.1.1.1 1994/09/10 06:27:52 gclarkii Exp $
;# This file, when interpreted, pulls the environment into normal variables.
;# Usage:
diff --git a/gnu/usr.bin/perl/lib/stat.pl b/gnu/usr.bin/perl/lib/stat.pl
index 6186f5428d18..1fe8c90d96c0 100644
--- a/gnu/usr.bin/perl/lib/stat.pl
+++ b/gnu/usr.bin/perl/lib/stat.pl
@@ -1,4 +1,4 @@
-;# $Header: /home/cvs/386BSD/ports/lang/perl/lib/stat.pl,v 1.1.1.1 1993/08/23 21:29:53 nate Exp $
+;# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/lib/stat.pl,v 1.1.1.1 1994/09/10 06:27:53 gclarkii Exp $
;# Usage:
;# require 'stat.pl';
diff --git a/gnu/usr.bin/perl/lib/validate.pl b/gnu/usr.bin/perl/lib/validate.pl
index 4b901b6c314e..d54dba4a0d60 100644
--- a/gnu/usr.bin/perl/lib/validate.pl
+++ b/gnu/usr.bin/perl/lib/validate.pl
@@ -1,4 +1,4 @@
-;# $Header: /home/cvs/386BSD/ports/lang/perl/lib/validate.pl,v 1.1.1.1 1993/08/23 21:29:51 nate Exp $
+;# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/lib/validate.pl,v 1.1.1.1 1994/09/10 06:27:53 gclarkii Exp $
;# The validate routine takes a single multiline string consisting of
;# lines containing a filename plus a file test to try on it. (The
diff --git a/gnu/usr.bin/perl/perl/crypt.c b/gnu/usr.bin/perl/perl/crypt.c
index 3e95f452cf7f..a60c30f771f7 100644
--- a/gnu/usr.bin/perl/perl/crypt.c
+++ b/gnu/usr.bin/perl/perl/crypt.c
@@ -36,7 +36,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* from static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; */
-static char rcsid[] = "$Header: /home/ncvs/src/gnu/usr.bin/perl/perl/crypt.c,v 1.1.1.1 1994/09/10 06:27:37 gclarkii Exp $";
+static char rcsid[] = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/crypt.c,v 1.2 1995/05/30 05:02:58 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
diff --git a/gnu/usr.bin/perl/perl/t/base/cond.t b/gnu/usr.bin/perl/perl/t/base/cond.t
index 7d49f4e9b591..69b687033d5e 100755
--- a/gnu/usr.bin/perl/perl/t/base/cond.t
+++ b/gnu/usr.bin/perl/perl/t/base/cond.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/base/cond.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/base/cond.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
# make sure conditional operators work
diff --git a/gnu/usr.bin/perl/perl/t/base/if.t b/gnu/usr.bin/perl/perl/t/base/if.t
index 2a9b82c77e7d..2635eb0d97a1 100755
--- a/gnu/usr.bin/perl/perl/t/base/if.t
+++ b/gnu/usr.bin/perl/perl/t/base/if.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/base/if.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/base/if.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/base/lex.t b/gnu/usr.bin/perl/perl/t/base/lex.t
index cd6321d9f081..0c59d8ab84d7 100755
--- a/gnu/usr.bin/perl/perl/t/base/lex.t
+++ b/gnu/usr.bin/perl/perl/t/base/lex.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/base/lex.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/base/lex.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..18\n";
diff --git a/gnu/usr.bin/perl/perl/t/base/pat.t b/gnu/usr.bin/perl/perl/t/base/pat.t
index 2c8d9a9f2b85..95d9aca91670 100755
--- a/gnu/usr.bin/perl/perl/t/base/pat.t
+++ b/gnu/usr.bin/perl/perl/t/base/pat.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/base/pat.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/base/pat.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/base/term.t b/gnu/usr.bin/perl/perl/t/base/term.t
index c049c5872364..ed057f69e7c6 100755
--- a/gnu/usr.bin/perl/perl/t/base/term.t
+++ b/gnu/usr.bin/perl/perl/t/base/term.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/base/term.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/base/term.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..6\n";
diff --git a/gnu/usr.bin/perl/perl/t/cmd/elsif.t b/gnu/usr.bin/perl/perl/t/cmd/elsif.t
index 0e3457f6ad1f..a80983e02c04 100755
--- a/gnu/usr.bin/perl/perl/t/cmd/elsif.t
+++ b/gnu/usr.bin/perl/perl/t/cmd/elsif.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/cmd/elsif.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/cmd/elsif.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
sub foo {
if ($_[0] == 1) {
diff --git a/gnu/usr.bin/perl/perl/t/cmd/for.t b/gnu/usr.bin/perl/perl/t/cmd/for.t
index 4a0c9226bae8..dc0ffcd68bdc 100755
--- a/gnu/usr.bin/perl/perl/t/cmd/for.t
+++ b/gnu/usr.bin/perl/perl/t/cmd/for.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/cmd/for.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/cmd/for.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..7\n";
diff --git a/gnu/usr.bin/perl/perl/t/cmd/mod.t b/gnu/usr.bin/perl/perl/t/cmd/mod.t
index eeb44d97b5d8..7117ff6c2d1a 100755
--- a/gnu/usr.bin/perl/perl/t/cmd/mod.t
+++ b/gnu/usr.bin/perl/perl/t/cmd/mod.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/cmd/mod.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/cmd/mod.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..7\n";
diff --git a/gnu/usr.bin/perl/perl/t/cmd/switch.t b/gnu/usr.bin/perl/perl/t/cmd/switch.t
index d0d4c932ad0d..fd33fc0a25b0 100755
--- a/gnu/usr.bin/perl/perl/t/cmd/switch.t
+++ b/gnu/usr.bin/perl/perl/t/cmd/switch.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/cmd/switch.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/cmd/switch.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..18\n";
diff --git a/gnu/usr.bin/perl/perl/t/cmd/while.t b/gnu/usr.bin/perl/perl/t/cmd/while.t
index 006e251a9d2e..824c4d46d4e1 100755
--- a/gnu/usr.bin/perl/perl/t/cmd/while.t
+++ b/gnu/usr.bin/perl/perl/t/cmd/while.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/cmd/while.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/cmd/while.t,v 1.1.1.1 1994/09/10 06:27:39 gclarkii Exp $
print "1..10\n";
diff --git a/gnu/usr.bin/perl/perl/t/comp/cmdopt.t b/gnu/usr.bin/perl/perl/t/comp/cmdopt.t
index 3c47130602ca..f2eed8b37401 100755
--- a/gnu/usr.bin/perl/perl/t/comp/cmdopt.t
+++ b/gnu/usr.bin/perl/perl/t/comp/cmdopt.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/comp/cmdopt.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/comp/cmdopt.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..40\n";
diff --git a/gnu/usr.bin/perl/perl/t/comp/decl.t b/gnu/usr.bin/perl/perl/t/comp/decl.t
index f1c84c2190ce..3158a64000cb 100755
--- a/gnu/usr.bin/perl/perl/t/comp/decl.t
+++ b/gnu/usr.bin/perl/perl/t/comp/decl.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/comp/decl.t,v 1.1.1.1 1993/08/23 21:30:07 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/comp/decl.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
# check to see if subroutine declarations work everwhere
diff --git a/gnu/usr.bin/perl/perl/t/comp/multiline.t b/gnu/usr.bin/perl/perl/t/comp/multiline.t
index 78df482d3e7c..eb404c0355c3 100755
--- a/gnu/usr.bin/perl/perl/t/comp/multiline.t
+++ b/gnu/usr.bin/perl/perl/t/comp/multiline.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/comp/multiline.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/comp/multiline.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..5\n";
diff --git a/gnu/usr.bin/perl/perl/t/comp/script.t b/gnu/usr.bin/perl/perl/t/comp/script.t
index 9dcf90195856..c2f6163f0a06 100755
--- a/gnu/usr.bin/perl/perl/t/comp/script.t
+++ b/gnu/usr.bin/perl/perl/t/comp/script.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/comp/script.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/comp/script.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/comp/term.t b/gnu/usr.bin/perl/perl/t/comp/term.t
index 70b23fd8a6ae..d8ce0adb061c 100755
--- a/gnu/usr.bin/perl/perl/t/comp/term.t
+++ b/gnu/usr.bin/perl/perl/t/comp/term.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/comp/term.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/comp/term.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
# tests that aren't important enough for base.term
diff --git a/gnu/usr.bin/perl/perl/t/io/argv.t b/gnu/usr.bin/perl/perl/t/io/argv.t
index 99c593620eee..e0db31da8a34 100755
--- a/gnu/usr.bin/perl/perl/t/io/argv.t
+++ b/gnu/usr.bin/perl/perl/t/io/argv.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/argv.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/argv.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..5\n";
diff --git a/gnu/usr.bin/perl/perl/t/io/dup.t b/gnu/usr.bin/perl/perl/t/io/dup.t
index 8d11eca79973..5462c368e60e 100755
--- a/gnu/usr.bin/perl/perl/t/io/dup.t
+++ b/gnu/usr.bin/perl/perl/t/io/dup.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/dup.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/dup.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..6\n";
diff --git a/gnu/usr.bin/perl/perl/t/io/inplace.t b/gnu/usr.bin/perl/perl/t/io/inplace.t
index b22afdaa4b98..3cd4c06a8632 100755
--- a/gnu/usr.bin/perl/perl/t/io/inplace.t
+++ b/gnu/usr.bin/perl/perl/t/io/inplace.t
@@ -2,7 +2,7 @@
$^I = '.bak';
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/inplace.t,v 1.1.1.1 1993/08/23 21:30:05 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/inplace.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/io/pipe.t b/gnu/usr.bin/perl/perl/t/io/pipe.t
index 791a9c715f85..371d85881c3c 100755
--- a/gnu/usr.bin/perl/perl/t/io/pipe.t
+++ b/gnu/usr.bin/perl/perl/t/io/pipe.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/pipe.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/pipe.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
$| = 1;
print "1..8\n";
diff --git a/gnu/usr.bin/perl/perl/t/io/print.t b/gnu/usr.bin/perl/perl/t/io/print.t
index 11854427410b..67a71c05a2c2 100755
--- a/gnu/usr.bin/perl/perl/t/io/print.t
+++ b/gnu/usr.bin/perl/perl/t/io/print.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/print.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/print.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..16\n";
diff --git a/gnu/usr.bin/perl/perl/t/io/tell.t b/gnu/usr.bin/perl/perl/t/io/tell.t
index 27e69a0fd7ee..3943b68f41cc 100755
--- a/gnu/usr.bin/perl/perl/t/io/tell.t
+++ b/gnu/usr.bin/perl/perl/t/io/tell.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/io/tell.t,v 1.1.1.1 1993/08/23 21:30:06 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/io/tell.t,v 1.1.1.1 1994/09/10 06:27:40 gclarkii Exp $
print "1..13\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/append.t b/gnu/usr.bin/perl/perl/t/op/append.t
index 92c6f48e80c4..38f8627bf7de 100755
--- a/gnu/usr.bin/perl/perl/t/op/append.t
+++ b/gnu/usr.bin/perl/perl/t/op/append.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/append.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/append.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/array.t b/gnu/usr.bin/perl/perl/t/op/array.t
index 39e05e3fbbb4..8e7b5b9ce0c4 100755
--- a/gnu/usr.bin/perl/perl/t/op/array.t
+++ b/gnu/usr.bin/perl/perl/t/op/array.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/array.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/array.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..36\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/auto.t b/gnu/usr.bin/perl/perl/t/op/auto.t
index 5301f934d8ed..9ea0aa86186d 100755
--- a/gnu/usr.bin/perl/perl/t/op/auto.t
+++ b/gnu/usr.bin/perl/perl/t/op/auto.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/auto.t,v 1.1.1.1 1993/08/23 21:30:01 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/auto.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..34\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/chop.t b/gnu/usr.bin/perl/perl/t/op/chop.t
index d691d734105b..89c9411e147f 100755
--- a/gnu/usr.bin/perl/perl/t/op/chop.t
+++ b/gnu/usr.bin/perl/perl/t/op/chop.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/chop.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/chop.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..4\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/cond.t b/gnu/usr.bin/perl/perl/t/op/cond.t
index 054a5ff7f0d7..a263acd57d8b 100755
--- a/gnu/usr.bin/perl/perl/t/op/cond.t
+++ b/gnu/usr.bin/perl/perl/t/op/cond.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/cond.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/cond.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..4\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/delete.t b/gnu/usr.bin/perl/perl/t/op/delete.t
index e4e1fea10658..4796f2294b46 100755
--- a/gnu/usr.bin/perl/perl/t/op/delete.t
+++ b/gnu/usr.bin/perl/perl/t/op/delete.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/delete.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/delete.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
print "1..6\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/do.t b/gnu/usr.bin/perl/perl/t/op/do.t
index 370012c129b1..ca52c0970b7a 100755
--- a/gnu/usr.bin/perl/perl/t/op/do.t
+++ b/gnu/usr.bin/perl/perl/t/op/do.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/do.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/do.t,v 1.1.1.1 1994/09/10 06:27:41 gclarkii Exp $
sub foo1
{
diff --git a/gnu/usr.bin/perl/perl/t/op/each.t b/gnu/usr.bin/perl/perl/t/op/each.t
index 532d1b01f3f4..2057b85a10a2 100755
--- a/gnu/usr.bin/perl/perl/t/op/each.t
+++ b/gnu/usr.bin/perl/perl/t/op/each.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/each.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/each.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/exec.t b/gnu/usr.bin/perl/perl/t/op/exec.t
index 69909f740790..e573830b9f78 100755
--- a/gnu/usr.bin/perl/perl/t/op/exec.t
+++ b/gnu/usr.bin/perl/perl/t/op/exec.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/exec.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/exec.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
$| = 1; # flush stdout
print "1..8\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/exp.t b/gnu/usr.bin/perl/perl/t/op/exp.t
index 2195e54067d6..f3c8d2e3c36d 100755
--- a/gnu/usr.bin/perl/perl/t/op/exp.t
+++ b/gnu/usr.bin/perl/perl/t/op/exp.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/exp.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/exp.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..6\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/flip.t b/gnu/usr.bin/perl/perl/t/op/flip.t
index 74ba5085ac5f..a2f2dbed94b1 100755
--- a/gnu/usr.bin/perl/perl/t/op/flip.t
+++ b/gnu/usr.bin/perl/perl/t/op/flip.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/flip.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/flip.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..8\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/fork.t b/gnu/usr.bin/perl/perl/t/op/fork.t
index 10b54a2a2c5b..9a7df615b125 100755
--- a/gnu/usr.bin/perl/perl/t/op/fork.t
+++ b/gnu/usr.bin/perl/perl/t/op/fork.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/fork.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/fork.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
$| = 1;
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/glob.t b/gnu/usr.bin/perl/perl/t/op/glob.t
index 68b0844cad74..e1afdde5e8f2 100755
--- a/gnu/usr.bin/perl/perl/t/op/glob.t
+++ b/gnu/usr.bin/perl/perl/t/op/glob.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/glob.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/glob.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..4\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/index.t b/gnu/usr.bin/perl/perl/t/op/index.t
index 769314b5e37f..82ee07997586 100755
--- a/gnu/usr.bin/perl/perl/t/op/index.t
+++ b/gnu/usr.bin/perl/perl/t/op/index.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/index.t,v 1.1.1.1 1993/08/23 21:30:01 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/index.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..20\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/int.t b/gnu/usr.bin/perl/perl/t/op/int.t
index 09434b8675a6..be87f5f92f9c 100755
--- a/gnu/usr.bin/perl/perl/t/op/int.t
+++ b/gnu/usr.bin/perl/perl/t/op/int.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/int.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/int.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..4\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/join.t b/gnu/usr.bin/perl/perl/t/op/join.t
index a6678e979011..8b46640105bb 100755
--- a/gnu/usr.bin/perl/perl/t/op/join.t
+++ b/gnu/usr.bin/perl/perl/t/op/join.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/join.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/join.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/list.t b/gnu/usr.bin/perl/perl/t/op/list.t
index 52b2347bfd30..c1d03b425be3 100755
--- a/gnu/usr.bin/perl/perl/t/op/list.t
+++ b/gnu/usr.bin/perl/perl/t/op/list.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/list.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/list.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..27\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/local.t b/gnu/usr.bin/perl/perl/t/op/local.t
index 67396e7cddeb..d2d1224f8861 100755
--- a/gnu/usr.bin/perl/perl/t/op/local.t
+++ b/gnu/usr.bin/perl/perl/t/op/local.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/local.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/local.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
print "1..20\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/magic.t b/gnu/usr.bin/perl/perl/t/op/magic.t
index 1f47a9936ace..da9eb7e9a18a 100755
--- a/gnu/usr.bin/perl/perl/t/op/magic.t
+++ b/gnu/usr.bin/perl/perl/t/op/magic.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/magic.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/magic.t,v 1.1.1.1 1994/09/10 06:27:42 gclarkii Exp $
$| = 1; # command buffering
diff --git a/gnu/usr.bin/perl/perl/t/op/mkdir.t b/gnu/usr.bin/perl/perl/t/op/mkdir.t
index 0290ed4e5bbc..ba9d400f724e 100755
--- a/gnu/usr.bin/perl/perl/t/op/mkdir.t
+++ b/gnu/usr.bin/perl/perl/t/op/mkdir.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/mkdir.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/mkdir.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..7\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/oct.t b/gnu/usr.bin/perl/perl/t/op/oct.t
index 9322cf0e73e1..351cc68e4a09 100755
--- a/gnu/usr.bin/perl/perl/t/op/oct.t
+++ b/gnu/usr.bin/perl/perl/t/op/oct.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/oct.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/oct.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/ord.t b/gnu/usr.bin/perl/perl/t/op/ord.t
index 9d319882d4fe..0ee5610c04ca 100755
--- a/gnu/usr.bin/perl/perl/t/op/ord.t
+++ b/gnu/usr.bin/perl/perl/t/op/ord.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/ord.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/ord.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/pack.t b/gnu/usr.bin/perl/perl/t/op/pack.t
index 1dfaddf370ef..2b81445f6630 100755
--- a/gnu/usr.bin/perl/perl/t/op/pack.t
+++ b/gnu/usr.bin/perl/perl/t/op/pack.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/pack.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/pack.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/push.t b/gnu/usr.bin/perl/perl/t/op/push.t
index 3d738acfbda3..893bc16b6eb6 100755
--- a/gnu/usr.bin/perl/perl/t/op/push.t
+++ b/gnu/usr.bin/perl/perl/t/op/push.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/push.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/push.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
@tests = split(/\n/, <<EOF);
0 3, 0 1 2, 3 4 5 6 7
diff --git a/gnu/usr.bin/perl/perl/t/op/range.t b/gnu/usr.bin/perl/perl/t/op/range.t
index 6214f9527b99..dbcade62e553 100755
--- a/gnu/usr.bin/perl/perl/t/op/range.t
+++ b/gnu/usr.bin/perl/perl/t/op/range.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/range.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/range.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..8\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/read.t b/gnu/usr.bin/perl/perl/t/op/read.t
index 4151e5c6a674..d36c6ac7d50f 100755
--- a/gnu/usr.bin/perl/perl/t/op/read.t
+++ b/gnu/usr.bin/perl/perl/t/op/read.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/read.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/read.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..4\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/repeat.t b/gnu/usr.bin/perl/perl/t/op/repeat.t
index 68c61fc6a05e..60695d957a98 100755
--- a/gnu/usr.bin/perl/perl/t/op/repeat.t
+++ b/gnu/usr.bin/perl/perl/t/op/repeat.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/repeat.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/repeat.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..19\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/s.t b/gnu/usr.bin/perl/perl/t/op/s.t
index 59300209cd39..1ce76a598e77 100755
--- a/gnu/usr.bin/perl/perl/t/op/s.t
+++ b/gnu/usr.bin/perl/perl/t/op/s.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/s.t,v 1.1.1.1 1993/08/23 21:30:01 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/s.t,v 1.1.1.1 1994/09/10 06:27:43 gclarkii Exp $
print "1..51\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/sleep.t b/gnu/usr.bin/perl/perl/t/op/sleep.t
index 81113712d343..b9ca93a339e5 100755
--- a/gnu/usr.bin/perl/perl/t/op/sleep.t
+++ b/gnu/usr.bin/perl/perl/t/op/sleep.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/sleep.t,v 1.1.1.1 1993/08/23 21:30:04 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/sleep.t,v 1.1.1.1 1994/09/10 06:27:45 gclarkii Exp $
print "1..1\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/split.t b/gnu/usr.bin/perl/perl/t/op/split.t
index 63bf3c7c76da..20b969c201eb 100755
--- a/gnu/usr.bin/perl/perl/t/op/split.t
+++ b/gnu/usr.bin/perl/perl/t/op/split.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/split.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/split.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..12\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/sprintf.t b/gnu/usr.bin/perl/perl/t/op/sprintf.t
index cdb4af5a2244..7b822078edd1 100755
--- a/gnu/usr.bin/perl/perl/t/op/sprintf.t
+++ b/gnu/usr.bin/perl/perl/t/op/sprintf.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/sprintf.t,v 1.1.1.1 1993/08/23 21:30:01 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/sprintf.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..1\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/study.t b/gnu/usr.bin/perl/perl/t/op/study.t
index a0fdc4cd273c..4b8eaf72c852 100755
--- a/gnu/usr.bin/perl/perl/t/op/study.t
+++ b/gnu/usr.bin/perl/perl/t/op/study.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/study.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/study.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..24\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/substr.t b/gnu/usr.bin/perl/perl/t/op/substr.t
index 09f312f83762..edeef1bb76cf 100755
--- a/gnu/usr.bin/perl/perl/t/op/substr.t
+++ b/gnu/usr.bin/perl/perl/t/op/substr.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/substr.t,v 1.1.1.1 1993/08/23 21:30:01 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/substr.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..22\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/time.t b/gnu/usr.bin/perl/perl/t/op/time.t
index f8e5545f7b41..3b26bfe53231 100755
--- a/gnu/usr.bin/perl/perl/t/op/time.t
+++ b/gnu/usr.bin/perl/perl/t/op/time.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/time.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/time.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..5\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/undef.t b/gnu/usr.bin/perl/perl/t/op/undef.t
index b4827db0c547..b95cc0c6a531 100755
--- a/gnu/usr.bin/perl/perl/t/op/undef.t
+++ b/gnu/usr.bin/perl/perl/t/op/undef.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/undef.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/undef.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..21\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/unshift.t b/gnu/usr.bin/perl/perl/t/op/unshift.t
index 53d73883822b..3f5ffbdf14e0 100755
--- a/gnu/usr.bin/perl/perl/t/op/unshift.t
+++ b/gnu/usr.bin/perl/perl/t/op/unshift.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/unshift.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/unshift.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..2\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/vec.t b/gnu/usr.bin/perl/perl/t/op/vec.t
index 51344769b6cf..9abe64d95234 100755
--- a/gnu/usr.bin/perl/perl/t/op/vec.t
+++ b/gnu/usr.bin/perl/perl/t/op/vec.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/vec.t,v 1.1.1.1 1993/08/23 21:30:03 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/vec.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..13\n";
diff --git a/gnu/usr.bin/perl/perl/t/op/write.t b/gnu/usr.bin/perl/perl/t/op/write.t
index d17f1951bb76..041ef5a6dc06 100755
--- a/gnu/usr.bin/perl/perl/t/op/write.t
+++ b/gnu/usr.bin/perl/perl/t/op/write.t
@@ -1,6 +1,6 @@
#!./perl
-# $Header: /home/cvs/386BSD/ports/lang/perl/t/op/write.t,v 1.1.1.1 1993/08/23 21:30:02 nate Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/perl/t/op/write.t,v 1.1.1.1 1994/09/10 06:27:46 gclarkii Exp $
print "1..3\n";
diff --git a/gnu/usr.bin/perl/x2p/Makefile b/gnu/usr.bin/perl/x2p/Makefile
index 8057dfbb9ad8..cc6c2fe58dbc 100644
--- a/gnu/usr.bin/perl/x2p/Makefile
+++ b/gnu/usr.bin/perl/x2p/Makefile
@@ -11,9 +11,9 @@ DPADD= ${LIBM}
MAN1+= a2p.1 s2p.1 h2ph.1
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${.CURDIR}/s2p \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 555 ${.CURDIR}/s2p \
${DESTDIR}${BINDIR}
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${.CURDIR}/h2ph \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 555 ${.CURDIR}/h2ph \
${DESTDIR}${BINDIR}
afterinstall:
diff --git a/gnu/usr.bin/perl/x2p/a2p.1 b/gnu/usr.bin/perl/x2p/a2p.1
index 58d8c077fafd..6cbe3d191ca9 100644
--- a/gnu/usr.bin/perl/x2p/a2p.1
+++ b/gnu/usr.bin/perl/x2p/a2p.1
@@ -1,7 +1,10 @@
.rn '' }`
-''' $Header: /home/cvs/386BSD/ports/lang/perl/x2p/a2p.man,v 1.1.1.1 1993/08/23 21:30:10 nate Exp $
+''' $Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/perl/x2p/a2p.1,v 1.1.1.1 1994/09/10 06:27:55 gclarkii Exp $
'''
-''' $Log: a2p.man,v $
+''' $Log: a2p.1,v $
+.\" Revision 1.1.1.1 1994/09/10 06:27:55 gclarkii
+.\" Initial import of Perl 4.046 bmaked
+.\"
.\" Revision 1.1.1.1 1993/08/23 21:30:10 nate
.\" PERL!
.\"
diff --git a/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh b/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh
index e7ef3fdfc324..cdf622f84626 100644
--- a/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh
+++ b/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh
@@ -25,7 +25,7 @@
# {RCS/}.rcsfreeze.ver version number
# {RCS/}.rscfreeze.log log messages, most recent first
-PATH=/bin:/usr/bin:$PATH
+PATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
export PATH
DATE=`date` || exit
diff --git a/gnu/usr.bin/rcs/rcstest b/gnu/usr.bin/rcs/rcstest
index 6eca1f55f1ca..7363a6d26602 100755
--- a/gnu/usr.bin/rcs/rcstest
+++ b/gnu/usr.bin/rcs/rcstest
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# Test RCS's functions.
# The RCS commands are searched for in the PATH as usual;
@@ -18,7 +18,7 @@
# $Id: rcstest,v 1.1.1.1 1993/06/18 04:22:10 jkh Exp $
-# Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
+# Copyright 1990, 1991 by Paul Eggert
# Distributed under license by the Free Software Foundation, Inc.
#
# This file is part of RCS.
@@ -34,23 +34,13 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with RCS; see the file COPYING.
-# If not, write to the Free Software Foundation,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with RCS; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Report problems and direct all questions to:
#
# rcs-bugs@cs.purdue.edu
-# The Makefile overrides the following defaults.
-: ${ALL_CFLAGS=-Dhas_conf_h}
-: ${CC=cc}
-: ${DIFF=diff}
-# : ${LDFLAGS=} ${LIBS=} tickles old shell bug
-
-CL="$CC $ALL_CFLAGS $LDFLAGS -o a.out"
-L=$LIBS
-
RCSINIT=-x
export RCSINIT
@@ -65,26 +55,26 @@ case $1 in
*) echo >&2 "$0: usage: $0 [-v]"; exit 2
esac
-if test -d RCS
-then rmdir=:
-else rmdir=rmdir; mkdir RCS || exit
-fi
+test -d RCS || {
+ echo >&2 "$0: RCS: not a directory; please \`mkdir RCS' first."
+ exit 1
+}
rm -f a.* $RCSfile $RCS_alt $lockfile &&
echo 1.1 >a.11 &&
echo 1.1.1.1 >a.3x1 &&
echo 1.2 >a.12 || { echo "#initialization failed"; exit 2; }
-case "`$DIFF -c a.11 a.3x1`" in
-*!\ 1.1.1.1)
- diff="$DIFF -c";;
+case `diff -c a.11 a.3x1` in
+*'! 1.1.1.1')
+ diff='diff -c';;
*)
- echo "#warning: $DIFF -c does not work, so diagnostics may be cryptic"
- diff=$DIFF
+ echo "#warning: diff -c does not work, so diagnostics may be cryptic"
+ diff=diff
esac
rcs -i -L -ta.11 $q a.c &&
-test -r $RCSfile || {
+<$RCSfile || {
echo "#rcs -i -L failed; perhaps RCS is not properly installed."
exit 1
}
@@ -94,7 +84,7 @@ rm -f $RCSfile || exit 2
cp a.11 a.c &&
ci -ta.11 -mm $q a.c &&
-test -r $RCSfile &&
+<$RCSfile &&
rcs -L $q a.c || { echo "#ci+rcs -L failed"; exit 1; }
test ! -f a.c || { echo "#ci did not remove working file"; exit 1; }
for l in '' '-l'
@@ -109,7 +99,6 @@ ci -mm $q a.c &&
co $q a.c &&
$diff a.12 a.c || { echo "#ci+co failed"; exit 1; }
-rm -f a.c &&
co -r1.1 $q a.c &&
$diff a.11 a.c || { echo "#can't retrieve first revision"; exit 1; }
@@ -119,24 +108,21 @@ ci -r1.1.1 -mm $q a.c &&
co -r1.1.1.1 $q a.c &&
$diff a.3x1 a.c || { echo "#branches failed"; exit 1; }
-rm -f a.c &&
co -l $q a.c &&
ci -f -mm $q a.c &&
co -r1.3 $q a.c &&
$diff a.12 a.c || { echo "#(co -l; ci -f) failed"; exit 1; }
-rm -f a.c &&
co -l $q a.c &&
echo 1.4 >a.c &&
ci -l -mm $q a.c &&
echo error >a.c &&
ci -mm $q a.c || { echo "#ci -l failed"; exit 1; }
-rm -f a.c &&
co -l $q a.c &&
echo 1.5 >a.c &&
ci -u -mm $q a.c &&
-test -r a.c || { echo "#ci -u didn't create a working file"; exit 1; }
+<a.c || { echo "#ci -u didn't create a working file"; exit 1; }
rm -f a.c &&
echo error >a.c || exit 2
ci -mm $q a.c 2>/dev/null && { echo "#ci -u didn't unlock the file"; exit 1; }
@@ -180,28 +166,42 @@ case $LOGNAME in
esac
esac
esac
-
-
-# Get the date of the previous revision in UTC.
-date=`rlog -r a.c | sed -n '/^date: /{ s///; s/;.*//; p; q; }'` || exit
-case $date in
-[0-9][0-9][0-9]*[0-9]/[0-1][0-9]/[0-3][0-9]\ [0-2][0-9]:[0-5][0-9]:[0-6][0-9]);;
-*) echo >&2 "$0: $date: bad rlog date output"; exit 1
+date=`date -u 2>/dev/null` ||
+date=`TZ=GMT0 date 2>/dev/null` ||
+date=`TZ= date` || exit 2
+set $date
+case $2 in
+Jan) m=01;; Feb) m=02;; Mar) m=03;; Apr) m=04;; May) m=05;; Jun) m=06;;
+Jul) m=07;; Aug) m=08;; Sep) m=09;; Oct) m=10;; Nov) m=11;; Dec) m=12;;
+*) echo >&2 "$0: $2: unknown month name"; exit 2
esac
-PWD=`pwd` && export PWD &&
-rm -f a.c &&
+case $3 in
+?) d=0$3;;
+*) d=$3
+esac
+case $6 in
+[0-9][0-9][0-9][0-9]*) D=$6/$m/$d;;
+*)
+ case $5 in
+ [0-9][0-9][0-9][0-9]*) D=$5/$m/$d;;
+ *) echo >&2 "$0: bad date format: $date"; exit 2
+ esac
+esac
+T=$4
+case $PWD in
+'') PWD=`pwd`
+esac &&
co -l $q a.c &&
sed 's/@/$/g' >a.kv <<EOF
@Author: w @
-@Date: $date @
-@Header: $PWD$SLASH$RCSfile 2.1 $date w s @
-@Id: a.c 2.1 $date w s @
+@Date: $D $T @
+@Header: $PWD$SLASH$RCSfile 2.1 $D $T w s @
+@Id: a.c 2.1 $D $T w s @
@Locker: @
- * @Log: a.c @
- * Revision 2.1 $date w
+@Log: a.c @
+ * Revision 2.1 $D $T w
* m
*
-@Name: Oz @
@RCSfile: a.c @
@Revision: 2.1 @
@Source: $PWD$SLASH$RCSfile @
@@ -210,28 +210,25 @@ EOF
test $? = 0 &&
sed 's/:.*\$/$/' a.kv >a.k &&
sed -e 's/w s [$]/w s '"$me"' $/' -e 's/[$]Locker: /&'"$me/" a.kv >a.kvl &&
-sed s/Oz//g a.kv >a.e &&
-sed s/Oz/N/g a.kv >a.N &&
-sed -e '/\$/!d' -e 's/\$$/: old $/' a.k >a.o &&
+sed -e '/^\$/!d' -e 's/\$$/: old $/' a.k >a.o &&
sed -e 's/\$[^ ]*: //' -e 's/ \$//' a.kv >a.v &&
cp a.o a.c &&
-ci -d"$date" -nOz -ss -ww -u2.1 -mm $q a.c &&
+ci -d"$date" -ss -ww -u2.1 -mm $q a.c &&
$diff a.kv a.c || { echo "#keyword expansion failed"; exit 1; }
-co -pOz -ko $q a.c >a.oo &&
+co -p -ko $q a.c >a.oo &&
$diff a.o a.oo || { echo "#co -p -ko failed"; exit 1; }
-cp a.kv a.o && cp a.o a.b || exit 2
-rcs -oOz $q a.c &&
+cp a.kv a.o || exit 2
+rcs -o2.1 $q a.c &&
rcs -l $q a.c &&
ci -k -u $q a.c &&
$diff a.kv a.c || { echo "#ci -k failed"; exit 1; }
-sed -n 's/^[^$]*\$/$/p' a.kv >a.i &&
+sed '/^[^$]/d' a.kv >a.i &&
ident a.c >a.i1 &&
sed -e 1d -e 's/^[ ]*//' a.i1 >a.i2 &&
$diff a.i a.i2 || { echo "#ident failed"; exit 1; }
rcs -i $q a.c 2>/dev/null && { echo "#rcs -i permitted existing file"; exit 1; }
-rm -f a.c &&
co -l $q a.c &&
echo 2.2 >a.c &&
ci -mm $q a.c &&
@@ -262,73 +259,40 @@ rcs -nN:1.1 $q a.c &&
co -rN $q a.c &&
$diff a.11 a.c || { echo "#rcs -n failed"; exit 1; }
-rm -f a.c &&
rcs -NN:2.1 $q a.c &&
co -rN $q a.c &&
-$diff a.N a.c || { echo "#rcs -N failed"; exit 1; }
+$diff a.kv a.c || { echo "#rcs -N failed"; exit 1; }
-rm -f a.c &&
co -l $q a.c &&
-echo ':::$''Log$' >a.c &&
+rcs -c':::' $q a.c &&
+echo '$''Log$' >a.c &&
ci -u -mm $q a.c &&
-test " `sed '$!d' a.c`" = ' :::' || { echo "#comment leader failed"; exit 1; }
+test " `sed '$!d' a.c`" = ' :::' || { echo "#rcs -c failed"; exit 1; }
-rm -f a.c &&
rcs -o2.2: $q a.c &&
co $q a.c &&
-$diff a.e a.c || { echo "#rcs -o failed"; exit 1; }
+$diff a.kv a.c || { echo "#rcs -o failed"; exit 1; }
-rcsdiff -r1.1 -rOz $q a.c >a.0
+rcsdiff -r1.1 -r2.1 $q a.c >a.0
case $? in
1) ;;
*) echo "#rcsdiff bad status"; exit 1
esac
-$DIFF a.11 a.kv >a.1
+diff a.11 a.kv >a.1
$diff a.0 a.1 || { echo "#rcsdiff failed"; exit 1; }
rcs -l2.1 $q a.c || { echo "#rcs -l2.1 failed"; exit 1; }
-for i in b k kv kvl o v
+for i in k kv kvl o v
do
rm -f a.c &&
cp a.$i a.c &&
- rcsdiff -k$i -rOz $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
+ rcsdiff -k$i $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
done
co -p1.1 -ko $q a.c >a.t &&
$diff a.11 a.t || { echo "#co -p1.1 -ko failed"; exit 1; }
rcs -u2.1 $q a.c || { echo "#rcs -u2.1 failed"; exit 1; }
rm -f a.c &&
-rcsclean $q a.c &&
-rcsclean -u $q a.c || { echo "#rcsclean botched a nonexistent file"; exit 1; }
-
-rm -f a.c &&
-co $q a.c &&
-rcsclean -n $q a.c &&
-rcsclean -n -u $q a.c &&
-test -f a.c || { echo "#rcsclean -n removed a file"; exit 1; }
-
-rm -f a.c &&
-co $q a.c &&
-rcsclean $q a.c &&
-test ! -f a.c || { echo "#rcsclean missed an unlocked file"; exit 1; }
-
-rm -f a.c &&
-co -l $q a.c &&
-rcsclean $q a.c &&
-test -f a.c || { echo "#rcsclean removed a locked file"; exit 1; }
-rcsclean -u $q a.c &&
-test ! -f a.c || {
- echo "#rcsclean -u missed an unchanged locked file"; exit 1;
-}
-
-rm -f a.c &&
-co -l $q a.c &&
-echo change >>a.c &&
-rcsclean $q a.c &&
-rcsclean $q -u a.c &&
-test -f a.c || { echo "#rcsclean removed a changed file"; exit 1; }
-
-rm -f a.c &&
co -l $q a.c &&
cat >a.c <<'EOF'
2.2
@@ -360,7 +324,7 @@ b1
c
d1
EOF
-rcsmerge -E -r2.2 -r2.3 $q a.c
+rcsmerge -r2.2 -r2.3 $q a.c
case $? in
0)
if $diff a.0 a.c >/dev/null
@@ -379,36 +343,16 @@ case $? in
echo "#rcsmerge bad status"; exit 1
esac
-# Avoid `tr' if possible; it's not portable, and it can't handle null bytes.
-# Our substitute exclusive-ORs with '\n';
-# this ensures null bytes on output, which is even better than `tr',
-# since some diffs think a file is binary only if it contains null bytes.
-cat >a.c <<'EOF'
-#include <stdio.h>
-int main() {
- int c;
- while ((c=getchar()) != EOF)
- putchar(c ^ '\n');
- return 0;
-}
-EOF
-tr=tr
-if (rm -f a.exe a.out && $CL a.c $L >&2) >/dev/null 2>&1
-then
- if test -s a.out
- then tr=./a.out
- elif test -s a.exe
- then tr=./a.exe
- fi
-fi
+nl='
+'
{
- co -p $q a.c | $tr '\012' '\200' >a.24 &&
+ co -p $q a.c | tr "$nl" '\200' >a.24 &&
cp a.24 a.c &&
ciOut=`(ci -l -mm $q a.c 2>&1)` &&
case $ciOut in
?*) echo >&2 "$ciOut"
esac &&
- co -p $q a.c | $tr '\200' '\012' >a.c &&
+ co -p $q a.c | tr '\200' "$nl" >a.c &&
rcsdiff -r2.3 $q a.c >/dev/null &&
echo 2.5 >a.c &&
@@ -434,15 +378,15 @@ locks: strict
access list:
symbolic names:
N: 2.1
- Oz: 2.1
n: 1.8
+comment leader: ":::"
keyword substitution: kv
total revisions: 13; selected revisions: 1
description:
1.1
----------------------------
revision 2.1
-date: $date; author: w; state: s; lines: +14 -1
+date: $D $T; author: w; state: s; lines: +13 -1
=============================================================================
EOF
test $? = 0 || { echo "#rlog failed"; exit 1; }
@@ -450,5 +394,4 @@ test $? = 0 || { echo "#rlog failed"; exit 1; }
test ! -f $lockfile || { echo "#lock file not removed"; exit 1; }
-rm -f a.* $RCSfile $RCS_alt
-$rmdir RCS
+exec rm -f a.* $RCSfile $RCS_alt
diff --git a/gnu/usr.bin/send-pr/Makefile b/gnu/usr.bin/send-pr/Makefile
index a6e4d222f975..a3a765be3993 100644
--- a/gnu/usr.bin/send-pr/Makefile
+++ b/gnu/usr.bin/send-pr/Makefile
@@ -4,15 +4,11 @@
MAN1= send-pr.1
SUBMITTERS= current-users
-RELEASE= `uname -rsm`
-RELEASE_EV!= uname -rsm
+RELEASE!= uname -rsm
CLEANFILES+= send-pr send-pr.el
SUBDIR+= doc
-LINKS= ${BINDIR}/send-pr ${BINDIR}/sendbug
-MLINKS= send-pr.1 sendbug.1
-
all: send-pr _PROGSUBDIR
send-pr: send-pr.sh Makefile
@@ -23,14 +19,14 @@ send-pr: send-pr.sh Makefile
send-pr.el: send-pr-el.in Makefile
sed -e 's,@DATADIR@,/etc,g' \
- -e 's/@DEFAULT_RELEASE@/$(RELEASE_EV)/g' \
+ -e 's/@DEFAULT_RELEASE@/$(RELEASE)/g' \
-e 's/"unknown"/"$(SUBMITTERS)"/g' \
${.ALLSRC:N*Makefile} > ${.TARGET}
beforeinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
send-pr ${DESTDIR}${BINDIR}/send-pr
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 0644 \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 0644 \
${.CURDIR}/categories ${DESTDIR}/etc/gnats/freefall
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/send-pr/send-pr.1 b/gnu/usr.bin/send-pr/send-pr.1
index af29f44a11e9..3717ebd90c17 100644
--- a/gnu/usr.bin/send-pr/send-pr.1
+++ b/gnu/usr.bin/send-pr/send-pr.1
@@ -237,6 +237,15 @@ for installation instructions.
.I Reporting Problems Using send-pr
(also installed as the GNU Info file
.BR send-pr.info ).
+.LP
+.BR gnats (l),
+.BR query-pr (1),
+.BR edit-pr (1),
+.BR gnats (8),
+.BR queue-pr (8),
+.BR at-pr (8),
+.BR mkcat (8),
+.BR mkdist (8).
.SH AUTHORS
Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus
Support)
diff --git a/gnu/usr.bin/sort/Makefile b/gnu/usr.bin/sort/Makefile
index 73d919cf5eb9..78eb30de1716 100644
--- a/gnu/usr.bin/sort/Makefile
+++ b/gnu/usr.bin/sort/Makefile
@@ -1,6 +1,11 @@
PROG= sort
-SRCS= sort.c error.c version.c long-options.c getopt.c getopt1.c xstrtod.c
+SRCS= sort.c error.c version.c long-options.c getopt.c getopt1.c
+
+CFLAGS+=-I${.CURDIR} -DDIRENT=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_LONG_DOUBLE=1 \
+ -DHAVE_ST_BLKSIZE=1 -DHAVE_VPRINTF=1 -DRETSIGTYPE=void \
+ -DSTDC_HEADERS=1 -DHAVE_STRERROR=1 -DHAVE_FCNTL_H=1 \
+ -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRING_H=1 \
+ -DHAVE_UNISTD_H=1
-CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/sort/error.c b/gnu/usr.bin/sort/error.c
index 21a9ca4df64d..611f220d07d2 100644
--- a/gnu/usr.bin/sort/error.c
+++ b/gnu/usr.bin/sort/error.c
@@ -1,5 +1,5 @@
/* error.c -- error handler for noninteractive utilities
- Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,55 +15,53 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+/* Written by David MacKenzie. */
#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
#endif
#include <stdio.h>
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-# if __STDC__
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-# else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start(args)
-# endif
-#else
-# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
-# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
-#endif
+#ifdef HAVE_VPRINTF
-#if STDC_HEADERS || _LIBC
-# include <stdlib.h>
-# include <string.h>
-#else
-void exit ();
-#endif
+#if __STDC__
+#include <stdarg.h>
+#define VA_START(args, lastarg) va_start(args, lastarg)
+#else /* !__STDC__ */
+#include <varargs.h>
+#define VA_START(args, lastarg) va_start(args)
+#endif /* !__STDC__ */
-/* This variable is incremented each time `error' is called. */
-unsigned int error_message_count;
+#else /* !HAVE_VPRINTF */
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-void (*error_print_progname) () = NULL;
+#ifdef HAVE_DOPRNT
+#define va_alist args
+#define va_dcl int args;
+#else /* !HAVE_DOPRNT */
+#define va_alist a1, a2, a3, a4, a5, a6, a7, a8
+#define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
+#endif /* !HAVE_DOPRNT */
-#ifdef _LIBC
-#define program_name program_invocation_name
-#endif
+#endif /* !HAVE_VPRINTF */
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#else /* !STDC_HEADERS */
+void exit ();
+#endif /* !STDC_HEADERS */
-/* The calling program should define program_name and set it to the
- name of the executing program. */
extern char *program_name;
-#if HAVE_STRERROR || _LIBC
-# ifndef strerror /* On some systems, strerror is a macro */
-char *strerror ();
-# endif
-#else
+#ifndef HAVE_STRERROR
static char *
private_strerror (errnum)
int errnum;
@@ -75,51 +73,40 @@ private_strerror (errnum)
return "Unknown system error";
}
#define strerror private_strerror
-#endif
+#endif /* !HAVE_STRERROR */
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
/* VARARGS */
-
void
-#if defined(VA_START) && __STDC__
-error (int status, int errnum, const char *message, ...)
-#else
+#if defined (HAVE_VPRINTF) && __STDC__
+error (int status, int errnum, char *message, ...)
+#else /* !HAVE_VPRINTF or !__STDC__ */
error (status, errnum, message, va_alist)
int status;
int errnum;
char *message;
va_dcl
-#endif
+#endif /* !HAVE_VPRINTF or !__STDC__ */
{
-#ifdef VA_START
+#ifdef HAVE_VPRINTF
va_list args;
-#endif
+#endif /* HAVE_VPRINTF */
- if (error_print_progname)
- (*error_print_progname) ();
- else
- {
- fflush (stdout);
- fprintf (stderr, "%s: ", program_name);
- }
-
-#ifdef VA_START
+ fprintf (stderr, "%s: ", program_name);
+#ifdef HAVE_VPRINTF
VA_START (args, message);
-# if HAVE_VPRINTF || _LIBC
vfprintf (stderr, message, args);
-# else
- _doprnt (message, args, stderr);
-# endif
va_end (args);
-#else
+#else /* !HAVE_VPRINTF */
+#ifdef HAVE_DOPRNT
+ _doprnt (message, &args, stderr);
+#else /* !HAVE_DOPRNT */
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif
-
- ++error_message_count;
-
+#endif /* !HAVE_DOPRNT */
+#endif /* !HAVE_VPRINTF */
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
diff --git a/gnu/usr.bin/sort/getopt.c b/gnu/usr.bin/sort/getopt.c
index 8bcf5594571c..7a4673b8d8db 100644
--- a/gnu/usr.bin/sort/getopt.c
+++ b/gnu/usr.bin/sort/getopt.c
@@ -3,7 +3,7 @@
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -20,17 +20,18 @@
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-#define _NO_PROTO
-#endif
-
#ifdef HAVE_CONFIG_H
+#if defined (emacs) || defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
#endif
-#if !defined (__STDC__) || !__STDC__
+#ifndef __STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
@@ -38,6 +39,11 @@
#endif
#endif
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
@@ -59,16 +65,10 @@
#include <stdlib.h>
#endif /* GNU C library. */
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-#ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-#else
-# define _(msgid) (msgid)
-#endif
-#endif
+/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
+ long-named option. Because this is not POSIX.2 compliant, it is
+ being phased out. */
+/* #define GETOPT_COMPAT */
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
@@ -92,7 +92,7 @@
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
-char *optarg = NULL;
+char *optarg = 0;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
@@ -162,9 +162,6 @@ static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
@@ -195,18 +192,19 @@ my_index (str, chr)
}
/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
+ If not using GCC, it is ok not to declare it.
+ (Supposedly there are some machines where it might get a warning,
+ but changing this conditional to __STDC__ is too risky.) */
#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-#if !defined (__STDC__) || !__STDC__
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-#endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
+#ifdef IN_GCC
+#include "gstddef.h"
+#else
+#include <stddef.h>
+#endif
+extern size_t strlen (const char *);
+#endif
+
+#endif /* GNU C library. */
/* Handle permutation of arguments. */
@@ -281,42 +279,6 @@ exchange (argv)
first_nonopt += (optind - last_nonopt);
last_nonopt = optind;
}
-
-/* Initialize the internal data when the first call is made. */
-
-static const char *
-_getopt_initialize (optstring)
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind = 1;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
- return optstring;
-}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
@@ -383,18 +345,41 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
int *longind;
int long_only;
{
- optarg = NULL;
+ int option_index;
+
+ optarg = 0;
+
+ /* Initialize the internal data when the first call is made.
+ Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
if (optind == 0)
{
- optstring = _getopt_initialize (optstring);
- optind = 1; /* Don't scan ARGV[0], the program name. */
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (getenv ("POSIXLY_CORRECT") != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
}
if (nextchar == NULL || *nextchar == '\0')
{
- /* Advance to the next ARGV-element. */
-
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
@@ -405,16 +390,21 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else if (last_nonopt != optind)
first_nonopt = optind;
- /* Skip any additional non-options
+ /* Now skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
- && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ && (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[optind][0] != '+' || argv[optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
optind++;
last_nonopt = optind;
}
- /* The special ARGV-element `--' means premature end of options.
+ /* Special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
@@ -447,7 +437,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
- if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ if ((argv[optind][0] != '-' || argv[optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[optind][0] != '+' || argv[optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
{
if (ordering == REQUIRE_ORDER)
return EOF;
@@ -456,53 +451,36 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
/* We have found another option-ARGV-element.
- Skip the initial punctuation. */
+ Start decoding its characters. */
nextchar = (argv[optind] + 1
+ (longopts != NULL && argv[optind][1] == '-'));
}
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2]
- || !my_index (optstring, argv[optind][1])))))
+ && ((argv[optind][0] == '-'
+ && (argv[optind][1] == '-' || long_only))
+#ifdef GETOPT_COMPAT
+ || argv[optind][0] == '+'
+#endif /* GETOPT_COMPAT */
+ ))
{
- char *nameend;
const struct option *p;
- const struct option *pfound = NULL;
+ char *s = nextchar;
int exact = 0;
int ambig = 0;
+ const struct option *pfound = NULL;
int indfound;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-#ifdef lint
- indfound = 0; /* Avoid spurious compiler warning. */
-#endif
+ while (*s && *s != '=')
+ s++;
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
+ /* Test all options for either exact match or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name;
+ p++, option_index++)
+ if (!strncmp (p->name, nextchar, s - nextchar))
{
- if (nameend - nextchar == strlen (p->name))
+ if (s - nextchar == strlen (p->name))
{
/* Exact match found. */
pfound = p;
@@ -517,14 +495,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
indfound = option_index;
}
else
- /* Second or later nonexact match found. */
+ /* Second nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+ fprintf (stderr, "%s: option `%s' is ambiguous\n",
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
@@ -535,26 +513,27 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
option_index = indfound;
optind++;
- if (*nameend)
+ if (*s)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
- optarg = nameend + 1;
+ optarg = s + 1;
else
{
if (opterr)
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
-
+ {
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ "%s: option `--%s' doesn't allow an argument\n",
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ "%s: option `%c%s' doesn't allow an argument\n",
+ argv[0], argv[optind - 1][0], pfound->name);
+ }
nextchar += strlen (nextchar);
return '?';
}
@@ -566,9 +545,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
+ fprintf (stderr, "%s: option `%s' requires an argument\n",
+ argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
@@ -583,23 +561,25 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
return pfound->val;
}
-
/* Can't find it as a long option. If this is not getopt_long_only,
or the option starts with '--' or is not a valid short
option, then it's an error.
Otherwise interpret it as a short option. */
if (!long_only || argv[optind][1] == '-'
+#ifdef GETOPT_COMPAT
+ || argv[optind][0] == '+'
+#endif /* GETOPT_COMPAT */
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
{
if (argv[optind][1] == '-')
/* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+ fprintf (stderr, "%s: unrecognized option `--%s'\n",
argv[0], nextchar);
else
/* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+ fprintf (stderr, "%s: unrecognized option `%c%s'\n",
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
@@ -608,7 +588,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
}
- /* Look at and handle the next short option-character. */
+ /* Look at and handle the next option-character. */
{
char c = *nextchar++;
@@ -622,13 +602,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (opterr)
{
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
+#if 0
+ if (c < 040 || c >= 0177)
+ fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
argv[0], c);
else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
+ fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
+#else
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
+#endif
}
optopt = c;
return '?';
@@ -644,7 +627,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optind++;
}
else
- optarg = NULL;
+ optarg = 0;
nextchar = NULL;
}
else
@@ -661,10 +644,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (opterr)
{
+#if 0
+ fprintf (stderr, "%s: option `-%c' requires an argument\n",
+ argv[0], c);
+#else
/* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
+ fprintf (stderr, "%s: option requires an argument -- %c\n",
+ argv[0], c);
+#endif
}
optopt = c;
if (optstring[0] == ':')
diff --git a/gnu/usr.bin/sort/getopt.h b/gnu/usr.bin/sort/getopt.h
index 4ac33b71824d..45541f5ac0f9 100644
--- a/gnu/usr.bin/sort/getopt.h
+++ b/gnu/usr.bin/sort/getopt.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -76,7 +76,7 @@ extern int optopt;
struct option
{
-#if defined (__STDC__) && __STDC__
+#if __STDC__
const char *name;
#else
char *name;
@@ -94,15 +94,15 @@ struct option
#define required_argument 1
#define optional_argument 2
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+#if __STDC__
+#if defined(__GNU_LIBRARY__)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
+#endif /* not __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
@@ -120,7 +120,7 @@ extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
-#endif /* __STDC__ */
+#endif /* not __STDC__ */
#ifdef __cplusplus
}
diff --git a/gnu/usr.bin/sort/getopt1.c b/gnu/usr.bin/sort/getopt1.c
index 4580211cfac3..f784b5757c59 100644
--- a/gnu/usr.bin/sort/getopt1.c
+++ b/gnu/usr.bin/sort/getopt1.c
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -17,12 +17,19 @@
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
+#if defined (emacs) || defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
#endif
#include "getopt.h"
-#if !defined (__STDC__) || !__STDC__
+#ifndef __STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
diff --git a/gnu/usr.bin/sort/long-options.c b/gnu/usr.bin/sort/long-options.c
index dd7a8ca14822..85876677a1b1 100644
--- a/gnu/usr.bin/sort/long-options.c
+++ b/gnu/usr.bin/sort/long-options.c
@@ -1,5 +1,5 @@
/* Utility to accept --help and --version options as unobtrusively as possible.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,11 +18,21 @@
/* Jim Meyering (meyering@comco.com) */
#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
#endif
#include <stdio.h>
#include <getopt.h>
+#include <sys/types.h>
+#include "system.h"
+#include "version.h"
#include "long-options.h"
static struct option const long_options[] =
@@ -36,11 +46,9 @@ static struct option const long_options[] =
Be careful not to gobble up `--'. */
void
-parse_long_options (argc, argv, command_name, version_string, usage)
+parse_long_options (argc, argv, usage)
int argc;
char **argv;
- const char *command_name;
- const char *version_string;
void (*usage)();
{
int c;
@@ -59,10 +67,10 @@ parse_long_options (argc, argv, command_name, version_string, usage)
switch (c)
{
case 'h':
- (*usage) (0);
+ usage (0);
case 'v':
- printf ("%s - %s\n", command_name, version_string);
+ printf ("%s\n", version_string);
exit (0);
default:
diff --git a/gnu/usr.bin/sort/long-options.h b/gnu/usr.bin/sort/long-options.h
index 986a52d0d47c..9d1a9c73a393 100644
--- a/gnu/usr.bin/sort/long-options.h
+++ b/gnu/usr.bin/sort/long-options.h
@@ -1,10 +1 @@
-#undef __P
-#if defined (__STDC__) && __STDC__
-#define __P(args) args
-#else
-#define __P(args) ()
-#endif
-
-void
- parse_long_options __P ((int _argc, char **_argv, const char *_command_name,
- const char *_version_string, void (*_usage) (int)));
+void parse_long_options ();
diff --git a/gnu/usr.bin/sort/sort.1 b/gnu/usr.bin/sort/sort.1
index e9f4b1ed290c..17ea03f62acc 100644
--- a/gnu/usr.bin/sort/sort.1
+++ b/gnu/usr.bin/sort/sort.1
@@ -1,4 +1,4 @@
-.TH SORT 1 "GNU Text Utilities" "FSF" \" -*- nroff -*-
+.TH SORT 1 \" -*- nroff -*-
.SH NAME
sort \- sort lines of text files
.SH SYNOPSIS
@@ -192,7 +192,7 @@ option is taken to apply to both the \fI+pos\fP and the \fI\-pos\fP
parts of a key specification. Keys may span multiple fields.
.PP
In addition, when GNU
-.B sort
+.B join
is invoked with exactly one argument, the following options are recognized:
.TP
.I "\-\-help"
diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c
index 5a93de6fa621..74d4b466ffc5 100644
--- a/gnu/usr.bin/sort/sort.c
+++ b/gnu/usr.bin/sort/sort.c
@@ -1,5 +1,5 @@
/* sort - sort lines of text (with all kinds of options).
- Copyright (C) 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation
+ Copyright (C) 1988, 1991 Free Software Foundation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,13 +13,22 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Written December 1988 by Mike Haertel.
The author may be reached (Email) at the address mike@gnu.ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
/* Get isblank from GNU libc. */
#define _GNU_SOURCE
@@ -27,16 +36,10 @@
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "system.h"
-#include "version.h"
#include "long-options.h"
-#include "error.h"
-#include "xstrtod.h"
-#ifdef HAVE_LIMITS_H
+#ifdef _POSIX_VERSION
#include <limits.h>
#else
#ifndef UCHAR_MAX
@@ -49,73 +52,16 @@ char *realloc ();
void free ();
#endif
-/* Undefine, to avoid warning about redefinition on some systems. */
-#undef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
+void error ();
+static void usage ();
+#define min(a, b) ((a) < (b) ? (a) : (b))
#define UCHAR_LIM (UCHAR_MAX + 1)
#define UCHAR(c) ((unsigned char) (c))
-#ifndef DEFAULT_TMPDIR
-#define DEFAULT_TMPDIR "/tmp"
-#endif
-
/* The kind of blanks for '-b' to skip in various options. */
enum blanktype { bl_start, bl_end, bl_both };
-/* Lines are held in core as counted strings. */
-struct line
-{
- char *text; /* Text of the line. */
- int length; /* Length not including final newline. */
- char *keybeg; /* Start of first key. */
- char *keylim; /* Limit of first key. */
-};
-
-/* Arrays of lines. */
-struct lines
-{
- struct line *lines; /* Dynamically allocated array of lines. */
- int used; /* Number of slots used. */
- int alloc; /* Number of slots allocated. */
- int limit; /* Max number of slots to allocate. */
-};
-
-/* Input buffers. */
-struct buffer
-{
- char *buf; /* Dynamically allocated buffer. */
- int used; /* Number of bytes used. */
- int alloc; /* Number of bytes allocated. */
- int left; /* Number of bytes left after line parsing. */
-};
-
-struct keyfield
-{
- int sword; /* Zero-origin 'word' to start at. */
- int schar; /* Additional characters to skip. */
- int skipsblanks; /* Skip leading white space at start. */
- int eword; /* Zero-origin first word after field. */
- int echar; /* Additional characters in field. */
- int skipeblanks; /* Skip trailing white space at finish. */
- int *ignore; /* Boolean array of characters to ignore. */
- char *translate; /* Translation applied to characters. */
- int numeric; /* Flag for numeric comparison. Handle
- strings of digits with optional decimal
- point, but no exponential notation. */
- int general_numeric; /* Flag for general, numeric comparison.
- Handle numbers in exponential notation. */
- int month; /* Flag for comparison by month name. */
- int reverse; /* Reverse the sense of comparison. */
- struct keyfield *next; /* Next keyfield to try. */
-};
-
-struct month
-{
- char *name;
- int val;
-};
-
/* The name this program was run with. */
char *program_name;
@@ -136,7 +82,11 @@ static char fold_toupper[UCHAR_LIM];
/* Table mapping 3-letter month names to integers.
Alphabetic order allows binary search. */
-static struct month const monthtab[] =
+static struct month
+{
+ char *name;
+ int val;
+} const monthtab[] =
{
{"APR", 4},
{"AUG", 8},
@@ -157,17 +107,17 @@ static struct month const monthtab[] =
/* Initial buffer size for in core sorting. Will not grow unless a
line longer than this is seen. */
-static int sortalloc = 512 * 1024;
+static int sortalloc = 524288;
/* Initial buffer size for in core merge buffers. Bear in mind that
up to NMERGE * mergealloc bytes may be allocated for merge buffers. */
-static int mergealloc = 16 * 1024;
+static int mergealloc = 16384;
/* Guess of average line length. */
static int linelength = 30;
/* Maximum number of elements for the array(s) of struct line's, in bytes. */
-#define LINEALLOC (256 * 1024)
+#define LINEALLOC 262144
/* Prefix for temporary file names. */
static char *temp_file_prefix;
@@ -192,55 +142,49 @@ static int unique;
/* Nonzero if any of the input files are the standard input. */
static int have_read_stdin;
-/* Lists of key field comparisons to be tried. */
-static struct keyfield keyhead;
+/* Lines are held in core as counted strings. */
+struct line
+{
+ char *text; /* Text of the line. */
+ int length; /* Length not including final newline. */
+ char *keybeg; /* Start of first key. */
+ char *keylim; /* Limit of first key. */
+};
-static void
-usage (int status)
+/* Arrays of lines. */
+struct lines
{
- if (status != 0)
- fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
- else
- {
- printf (_("\
-Usage: %s [OPTION]... [FILE]...\n\
-"),
- program_name);
- printf (_("\
-Write sorted concatenation of all FILE(s) to standard output.\n\
-\n\
- +POS1 [-POS2] start a key at POS1, end it before POS2\n\
- -M compare (unknown) < `JAN' < ... < `DEC', imply -b\n\
- -T DIRECT use DIRECT for temporary files, not $TMPDIR or %s\n\
- -b ignore leading blanks in sort fields or keys\n\
- -c check if given files already sorted, do not sort\n\
- -d consider only [a-zA-Z0-9 ] characters in keys\n\
- -f fold lower case to upper case characters in keys\n\
- -g compare according to general numerical value, imply -b\n\
- -i consider only [\\040-\\0176] characters in keys\n\
- -k POS1[,POS2] same as +POS1 [-POS2], but all positions counted from 1\n\
- -m merge already sorted files, do not sort\n\
- -n compare according to string numerical value, imply -b\n\
- -o FILE write result on FILE instead of standard output\n\
- -r reverse the result of comparisons\n\
- -s stabilize sort by disabling last resort comparison\n\
- -t SEP use SEParator instead of non- to whitespace transition\n\
- -u with -c, check for strict ordering\n\
- -u with -m, only output the first of an equal sequence\n\
- --help display this help and exit\n\
- --version output version information and exit\n\
-\n\
-POS is F[.C][OPTS], where F is the field number and C the character\n\
-position in the field, both counted from zero. OPTS is made up of one\n\
-or more of Mbdfinr, this effectively disable global -Mbdfinr settings\n\
-for that key. If no key given, use the entire line as key. With no\n\
-FILE, or when FILE is -, read standard input.\n\
-")
- , DEFAULT_TMPDIR);
- }
- exit (status);
-}
+ struct line *lines; /* Dynamically allocated array of lines. */
+ int used; /* Number of slots used. */
+ int alloc; /* Number of slots allocated. */
+ int limit; /* Max number of slots to allocate. */
+};
+
+/* Input buffers. */
+struct buffer
+{
+ char *buf; /* Dynamically allocated buffer. */
+ int used; /* Number of bytes used. */
+ int alloc; /* Number of bytes allocated. */
+ int left; /* Number of bytes left after line parsing. */
+};
+
+/* Lists of key field comparisons to be tried. */
+static struct keyfield
+{
+ int sword; /* Zero-origin 'word' to start at. */
+ int schar; /* Additional characters to skip. */
+ int skipsblanks; /* Skip leading white space at start. */
+ int eword; /* Zero-origin first word after field. */
+ int echar; /* Additional characters in field. */
+ int skipeblanks; /* Skip trailing white space at finish. */
+ int *ignore; /* Boolean array of characters to ignore. */
+ char *translate; /* Translation applied to characters. */
+ int numeric; /* Flag for numeric comparison. */
+ int month; /* Flag for comparison by month name. */
+ int reverse; /* Reverse the sense of comparison. */
+ struct keyfield *next; /* Next keyfield to try. */
+} keyhead;
/* The list of temporary files. */
static struct tempnode
@@ -252,7 +196,7 @@ static struct tempnode
/* Clean up any remaining temporary files. */
static void
-cleanup (void)
+cleanup ()
{
struct tempnode *node;
@@ -262,15 +206,16 @@ cleanup (void)
/* Allocate N bytes of memory dynamically, with error checking. */
-static char *
-xmalloc (unsigned int n)
+char *
+xmalloc (n)
+ unsigned n;
{
char *p;
p = malloc (n);
if (p == 0)
{
- error (0, 0, _("virtual memory exhausted"));
+ error (0, 0, "virtual memory exhausted");
cleanup ();
exit (2);
}
@@ -282,8 +227,10 @@ xmalloc (unsigned int n)
If P is NULL, run xmalloc.
If N is 0, run free and return NULL. */
-static char *
-xrealloc (char *p, unsigned int n)
+char *
+xrealloc (p, n)
+ char *p;
+ unsigned n;
{
if (p == 0)
return xmalloc (n);
@@ -295,7 +242,7 @@ xrealloc (char *p, unsigned int n)
p = realloc (p, n);
if (p == 0)
{
- error (0, 0, _("virtual memory exhausted"));
+ error (0, 0, "virtual memory exhausted");
cleanup ();
exit (2);
}
@@ -303,81 +250,50 @@ xrealloc (char *p, unsigned int n)
}
static FILE *
-xtmpfopen (const char *file)
+xfopen (file, how)
+ char *file, *how;
{
- FILE *fp;
- int fd;
+ FILE *fp = strcmp (file, "-") ? fopen (file, how) : stdin;
- fd = open (file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd < 0 || (fp = fdopen (fd, "w")) == NULL)
+ if (fp == 0)
{
error (0, errno, "%s", file);
cleanup ();
exit (2);
}
-
- return fp;
-}
-
-static FILE *
-xfopen (const char *file, const char *how)
-{
- FILE *fp;
-
- if (strcmp (file, "-") == 0)
- {
- fp = stdin;
- }
- else
- {
- if ((fp = fopen (file, how)) == NULL)
- {
- error (0, errno, "%s", file);
- cleanup ();
- exit (2);
- }
- }
-
if (fp == stdin)
have_read_stdin = 1;
return fp;
}
static void
-xfclose (FILE *fp)
+xfclose (fp)
+ FILE *fp;
{
- if (fp == stdin)
- {
- /* Allow reading stdin from tty more than once. */
- if (feof (fp))
- clearerr (fp);
- }
- else if (fp == stdout)
- {
- if (fflush (fp) != 0)
- {
- error (0, errno, _("flushing file"));
- cleanup ();
- exit (2);
- }
- }
- else
+ fflush (fp);
+ if (fp != stdin && fp != stdout)
{
if (fclose (fp) != 0)
{
- error (0, errno, _("error closing file"));
+ error (0, errno, "error closing file");
cleanup ();
exit (2);
}
}
+ else
+ /* Allow reading stdin from tty more than once. */
+ clearerr (fp);
}
static void
-xfwrite (const char *buf, int size, int nelem, FILE *fp)
+xfwrite (buf, size, nelem, fp)
+ char *buf;
+ int size, nelem;
+ FILE *fp;
{
if (fwrite (buf, size, nelem, fp) != nelem)
{
- error (0, errno, _("write error"));
+ error (0, errno, "write error");
cleanup ();
exit (2);
}
@@ -386,25 +302,18 @@ xfwrite (const char *buf, int size, int nelem, FILE *fp)
/* Return a name for a temporary file. */
static char *
-tempname (void)
+tempname ()
{
- static unsigned int seq;
+ static int seq;
int len = strlen (temp_file_prefix);
- char *name = xmalloc (len + 1 + sizeof ("sort") - 1 + 5 + 5 + 1);
- struct tempnode *node;
-
- node = (struct tempnode *) xmalloc (sizeof (struct tempnode));
- sprintf (name,
- "%s%ssort%5.5d%5.5d",
- temp_file_prefix,
- (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
- (unsigned int) getpid () & 0xffff, seq);
-
- /* Make sure that SEQ's value fits in 5 digits. */
- ++seq;
- if (seq >= 100000)
- seq = 0;
+ char *name = xmalloc (len + 16);
+ struct tempnode *node =
+ (struct tempnode *) xmalloc (sizeof (struct tempnode));
+ if (len && temp_file_prefix[len - 1] != '/')
+ sprintf (name, "%s/sort%5.5d%5.5d", temp_file_prefix, getpid (), ++seq);
+ else
+ sprintf (name, "%ssort%5.5d%5.5d", temp_file_prefix, getpid (), ++seq);
node->name = name;
node->next = temphead.next;
temphead.next = node;
@@ -415,7 +324,8 @@ tempname (void)
remove it if it is found on the list. */
static void
-zaptemp (char *name)
+zaptemp (name)
+ char *name;
{
struct tempnode *node, *temp;
@@ -435,7 +345,7 @@ zaptemp (char *name)
/* Initialize the character class tables. */
static void
-inittables (void)
+inittables ()
{
int i;
@@ -459,7 +369,9 @@ inittables (void)
/* Initialize BUF, allocating ALLOC bytes initially. */
static void
-initbuf (struct buffer *buf, int alloc)
+initbuf (buf, alloc)
+ struct buffer *buf;
+ int alloc;
{
buf->alloc = alloc;
buf->buf = xmalloc (buf->alloc);
@@ -472,11 +384,13 @@ initbuf (struct buffer *buf, int alloc)
of bytes buffered. */
static int
-fillbuf (struct buffer *buf, FILE *fp)
+fillbuf (buf, fp)
+ struct buffer *buf;
+ FILE *fp;
{
int cc;
- memmove (buf->buf, buf->buf + buf->used - buf->left, buf->left);
+ bcopy (buf->buf + buf->used - buf->left, buf->buf, buf->left);
buf->used = buf->left;
while (!feof (fp) && (buf->used == 0 || !memchr (buf->buf, '\n', buf->used)))
@@ -489,7 +403,7 @@ fillbuf (struct buffer *buf, FILE *fp)
cc = fread (buf->buf + buf->used, 1, buf->alloc - buf->used, fp);
if (ferror (fp))
{
- error (0, errno, _("read error"));
+ error (0, errno, "read error");
cleanup ();
exit (2);
}
@@ -514,7 +428,10 @@ fillbuf (struct buffer *buf, FILE *fp)
for, ever. */
static void
-initlines (struct lines *lines, int alloc, int limit)
+initlines (lines, alloc, limit)
+ struct lines *lines;
+ int alloc;
+ int limit;
{
lines->alloc = alloc;
lines->lines = (struct line *) xmalloc (lines->alloc * sizeof (struct line));
@@ -526,7 +443,9 @@ initlines (struct lines *lines, int alloc, int limit)
by KEY in LINE. */
static char *
-begfield (const struct line *line, const struct keyfield *key)
+begfield (line, key)
+ struct line *line;
+ struct keyfield *key;
{
register char *ptr = line->text, *lim = ptr + line->length;
register int sword = key->sword, schar = key->schar;
@@ -552,10 +471,8 @@ begfield (const struct line *line, const struct keyfield *key)
while (ptr < lim && blanks[UCHAR (*ptr)])
++ptr;
- if (ptr + schar <= lim)
- ptr += schar;
- else
- ptr = lim;
+ while (ptr < lim && schar--)
+ ++ptr;
return ptr;
}
@@ -564,28 +481,19 @@ begfield (const struct line *line, const struct keyfield *key)
in LINE specified by KEY. */
static char *
-limfield (const struct line *line, const struct keyfield *key)
+limfield (line, key)
+ struct line *line;
+ struct keyfield *key;
{
register char *ptr = line->text, *lim = ptr + line->length;
register int eword = key->eword, echar = key->echar;
- /* Note: from the POSIX spec:
- The leading field separator itself is included in
- a field when -t is not used. FIXME: move this comment up... */
-
- /* Move PTR past EWORD fields or to one past the last byte on LINE,
- whichever comes first. If there are more than EWORD fields, leave
- PTR pointing at the beginning of the field having zero-based index,
- EWORD. If a delimiter character was specified (via -t), then that
- `beginning' is the first character following the delimiting TAB.
- Otherwise, leave PTR pointing at the first `blank' character after
- the preceding field. */
if (tab)
while (ptr < lim && eword--)
{
while (ptr < lim && *ptr != tab)
++ptr;
- if (ptr < lim && (eword || echar > 0))
+ if (ptr < lim && (eword || key->skipeblanks))
++ptr;
}
else
@@ -597,54 +505,23 @@ limfield (const struct line *line, const struct keyfield *key)
++ptr;
}
- /* Make LIM point to the end of (one byte past) the current field. */
- if (tab)
- {
- char *newlim;
- newlim = memchr (ptr, tab, lim - ptr);
- if (newlim)
- lim = newlim;
- }
- else
- {
- char *newlim;
- newlim = ptr;
- while (newlim < lim && blanks[UCHAR (*newlim)])
- ++newlim;
- while (newlim < lim && !blanks[UCHAR (*newlim)])
- ++newlim;
- lim = newlim;
- }
-
- /* If we're skipping leading blanks, don't start counting characters
- until after skipping past any leading blanks. */
- if (key->skipsblanks)
+ if (key->skipeblanks)
while (ptr < lim && blanks[UCHAR (*ptr)])
++ptr;
- /* Advance PTR by ECHAR (if possible), but no further than LIM. */
- if (ptr + echar <= lim)
- ptr += echar;
- else
- ptr = lim;
+ while (ptr < lim && echar--)
+ ++ptr;
return ptr;
}
-/* FIXME */
-
-void
-trim_trailing_blanks (const char *a_start, char **a_end)
-{
- while (*a_end > a_start && blanks[UCHAR (*(*a_end - 1))])
- --(*a_end);
-}
-
/* Find the lines in BUF, storing pointers and lengths in LINES.
- Also replace newlines in BUF with NULs. */
+ Also replace newlines with NULs. */
static void
-findlines (struct buffer *buf, struct lines *lines)
+findlines (buf, lines)
+ struct buffer *buf;
+ struct lines *lines;
{
register char *beg = buf->buf, *lim = buf->buf + buf->used, *ptr;
struct keyfield *key = keyhead.next;
@@ -689,11 +566,6 @@ findlines (struct buffer *buf, struct lines *lines)
++beg;
lines->lines[lines->used].keybeg = beg;
}
- if (key->skipeblanks)
- {
- trim_trailing_blanks (lines->lines[lines->used].keybeg,
- &lines->lines[lines->used].keylim);
- }
}
else
{
@@ -713,7 +585,8 @@ findlines (struct buffer *buf, struct lines *lines)
of the fraction. Strings not of this form are considered to be zero. */
static int
-fraccompare (register const char *a, register const char *b)
+fraccompare (a, b)
+ register char *a, *b;
{
register tmpa = UCHAR (*a), tmpb = UCHAR (*b);
@@ -768,12 +641,12 @@ fraccompare (register const char *a, register const char *b)
hideously fast. */
static int
-numcompare (register const char *a, register const char *b)
+numcompare (a, b)
+ register char *a, *b;
{
register int tmpa, tmpb, loga, logb, tmp;
- tmpa = UCHAR (*a);
- tmpb = UCHAR (*b);
+ tmpa = UCHAR (*a), tmpb = UCHAR (*b);
while (blanks[tmpa])
tmpa = UCHAR (*++a);
@@ -782,30 +655,19 @@ numcompare (register const char *a, register const char *b)
if (tmpa == '-')
{
- do
- tmpa = UCHAR (*++a);
- while (tmpa == '0');
+ tmpa = UCHAR (*++a);
if (tmpb != '-')
{
- if (tmpa == '.')
- do
- tmpa = UCHAR (*++a);
- while (tmpa == '0');
- if (digits[tmpa])
- return -1;
- while (tmpb == '0')
- tmpb = UCHAR (*++b);
- if (tmpb == '.')
- do
- tmpb = *++b;
- while (tmpb == '0');
- if (digits[tmpb])
+ if (digits[tmpa] && digits[tmpb])
return -1;
return 0;
}
- do
+ tmpb = UCHAR (*++b);
+
+ while (tmpa == '0')
+ tmpa = UCHAR (*++a);
+ while (tmpb == '0')
tmpb = UCHAR (*++b);
- while (tmpb == '0');
while (tmpa == tmpb && digits[tmpa])
tmpa = UCHAR (*++a), tmpb = UCHAR (*++b);
@@ -835,22 +697,7 @@ numcompare (register const char *a, register const char *b)
}
else if (tmpb == '-')
{
- do
- tmpb = UCHAR (*++b);
- while (tmpb == '0');
- if (tmpb == '.')
- do
- tmpb = *++b;
- while (tmpb == '0');
- if (digits[tmpb])
- return 1;
- while (tmpa == '0')
- tmpa = UCHAR (*++a);
- if (tmpa == '.')
- do
- tmpa = UCHAR (*++a);
- while (tmpa == '0');
- if (digits[tmpa])
+ if (digits[UCHAR (tmpa)] && digits[UCHAR (*++b)])
return 1;
return 0;
}
@@ -889,29 +736,13 @@ numcompare (register const char *a, register const char *b)
}
}
-static int
-general_numcompare (const char *sa, const char *sb)
-{
- double a, b;
- /* FIXME: add option to warn about failed conversions. */
- /* FIXME: maybe add option to try expensive FP conversion
- only if A and B can't be compared more cheaply/accurately. */
- if (xstrtod (sa, NULL, &a))
- {
- a = 0;
- }
- if (xstrtod (sb, NULL, &b))
- {
- b = 0;
- }
- return a == b ? 0 : a < b ? -1 : 1;
-}
-
/* Return an integer <= 12 associated with month name S with length LEN,
0 if the name in S is not recognized. */
static int
-getmonth (const char *s, int len)
+getmonth (s, len)
+ char *s;
+ int len;
{
char month[4];
register int i, lo = 0, hi = 12;
@@ -940,7 +771,8 @@ getmonth (const char *s, int len)
are no more keys or a difference is found. */
static int
-keycompare (const struct line *a, const struct line *b)
+keycompare (a, b)
+ struct line *a, *b;
{
register char *texta, *textb, *lima, *limb, *translate;
register int *ignore;
@@ -989,16 +821,6 @@ keycompare (const struct line *a, const struct line *b)
if (lenb < 0)
lenb = 0;
- if (key->skipeblanks)
- {
- char *a_end = texta + lena;
- char *b_end = textb + lenb;
- trim_trailing_blanks (texta, &a_end);
- trim_trailing_blanks (textb, &b_end);
- lena = a_end - texta;
- lenb = b_end - textb;
- }
-
/* Actually compare the fields. */
if (key->numeric)
{
@@ -1017,23 +839,6 @@ keycompare (const struct line *a, const struct line *b)
return key->reverse ? -diff : diff;
continue;
}
- else if (key->general_numeric)
- {
- if (*lima || *limb)
- {
- char savea = *lima, saveb = *limb;
-
- *lima = *limb = '\0';
- diff = general_numcompare (texta, textb);
- *lima = savea, *limb = saveb;
- }
- else
- diff = general_numcompare (texta, textb);
-
- if (diff)
- return key->reverse ? -diff : diff;
- continue;
- }
else if (key->month)
{
diff = getmonth (texta, lena) - getmonth (textb, lenb);
@@ -1042,64 +847,38 @@ keycompare (const struct line *a, const struct line *b)
continue;
}
else if (ignore && translate)
-
-#define CMP_WITH_IGNORE(A, B) \
- do \
- { \
- while (texta < lima && textb < limb) \
- { \
- while (texta < lima && ignore[UCHAR (*texta)]) \
- ++texta; \
- while (textb < limb && ignore[UCHAR (*textb)]) \
- ++textb; \
- if (texta < lima && textb < limb) \
- { \
- if ((A) != (B)) \
- { \
- diff = (A) - (B); \
- break; \
- } \
- ++texta; \
- ++textb; \
- } \
- \
- if (texta == lima && textb < limb && !ignore[UCHAR (*textb)]) \
- diff = -1; \
- else if (texta < lima && textb == limb \
- && !ignore[UCHAR (*texta)]) \
- diff = 1; \
- } \
- \
- if (diff == 0) \
- { \
- while (texta < lima && ignore[UCHAR (*texta)]) \
- ++texta; \
- while (textb < limb && ignore[UCHAR (*textb)]) \
- ++textb; \
- \
- if (texta == lima && textb < limb) \
- diff = -1; \
- else if (texta < lima && textb == limb) \
- diff = 1; \
- } \
- /* Relative lengths are meaningless if characters were ignored. \
- Handling this case here avoids what might be an invalid length \
- comparison below. */ \
- if (diff == 0 && texta == lima && textb == limb) \
- return 0; \
- } \
- while (0)
-
- CMP_WITH_IGNORE (translate[UCHAR (*texta)], translate[UCHAR (*textb)]);
+ while (texta < lima && textb < limb)
+ {
+ while (texta < lima && ignore[UCHAR (*texta)])
+ ++texta;
+ while (textb < limb && ignore[UCHAR (*textb)])
+ ++textb;
+ if (texta < lima && textb < limb &&
+ translate[UCHAR (*texta++)] != translate[UCHAR (*textb++)])
+ {
+ diff = translate[UCHAR (*--texta)] - translate[UCHAR (*--textb)];
+ break;
+ }
+ }
else if (ignore)
- CMP_WITH_IGNORE (*texta, *textb);
+ while (texta < lima && textb < limb)
+ {
+ while (texta < lima && ignore[UCHAR (*texta)])
+ ++texta;
+ while (textb < limb && ignore[UCHAR (*textb)])
+ ++textb;
+ if (texta < lima && textb < limb && *texta++ != *textb++)
+ {
+ diff = *--texta - *--textb;
+ break;
+ }
+ }
else if (translate)
while (texta < lima && textb < limb)
{
if (translate[UCHAR (*texta++)] != translate[UCHAR (*textb++)])
{
- diff = (translate[UCHAR (*--texta)]
- - translate[UCHAR (*--textb)]);
+ diff = translate[UCHAR (*--texta)] - translate[UCHAR (*--textb)];
break;
}
}
@@ -1119,7 +898,8 @@ keycompare (const struct line *a, const struct line *b)
depending on whether A compares less than, equal to, or greater than B. */
static int
-compare (register const struct line *a, register const struct line *b)
+compare (a, b)
+ register struct line *a, *b;
{
int diff, tmpa, tmpb, mini;
@@ -1158,17 +938,18 @@ compare (register const struct line *a, register const struct line *b)
}
/* Check that the lines read from the given FP come in order. Return
- 1 if they do and 0 if there is a disorder.
- FIXME: return number of first out-of-order line if not sorted. */
+ 1 if they do and 0 if there is a disorder. */
static int
-checkfp (FILE *fp)
+checkfp (fp)
+ FILE *fp;
{
struct buffer buf; /* Input buffer. */
struct lines lines; /* Lines scanned from the buffer. */
struct line temp; /* Copy of previous line. */
int cc; /* Character count. */
- int alloc, sorted = 1;
+ int cmp; /* Result of calling compare. */
+ int alloc, i, success = 1;
initbuf (&buf, mergealloc);
initlines (&lines, mergealloc / linelength + 1,
@@ -1177,69 +958,64 @@ checkfp (FILE *fp)
temp.text = xmalloc (alloc);
cc = fillbuf (&buf, fp);
- if (cc == 0)
- goto finish;
-
findlines (&buf, &lines);
- while (1)
- {
- struct line *prev_line; /* Pointer to previous line. */
- int cmp; /* Result of calling compare. */
- int i;
+ if (cc)
+ do
+ {
+ /* Compare each line in the buffer with its successor. */
+ for (i = 0; i < lines.used - 1; ++i)
+ {
+ cmp = compare (&lines.lines[i], &lines.lines[i + 1]);
+ if ((unique && cmp >= 0) || (cmp > 0))
+ {
+ success = 0;
+ goto finish;
+ }
+ }
- /* Compare each line in the buffer with its successor. */
- for (i = 0; i < lines.used - 1; ++i)
- {
- cmp = compare (&lines.lines[i], &lines.lines[i + 1]);
- if ((unique && cmp >= 0) || (cmp > 0))
- {
- sorted = 0;
- goto finish;
- }
- }
+ /* Save the last line of the buffer and refill the buffer. */
+ if (lines.lines[lines.used - 1].length > alloc)
+ {
+ while (lines.lines[lines.used - 1].length + 1 > alloc)
+ alloc *= 2;
+ temp.text = xrealloc (temp.text, alloc);
+ }
+ bcopy (lines.lines[lines.used - 1].text, temp.text,
+ lines.lines[lines.used - 1].length + 1);
+ temp.length = lines.lines[lines.used - 1].length;
- /* Save the last line of the buffer and refill the buffer. */
- prev_line = lines.lines + (lines.used - 1);
- if (prev_line->length > alloc)
- {
- while (prev_line->length + 1 > alloc)
- alloc *= 2;
- temp.text = xrealloc (temp.text, alloc);
- }
- memcpy (temp.text, prev_line->text, prev_line->length + 1);
- temp.length = prev_line->length;
- temp.keybeg = temp.text + (prev_line->keybeg - prev_line->text);
- temp.keylim = temp.text + (prev_line->keylim - prev_line->text);
-
- cc = fillbuf (&buf, fp);
- if (cc == 0)
- break;
-
- findlines (&buf, &lines);
- /* Make sure the line saved from the old buffer contents is
- less than or equal to the first line of the new buffer. */
- cmp = compare (&temp, &lines.lines[0]);
- if ((unique && cmp >= 0) || (cmp > 0))
- {
- sorted = 0;
- break;
- }
- }
+ cc = fillbuf (&buf, fp);
+ if (cc)
+ {
+ findlines (&buf, &lines);
+ /* Make sure the line saved from the old buffer contents is
+ less than or equal to the first line of the new buffer. */
+ cmp = compare (&temp, &lines.lines[0]);
+ if ((unique && cmp >= 0) || (cmp > 0))
+ {
+ success = 0;
+ break;
+ }
+ }
+ }
+ while (cc);
finish:
xfclose (fp);
free (buf.buf);
free ((char *) lines.lines);
free (temp.text);
- return sorted;
+ return success;
}
/* Merge lines from FPS onto OFP. NFPS cannot be greater than NMERGE.
Close FPS before returning. */
static void
-mergefps (FILE **fps, register int nfps, FILE *ofp)
+mergefps (fps, nfps, ofp)
+ FILE *fps[], *ofp;
+ register int nfps;
{
struct buffer buffer[NMERGE]; /* Input buffers for each file. */
struct lines lines[NMERGE]; /* Line tables for each buffer. */
@@ -1253,10 +1029,6 @@ mergefps (FILE **fps, register int nfps, FILE *ofp)
output. */
register int i, j, t;
-#ifdef lint /* Suppress `used before initialized' warning. */
- savealloc = 0;
-#endif
-
/* Allocate space for a saved line if necessary. */
if (unique)
{
@@ -1300,7 +1072,7 @@ mergefps (FILE **fps, register int nfps, FILE *ofp)
/* Repeatedly output the smallest line until no input remains. */
while (nfps)
{
- /* If uniqified output is turned on, output only the first of
+ /* If uniqified output is turned out, output only the first of
an identical series of lines. */
if (unique)
{
@@ -1319,7 +1091,7 @@ mergefps (FILE **fps, register int nfps, FILE *ofp)
saved.text = xrealloc (saved.text, savealloc);
}
saved.length = lines[ord[0]].lines[cur[ord[0]]].length;
- memcpy (saved.text, lines[ord[0]].lines[cur[ord[0]]].text,
+ bcopy (lines[ord[0]].lines[cur[ord[0]]].text, saved.text,
saved.length + 1);
if (lines[ord[0]].lines[cur[ord[0]]].keybeg != NULL)
{
@@ -1401,7 +1173,9 @@ mergefps (FILE **fps, register int nfps, FILE *ofp)
/* Sort the array LINES with NLINES members, using TEMP for temporary space. */
static void
-sortlines (struct line *lines, int nlines, struct line *temp)
+sortlines (lines, nlines, temp)
+ struct line *lines, *temp;
+ int nlines;
{
register struct line *lo, *hi, *t;
register int nlo, nhi;
@@ -1442,7 +1216,9 @@ sortlines (struct line *lines, int nlines, struct line *temp)
Return a count of disordered files. */
static int
-check (char **files, int nfiles)
+check (files, nfiles)
+ char *files[];
+ int nfiles;
{
int i, disorders = 0;
FILE *fp;
@@ -1452,7 +1228,7 @@ check (char **files, int nfiles)
fp = xfopen (files[i], "r");
if (!checkfp (fp))
{
- fprintf (stderr, _("%s: disorder on %s\n"), program_name, files[i]);
+ printf ("%s: disorder on %s\n", program_name, files[i]);
++disorders;
}
}
@@ -1462,7 +1238,10 @@ check (char **files, int nfiles)
/* Merge NFILES FILES onto OFP. */
static void
-merge (char **files, int nfiles, FILE *ofp)
+merge (files, nfiles, ofp)
+ char *files[];
+ int nfiles;
+ FILE *ofp;
{
int i, j, t;
char *temp;
@@ -1475,7 +1254,7 @@ merge (char **files, int nfiles, FILE *ofp)
{
for (j = 0; j < NMERGE; ++j)
fps[j] = xfopen (files[i * NMERGE + j], "r");
- tfp = xtmpfopen (temp = tempname ());
+ tfp = xfopen (temp = tempname (), "w");
mergefps (fps, NMERGE, tfp);
xfclose (tfp);
for (j = 0; j < NMERGE; ++j)
@@ -1484,7 +1263,7 @@ merge (char **files, int nfiles, FILE *ofp)
}
for (j = 0; j < nfiles % NMERGE; ++j)
fps[j] = xfopen (files[i * NMERGE + j], "r");
- tfp = xtmpfopen (temp = tempname ());
+ tfp = xfopen (temp = tempname (), "w");
mergefps (fps, nfiles % NMERGE, tfp);
xfclose (tfp);
for (j = 0; j < nfiles % NMERGE; ++j)
@@ -1503,7 +1282,10 @@ merge (char **files, int nfiles, FILE *ofp)
/* Sort NFILES FILES onto OFP. */
static void
-sort (char **files, int nfiles, FILE *ofp)
+sort (files, nfiles, ofp)
+ char **files;
+ int nfiles;
+ FILE *ofp;
{
struct buffer buf;
struct lines lines;
@@ -1511,7 +1293,7 @@ sort (char **files, int nfiles, FILE *ofp)
int i, ntmp;
FILE *fp, *tfp;
struct tempnode *node;
- int n_temp_files = 0;
+ int ntemp = 0;
char **tempfiles;
initbuf (&buf, sortalloc);
@@ -1534,12 +1316,12 @@ sort (char **files, int nfiles, FILE *ofp)
xrealloc ((char *) tmp, ntmp * sizeof (struct line));
}
sortlines (lines.lines, lines.used, tmp);
- if (feof (fp) && !nfiles && !n_temp_files && !buf.left)
+ if (feof (fp) && !nfiles && !ntemp && !buf.left)
tfp = ofp;
else
{
- ++n_temp_files;
- tfp = xtmpfopen (tempname ());
+ ++ntemp;
+ tfp = xfopen (tempname (), "w");
}
for (i = 0; i < lines.used; ++i)
if (!unique || i == 0
@@ -1558,13 +1340,13 @@ sort (char **files, int nfiles, FILE *ofp)
free ((char *) lines.lines);
free ((char *) tmp);
- if (n_temp_files)
+ if (ntemp)
{
- tempfiles = (char **) xmalloc (n_temp_files * sizeof (char *));
- i = n_temp_files;
+ tempfiles = (char **) xmalloc (ntemp * sizeof (char *));
+ i = ntemp;
for (node = temphead.next; i > 0; node = node->next)
tempfiles[--i] = node->name;
- merge (tempfiles, n_temp_files, ofp);
+ merge (tempfiles, ntemp, ofp);
free ((char *) tempfiles);
}
}
@@ -1572,7 +1354,8 @@ sort (char **files, int nfiles, FILE *ofp)
/* Insert key KEY at the end of the list (`keyhead'). */
static void
-insertkey (struct keyfield *key)
+insertkey (key)
+ struct keyfield *key;
{
struct keyfield *k = &keyhead;
@@ -1583,26 +1366,28 @@ insertkey (struct keyfield *key)
}
static void
-badfieldspec (const char *s)
+badfieldspec (s)
+ char *s;
{
- error (2, 0, _("invalid field specification `%s'"), s);
+ error (2, 0, "invalid field specification `%s'", s);
}
/* Handle interrupts and hangups. */
static void
-sighandler (int sig)
+sighandler (sig)
+ int sig;
{
-#ifdef SA_INTERRUPT
+#ifdef _POSIX_VERSION
struct sigaction sigact;
sigact.sa_handler = SIG_DFL;
sigemptyset (&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction (sig, &sigact, NULL);
-#else /* !SA_INTERRUPT */
+#else /* !_POSIX_VERSION */
signal (sig, SIG_DFL);
-#endif /* SA_INTERRUPT */
+#endif /* _POSIX_VERSION */
cleanup ();
kill (getpid (), sig);
}
@@ -1613,8 +1398,10 @@ sighandler (int sig)
BLANKTYPE is the kind of blanks that 'b' should skip. */
static char *
-set_ordering (register const char *s, struct keyfield *key,
- enum blanktype blanktype)
+set_ordering (s, key, blanktype)
+ register char *s;
+ struct keyfield *key;
+ enum blanktype blanktype;
{
while (*s)
{
@@ -1632,9 +1419,11 @@ set_ordering (register const char *s, struct keyfield *key,
case 'f':
key->translate = fold_toupper;
break;
+#if 0
case 'g':
- key->general_numeric = 1;
+ /* Reserved for comparing floating-point numbers. */
break;
+#endif
case 'i':
key->ignore = nonprinting;
break;
@@ -1643,24 +1432,22 @@ set_ordering (register const char *s, struct keyfield *key,
break;
case 'n':
key->numeric = 1;
- if (blanktype == bl_start || blanktype == bl_both)
- key->skipsblanks = 1;
- if (blanktype == bl_end || blanktype == bl_both)
- key->skipeblanks = 1;
break;
case 'r':
key->reverse = 1;
break;
default:
- return (char *) s;
+ return s;
}
++s;
}
- return (char *) s;
+ return s;
}
void
-main (int argc, char **argv)
+main (argc, argv)
+ int argc;
+ char *argv[];
{
struct keyfield *key = NULL, gkey;
char *s;
@@ -1668,25 +1455,22 @@ main (int argc, char **argv)
int checkonly = 0, mergeonly = 0, nfiles = 0;
char *minus = "-", *outfile = minus, **files, *tmp;
FILE *ofp;
-#ifdef SA_INTERRUPT
+#ifdef _POSIX_VERSION
struct sigaction oldact, newact;
-#endif /* SA_INTERRUPT */
+#endif /* _POSIX_VERSION */
-#ifdef __FreeBSD__
- (void) setlocale(LC_CTYPE, "");
-#endif
program_name = argv[0];
- parse_long_options (argc, argv, "sort", version_string, usage);
+ parse_long_options (argc, argv, usage);
have_read_stdin = 0;
inittables ();
temp_file_prefix = getenv ("TMPDIR");
if (temp_file_prefix == NULL)
- temp_file_prefix = DEFAULT_TMPDIR;
+ temp_file_prefix = "/tmp";
-#ifdef SA_INTERRUPT
+#ifdef _POSIX_VERSION
newact.sa_handler = sighandler;
sigemptyset (&newact.sa_mask);
newact.sa_flags = 0;
@@ -1703,7 +1487,7 @@ main (int argc, char **argv)
sigaction (SIGTERM, NULL, &oldact);
if (oldact.sa_handler != SIG_IGN)
sigaction (SIGTERM, &newact, NULL);
-#else /* !SA_INTERRUPT */
+#else /* !_POSIX_VERSION */
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, sighandler);
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
@@ -1712,12 +1496,12 @@ main (int argc, char **argv)
signal (SIGPIPE, sighandler);
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
signal (SIGTERM, sighandler);
-#endif /* !SA_INTERRUPT */
+#endif /* !_POSIX_VERSION */
gkey.sword = gkey.eword = -1;
gkey.ignore = NULL;
gkey.translate = NULL;
- gkey.numeric = gkey.general_numeric = gkey.month = gkey.reverse = 0;
+ gkey.numeric = gkey.month = gkey.reverse = 0;
gkey.skipsblanks = gkey.skipeblanks = 0;
files = (char **) xmalloc (sizeof (char *) * argc);
@@ -1733,9 +1517,9 @@ main (int argc, char **argv)
key->ignore = NULL;
key->translate = NULL;
key->skipsblanks = key->skipeblanks = 0;
- key->numeric = key->general_numeric = key->month = key->reverse = 0;
+ key->numeric = key->month = key->reverse = 0;
s = argv[i] + 1;
- if (! (digits[UCHAR (*s)] || (*s == '.' && digits[UCHAR (s[1])])))
+ if (!digits[UCHAR (*s)])
badfieldspec (argv[i]);
for (t = 0; digits[UCHAR (*s)]; ++s)
t = 10 * t + *s - '0';
@@ -1757,7 +1541,7 @@ main (int argc, char **argv)
else if (argv[i][0] == '-' && argv[i][1])
{
s = argv[i] + 1;
- if (digits[UCHAR (*s)] || (*s == '.' && digits[UCHAR (s[1])]))
+ if (digits[UCHAR (*s)])
{
if (!key)
usage (2);
@@ -1792,7 +1576,7 @@ main (int argc, char **argv)
else
{
if (i == argc - 1)
- error (2, 0, _("option `-k' requires an argument"));
+ error (2, 0, "option `-k' requires an argument");
else
s = argv[++i];
}
@@ -1810,34 +1594,15 @@ main (int argc, char **argv)
badfieldspec (argv[i]);
for (t = 0; digits[UCHAR (*s)]; ++s)
t = 10 * t + *s - '0';
- if (t == 0)
- {
- /* Provoke with `sort -k0' */
- error (0, 0, _("the starting field number argument \
-to the `-k' option must be positive"));
- badfieldspec (argv[i]);
- }
- --t;
+ if (t)
+ t--;
t2 = 0;
if (*s == '.')
{
- if (!digits[UCHAR (s[1])])
- {
- /* Provoke with `sort -k1.' */
- error (0, 0, _("starting field spec has `.' but \
-lacks following character offset"));
- badfieldspec (argv[i]);
- }
for (++s; digits[UCHAR (*s)]; ++s)
t2 = 10 * t2 + *s - '0';
- if (t2 == 0)
- {
- /* Provoke with `sort -k1.0' */
- error (0, 0, _("starting field character offset \
-argument to the `-k' option\nmust be positive"));
- badfieldspec (argv[i]);
- }
- --t2;
+ if (t2)
+ t2--;
}
if (t2 || t)
{
@@ -1847,52 +1612,20 @@ argument to the `-k' option\nmust be positive"));
else
key->sword = -1;
s = set_ordering (s, key, bl_start);
- if (*s == 0)
- {
- key->eword = -1;
- key->echar = 0;
- }
- else if (*s != ',')
+ if (*s && *s != ',')
badfieldspec (argv[i]);
- else if (*s == ',')
+ else if (*s++)
{
- /* Skip over comma. */
- ++s;
- if (*s == 0)
- {
- /* Provoke with `sort -k1,' */
- error (0, 0, _("field specification has `,' but \
-lacks following field spec"));
- badfieldspec (argv[i]);
- }
/* Get POS2. */
for (t = 0; digits[UCHAR (*s)]; ++s)
t = t * 10 + *s - '0';
- if (t == 0)
- {
- /* Provoke with `sort -k1,0' */
- error (0, 0, _("ending field number argument \
-to the `-k' option must be positive"));
- badfieldspec (argv[i]);
- }
- --t;
t2 = 0;
if (*s == '.')
{
- if (!digits[UCHAR (s[1])])
- {
- /* Provoke with `sort -k1,1.' */
- error (0, 0, _("ending field spec has `.' \
-but lacks following character offset"));
- badfieldspec (argv[i]);
- }
for (++s; digits[UCHAR (*s)]; ++s)
t2 = t2 * 10 + *s - '0';
- }
- else
- {
- /* `-k 2,3' is equivalent to `+1 -3'. */
- ++t;
+ if (t2)
+ t--;
}
key->eword = t;
key->echar = t2;
@@ -1912,7 +1645,7 @@ but lacks following character offset"));
else
{
if (i == argc - 1)
- error (2, 0, _("option `-o' requires an argument"));
+ error (2, 0, "option `-o' requires an argument");
else
outfile = argv[++i];
}
@@ -1929,20 +1662,19 @@ but lacks following character offset"));
goto outer;
}
else
- error (2, 0, _("option `-t' requires an argument"));
+ error (2, 0, "option `-t' requires an argument");
break;
case 'T':
if (s[1])
temp_file_prefix = ++s;
- else
+ else if (i < argc - 1)
{
- if (i < argc - 1)
- temp_file_prefix = argv[++i];
- else
- error (2, 0, _("option `-T' requires an argument"));
+ temp_file_prefix = argv[++i];
+ goto outer;
}
- goto outer;
- /* break; */
+ else
+ error (2, 0, "option `-T' requires an argument");
+ break;
case 'u':
unique = 1;
break;
@@ -1951,7 +1683,7 @@ but lacks following character offset"));
Solaris 2. */
goto outer;
default:
- fprintf (stderr, _("%s: unrecognized option `-%c'\n"),
+ fprintf (stderr, "%s: unrecognized option `-%c'\n",
argv[0], *s);
usage (2);
}
@@ -1972,8 +1704,7 @@ but lacks following character offset"));
/* Inheritance of global options to individual keys. */
for (key = keyhead.next; key; key = key->next)
if (!key->ignore && !key->translate && !key->skipsblanks && !key->reverse
- && !key->skipeblanks && !key->month && !key->numeric
- && !key->general_numeric)
+ && !key->skipeblanks && !key->month && !key->numeric)
{
key->ignore = gkey.ignore;
key->translate = gkey.translate;
@@ -1981,13 +1712,11 @@ but lacks following character offset"));
key->skipeblanks = gkey.skipeblanks;
key->month = gkey.month;
key->numeric = gkey.numeric;
- key->general_numeric = gkey.general_numeric;
key->reverse = gkey.reverse;
}
if (!keyhead.next && (gkey.ignore || gkey.translate || gkey.skipsblanks
- || gkey.skipeblanks || gkey.month || gkey.numeric
- || gkey.general_numeric))
+ || gkey.skipeblanks || gkey.month || gkey.numeric))
insertkey (&gkey);
reverse = gkey.reverse;
@@ -2002,61 +1731,32 @@ but lacks following character offset"));
if (strcmp (outfile, "-"))
{
- struct stat outstat;
- if (stat (outfile, &outstat) == 0)
+ for (i = 0; i < nfiles; ++i)
+ if (!strcmp (outfile, files[i]))
+ break;
+ if (i == nfiles)
+ ofp = xfopen (outfile, "w");
+ else
{
- /* The following code prevents a race condition when
- people use the brain dead shell programming idiom:
- cat file | sort -o file
- This feature is provided for historical compatibility,
- but we strongly discourage ever relying on this in
- new shell programs. */
-
- /* Temporarily copy each input file that might be another name
- for the output file. When in doubt (e.g. a pipe), copy. */
- for (i = 0; i < nfiles; ++i)
+ char buf[8192];
+ FILE *fp = xfopen (outfile, "r");
+ int cc;
+
+ tmp = tempname ();
+ ofp = xfopen (tmp, "w");
+ while ((cc = fread (buf, 1, sizeof buf, fp)) > 0)
+ xfwrite (buf, 1, cc, ofp);
+ if (ferror (fp))
{
- char buf[8192];
- FILE *fp;
- int cc;
-
- if (S_ISREG (outstat.st_mode) && strcmp (outfile, files[i]))
- {
- struct stat instat;
- if ((strcmp (files[i], "-")
- ? stat (files[i], &instat)
- : fstat (fileno (stdin), &instat)) != 0)
- {
- error (0, errno, "%s", files[i]);
- cleanup ();
- exit (2);
- }
- if (S_ISREG (instat.st_mode)
- && (instat.st_ino != outstat.st_ino
- || instat.st_dev != outstat.st_dev))
- {
- /* We know the files are distinct. */
- continue;
- }
- }
-
- fp = xfopen (files[i], "r");
- tmp = tempname ();
- ofp = xtmpfopen (tmp);
- while ((cc = fread (buf, 1, sizeof buf, fp)) > 0)
- xfwrite (buf, 1, cc, ofp);
- if (ferror (fp))
- {
- error (0, errno, "%s", files[i]);
- cleanup ();
- exit (2);
- }
- xfclose (ofp);
- xfclose (fp);
- files[i] = tmp;
+ error (0, errno, "%s", outfile);
+ cleanup ();
+ exit (2);
}
+ xfclose (ofp);
+ xfclose (fp);
+ files[i] = tmp;
+ ofp = xfopen (outfile, "w");
}
- ofp = xfopen (outfile, "w");
}
else
ofp = stdout;
@@ -2073,12 +1773,57 @@ but lacks following character offset"));
Solaris, Ultrix, and Irix. This premature fflush makes the output
reappear. --karl@cs.umb.edu */
if (fflush (ofp) < 0)
- error (1, errno, _("%s: write error"), outfile);
+ error (1, errno, "fflush", outfile);
if (have_read_stdin && fclose (stdin) == EOF)
- error (1, errno, outfile);
+ error (1, errno, "-");
if (ferror (stdout) || fclose (stdout) == EOF)
- error (1, errno, _("%s: write error"), outfile);
+ error (1, errno, "write error");
exit (0);
}
+
+static void
+usage (status)
+ int status;
+{
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
+Usage: %s [OPTION]... [FILE]...\n\
+",
+ program_name);
+ printf ("\
+\n\
+ +POS1 [-POS2] start a key at POS1, end it before POS2\n\
+ -M compare (unknown) < `JAN' < ... < `DEC', imply -b\n\
+ -T DIRECT use DIRECTfor temporary files, not $TEMPDIR nor /tmp\n\
+ -b ignore leading blanks in sort fields or keys\n\
+ -c check if given files already sorted, do not sort\n\
+ -d consider only [a-zA-Z0-9 ] characters in keys\n\
+ -f fold lower case to upper case characters in keys\n\
+ -i consider only [\\040-\\0176] characters in keys\n\
+ -k POS1[,POS2] same as +POS1 [-POS2], but all positions counted from 1\n\
+ -m merge already sorted files, do not sort\n\
+ -n compare according to string numerical value, imply -b\n\
+ -o FILE write result on FILE instead of standard output\n\
+ -r reverse the result of comparisons\n\
+ -s stabilize sort by disabling last resort comparison\n\
+ -t SEP use SEParator instead of non- to whitespace transition\n\
+ -u with -c, check for strict ordering\n\
+ -u with -m, only output the first of an equal sequence\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+POS is F[.C][OPTS], where F is the field number and C the character\n\
+position in the field, both counted from zero. OPTS is made up of one\n\
+or more of Mbdfinr, this effectively disable global -Mbdfinr settings\n\
+for that key. If no key given, use the entire line as key. With no\n\
+FILE, or when FILE is -, read standard input.\n\
+");
+ }
+ exit (status);
+}
diff --git a/gnu/usr.bin/sort/system.h b/gnu/usr.bin/sort/system.h
index bfb19e121c34..4aeaaea188b6 100644
--- a/gnu/usr.bin/sort/system.h
+++ b/gnu/usr.bin/sort/system.h
@@ -13,25 +13,48 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Include sys/types.h before this file. */
#include <sys/stat.h>
-#ifdef STAT_MACROS_BROKEN
+#ifdef STAT_MACROS_BROKEN
+#ifdef S_ISBLK
#undef S_ISBLK
+#endif
+#ifdef S_ISCHR
#undef S_ISCHR
+#endif
+#ifdef S_ISDIR
#undef S_ISDIR
+#endif
+#ifdef S_ISFIFO
#undef S_ISFIFO
+#endif
+#ifdef S_ISLNK
#undef S_ISLNK
+#endif
+#ifdef S_ISMPB
#undef S_ISMPB
+#endif
+#ifdef S_ISMPC
#undef S_ISMPC
+#endif
+#ifdef S_ISNWK
#undef S_ISNWK
+#endif
+#ifdef S_ISREG
#undef S_ISREG
+#endif
+#ifdef S_ISSOCK
#undef S_ISSOCK
-#endif /* STAT_MACROS_BROKEN. */
+#endif
+#endif /* STAT_MACROS_BROKEN. */
+#ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */
+#define mode_t unsigned short
+#endif
#if !defined(S_ISBLK) && defined(S_IFBLK)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#endif
@@ -67,56 +90,42 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
#ifndef _POSIX_VERSION
off_t lseek ();
#endif
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
+#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
+#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#include <memory.h>
#endif
-
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
+#include <string.h>
+#ifndef index
+#define index strchr
#endif
-
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
+#ifndef rindex
+#define rindex strrchr
+#endif
+/* Don't define bcopy; we need one that can handle overlaps. */
+#ifndef bzero
+#define bzero(s, n) memset ((s), 0, (n))
+#endif
+#ifndef bcmp
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif
-
-/* Don't use bcopy! Use memmove if source and destination may overlap,
- memcpy otherwise. */
-
-#ifdef HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
#else
-# include <strings.h>
+#include <strings.h>
char *memchr ();
#endif
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
char *getenv ();
+extern int errno;
#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-
-#ifdef HAVE_FCNTL_H
+#if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION)
#include <fcntl.h>
#else
#include <sys/file.h>
@@ -164,42 +173,28 @@ char *getenv ();
#include <ctype.h>
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-#define ISASCII(c) 1
-#else
-#define ISASCII(c) isascii(c)
+#ifndef isascii
+#define isascii(c) 1
#endif
#ifdef isblank
-#define ISBLANK(c) (ISASCII (c) && isblank (c))
+#define ISBLANK(c) (isascii (c) && isblank (c))
#else
#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef isgraph
-#define ISGRAPH(c) (ISASCII (c) && isgraph (c))
+#define ISGRAPH(c) (isascii (c) && isgraph (c))
#else
-#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
-#endif
-
-#define ISPRINT(c) (ISASCII (c) && isprint (c))
-#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
-#define ISALNUM(c) (ISASCII (c) && isalnum (c))
-#define ISALPHA(c) (ISASCII (c) && isalpha (c))
-#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
-#define ISLOWER(c) (ISASCII (c) && islower (c))
-#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
-#define ISSPACE(c) (ISASCII (c) && isspace (c))
-#define ISUPPER(c) (ISASCII (c) && isupper (c))
-#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
-
-/* Disable string localization for the time being. */
-#undef _
-#define _(String) String
-
-#ifndef __P
-# if PROTOTYPES
-# define __P(Args) Args
-# else
-# define __P(Args) ()
-# endif
-#endif
+#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c))
+#endif
+
+#define ISPRINT(c) (isascii (c) && isprint (c))
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISALNUM(c) (isascii (c) && isalnum (c))
+#define ISALPHA(c) (isascii (c) && isalpha (c))
+#define ISCNTRL(c) (isascii (c) && iscntrl (c))
+#define ISLOWER(c) (isascii (c) && islower (c))
+#define ISPUNCT(c) (isascii (c) && ispunct (c))
+#define ISSPACE(c) (isascii (c) && isspace (c))
+#define ISUPPER(c) (isascii (c) && isupper (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
diff --git a/gnu/usr.bin/sort/version.c b/gnu/usr.bin/sort/version.c
index 0289fcb69842..64c62b1953ab 100644
--- a/gnu/usr.bin/sort/version.c
+++ b/gnu/usr.bin/sort/version.c
@@ -1,3 +1,13 @@
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+ (which it would do because it found this file in $srcdir). */
#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
#include "version.h"
-const char *version_string = "GNU textutils 1.14";
+const char *version_string = "GNU textutils 1.9";
diff --git a/gnu/usr.bin/tar/Makefile b/gnu/usr.bin/tar/Makefile
index c9c76bfdda4b..c0b6d4410405 100644
--- a/gnu/usr.bin/tar/Makefile
+++ b/gnu/usr.bin/tar/Makefile
@@ -15,3 +15,4 @@ DPADD+= ${LIBGNUREGEX}
LDADD+= -lgnuregex
.include <bsd.prog.mk>
+.include "../../usr.bin/Makefile.inc"
diff --git a/gnu/usr.bin/tar/getdate.y b/gnu/usr.bin/tar/getdate.y
index aa8f6b512a33..86ca34f7f59c 100644
--- a/gnu/usr.bin/tar/getdate.y
+++ b/gnu/usr.bin/tar/getdate.y
@@ -1,5 +1,5 @@
%{
-/* $Revision: 1.1.1.1 $
+/* $Revision: 1.2 $
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
@@ -98,7 +98,7 @@ extern struct tm *localtime();
#if !defined(lint) && !defined(SABER)
static char RCS[] =
- "$Header: /home/ncvs/src/gnu/usr.bin/tar/getdate.y,v 1.1.1.1 1993/06/18 04:22:21 jkh Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/gnu/usr.bin/tar/getdate.y,v 1.2 1994/11/04 02:12:22 jkh Exp $";
#endif /* !defined(lint) && !defined(SABER) */
diff --git a/gnu/usr.bin/tar/tar.1 b/gnu/usr.bin/tar/tar.1
index 2cb50b30c01e..f2ade73b05a9 100644
--- a/gnu/usr.bin/tar/tar.1
+++ b/gnu/usr.bin/tar/tar.1
@@ -39,7 +39,7 @@ regular disk file.
The first argument word of the
.Nm
command line is usually a command word of bundled function and modifier
-letters, optionally preceded by a dash;
+letters, optionally preceeded by a dash;
it must contain exactly one function letter from the set
.Cm A ,
.Cm c ,
@@ -53,7 +53,7 @@ extract (further described below). The command word can also contain other
function modifiers described below, some of which will take arguments from
the command line in the order they are specified in the command word (review
the EXAMPLES section). Functions and function modifiers can also be specified
-with the GNU argument convention (preceded by two dashes, one function or
+with the GNU argument convention (preceeded by two dashes, one function or
modifier per word. Command-line arguments that specify files to
add to, extract from, or list from an archive may be given as shell
pattern matching strings.
@@ -132,7 +132,7 @@ this will change the inode-change time!).
Sets the block size for reading or writing to N 512-byte blocks.
.It Fl B
.It Fl -read-full-blocks
-Re-assemble short reads into full blocks (for reading 4.2BSD pipes).
+Re-assemble short readsinto full blocks (for reading 4.2BSD pipes).
.It Fl C Ar directory
.It Fl -directory Ar directory
Change to
@@ -176,7 +176,7 @@ Ignore blocks of zeroes in archive (usually means End-Of-File).
.It Fl -ignore-failed-read
Don't exit with non-zero status on unreadable files.
.It Fl k
-.It Fl -keep-old-files
+-It Fl -keep-old-files
Keep files which already exist on disk; don't overwrite them from the archive.
.It Fl K Ar file
.It Fl -starting-file Ar file
@@ -215,9 +215,6 @@ Extract all protection information.
.It Fl -preserve
Has the effect of
.Fl p s.
-.It Fl P
-.It Fl -absolute-paths
-Don't strip leading `/' from file names.
.It Fl R
.It Fl -record-number
Show record number within archive with each message.
@@ -375,7 +372,7 @@ domain version), Jay Fenlason (first GNU author), Joy Kendall, Jim
Kingdon, David J. MacKenzie, Michael I Bushnell, Noah Friedman, and
innumerable others who have contributed fixes and additions.
-Man page obtained by the FreeBSD group from the NetBSD 1.0 release.
+Obtained by the FreeBSD group from the NetBSD 1.0 release.
.Sh BUGS
The
.Fl C
diff --git a/gnu/usr.bin/tar/tar.c b/gnu/usr.bin/tar/tar.c
index 8fb8f810a345..84e2b94283ce 100644
--- a/gnu/usr.bin/tar/tar.c
+++ b/gnu/usr.bin/tar/tar.c
@@ -25,9 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <sys/types.h> /* Needed for typedefs in tar.h */
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#include "getopt.h"
/*
@@ -201,10 +198,6 @@ main (argc, argv)
{
extern char version_string[];
-#ifdef __FreeBSD__
- (void) setlocale (LC_ALL, "");
-#endif
-
tar = argv[0]; /* JF: was "tar" Set program name */
filename_terminator = '\n';
errors = 0;
diff --git a/gnu/usr.bin/texinfo/Makefile.inc b/gnu/usr.bin/texinfo/Makefile.inc
index 3bc46441f473..2aa30701b803 100644
--- a/gnu/usr.bin/texinfo/Makefile.inc
+++ b/gnu/usr.bin/texinfo/Makefile.inc
@@ -1,3 +1,5 @@
# Texinfo defaults.
# $Id: Makefile.inc,v 1.2 1994/09/15 12:09:36 jkh Exp $
+INFODIR?= /usr/share/info
+
diff --git a/gnu/usr.bin/texinfo/info-files/Makefile b/gnu/usr.bin/texinfo/info-files/Makefile
index eeda5bd5f4a3..1337187d7885 100644
--- a/gnu/usr.bin/texinfo/info-files/Makefile
+++ b/gnu/usr.bin/texinfo/info-files/Makefile
@@ -5,7 +5,7 @@
INFOFILES= dir
install:
- ${INSTALL} -c -g ${BINGRP} -o ${BINOWN} -m 444 ${INFOFILES} \
+ install ${COPY} -g ${BINGRP} -o ${BINOWN} -m 444 ${INFOFILES} \
${DESTDIR}${INFODIR}
clean cleandir obj:
diff --git a/gnu/usr.bin/texinfo/info-files/dir b/gnu/usr.bin/texinfo/info-files/dir
index 6c7f9002d373..ddedcfbcc747 100644
--- a/gnu/usr.bin/texinfo/info-files/dir
+++ b/gnu/usr.bin/texinfo/info-files/dir
@@ -15,9 +15,6 @@ File: dir Node: Top This is the top of the INFO tree
System utilities:
* AMD: (amdref). AMD Reference Manual.
-* CVS: (cvs). CVS Reference Manual.
-* CVS-CLIENT: (cvsclient). CVS client/server Reference Manual.
-* DIFF: (diff). DIFF/PATCH Reference Manual.
* DC: (dc). The GNU desk calculator.
* GAWK: (gawk). The GNU AWK language interpreter manual.
* Info: (info). Manual for this documentation browsing system.
@@ -46,7 +43,6 @@ Programming & development tools:
* GXX Internals: (gxxint). Guide to the internals of the GNU C++ compiler.
* GDB: (gdb). The GNU Debugger (C & C++) manual.
* GDB Internals: (gdbint). Guide to the internals of GDB.
-* GMP: (gmp). The GNU MP Math library.
* History: (history). The GNU History library.
* Readline: (readline). The GNU Readline library
* Regex: (regex). The GNU regular expression library.
diff --git a/gnu/usr.bin/texinfo/info/info.1 b/gnu/usr.bin/texinfo/info/info.1
index aabfcf12962d..674bcefb8dde 100644
--- a/gnu/usr.bin/texinfo/info/info.1
+++ b/gnu/usr.bin/texinfo/info/info.1
@@ -216,8 +216,7 @@ is not given.
.B INFO_PRINT_COMMAND
The command used for printing.
.SH SEE ALSO
-.BR man (1)
-.\" .BR emacs (1)
+.BR emacs (1)
.SH AUTHOR
.RS
Brian Fox, Free Software Foundation
diff --git a/gnu/usr.bin/texinfo/misc/Makefile b/gnu/usr.bin/texinfo/misc/Makefile
index c53561dd405c..59fb65f61a2c 100644
--- a/gnu/usr.bin/texinfo/misc/Makefile
+++ b/gnu/usr.bin/texinfo/misc/Makefile
@@ -39,8 +39,8 @@ LOADLIBES = $(LIBS)
SHELL = /bin/sh
-CFLAGS = -O2
-LDFLAGS = -O2
+CFLAGS = -g
+LDFLAGS = -g
prefix = /usr/local
exec_prefix = $(prefix)
diff --git a/gnu/usr.sbin/Makefile b/gnu/usr.sbin/Makefile
index 0ddbbf4b1af3..015692ca153a 100644
--- a/gnu/usr.sbin/Makefile
+++ b/gnu/usr.sbin/Makefile
@@ -1,6 +1,6 @@
# $Id: Makefile,v 1.1 1995/01/31 09:14:01 wpaul Exp $
-SUBDIR=
+SUBDIR= yppasswdd ypserv yp_mkdb
.include <bsd.subdir.mk>
diff --git a/include/Makefile b/include/Makefile
index 9c819ff712ba..227127e34681 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,5 +1,5 @@
# From: @(#)Makefile 8.2 (Berkeley) 1/4/94
-# $Id: Makefile,v 1.35 1996/02/14 15:17:53 wollman Exp $
+# $Id: Makefile,v 1.25.4.2 1995/08/31 21:30:59 davidg Exp $
#
# Doing a make install builds /usr/include
#
@@ -10,13 +10,14 @@ all depend lint tags:
CLEANFILES=version vers.c
SUBDIR= rpcsvc
+# XXX MISSING: mp.h
FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
err.h f2c.h fnmatch.h fstab.h fts.h glob.h grp.h strhash.h histedit.h \
kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h ndbm.h \
- netdb.h nl_types.h nlist.h paths.h pthread.h pwd.h ranlib.h regex.h \
- regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h signal.h \
+ netdb.h nl_types.h nlist.h paths.h pwd.h ranlib.h regex.h regexp.h \
+ resolv.h rune.h runetype.h setjmp.h sgtty.h signal.h \
stab.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \
- sysexits.h tar.h time.h timers.h ttyent.h unistd.h utime.h \
+ sysexits.h tar.h time.h ttyent.h unistd.h utime.h \
utmp.h vis.h
.if defined(WANT_CSRG_LIBM)
FILES+= math.h
@@ -26,7 +27,7 @@ MFILES= float.h floatingpoint.h stdarg.h varargs.h
LFILES= errno.h fcntl.h syslog.h termios.h
DIRS= arpa protocols rpc
-LDIRS= net netinet netipx nfs sys vm #netccitt netiso netns
+LDIRS= net netccitt netinet netiso netns nfs sys vm
LUDIR= ufs
UDIRS= ufs/ffs ufs/lfs ufs/mfs ufs/ufs
@@ -92,7 +93,6 @@ copies:
rm -rf ${DESTDIR}/usr/include/${LUDIR}
mkdir ${DESTDIR}/usr/include/${LUDIR}
chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/${LUDIR}
- chmod 755 ${DESTDIR}/usr/include/${LUDIR}
@-for i in ${LDIRS} ${UDIRS}; do \
${ECHO} ${SHARED} $$i; \
rm -rf ${DESTDIR}/usr/include/$$i; \
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index a6692269a45b..403530401d8a 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -53,7 +53,6 @@
*
* @(#)nameser.h 8.2 (Berkeley) 2/16/94
* From Id: nameser.h,v 4.9.1.15 1994/07/19 22:51:24 vixie Exp
- * $Id: nameser.h,v 1.7 1996/01/30 23:31:16 mpp Exp $
*/
#ifndef _ARPA_NAMESER_H_
@@ -202,7 +201,7 @@ typedef struct {
/* fields in third byte */
unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritative answer */
+ unsigned aa: 1; /* authoritive answer */
unsigned tc: 1; /* truncated message */
unsigned rd: 1; /* recursion desired */
/* fields in fourth byte */
@@ -214,7 +213,7 @@ typedef struct {
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritative answer */
+ unsigned aa :1; /* authoritive answer */
unsigned opcode :4; /* purpose of message */
unsigned qr :1; /* response flag */
/* fields in fourth byte */
diff --git a/include/arpa/telnet.h b/include/arpa/telnet.h
index 89e5c484a4f8..28f52d8b1dbc 100644
--- a/include/arpa/telnet.h
+++ b/include/arpa/telnet.h
@@ -200,7 +200,7 @@ char *telopts[NTELOPTS+1] = {
#define NSLC 18
/*
- * For backwards compatibility, we define SLC_NAMES to be the
+ * For backwards compatability, we define SLC_NAMES to be the
* list of names if SLC_NAMES is not defined.
*/
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
diff --git a/include/ctype.h b/include/ctype.h
index e14e514dd51c..157134eea879 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -111,16 +111,16 @@ __END_DECLS
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
-#define isphonogram(c) __istype((c), _Q)
+#define isphonogram(c) __istype((c), _T)
#define isrune(c) __istype((c), 0xFFFFFF00L)
-#define isspecial(c) __istype((c), _T)
+#define isspecial(c) __istype((c), _Q)
#endif
-/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
+/* See comments in <machine/ansi.h> about _BSD_RUNE_T_. */
__BEGIN_DECLS
-unsigned long ___runetype __P((_BSD_CT_RUNE_T_));
-_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_));
-_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_));
+unsigned long ___runetype __P((_BSD_RUNE_T_));
+_BSD_RUNE_T_ ___tolower __P((_BSD_RUNE_T_));
+_BSD_RUNE_T_ ___toupper __P((_BSD_RUNE_T_));
__END_DECLS
/*
@@ -139,40 +139,48 @@ __END_DECLS
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
static __inline int
-__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
+__istype(_BSD_RUNE_T_ _c, unsigned long _f)
{
- return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) :
- !!(_CurrentRuneLocale->runetype[_c] & _f);
+ if (_c < 0)
+ _c = (unsigned char) _c;
+ return((((_c & _CRMASK) ? ___runetype(_c) :
+ _CurrentRuneLocale->runetype[_c]) & _f) ? 1 : 0);
}
static __inline int
-__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
+__isctype(_BSD_RUNE_T_ _c, unsigned long _f)
{
- return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
- !!(_DefaultRuneLocale.runetype[_c] & _f);
+ if (_c < 0)
+ _c = (unsigned char) _c;
+ return((((_c & _CRMASK) ? 0 :
+ _DefaultRuneLocale.runetype[_c]) & _f) ? 1 : 0);
}
-static __inline _BSD_CT_RUNE_T_
-__toupper(_BSD_CT_RUNE_T_ _c)
+static __inline _BSD_RUNE_T_
+__toupper(_BSD_RUNE_T_ _c)
{
- return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
- _CurrentRuneLocale->mapupper[_c];
+ if (_c < 0)
+ _c = (unsigned char) _c;
+ return((_c & _CRMASK) ?
+ ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]);
}
-static __inline _BSD_CT_RUNE_T_
-__tolower(_BSD_CT_RUNE_T_ _c)
+static __inline _BSD_RUNE_T_
+__tolower(_BSD_RUNE_T_ _c)
{
- return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
- _CurrentRuneLocale->maplower[_c];
+ if (_c < 0)
+ _c = (unsigned char) _c;
+ return((_c & _CRMASK) ?
+ ___tolower(_c) : _CurrentRuneLocale->maplower[_c]);
}
#else /* not using inlines */
__BEGIN_DECLS
-int __istype __P((_BSD_CT_RUNE_T_, unsigned long));
-int __isctype __P((_BSD_CT_RUNE_T_, unsigned long));
-_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_));
-_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_));
+int __istype __P((_BSD_RUNE_T_, unsigned long));
+int __isctype __P((_BSD_RUNE_T_, unsigned long));
+_BSD_RUNE_T_ __toupper __P((_BSD_RUNE_T_));
+_BSD_RUNE_T_ __tolower __P((_BSD_RUNE_T_));
__END_DECLS
#endif /* using inlines */
diff --git a/include/db.h b/include/db.h
index cd907c3abe78..abf4ddd8cc15 100644
--- a/include/db.h
+++ b/include/db.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)db.h 8.7 (Berkeley) 6/16/94
+ * @(#)db.h 8.4 (Berkeley) 2/21/94
*/
#ifndef _DB_H_
@@ -152,7 +152,7 @@ typedef struct {
int lorder; /* byte order */
size_t reclen; /* record length (fixed-length records) */
u_char bval; /* delimiting byte (variable-length records */
- char *bfname; /* btree file name */
+ char *bfname; /* btree file name */
} RECNOINFO;
#ifdef __DBINTERFACE_PRIVATE
diff --git a/include/link.h b/include/link.h
index e527ab3d6c45..c71a1fcbd539 100644
--- a/include/link.h
+++ b/include/link.h
@@ -14,7 +14,7 @@
* must display the following acknowledgement:
* This product includes software developed by Paul Kranenburg.
* 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
+ * derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -27,7 +27,7 @@
* (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: link.h,v 1.6 1996/01/30 23:30:20 mpp Exp $
+ * $Id: link.h,v 1.4.4.1 1995/08/25 07:08:07 davidg Exp $
*/
/*
@@ -42,7 +42,7 @@
#define _LINK_H_
/*
- * A `Shared Object Descriptor' describes a shared object that is needed
+ * A `Shared Object Descriptor' descibes a shared object that is needed
* to complete the link edit process of the object containing it.
* A list of such objects (chained through `sod_next') is pointed at
* by `sdt_sods' in the section_dispatch_table structure.
@@ -237,7 +237,7 @@ struct _dynamic {
*/
struct crt_ldso {
int crt_ba; /* Base address of ld.so */
- int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */
+ int crt_dzfd; /* "/dev/zero" file decriptor (SunOS) */
int crt_ldfd; /* ld.so file descriptor */
struct _dynamic *crt_dp; /* Main's __DYNAMIC */
char **crt_ep; /* environment strings */
diff --git a/include/mpool.h b/include/mpool.h
index 9e3ebeb4ed7a..17efb3f82cfc 100644
--- a/include/mpool.h
+++ b/include/mpool.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1991, 1993, 1994
+ * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,65 +30,101 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)mpool.h 8.2 (Berkeley) 7/14/94
+ * @(#)mpool.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _MPOOL_H_
#define _MPOOL_H_
-#include <sys/queue.h>
-
/*
- * The memory pool scheme is a simple one. Each in-memory page is referenced
- * by a bucket which is threaded in up to two of three ways. All active pages
- * are threaded on a hash chain (hashed by page number) and an lru chain.
- * Inactive pages are threaded on a free chain. Each reference to a memory
- * pool is handed an opaque MPOOL cookie which stores all of this information.
+ * The memory pool scheme is a simple one. Each in memory page is referenced
+ * by a bucket which is threaded in three ways. All active pages are threaded
+ * on a hash chain (hashed by the page number) and an lru chain. Inactive
+ * pages are threaded on a free chain. Each reference to a memory pool is
+ * handed an MPOOL which is the opaque cookie passed to all of the memory
+ * routines.
*/
#define HASHSIZE 128
#define HASHKEY(pgno) ((pgno - 1) % HASHSIZE)
-/* The BKT structures are the elements of the queues. */
-typedef struct _bkt {
- CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */
- CIRCLEQ_ENTRY(_bkt) q; /* lru queue */
- void *page; /* page */
- pgno_t pgno; /* page number */
+/* The BKT structures are the elements of the lists. */
+typedef struct BKT {
+ struct BKT *hnext; /* next hash bucket */
+ struct BKT *hprev; /* previous hash bucket */
+ struct BKT *cnext; /* next free/lru bucket */
+ struct BKT *cprev; /* previous free/lru bucket */
+ void *page; /* page */
+ pgno_t pgno; /* page number */
#define MPOOL_DIRTY 0x01 /* page needs to be written */
#define MPOOL_PINNED 0x02 /* page is pinned into memory */
- u_int8_t flags; /* flags */
+ unsigned long flags; /* flags */
} BKT;
+/* The BKTHDR structures are the heads of the lists. */
+typedef struct BKTHDR {
+ struct BKT *hnext; /* next hash bucket */
+ struct BKT *hprev; /* previous hash bucket */
+ struct BKT *cnext; /* next free/lru bucket */
+ struct BKT *cprev; /* previous free/lru bucket */
+} BKTHDR;
+
typedef struct MPOOL {
- CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */
- /* hash queue array */
- CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE];
- pgno_t curcache; /* current number of cached pages */
- pgno_t maxcache; /* max number of cached pages */
- pgno_t npages; /* number of pages in the file */
- u_long pagesize; /* file page size */
- int fd; /* file descriptor */
- /* page in conversion routine */
+ BKTHDR free; /* The free list. */
+ BKTHDR lru; /* The LRU list. */
+ BKTHDR hashtable[HASHSIZE]; /* Hashed list by page number. */
+ pgno_t curcache; /* Current number of cached pages. */
+ pgno_t maxcache; /* Max number of cached pages. */
+ pgno_t npages; /* Number of pages in the file. */
+ u_long pagesize; /* File page size. */
+ int fd; /* File descriptor. */
+ /* Page in conversion routine. */
void (*pgin) __P((void *, pgno_t, void *));
- /* page out conversion routine */
+ /* Page out conversion routine. */
void (*pgout) __P((void *, pgno_t, void *));
- void *pgcookie; /* cookie for page in/out routines */
+ void *pgcookie; /* Cookie for page in/out routines. */
#ifdef STATISTICS
- u_long cachehit;
- u_long cachemiss;
- u_long pagealloc;
- u_long pageflush;
- u_long pageget;
- u_long pagenew;
- u_long pageput;
- u_long pageread;
- u_long pagewrite;
+ unsigned long cachehit;
+ unsigned long cachemiss;
+ unsigned long pagealloc;
+ unsigned long pageflush;
+ unsigned long pageget;
+ unsigned long pagenew;
+ unsigned long pageput;
+ unsigned long pageread;
+ unsigned long pagewrite;
#endif
} MPOOL;
+#ifdef __MPOOLINTERFACE_PRIVATE
+/* Macros to insert/delete into/from hash chain. */
+#define rmhash(bp) { \
+ (bp)->hprev->hnext = (bp)->hnext; \
+ (bp)->hnext->hprev = (bp)->hprev; \
+}
+#define inshash(bp, pg) { \
+ hp = &mp->hashtable[HASHKEY(pg)]; \
+ (bp)->hnext = hp->hnext; \
+ (bp)->hprev = (struct BKT *)hp; \
+ hp->hnext->hprev = (bp); \
+ hp->hnext = (bp); \
+}
+
+/* Macros to insert/delete into/from lru and free chains. */
+#define rmchain(bp) { \
+ (bp)->cprev->cnext = (bp)->cnext; \
+ (bp)->cnext->cprev = (bp)->cprev; \
+}
+#define inschain(bp, dp) { \
+ (bp)->cnext = (dp)->cnext; \
+ (bp)->cprev = (struct BKT *)(dp); \
+ (dp)->cnext->cprev = (bp); \
+ (dp)->cnext = (bp); \
+}
+#endif
+
__BEGIN_DECLS
-MPOOL *mpool_open __P((void *, int, pgno_t, pgno_t));
+MPOOL *mpool_open __P((DBT *, int, pgno_t, pgno_t));
void mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *),
void (*)(void *, pgno_t, void *), void *));
void *mpool_new __P((MPOOL *, pgno_t *));
diff --git a/include/ndbm.h b/include/ndbm.h
index 8d50be8655bf..a545bca1326e 100644
--- a/include/ndbm.h
+++ b/include/ndbm.h
@@ -49,7 +49,7 @@
#define DBM_REPLACE 1
/*
- * The db(3) support for ndbm always appends this suffix to the
+ * The db(3) support for ndbm(3) always appends this suffix to the
* file name to avoid overwriting the user's original database.
*/
#define DBM_SUFFIX ".db"
diff --git a/include/netdb.h b/include/netdb.h
index 1b1290b86901..4ea2f630342d 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * $Id: netdb.h,v 1.4 1996/01/30 23:30:30 mpp Exp $
+ * $Id: netdb.h,v 1.2.4.1 1995/08/30 04:06:24 davidg Exp $
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
@@ -76,7 +76,7 @@ struct hostent {
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
+#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
/*
@@ -111,7 +111,7 @@ struct protoent {
#define NETDB_INTERNAL -1 /* see errno */
#define NETDB_SUCCESS 0 /* no problem */
#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
+#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
#define NO_DATA 4 /* Valid name, no data record of requested type */
#define NO_ADDRESS NO_DATA /* no address, look for MX record */
diff --git a/include/protocols/routed.h b/include/protocols/routed.h
index c2b8327172a0..4dd83bd0bc9c 100644
--- a/include/protocols/routed.h
+++ b/include/protocols/routed.h
@@ -33,12 +33,8 @@
* @(#)routed.h 8.1 (Berkeley) 6/2/93
*/
-#ifndef _ROUTED_H_
-#define _ROUTED_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ident "$Revision: 1.4 $"
+#ifndef _PROTOCOLS_ROUTED_H_
+#define _PROTOCOLS_ROUTED_H_
/*
* Routing Information Protocol
@@ -47,93 +43,44 @@ extern "C" {
* by changing 32-bit net numbers to sockaddr's and
* padding stuff to 32-bit boundaries.
*/
+#define RIPVERSION 1
-#define RIPv1 1
-#define RIPv2 2
-#ifndef RIPVERSION
-#define RIPVERSION RIPv1
-#endif
-
-#define RIP_PORT 520
-
-#if RIPVERSION == 1
-/* Note that this so called sockaddr has a 2-byte sa_family and no sa_len.
- * It is not a UNIX sockaddr, but the shape of an address as defined
- * in RIPv1.
- */
struct netinfo {
struct sockaddr rip_dst; /* destination net/host */
int rip_metric; /* cost of route */
};
-#else
-struct netinfo {
- u_short n_family;
-#define RIP_AF_INET htons(AF_INET)
-#define RIP_AF_UNSPEC 0
-#define RIP_AF_AUTH 0xffff
- u_short n_tag; /* optional in RIPv2 */
- u_int n_dst; /* destination net or host */
-#define RIP_DEFAULT 0
- u_int n_mask; /* netmask in RIPv2 */
- u_int n_nhop; /* optional next hop in RIPv2 */
- u_int n_metric; /* cost of route */
-};
-#endif
-
-/* RIPv2 authentication */
-struct netauth {
- u_short a_type;
-#define RIP_AUTH_PW htons(2) /* password type */
- union {
-#define RIP_AUTH_PW_LEN 16
- char au_pw[RIP_AUTH_PW_LEN];
- } au;
-};
struct rip {
u_char rip_cmd; /* request/response */
u_char rip_vers; /* protocol version # */
- u_short rip_res1; /* pad to 32-bit boundary */
- union { /* variable length... */
- struct netinfo ru_nets[1];
- char ru_tracefile[1];
- struct netauth ru_auth[1];
+ u_char rip_res1[2]; /* pad to 32-bit boundary */
+ union {
+ struct netinfo ru_nets[1]; /* variable length... */
+ char ru_tracefile[1]; /* ditto ... */
} ripun;
#define rip_nets ripun.ru_nets
#define rip_tracefile ripun.ru_tracefile
};
-/* Packet types.
+/*
+ * Packet types.
*/
#define RIPCMD_REQUEST 1 /* want info */
#define RIPCMD_RESPONSE 2 /* responding to request */
#define RIPCMD_TRACEON 3 /* turn tracing on */
#define RIPCMD_TRACEOFF 4 /* turn it off */
-/* Gated extended RIP to include a "poll" command instead of using
- * RIPCMD_REQUEST with (RIP_AF_UNSPEC, RIP_DEFAULT). RFC 1058 says
- * command 5 is used by Sun Microsystems for its own purposes.
- */
-#define RIPCMD_POLL 5
-
-#define RIPCMD_MAX 6
-
+#define RIPCMD_MAX 5
#ifdef RIPCMDS
-char *ripcmds[RIPCMD_MAX] = {
- "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF"
-};
+char *ripcmds[RIPCMD_MAX] =
+ { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
#endif
-#define HOPCNT_INFINITY 16
+#define HOPCNT_INFINITY 16 /* per Xerox NS */
#define MAXPACKETSIZE 512 /* max broadcast size */
-#define NETS_LEN ((MAXPACKETSIZE-sizeof(struct rip)) \
- / sizeof(struct netinfo) +1)
-
-#define INADDR_RIP_GROUP (u_long)0xe0000009 /* 224.0.0.9 */
-
-/* Timer values used in managing the routing table.
- *
+/*
+ * Timer values used in managing the routing table.
* Complete tables are broadcast every SUPPLY_INTERVAL seconds.
* If changes occur between updates, dynamic updates containing only changes
* may be sent. When these are sent, a timer is set for a random value
@@ -142,30 +89,16 @@ char *ripcmds[RIPCMD_MAX] = {
*
* Every update of a routing entry forces an entry's timer to be reset.
* After EXPIRE_TIME without updates, the entry is marked invalid,
- * but held onto until GARBAGE_TIME so that others may see it, to
- * "poison" the bad route.
+ * but held onto until GARBAGE_TIME so that others may
+ * see it "be deleted".
*/
+#define TIMER_RATE 30 /* alarm clocks every 30 seconds */
+
#define SUPPLY_INTERVAL 30 /* time to supply tables */
-#define MIN_WAITTIME 2 /* min sec until next flash updates */
-#define MAX_WAITTIME 5 /* max sec until flash update */
+#define MIN_WAITTIME 2 /* min. interval to broadcast changes */
+#define MAX_WAITTIME 5 /* max. time to delay changes */
-#define STALE_TIME 90 /* switch to a new gateway */
#define EXPIRE_TIME 180 /* time to mark entry invalid */
#define GARBAGE_TIME 240 /* time to garbage collect */
-/* It is good to continue advertising bad routes this long so other
- * routers notice. This is fairly cheap, so it can be long. It
- * should be long to combat bogus holddowns implemented by major
- * router vendors.
- */
-#define POISON_TIME 120
-
-/* Do not switch to a new route for this long after a route has gone
- * bad, to ensure that the new route is not a remanent of the old route.
- */
-#define HOLD_TIME (MAX_WAITTIME*2)
-
-#ifdef __cplusplus
-}
-#endif
#endif /* !_ROUTED_H_ */
diff --git a/include/resolv.h b/include/resolv.h
index 77b4d1bff7e7..b7e24e7d02dc 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -53,7 +53,7 @@
*
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
* From Id: resolv.h,v 4.9.1.2 1993/05/17 09:59:01 vixie Exp
- * $Id: resolv.h,v 1.6 1996/01/30 23:30:34 mpp Exp $
+ * $Id: resolv.h,v 1.3.4.1 1995/08/30 04:06:27 davidg Exp $
*/
#ifndef _RESOLV_H_
@@ -72,7 +72,7 @@
* is new enough to contain a certain feature.
*/
-#define __RES 19951031
+#define __RES 19950621
/*
* Resolver configuration file.
@@ -115,7 +115,6 @@ struct __res_state {
struct in_addr addr;
u_int32_t mask;
} sort_list[MAXRESOLVSORT];
- char pad[72]; /* On an i386 this means 512b total. */
};
/*
@@ -126,7 +125,7 @@ struct __res_state {
#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
#define RES_USEVC 0x00000008 /* use virtual circuit */
#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
+#define RES_IGNTC 0x00000020 /* ignore trucation errors */
#define RES_RECURSE 0x00000040 /* recursion desired */
#define RES_DEFNAMES 0x00000080 /* use default domain name */
#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
diff --git a/include/rpc/auth.h b/include/rpc/auth.h
index 087e98805ae3..5ac0f61d0be1 100644
--- a/include/rpc/auth.h
+++ b/include/rpc/auth.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)auth.h 1.17 88/02/08 SMI
* from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC
- * $Id: auth.h,v 1.5 1996/01/31 08:02:11 hsu Exp $
+ * $Id: auth.h,v 1.3 1995/05/30 04:55:09 rgrimes Exp $
*/
/*
@@ -68,10 +68,14 @@ enum auth_stat {
AUTH_FAILED=7 /* some unknown reason */
};
+#if (mc68000 || sparc || vax || i386 || tahoe || hp300)
+typedef u_long u_int32; /* 32-bit unsigned integers */
+#endif
+
union des_block {
struct {
- u_int32_t high;
- u_int32_t low;
+ u_int32 high;
+ u_int32 low;
} key;
char c[8];
};
@@ -100,7 +104,7 @@ typedef struct {
struct auth_ops {
void (*ah_nextverf)();
int (*ah_marshal)(); /* nextverf & serialize */
- int (*ah_validate)(); /* validate verifier */
+ int (*ah_validate)(); /* validate varifier */
int (*ah_refresh)(); /* refresh credentials */
void (*ah_destroy)(); /* destroy this structure */
} *ah_ops;
diff --git a/include/rpc/auth_unix.h b/include/rpc/auth_unix.h
index 34ddc1ad2edd..4699ada38f9e 100644
--- a/include/rpc/auth_unix.h
+++ b/include/rpc/auth_unix.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)auth_unix.h 1.8 88/02/08 SMI
* from: @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC
- * $Id: auth_unix.h,v 1.4 1996/01/30 23:31:42 mpp Exp $
+ * $Id: auth_unix.h,v 1.3 1995/05/30 04:55:11 rgrimes Exp $
*/
/*
diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h
index 02080eb3e032..12b1f20d2854 100644
--- a/include/rpc/clnt.h
+++ b/include/rpc/clnt.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)clnt.h 1.31 88/02/08 SMI
* from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: clnt.h,v 1.4 1996/01/30 23:31:48 mpp Exp $
+ * $Id: clnt.h,v 1.3 1995/05/30 04:55:14 rgrimes Exp $
*/
/*
@@ -91,7 +91,7 @@ enum clnt_stat {
struct rpc_err {
enum clnt_stat re_status;
union {
- int RE_errno; /* related system error */
+ int RE_errno; /* realated system error */
enum auth_stat RE_why; /* why the auth error occurred */
struct {
u_long low; /* lowest verion supported */
@@ -210,7 +210,7 @@ typedef struct {
/*
- * RPCTEST is a test program which is accessible on every rpc
+ * RPCTEST is a test program which is accessable on every rpc
* transport/port. It is used for testing, performance evaluation,
* and network administration.
*/
diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h
index a0b53b4351ef..72c9c4398e45 100644
--- a/include/rpc/pmap_clnt.h
+++ b/include/rpc/pmap_clnt.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
* from: @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: pmap_clnt.h,v 1.4 1996/01/30 23:31:59 mpp Exp $
+ * $Id: pmap_clnt.h,v 1.3 1995/05/30 04:55:16 rgrimes Exp $
*/
/*
diff --git a/include/rpc/pmap_prot.h b/include/rpc/pmap_prot.h
index f4f19673842e..7263a0fed84b 100644
--- a/include/rpc/pmap_prot.h
+++ b/include/rpc/pmap_prot.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)pmap_prot.h 1.14 88/02/08 SMI
* from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: pmap_prot.h,v 1.4 1996/01/30 23:32:08 mpp Exp $
+ * $Id: pmap_prot.h,v 1.3 1995/05/30 04:55:18 rgrimes Exp $
*/
/*
diff --git a/include/rpc/pmap_rmt.h b/include/rpc/pmap_rmt.h
index d76131e49a34..95d1f94f85cd 100644
--- a/include/rpc/pmap_rmt.h
+++ b/include/rpc/pmap_rmt.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)pmap_rmt.h 1.2 88/02/08 SMI
* from: @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: pmap_rmt.h,v 1.4 1996/01/30 23:32:12 mpp Exp $
+ * $Id: pmap_rmt.h,v 1.3 1995/05/30 04:55:20 rgrimes Exp $
*/
/*
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index 66bab11811bc..9ec14a4bec34 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)rpc.h 1.9 88/02/08 SMI
* from: @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC
- * $Id: rpc.h,v 1.5 1996/01/30 23:32:20 mpp Exp $
+ * $Id: rpc.h,v 1.4 1995/05/30 04:55:23 rgrimes Exp $
*/
/*
diff --git a/include/rpc/rpc_msg.h b/include/rpc/rpc_msg.h
index ff77693158a1..0e8a74fc7d4b 100644
--- a/include/rpc/rpc_msg.h
+++ b/include/rpc/rpc_msg.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)rpc_msg.h 1.7 86/07/16 SMI
* from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: rpc_msg.h,v 1.5 1996/01/30 23:32:24 mpp Exp $
+ * $Id: rpc_msg.h,v 1.4 1995/05/30 04:55:25 rgrimes Exp $
*/
/*
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index 2be1a7e5bfee..c9872d4560e3 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)svc.h 1.20 88/02/08 SMI
* from: @(#)svc.h 2.2 88/07/29 4.0 RPCSRC
- * $Id: svc.h,v 1.5 1996/01/30 23:32:29 mpp Exp $
+ * $Id: svc.h,v 1.4 1995/05/30 04:55:28 rgrimes Exp $
*/
/*
@@ -76,7 +76,7 @@ typedef struct {
int xp_sock;
u_short xp_port; /* associated port number */
struct xp_ops {
- bool_t (*xp_recv)(); /* receive incoming requests */
+ bool_t (*xp_recv)(); /* receive incomming requests */
enum xprt_stat (*xp_stat)(); /* get transport status */
bool_t (*xp_getargs)(); /* get arguments */
bool_t (*xp_reply)(); /* send reply */
diff --git a/include/rpc/svc_auth.h b/include/rpc/svc_auth.h
index 093e6a669169..360e93430170 100644
--- a/include/rpc/svc_auth.h
+++ b/include/rpc/svc_auth.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)svc_auth.h 1.6 86/07/16 SMI
* from: @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC
- * $Id: svc_auth.h,v 1.4 1996/01/30 23:32:36 mpp Exp $
+ * $Id: svc_auth.h,v 1.3 1995/05/30 04:55:32 rgrimes Exp $
*/
/*
diff --git a/include/rpc/types.h b/include/rpc/types.h
index 8dc34df6f06c..3cdaee3fcd00 100644
--- a/include/rpc/types.h
+++ b/include/rpc/types.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)types.h 1.18 87/07/24 SMI
* from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC
- * $Id: types.h,v 1.4 1996/01/30 23:32:39 mpp Exp $
+ * $Id: types.h,v 1.3 1995/05/30 04:55:35 rgrimes Exp $
*/
/*
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 49dd3320c5f9..87075abbe8fe 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -7,7 +7,7 @@
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
@@ -28,7 +28,7 @@
*
* from: @(#)xdr.h 1.19 87/04/22 SMI
* from: @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
- * $Id: xdr.h,v 1.4 1996/01/30 23:32:45 mpp Exp $
+ * $Id: xdr.h,v 1.3 1995/05/30 04:55:38 rgrimes Exp $
*/
/*
@@ -103,8 +103,8 @@ typedef bool_t (*xdrproc_t)();
/*
* The XDR handle.
* Contains operation which is being applied to the stream,
- * an operations vector for the particular implementation (e.g. see xdr_mem.c),
- * and two private fields for the use of the particular implementation.
+ * an operations vector for the paticular implementation (e.g. see xdr_mem.c),
+ * and two private fields for the use of the particular impelementation.
*/
typedef struct {
enum xdr_op x_op; /* operation; fast additional param */
@@ -192,7 +192,7 @@ struct xdr_discrim {
};
/*
- * In-line routines for fast encode/decode of primitive data types.
+ * In-line routines for fast encode/decode of primitve data types.
* Caveat emptor: these use single memory cycles to get the
* data from the underlying buffer, and will fail to operate
* properly if the data is not aligned. The standard way to use these
diff --git a/include/rpcsvc/Makefile b/include/rpcsvc/Makefile
index 52c23de44f70..d9d24e22a20c 100644
--- a/include/rpcsvc/Makefile
+++ b/include/rpcsvc/Makefile
@@ -1,5 +1,5 @@
# from: @(#)Makefile 2.3 88/08/11 4.0 RPCSRC
-# $Id: Makefile,v 1.7 1995/08/15 20:06:50 joerg Exp $
+# $Id: Makefile,v 1.3.4.1 1995/08/30 07:24:54 davidg Exp $
.SUFFIXES: .x
diff --git a/include/rpcsvc/bootparam_prot.x b/include/rpcsvc/bootparam_prot.x
index 249ed8ab90af..a6d4f0ee022f 100644
--- a/include/rpcsvc/bootparam_prot.x
+++ b/include/rpcsvc/bootparam_prot.x
@@ -44,6 +44,8 @@
%#include <sys/param.h>
%#include <sys/syslimits.h>
%#include <sys/ucred.h>
+%#include <nfs/nfsv2.h>
+%#include <nfs/nfs.h>
#else
%#ifndef lint
%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/
diff --git a/include/rpcsvc/yp.x b/include/rpcsvc/yp.x
index ce5bcf264f9b..7e3175e1d521 100644
--- a/include/rpcsvc/yp.x
+++ b/include/rpcsvc/yp.x
@@ -34,7 +34,7 @@
#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)yp.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static char rcsid[] = "$Id: yp.x,v 1.5 1996/02/26 02:22:53 wpaul Exp $";
+%static char rcsid[] = "$Id: yp.x,v 1.1 1994/08/04 19:01:55 wollman Exp $";
%#endif /* not lint */
#endif
@@ -119,13 +119,8 @@ struct ypresp_val {
struct ypresp_key_val {
ypstat stat;
-#ifdef STUPID_SUN_BUG /* These are backwards */
keydat key;
valdat val;
-#else
- valdat val;
- keydat key;
-#endif
};
@@ -225,78 +220,9 @@ struct ypbind_setdom {
/*
- * NIS v1 support for backwards compatibility
- */
-enum ypreqtype {
- YPREQ_KEY = 1,
- YPREQ_NOKEY = 2,
- YPREQ_MAP_PARMS = 3
-};
-
-enum ypresptype {
- YPRESP_VAL = 1,
- YPRESP_KEY_VAL = 2,
- YPRESP_MAP_PARMS = 3
-};
-
-union yprequest switch (ypreqtype yp_reqtype) {
-case YPREQ_KEY:
- ypreq_key yp_req_keytype;
-case YPREQ_NOKEY:
- ypreq_nokey yp_req_nokeytype;
-case YPREQ_MAP_PARMS:
- ypmap_parms yp_req_map_parmstype;
-};
-
-union ypresponse switch (ypresptype yp_resptype) {
-case YPRESP_VAL:
- ypresp_val yp_resp_valtype;
-case YPRESP_KEY_VAL:
- ypresp_key_val yp_resp_key_valtype;
-case YPRESP_MAP_PARMS:
- ypmap_parms yp_resp_map_parmstype;
-};
-
-#if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
-/*
* YP access protocol
*/
program YPPROG {
-/*
- * NIS v1 support for backwards compatibility
- */
- version YPOLDVERS {
- void
- YPOLDPROC_NULL(void) = 0;
-
- bool
- YPOLDPROC_DOMAIN(domainname) = 1;
-
- bool
- YPOLDPROC_DOMAIN_NONACK(domainname) = 2;
-
- ypresponse
- YPOLDPROC_MATCH(yprequest) = 3;
-
- ypresponse
- YPOLDPROC_FIRST(yprequest) = 4;
-
- ypresponse
- YPOLDPROC_NEXT(yprequest) = 5;
-
- ypresponse
- YPOLDPROC_POLL(yprequest) = 6;
-
- ypresponse
- YPOLDPROC_PUSH(yprequest) = 7;
-
- ypresponse
- YPOLDPROC_PULL(yprequest) = 8;
-
- ypresponse
- YPOLDPROC_GET(yprequest) = 9;
- } = 1;
-
version YPVERS {
void
YPPROC_NULL(void) = 0;
@@ -311,11 +237,8 @@ program YPPROG {
YPPROC_MATCH(ypreq_key) = 3;
ypresp_key_val
-#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
YPPROC_FIRST(ypreq_key) = 4;
-#else
- YPPROC_FIRST(ypreq_nokey) = 4;
-#endif
+
ypresp_key_val
YPPROC_NEXT(ypreq_key) = 5;
@@ -338,8 +261,8 @@ program YPPROG {
YPPROC_MAPLIST(domainname) = 11;
} = 2;
} = 100004;
-#endif
-#if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
+
+
/*
* YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
*/
@@ -347,17 +270,13 @@ program YPPUSH_XFRRESPPROG {
version YPPUSH_XFRRESPVERS {
void
YPPUSHPROC_NULL(void) = 0;
-#ifdef STUPID_SUN_BUG /* argument and return value are backwards */
+
yppushresp_xfr
YPPUSHPROC_XFRRESP(void) = 1;
-#else
- void
- YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
-#endif
} = 1;
} = 0x40000000; /* transient: could be anything up to 0x5fffffff */
-#endif
-#if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
+
+
/*
* YP binding protocol
*/
@@ -374,4 +293,4 @@ program YPBINDPROG {
} = 2;
} = 100007;
-#endif
+
diff --git a/include/rpcsvc/yp_prot.h b/include/rpcsvc/yp_prot.h
index 63df4d6c5a5b..7daf9a1402c7 100644
--- a/include/rpcsvc/yp_prot.h
+++ b/include/rpcsvc/yp_prot.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: yp_prot.h,v 1.3 1996/01/30 23:33:04 mpp Exp $
+ * $Id: yp_prot.h,v 1.2 1995/05/30 04:55:47 rgrimes Exp $
*/
#ifndef _YP_PROT_H_
@@ -294,8 +294,8 @@ struct ypbind_setdom {
* is supplied to ypxfr as a command-line parameter when it
* is activated by ypserv."
*
- * This protocol is not implemented, naturally, because this YP
- * implementation only does the client side.
+ * This protocol is not implimented, naturally, because this YP
+ * implimentation only does the client side.
*/
#define YPPUSHVERS ((u_long)1)
#define YPPUSHVERS_ORIG ((u_long)1)
@@ -314,7 +314,7 @@ struct yppushresp_xfr {
#define YPPUSH_AGE ((long)2) /* Master's version not newer */
#define YPPUSH_NOMAP ((long)-1) /* Can't find server for map */
#define YPPUSH_NODOM ((long)-2) /* Domain not supported */
-#define YPPUSH_RSRC ((long)-3) /* Local resource alloc failure */
+#define YPPUSH_RSRC ((long)-3) /* Local resouce alloc failure */
#define YPPUSH_RPC ((long)-4) /* RPC failure talking to server */
#define YPPUSH_MADDR ((long)-5) /* Can't get master address */
#define YPPUSH_YPERR ((long)-6) /* YP server/map db error */
diff --git a/include/runetype.h b/include/runetype.h
index e7fdf5d74b11..4bce6588b8ba 100644
--- a/include/runetype.h
+++ b/include/runetype.h
@@ -39,22 +39,13 @@
#ifndef _RUNETYPE_H_
#define _RUNETYPE_H_
-#include <sys/cdefs.h>
#include <machine/ansi.h>
+#include <sys/cdefs.h>
-#ifdef _BSD_RUNE_T_
-typedef _BSD_RUNE_T_ rune_t;
-#undef _BSD_RUNE_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ rune_t;
+typedef _BSD_WCHAR_T_ wchar_t;
+#undef _BSD_WCHAR_T_
#endif
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
@@ -80,9 +71,9 @@ typedef struct {
char encoding[32]; /* ASCII name of this encoding */
rune_t (*sgetrune)
- __P((const char *, size_t, char const **));
+ __P((const char *, unsigned int, char const **));
int (*sputrune)
- __P((rune_t, char *, size_t, char **));
+ __P((rune_t, char *, unsigned int, char **));
rune_t invalid_rune;
unsigned long runetype[_CACHED_RUNES];
diff --git a/include/signal.h b/include/signal.h
index d8ebeeeeac08..6bb7ddf2cca4 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -33,12 +33,12 @@
* @(#)signal.h 8.3 (Berkeley) 3/30/94
*/
-#ifndef _SIGNAL_H_
-#define _SIGNAL_H_
+#ifndef _USER_SIGNAL_H
+#define _USER_SIGNAL_H
+#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/signal.h>
-#include <machine/ansi.h>
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
extern __const char *__const sys_signame[NSIG];
@@ -48,7 +48,7 @@ extern __const char *__const sys_siglist[NSIG];
__BEGIN_DECLS
int raise __P((int));
#ifndef _ANSI_SOURCE
-int kill __P((_BSD_PID_T_, int));
+int kill __P((pid_t, int));
int sigaction __P((int, const struct sigaction *, struct sigaction *));
int sigaddset __P((sigset_t *, int));
int sigdelset __P((sigset_t *, int));
@@ -59,7 +59,7 @@ int sigpending __P((sigset_t *));
int sigprocmask __P((int, const sigset_t *, sigset_t *));
int sigsuspend __P((const sigset_t *));
#ifndef _POSIX_SOURCE
-int killpg __P((_BSD_PID_T_, int));
+int killpg __P((pid_t, int));
int sigblock __P((int));
int siginterrupt __P((int, int));
int sigpause __P((int));
@@ -68,17 +68,15 @@ int sigsetmask __P((int));
int sigstack __P((const struct sigstack *, struct sigstack *));
int sigvec __P((int, struct sigvec *, struct sigvec *));
void psignal __P((unsigned int, const char *));
-#endif /* !_POSIX_SOURCE */
-#endif /* !_ANSI_SOURCE */
+#endif /* !_POSIX_SOURCE */
+#endif /* !_ANSI_SOURCE */
__END_DECLS
-#ifndef _ANSI_SOURCE
/* List definitions after function declarations, or Reiser cpp gets upset. */
#define sigaddset(set, signo) (*(set) |= 1 << ((signo) - 1), 0)
#define sigdelset(set, signo) (*(set) &= ~(1 << ((signo) - 1)), 0)
#define sigemptyset(set) (*(set) = 0, 0)
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
#define sigismember(set, signo) ((*(set) & (1 << ((signo) - 1))) != 0)
-#endif /* !_ANSI_SOURCE */
-#endif /* !_SIGNAL_H_ */
+#endif /* !_USER_SIGNAL_H */
diff --git a/include/stddef.h b/include/stddef.h
index 38a773636a78..70af6892224a 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -40,19 +40,15 @@
typedef _BSD_PTRDIFF_T_ ptrdiff_t;
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-#ifdef _BSD_RUNE_T_
-typedef _BSD_RUNE_T_ rune_t;
-#undef _BSD_RUNE_T_
-#endif
-#endif
-
#ifdef _BSD_SIZE_T_
typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
#ifdef _BSD_WCHAR_T_
+#ifndef _ANSI_SOURCE
+typedef _BSD_WCHAR_T_ rune_t;
+#endif
typedef _BSD_WCHAR_T_ wchar_t;
#undef _BSD_WCHAR_T_
#endif
diff --git a/include/stdio.h b/include/stdio.h
index 9c4c37ee49e7..595f8f27dc1b 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -162,8 +162,8 @@ __END_DECLS
#define __SMBF 0x0080 /* _buf is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
-#define __SOPT 0x0400 /* do fseek() optimization */
-#define __SNPT 0x0800 /* do not do fseek() optimization */
+#define __SOPT 0x0400 /* do fseek() optimisation */
+#define __SNPT 0x0800 /* do not do fseek() optimisation */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
@@ -224,7 +224,7 @@ int ferror __P((FILE *));
int fflush __P((FILE *));
int fgetc __P((FILE *));
int fgetpos __P((FILE *, fpos_t *));
-char *fgets __P((char *, int, FILE *));
+char *fgets __P((char *, size_t, FILE *));
FILE *fopen __P((const char *, const char *));
int fprintf __P((FILE *, const char *, ...));
int fputc __P((int, FILE *));
@@ -234,7 +234,7 @@ FILE *freopen __P((const char *, const char *, FILE *));
int fscanf __P((FILE *, const char *, ...));
int fseek __P((FILE *, long, int));
int fsetpos __P((FILE *, const fpos_t *));
-long ftell __P((FILE *));
+long ftell __P((const FILE *));
size_t fwrite __P((const void *, size_t, size_t, FILE *));
int getc __P((FILE *));
int getchar __P((void));
@@ -283,7 +283,6 @@ __END_DECLS
*/
#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
__BEGIN_DECLS
-int asprintf __P((char **, const char *, ...));
char *fgetln __P((FILE *, size_t *));
int fpurge __P((FILE *));
int getw __P((FILE *));
@@ -294,7 +293,6 @@ void setbuffer __P((FILE *, char *, int));
int setlinebuf __P((FILE *));
char *tempnam __P((const char *, const char *));
int snprintf __P((char *, size_t, const char *, ...));
-int vasprintf __P((char **, const char *, _BSD_VA_LIST_));
int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_));
int vscanf __P((const char *, _BSD_VA_LIST_));
int vsscanf __P((const char *, const char *, _BSD_VA_LIST_));
diff --git a/include/stdlib.h b/include/stdlib.h
index 069656d4719b..3f1d64895595 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -38,19 +38,15 @@
#include <machine/ansi.h>
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-#ifdef _BSD_RUNE_T_
-typedef _BSD_RUNE_T_ rune_t;
-#undef _BSD_RUNE_T_
-#endif
-#endif
-
#ifdef _BSD_SIZE_T_
typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
#ifdef _BSD_WCHAR_T_
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+typedef _BSD_WCHAR_T_ rune_t;
+#endif
typedef _BSD_WCHAR_T_ wchar_t;
#undef _BSD_WCHAR_T_
#endif
diff --git a/include/strhash.h b/include/strhash.h
index 7533fb9c7711..59523da9cf79 100644
--- a/include/strhash.h
+++ b/include/strhash.h
@@ -1,7 +1,7 @@
#ifndef _STRHASH_H_INCLUDE
#define _STRHASH_H_INCLUDE
-/* $Header: /home/ncvs/src/include/strhash.h,v 1.1 1995/03/26 10:12:53 jkh Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/include/strhash.h,v 1.2 1995/05/30 04:54:49 rgrimes Exp $ */
/*
*
diff --git a/include/time.h b/include/time.h
index 0c119a3c3ede..884a2fb9bfd6 100644
--- a/include/time.h
+++ b/include/time.h
@@ -100,13 +100,6 @@ time_t mktime __P((struct tm *));
size_t strftime __P((char *, size_t, const char *, const struct tm *));
time_t time __P((time_t *));
-#ifdef _THREAD_SAFE
-int asctime_r __P((const struct tm *, char *, int));
-int ctime_r __P((const time_t *, char *, int));
-int gmtime_r __P((const time_t *, struct tm *));
-int localtime_r __P((const time_t *, struct tm *));
-#endif
-
#ifndef _ANSI_SOURCE
void tzset __P((void));
#endif /* not ANSI */
diff --git a/include/unistd.h b/include/unistd.h
index 94df71e4b1d6..eb6d141aba6f 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -142,7 +142,6 @@ int re_exec __P((const char *));
int readlink __P((const char *, char *, int));
int reboot __P((int));
int revoke __P((const char *));
-pid_t rfork __P((int));
int rresvport __P((int *));
int ruserok __P((const char *, int, const char *, const char *));
char *sbrk __P((int));
@@ -166,7 +165,6 @@ int swapon __P((const char *));
int symlink __P((const char *, const char *));
void sync __P((void));
int syscall __P((int, ...));
-off_t __syscall __P((quad_t, ...));
int truncate __P((const char *, off_t));
int ttyslot __P((void));
unsigned int ualarm __P((unsigned int, unsigned int));
diff --git a/include/vis.h b/include/vis.h
index a172afc8662f..53ef1a91c4b9 100644
--- a/include/vis.h
+++ b/include/vis.h
@@ -31,24 +31,16 @@
* SUCH DAMAGE.
*
* @(#)vis.h 8.1 (Berkeley) 6/2/93
- * $Id: vis.h,v 1.3 1996/05/01 00:57:57 bde Exp $
*/
#ifndef _VIS_H_
#define _VIS_H_
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
/*
* to select alternate encoding format
*/
#define VIS_OCTAL 0x01 /* use octal \ddd format */
-#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropriate */
+#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropiate */
/*
* to alter set of characters encoded (default is to encode all
diff --git a/lib/Makefile b/lib/Makefile
index a79c8130fb09..458d63eafe14 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -9,32 +9,11 @@ SUBDIR=csu/vax.pcc
SUBDIR=csu/${MACHINE}
.endif
-# XXX MISSING: libplot
-SUBDIR+= libc libcompat libcom_err libcurses libedit \
- libf2c libforms \
+# XXX MISSING: libmp libplot
+SUBDIR+= libc libcompat libcom_err libcrypt libcurses libedit \
+ libdisk libf2c libforms \
libkvm libmd libmytinfo libncurses libpcap libresolv librpcsvc \
- libscsi libskey libss libtermcap libutil libxpg4 liby \
- libdisk
-
-.if !exists(../secure) || defined(NOSECURE) || defined(NOCRYPT)
-SUBDIR+= libcrypt
-.else
-SUBDIR+= ../secure/lib/libcrypt
-.if defined(RELEASEDIR)
-# releases do need both libraries
-SUBDIR+= libcrypt
-.endif
-.endif
-
-.if !exists(../secure) || defined(NOSECURE)
-SUBDIR+= libtelnet
-.else
-.if defined(RELEASEDIR)
-# releases do need both libraries
-SUBDIR+= libtelnet
-.endif
-SUBDIR+= ../secure/lib/libtelnet
-.endif
+ libscsi libskey libss libtelnet libtermcap libutil liby
.if defined(WANT_CSRG_LIBM)
SUBDIR+= libm
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index f4f8f7eb55ea..145fd5e27186 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -1,8 +1,8 @@
# from: @(#)Makefile 5.6 (Berkeley) 5/22/91
-# $Id: Makefile,v 1.24 1996/05/07 23:16:08 wosch Exp $
+# $Id: Makefile,v 1.15.4.1 1995/08/30 07:31:12 davidg Exp $
-CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
-OBJS= crt0.o c++rt0.o gcrt0.o scrt0.o sgcrt0.o
+CFLAGS+= -DLIBC_SCCS -DDYNAMIC
+OBJS= crt0.o gcrt0.o c++rt0.o
CLEANFILES+= a.out
MAN3+= dlopen.3
MLINKS+= dlopen.3 dlsym.3 \
@@ -12,35 +12,23 @@ MLINKS+= dlopen.3 dlsym.3 \
all: ${OBJS}
crt0.o: crt0.c
- ${CC} ${CFLAGS} -c -DCRT0 -DDYNAMIC ${.CURDIR}/crt0.c -o ${.TARGET}
+ ${CC} ${CFLAGS} -c -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
${LD} -x -r ${.TARGET}
- mv -f a.out ${.TARGET}
+ mv a.out ${.TARGET}
c++rt0.o: c++rt0.c
${CC} ${CFLAGS} -fpic -c ${.CURDIR}/c++rt0.c
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
#
# gcrt0.o doesn't really depend on crt0.o, but this is the easiest way
# to get the dependencies mostly correct.
#
gcrt0.o: crt0.o
- ${CC} ${CFLAGS} -c -DMCRT0 -DDYNAMIC ${.CURDIR}/crt0.c -o ${.TARGET}
- ${LD} -x -r ${.TARGET}
- mv -f a.out ${.TARGET}
-
-# dependencies fudged as for gcrt0.o
-scrt0.o: crt0.o
- ${CC} ${CFLAGS} -c -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
- ${LD} -x -r ${.TARGET}
- mv -f a.out ${.TARGET}
-
-# dependencies fudged as for gcrt0.o
-sgcrt0.o: scrt0.o
${CC} ${CFLAGS} -c -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
${LD} -x -r ${.TARGET}
- mv -f a.out ${.TARGET}
+ mv a.out ${.TARGET}
beforeinstall:
cmp -s ${.CURDIR}/dlfcn.h ${DESTDIR}/usr/include/dlfcn.h || \
@@ -58,7 +46,7 @@ depend: .depend
.depend: crt0.c c++rt0.c
rm -f .depend
- mkdep ${CFLAGS} -DCRT0 -DDYNAMIC ${.CURDIR}/crt0.c
+ mkdep ${CFLAGS} -DCRT0 ${.CURDIR}/crt0.c
mkdep -a ${CFLAGS} ${.CURDIR}/c++rt0.c
lint tags:
diff --git a/lib/csu/i386/c++rt0.c b/lib/csu/i386/c++rt0.c
index 9b397929e693..99bfffb84e0d 100644
--- a/lib/csu/i386/c++rt0.c
+++ b/lib/csu/i386/c++rt0.c
@@ -27,7 +27,7 @@
* (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: c++rt0.c,v 1.5 1996/02/20 04:07:26 jdp Exp $
+ * $Id: c++rt0.c,v 1.2.4.1 1995/08/25 07:08:32 davidg Exp $
*/
/*
@@ -38,8 +38,8 @@
* number of pointers in each.
* The tables are also null-terminated.
*/
-void (*__CTOR_LIST__[2])(void);
-void (*__DTOR_LIST__[2])(void);
+void (*__CTOR_LIST__[0])(void);
+void (*__DTOR_LIST__[0])(void);
static void
__dtors(void)
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c
index 46e3a425c89d..e656c463e247 100644
--- a/lib/csu/i386/crt0.c
+++ b/lib/csu/i386/crt0.c
@@ -27,105 +27,101 @@
* (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: crt0.c,v 1.23 1996/01/30 05:55:20 nate Exp $
+ * $Id: crt0.c,v 1.16.4.2 1995/09/28 13:16:24 davidg Exp $
*/
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "%W% (Erasmus) %G%";
+#endif /* LIBC_SCCS and not lint */
+
+extern void exit();
+int _callmain();
+
#include <sys/param.h>
+#include <locale.h>
#include <stdlib.h>
+extern void _startup_setlocale __P((int, const char *));
#ifdef DYNAMIC
#include <sys/types.h>
#include <sys/syscall.h>
#include <a.out.h>
#include <string.h>
-#include <sys/mman.h>
-#include <link.h>
-
-/* !!!
- * This is gross, ld.so is a ZMAGIC a.out, but has `sizeof(hdr)' for
- * an entry point and not at PAGSIZ as the N_*ADDR macros assume.
- */
-#undef N_DATADDR
-#define N_DATADDR(x) ((x).a_text)
-
-#undef N_BSSADDR
-#define N_BSSADDR(x) ((x).a_text + (x).a_data)
-
#ifndef N_GETMAGIC
#define N_GETMAGIC(x) ((x).a_magic)
-#endif /* N_GETMAGIC */
-
-#ifndef MAP_PRIVATE
-#define MAP_PRIVATE MAP_COPY
-#endif /* MAP_PRIVATE */
-
-#ifndef MAP_FILE
+#endif
+#ifndef N_BSSADDR
+#define N_BSSADDR(x) (N_DATADDR(x)+(x).a_data)
+#endif
+#include <sys/mman.h>
+#ifdef sun
+#define MAP_COPY MAP_PRIVATE
#define MAP_FILE 0
-#endif /* MAP_FILE */
-
-#ifndef MAP_ANON
#define MAP_ANON 0
-#endif /* MAP_ANON */
-
-#ifdef DEBUG
-/*
- * We need these two because we are going to call them before the ld.so is
- * finished (as a matter of fact before we know if it exists !) so we must
- * provide these versions for them
- */
-static char *_getenv();
-static int _strncmp();
-#endif /* DEBUG */
+#else
+#ifdef BSD
+#if BSD>=199306 && !defined(MAP_FILE)
+#define MAP_FILE 0
+#endif /* BSD>=199306 */
+#endif /* BSD */
+#endif /* sun */
-#ifndef LDSO
-#define LDSO "/usr/libexec/ld.so"
-#endif /* LDSO */
+#include <link.h>
-extern struct _dynamic _DYNAMIC;
+extern struct _dynamic _DYNAMIC;
static struct ld_entry *ld_entry;
-static void __do_dynamic_link ();
+static void __do_dynamic_link ();
+static char *_getenv();
+static int _strncmp();
+
+#ifdef sun
+#define LDSO "/usr/lib/ld.so"
+#endif
+#ifdef BSD
+#define LDSO "/usr/libexec/ld.so"
+#endif
+
#endif /* DYNAMIC */
-int _callmain();
-int errno;
-static char empty[1];
-char *__progname = empty;
+static char *_strrchr();
+
char **environ;
+#ifdef BSD
extern unsigned char etext;
extern unsigned char eprol asm ("eprol");
extern start() asm("start");
extern mcount() asm ("mcount");
-extern int main(int argc, char **argv, char **envp);
-int __syscall(int syscall,...);
-#ifdef MCRT0
-void monstartup(void *low, void *high);
-#endif /* MCRT0 */
+int errno;
+static char empty[1];
+char *__progname = empty;
+#endif
/*
- * We need these system calls, but can't use library stubs because the are
- * not accessible until we have done the ld.so stunt.
+ * We need these system calls, but can't use library stubs
*/
+#define _exit(v) __syscall(SYS_exit, (int)(v))
+#define open(name, f, m) __syscall(SYS_open, (char *)(name), (int)(f), (int)(m))
+#define close(fd) __syscall(SYS_close, (int)(fd))
+#define read(fd, s, n) __syscall(SYS_read, (int)(fd), (void *)(s), (size_t)(n))
+#define write(fd, s, n) __syscall(SYS_write, (int)(fd), (void *)(s), (size_t)(n))
+#define dup(fd) __syscall(SYS_dup, (int)(fd))
+#define dup2(fd, fdnew) __syscall(SYS_dup2, (int)(fd), (int)(fdnew))
+#ifdef sun
+#define mmap(addr, len, prot, flags, fd, off) \
+ __syscall(SYS_mmap, (addr), (len), (prot), _MAP_NEW|(flags), (fd), (off))
+#else
+#define mmap(addr, len, prot, flags, fd, off) \
+ __syscall(SYS_mmap, (caddr_t)(addr), (size_t)(len), (int)(prot), (int)(flags), (int)(fd), (long)0L, (off_t)(off))
+#endif
-#define _exit(v) \
- __syscall(SYS_exit, (int)(v))
-#define _open(name, f, m) \
- __syscall(SYS_open, (char *)(name), (int)(f), (int)(m))
-#define _read(fd, s, n) \
- __syscall(SYS_read, (int)(fd), (void *)(s), (size_t)(n))
-#define _write(fd, s, n) \
- __syscall(SYS_write, (int)(fd), (void *)(s), (size_t)(n))
-#define _mmap(addr, len, prot, flags, fd, off) \
- (caddr_t) __syscall(SYS_mmap, (caddr_t)(addr), (size_t)(len), \
- (int)(prot), (int)(flags), (int)(fd), (long)0L, (off_t)(off))
-
-#define _PUTNMSG(str, len) _write(2, (str), (len))
+#define _PUTNMSG(str, len) write(2, (str), (len))
#define _PUTMSG(str) _PUTNMSG((str), sizeof (str) - 1)
#define _FATAL(str) ( _PUTMSG(str), _exit(1) )
-int
start()
{
struct kframe {
@@ -158,20 +154,22 @@ start()
--targv;
environ = targv;
- if (argv[0]) {
- register char *s;
- __progname = argv[0];
- for (s=__progname; *s != '\0'; s++)
- if (*s == '/')
- __progname = s+1;
- }
+ if (argv[0])
+ if ((__progname = _strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
#ifdef DYNAMIC
/* ld(1) convention: if DYNAMIC = 0 then statically linked */
- /* sometimes GCC is too smart/stupid for its own good */
+#ifdef stupid_gcc
+ if (&_DYNAMIC)
+ __do_dynamic_link();
+#else
x = (caddr_t)&_DYNAMIC;
if (x)
__do_dynamic_link();
+#endif
#endif /* DYNAMIC */
asm("eprol:");
@@ -181,6 +179,9 @@ asm("eprol:");
monstartup(&eprol, &etext);
#endif /* MCRT0 */
+ if (getenv("ENABLE_STARTUP_LOCALE") != NULL)
+ _startup_setlocale(LC_ALL, "");
+
asm ("__callmain:"); /* Defined for the benefit of debuggers */
exit(main(kfp->kargc, argv, environ));
}
@@ -201,15 +202,13 @@ __do_dynamic_link ()
#endif
ldso = LDSO;
- crt.crt_ldfd = _open(ldso, 0, 0);
+ crt.crt_ldfd = open(ldso, 0, 0);
if (crt.crt_ldfd == -1) {
- _PUTMSG("Couldn't open ");
- _PUTMSG(LDSO);
- _FATAL(".\n");
+ _FATAL("No ld.so\n");
}
/* Read LDSO exec header */
- if (_read(crt.crt_ldfd, &hdr, sizeof hdr) < sizeof hdr) {
+ if (read(crt.crt_ldfd, &hdr, sizeof hdr) < sizeof hdr) {
_FATAL("Failure reading ld.so\n");
}
if ((N_GETMAGIC_NET(hdr) != ZMAGIC) && (N_GETMAGIC(hdr) != QMAGIC)) {
@@ -220,29 +219,39 @@ __do_dynamic_link ()
crt.crt_dzfd = -1;
/* Map in ld.so */
- crt.crt_ba = (int)_mmap(0, hdr.a_text,
+ crt.crt_ba = mmap(0, hdr.a_text,
PROT_READ|PROT_EXEC,
- MAP_FILE|MAP_PRIVATE,
+ MAP_FILE|MAP_COPY,
crt.crt_ldfd, N_TXTOFF(hdr));
if (crt.crt_ba == -1) {
- _FATAL("Cannot map ld.so (text)\n");
+ _FATAL("Cannot map ld.so\n");
}
+#ifdef BSD
+/* !!!
+ * This is gross, ld.so is a ZMAGIC a.out, but has `sizeof(hdr)' for
+ * an entry point and not at PAGSIZ as the N_*ADDR macros assume.
+ */
+#undef N_DATADDR
+#undef N_BSSADDR
+#define N_DATADDR(x) ((x).a_text)
+#define N_BSSADDR(x) ((x).a_text + (x).a_data)
+#endif
+
/* Map in data segment of ld.so writable */
- if ((int)_mmap((caddr_t)(crt.crt_ba+N_DATADDR(hdr)), hdr.a_data,
+ if (mmap(crt.crt_ba+N_DATADDR(hdr), hdr.a_data,
PROT_READ|PROT_WRITE,
- MAP_FIXED|MAP_FILE|MAP_PRIVATE,
+ MAP_FIXED|MAP_FILE|MAP_COPY,
crt.crt_ldfd, N_DATOFF(hdr)) == -1) {
- _FATAL("Cannot map ld.so (data)\n");
+ _FATAL("Cannot map ld.so\n");
}
/* Map bss segment of ld.so zero */
- if (hdr.a_bss && (int)_mmap((caddr_t)(crt.crt_ba+N_BSSADDR(hdr)),
- hdr.a_bss,
+ if (hdr.a_bss && mmap(crt.crt_ba+N_BSSADDR(hdr), hdr.a_bss,
PROT_READ|PROT_WRITE,
- MAP_FIXED|MAP_ANON|MAP_PRIVATE,
+ MAP_FIXED|MAP_ANON|MAP_COPY,
crt.crt_dzfd, 0) == -1) {
- _FATAL("Cannot map ld.so (bss)\n");
+ _FATAL("Cannot map ld.so\n");
}
crt.crt_dp = &_DYNAMIC;
@@ -326,7 +335,6 @@ dlerror()
* Support routines
*/
-#ifdef DEBUG
static int
_strncmp(s1, s2, n)
register char *s1, *s2;
@@ -361,8 +369,6 @@ _getenv(name)
return (char *)0;
}
-#endif /* DEBUG */
-
asm(" ___syscall:");
asm(" popl %ecx");
asm(" popl %eax");
@@ -379,6 +385,21 @@ _getenv(name)
#endif /* DYNAMIC */
+static char *
+_strrchr(p, ch)
+register char *p, ch;
+{
+ register char *save;
+
+ for (save = NULL;; ++p) {
+ if (*p == ch)
+ save = (char *)p;
+ if (!*p)
+ return(save);
+ }
+/* NOTREACHED */
+}
+
#ifdef MCRT0
asm (" .text");
asm ("_eprol:");
diff --git a/lib/libF77/README b/lib/libF77/README
index a575124bc841..b5b0b811036c 100644
--- a/lib/libF77/README
+++ b/lib/libF77/README
@@ -87,10 +87,8 @@ for use with INTEGER*8. To use it, you must modify f2c.h to
declare longint appropriately; then add pow_qq.o to the POW =
line in the makefile.
-Following Fortran 90, s_cat.c and s_copy.c allow the target of a
-(character string) assignment to be appear on its right-hand, at
-the cost of some extra overhead for all run-time concatenations.
-If you prefer the extra efficiency that comes with the Fortran 77
-requirement that the left-hand side of a character assignment not
-be involved in the right-hand side, compile s_cat.c and s_copy.c
-with -DNO_OVERWRITE .
+If you wish to allow the target of a (character string) concatenation
+to be appear on its right-hand (at the cost of extra overhead for
+all run-time concatenations), change "s_cat.o" to "s_catow.o" in
+the makefile. Note that the Fortran 77 Standard explicitly forbids
+the target of a concatenation from appearing on its right-hand side.
diff --git a/lib/libF77/Version.c b/lib/libF77/Version.c
index df2434a5a189..bbc611008778 100644
--- a/lib/libF77/Version.c
+++ b/lib/libF77/Version.c
@@ -1,4 +1,4 @@
-static char junk[] = "\n@(#)LIBF77 VERSION 2.01 6 Sept. 1995\n";
+static char junk[] = "\n@(#)LIBF77 VERSION 2.01 19 Sept. 1994\n";
/*
2.00 11 June 1980. File version.c added to library.
@@ -27,15 +27,4 @@ static char junk[] = "\n@(#)LIBF77 VERSION 2.01 6 Sept. 1995\n";
2 June 1994: adjust so abnormal terminations invoke f_exit just once
16 Sept. 1994: s_cmp: treat characters as unsigned in comparisons.
19 Sept. 1994: s_paus: flush after end of PAUSE; add -DMSDOS
- 12 Jan. 1995: pow_[dhiqrz][hiq]: adjust x**i to work on machines
- that sign-extend right shifts when i is the most
- negative integer.
- 26 Jan. 1995: adjust s_cat.c, s_copy.c to permit the left-hand side
- of character assignments to appear on the right-hand
- side (unless compiled with -DNO_OVERWRITE).
- 27 Jan. 1995: minor tweak to s_copy.c: copy forward whenever
- possible (for better cache behavior).
- 30 May 1995: added subroutine exit(rc) integer rc. Version not changed.
- 29 Aug. 1995: add F77_aloc.c; use it in s_cat.c and system_.c.
- 6 Sept. 1995: fix return type of system_ under -DKR_headers.
*/
diff --git a/lib/libF77/libF77.xsum b/lib/libF77/libF77.xsum
index fe3fbfc7f648..faf4a24ac01c 100644
--- a/lib/libF77/libF77.xsum
+++ b/lib/libF77/libF77.xsum
@@ -1,7 +1,6 @@
-F77_aloc.c fc8e8844 536
Notice 1211689a 1195
-README 1d306d9d 4130
-Version.c f329c4b2 2060
+README 1c4c3814 4053
+Version.c 10d0f4c6 1447
abort_.c eaf90dc0 239
c_abs.c ecce7a47 205
c_cos.c f2338a46 260
@@ -40,7 +39,6 @@ ef1asc_.c f14b3469 453
ef1cmc_.c 1e0b86e3 360
erf_.c 7a407d 158
erfc_.c fb488e22 163
-exit.c eaf1e4de 476
f2ch.add fed3bb7b 6056
getarg_.c edcf61f8 495
getenv_.c eaafcc11 975
@@ -69,16 +67,16 @@ l_ge.c 5b7cb55 267
l_gt.c ad1b388 266
l_le.c f5407149 267
l_lt.c f81a93f8 266
-main.c 1144a505 2064
-makefile e4156396 3063
+main.c ec7fc5ad 2012
+makefile 1f2ebd87 3036
pow_ci.c f593b0b9 345
pow_dd.c e451857d 209
-pow_di.c 11a1842e 381
-pow_hh.c e0cb1b69 422
-pow_ii.c 17c60a01 421
-pow_qq.c ffbbdec9 449
-pow_ri.c eacf8350 369
-pow_zi.c fe9073e4 715
+pow_di.c f5c04524 360
+pow_hh.c feb3b910 401
+pow_ii.c fe444c9b 395
+pow_qq.c fdf1dc33 395
+pow_ri.c ea06b62d 348
+pow_zi.c f21e1934 694
pow_zz.c f0e5f141 482
r_abs.c 1a4e3da 139
r_acos.c ca67f96 166
@@ -102,15 +100,16 @@ r_sinh.c f21a38b8 166
r_sqrt.c f24b8aa4 166
r_tan.c e60b7778 162
r_tanh.c f22ec5c 166
-s_cat.c 151033e2 1304
+s_cat.c e53641 408
+s_catow.c 538ae5a 1222
s_cmp.c ff4f2982 655
-s_copy.c e10dd76f 957
+s_copy.c f50c7ec9 397
s_paus.c e726a719 1552
s_rnge.c 1d6cada2 680
s_stop.c 1f5aaac8 511
sig_die.c e934624a 634
-signal_.c fde97f5f 395
-system_.c e4ed54ab 579
+signal_.c 1b0b75f3 327
+system_.c c910b8a 396
z_abs.c f71a28c1 201
z_cos.c 110bc444 269
z_div.c ff56b823 675
diff --git a/lib/libF77/main.c b/lib/libF77/main.c
index 79f19435a08b..24c2f22d3699 100644
--- a/lib/libF77/main.c
+++ b/lib/libF77/main.c
@@ -10,21 +10,15 @@
#endif
#ifndef KR_headers
-#undef VOID
#include "stdlib.h"
#endif
-
-#ifndef VOID
-#define VOID void
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO__STDC
#define ONEXIT onexit
-extern VOID f_exit();
+extern void f_exit();
#else
#ifndef KR_headers
extern void f_exit(void);
@@ -35,13 +29,13 @@ extern int atexit(void (*)(void));
#else
#ifndef NO_ONEXIT
#define ONEXIT onexit
-extern VOID f_exit();
+extern void f_exit();
#endif
#endif
#endif
#ifdef KR_headers
-extern VOID f_init(), sig_die();
+extern void f_init(), sig_die();
extern int MAIN__();
#define Int /* int */
#else
@@ -50,37 +44,37 @@ extern int MAIN__(void);
#define Int int
#endif
-static VOID sigfdie(Int n)
+static void sigfdie(Int n)
{
sig_die("Floating Exception", 1);
}
-static VOID sigidie(Int n)
+static void sigidie(Int n)
{
sig_die("IOT Trap", 1);
}
#ifdef SIGQUIT
-static VOID sigqdie(Int n)
+static void sigqdie(Int n)
{
sig_die("Quit signal", 1);
}
#endif
-static VOID sigindie(Int n)
+static void sigindie(Int n)
{
sig_die("Interrupt", 0);
}
-static VOID sigtdie(Int n)
+static void sigtdie(Int n)
{
sig_die("Killed", 0);
}
#ifdef SIGTRAP
-static VOID sigtrdie(Int n)
+static void sigtrdie(Int n)
{
sig_die("Trace trap", 1);
}
diff --git a/lib/libF77/makefile b/lib/libF77/makefile
index 6e7cc6840878..405128d2a572 100644
--- a/lib/libF77/makefile
+++ b/lib/libF77/makefile
@@ -18,9 +18,9 @@ CFLAGS = -O
ld -r -x -o $*.xxx $*.o
mv $*.xxx $*.o
-MISC = F77_aloc.o Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o \
- getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
- derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit.o
+MISC = Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o getenv_.o\
+ signal_.o s_stop.o s_paus.o system_.o cabs.o\
+ derf_.o derfc_.o erf_.o erfc_.o sig_die.o
POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o
CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
@@ -58,12 +58,12 @@ clean:
rm -f libF77.a *.o
check:
- xsum Notice README F77_aloc.c Version.c abort_.c c_abs.c c_cos.c \
- c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c d_abs.c d_acos.c \
+ xsum Notice README Version.c abort_.c c_abs.c c_cos.c c_div.c \
+ c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c d_abs.c d_acos.c \
d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c d_dim.c \
d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c d_nint.c \
d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c d_tanh.c \
- derf_.c derfc_.c ef1asc_.c ef1cmc_.c erf_.c erfc_.c exit.c f2ch.add \
+ derf_.c derfc_.c ef1asc_.c ef1cmc_.c erf_.c erfc_.c f2ch.add \
getarg_.c getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c \
h_mod.c h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c \
i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c i_nint.c \
@@ -72,7 +72,7 @@ check:
pow_zi.c pow_zz.c r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c \
r_cnjg.c r_cos.c r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c \
r_log.c r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c \
- r_tan.c r_tanh.c s_cat.c s_cmp.c s_copy.c \
- s_paus.c s_rnge.c s_stop.c sig_die.c signal_.c system_.c \
- z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c >zap
+ r_tan.c r_tanh.c s_cat.c s_catow.c s_cmp.c s_copy.c s_paus.c s_rnge.c \
+ s_stop.c sig_die.c signal_.c system_.c z_abs.c z_cos.c z_div.c \
+ z_exp.c z_log.c z_sin.c z_sqrt.c >zap
cmp zap libF77.xsum && rm zap || diff libF77.xsum zap
diff --git a/lib/libF77/pow_di.c b/lib/libF77/pow_di.c
index affed625a911..7af69a71259b 100644
--- a/lib/libF77/pow_di.c
+++ b/lib/libF77/pow_di.c
@@ -8,7 +8,6 @@ double pow_di(doublereal *ap, integer *bp)
{
double pow, x;
integer n;
-unsigned long u;
pow = 1;
x = *ap;
@@ -21,11 +20,11 @@ if(n != 0)
n = -n;
x = 1/x;
}
- for(u = n; ; )
+ for( ; ; )
{
- if(u & 01)
+ if(n & 01)
pow *= x;
- if(u >>= 1)
+ if(n >>= 1)
x *= x;
else
break;
diff --git a/lib/libF77/pow_hh.c b/lib/libF77/pow_hh.c
index 24a019734da1..e1a503c5ca82 100644
--- a/lib/libF77/pow_hh.c
+++ b/lib/libF77/pow_hh.c
@@ -7,7 +7,6 @@ shortint pow_hh(shortint *ap, shortint *bp)
#endif
{
shortint pow, x, n;
- unsigned u;
x = *ap;
n = *bp;
@@ -19,12 +18,11 @@ shortint pow_hh(shortint *ap, shortint *bp)
return x == 0 ? 1/x : 0;
n = -n;
}
- u = n;
for(pow = 1; ; )
{
- if(u & 01)
+ if(n & 01)
pow *= x;
- if(u >>= 1)
+ if(n >>= 1)
x *= x;
else
break;
diff --git a/lib/libF77/pow_ii.c b/lib/libF77/pow_ii.c
index 84d1c7e0b5ec..e7948776e6c7 100644
--- a/lib/libF77/pow_ii.c
+++ b/lib/libF77/pow_ii.c
@@ -7,7 +7,6 @@ integer pow_ii(integer *ap, integer *bp)
#endif
{
integer pow, x, n;
- unsigned long u;
x = *ap;
n = *bp;
@@ -19,12 +18,11 @@ integer pow_ii(integer *ap, integer *bp)
return x == 0 ? 1/x : 0;
n = -n;
}
- u = n;
for(pow = 1; ; )
{
- if(u & 01)
+ if(n & 01)
pow *= x;
- if(u >>= 1)
+ if(n >>= 1)
x *= x;
else
break;
diff --git a/lib/libF77/pow_qq.c b/lib/libF77/pow_qq.c
index 3bc80e05f7f0..d80c40a9a697 100644
--- a/lib/libF77/pow_qq.c
+++ b/lib/libF77/pow_qq.c
@@ -7,7 +7,6 @@ longint pow_qq(longint *ap, longint *bp)
#endif
{
longint pow, x, n;
- unsigned long long u; /* system-dependent */
x = *ap;
n = *bp;
@@ -19,12 +18,11 @@ longint pow_qq(longint *ap, longint *bp)
return x == 0 ? 1/x : 0;
n = -n;
}
- u = n;
for(pow = 1; ; )
{
- if(u & 01)
+ if(n & 01)
pow *= x;
- if(u >>= 1)
+ if(n >>= 1)
x *= x;
else
break;
diff --git a/lib/libF77/pow_ri.c b/lib/libF77/pow_ri.c
index 6e5816bbf109..3a3c4cf1ca4e 100644
--- a/lib/libF77/pow_ri.c
+++ b/lib/libF77/pow_ri.c
@@ -8,7 +8,6 @@ double pow_ri(real *ap, integer *bp)
{
double pow, x;
integer n;
-unsigned long u;
pow = 1;
x = *ap;
@@ -21,11 +20,11 @@ if(n != 0)
n = -n;
x = 1/x;
}
- for(u = n; ; )
+ for( ; ; )
{
- if(u & 01)
+ if(n & 01)
pow *= x;
- if(u >>= 1)
+ if(n >>= 1)
x *= x;
else
break;
diff --git a/lib/libF77/pow_zi.c b/lib/libF77/pow_zi.c
index 167e6acbc6a5..8dd60069bfe0 100644
--- a/lib/libF77/pow_zi.c
+++ b/lib/libF77/pow_zi.c
@@ -9,7 +9,6 @@ void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */
#endif
{
integer n;
-unsigned long u;
double t;
doublecomplex x;
static doublecomplex one = {1.0, 0.0};
@@ -31,15 +30,15 @@ else
x.i = a->i;
}
-for(u = n; ; )
+for( ; ; )
{
- if(u & 01)
+ if(n & 01)
{
t = p->r * x.r - p->i * x.i;
p->i = p->r * x.i + p->i * x.r;
p->r = t;
}
- if(u >>= 1)
+ if(n >>= 1)
{
t = x.r * x.r - x.i * x.i;
x.i = 2 * x.r * x.i;
diff --git a/lib/libF77/s_cat.c b/lib/libF77/s_cat.c
index 1d6fd24828bd..7f55cd561188 100644
--- a/lib/libF77/s_cat.c
+++ b/lib/libF77/s_cat.c
@@ -1,71 +1,25 @@
-/* Unless compiled with -DNO_OVERWRITE, this variant of s_cat allows the
- * target of a concatenation to appear on its right-hand side (contrary
- * to the Fortran 77 Standard, but in accordance with Fortran 90).
- */
-
#include "f2c.h"
-#ifndef NO_OVERWRITE
-#include "stdio.h"
-#undef abs
-#ifdef KR_headers
- extern char *F77_aloc();
- extern void free();
- extern void exit_();
-#else
-#include "stdlib.h"
- extern char *F77_aloc(ftnlen, char*);
-#endif
-#include "string.h"
-#endif /* NO_OVERWRITE */
- VOID
#ifdef KR_headers
-s_cat(lp, rpp, rnp, np, ll) char *lp, *rpp[]; ftnlen rnp[], *np, ll;
+VOID s_cat(lp, rpp, rnp, np, ll) char *lp, *rpp[]; ftnlen rnp[], *np, ll;
#else
-s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll)
+VOID s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll)
#endif
{
- ftnlen i, nc;
- char *rp;
- ftnlen n = *np;
-#ifndef NO_OVERWRITE
- ftnlen L, m;
- char *lp0, *lp1;
+ftnlen i, n, nc;
+char *f__rp;
- lp0 = 0;
- lp1 = lp;
- L = ll;
- i = 0;
- while(i < n) {
- rp = rpp[i];
- m = rnp[i++];
- if (rp >= lp1 || rp + m <= lp) {
- if ((L -= m) <= 0) {
- n = i;
- break;
- }
- lp1 += m;
- continue;
- }
- lp0 = lp;
- lp = lp1 = F77_aloc(L = ll, "s_cat");
- }
-#endif /* NO_OVERWRITE */
- for(i = 0 ; i < n ; ++i) {
- nc = ll;
- if(rnp[i] < nc)
- nc = rnp[i];
- ll -= nc;
- rp = rpp[i];
- while(--nc >= 0)
- *lp++ = *rp++;
- }
- while(--ll >= 0)
- *lp++ = ' ';
-#ifndef NO_OVERWRITE
- if (lp0) {
- memcpy(lp0, lp1, L);
- free(lp1);
- }
-#endif
+n = *np;
+for(i = 0 ; i < n ; ++i)
+ {
+ nc = ll;
+ if(rnp[i] < nc)
+ nc = rnp[i];
+ ll -= nc;
+ f__rp = rpp[i];
+ while(--nc >= 0)
+ *lp++ = *f__rp++;
}
+while(--ll >= 0)
+ *lp++ = ' ';
+}
diff --git a/lib/libF77/s_copy.c b/lib/libF77/s_copy.c
index d1673510c62b..989f5dded9b0 100644
--- a/lib/libF77/s_copy.c
+++ b/lib/libF77/s_copy.c
@@ -1,9 +1,3 @@
-/* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
- * target of an assignment to appear on its right-hand side (contrary
- * to the Fortran 77 Standard, but in accordance with Fortran 90),
- * as in a(2:5) = a(4:7) .
- */
-
#include "f2c.h"
/* assign strings: a = b */
@@ -14,38 +8,20 @@ VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb;
void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
#endif
{
- register char *aend, *bend;
+register char *aend, *bend;
- aend = a + la;
+aend = a + la;
- if(la <= lb)
-#ifndef NO_OVERWRITE
- if (a <= b || a >= b + la)
-#endif
- while(a < aend)
- *a++ = *b++;
-#ifndef NO_OVERWRITE
- else
- for(b += la; a < aend; )
- *--aend = *--b;
-#endif
+if(la <= lb)
+ while(a < aend)
+ *a++ = *b++;
- else {
- bend = b + lb;
-#ifndef NO_OVERWRITE
- if (a <= b || a >= bend)
-#endif
- while(b < bend)
- *a++ = *b++;
-#ifndef NO_OVERWRITE
- else {
- a += lb;
- while(b < bend)
- *--a = *--bend;
- a += lb;
- }
-#endif
- while(a < aend)
- *a++ = ' ';
- }
+else
+ {
+ bend = b + lb;
+ while(b < bend)
+ *a++ = *b++;
+ while(a < aend)
+ *a++ = ' ';
}
+}
diff --git a/lib/libF77/signal_.c b/lib/libF77/signal_.c
index 8f06c913ff6f..90ec7ea39af2 100644
--- a/lib/libF77/signal_.c
+++ b/lib/libF77/signal_.c
@@ -1,21 +1,19 @@
#include "f2c.h"
#ifdef KR_headers
-typedef VOID (*sig_type)();
+typedef int (*sig_type)();
extern sig_type signal();
-typedef int (*sig_proc)();
ftnint signal_(sigp, proc) integer *sigp; sig_type proc;
#else
#include "signal.h"
typedef void (*sig_type)(int);
-typedef int (*sig_proc)(int);
-ftnint signal_(integer *sigp, sig_proc proc)
+ftnint signal_(integer *sigp, sig_type proc)
#endif
{
int sig;
sig = (int)*sigp;
- return (ftnint)signal(sig, (sig_type)proc);
+ return (ftnint)signal(sig, proc);
}
diff --git a/lib/libF77/system_.c b/lib/libF77/system_.c
index e6b3a02d527c..6f8a71d2e7a0 100644
--- a/lib/libF77/system_.c
+++ b/lib/libF77/system_.c
@@ -3,34 +3,22 @@
#include "f2c.h"
#ifdef KR_headers
-extern char *F77_aloc();
-
- integer
system_(s, n) register char *s; ftnlen n;
#else
#undef abs
#undef min
#undef max
#include "stdlib.h"
-extern char *F77_aloc(ftnlen, char*);
-
- integer
system_(register char *s, ftnlen n)
#endif
{
- char buff0[256], *buff;
- register char *bp, *blast;
- integer rv;
+char buff[1000];
+register char *bp, *blast;
- buff = bp = n < sizeof(buff0)
- ? buff0 : F77_aloc(n+1, "system_");
- blast = bp + n;
+blast = buff + (n < 1000 ? n : 1000);
- while(bp < blast && *s)
- *bp++ = *s++;
- *bp = 0;
- rv = system(buff);
- if (buff != buff0)
- free(buff);
- return rv;
- }
+for(bp = buff ; bp<blast && *s!='\0' ; )
+ *bp++ = *s++;
+*bp = '\0';
+return system(buff);
+}
diff --git a/lib/libI77/Notice b/lib/libI77/Notice
index 9715a192abf4..b0dba28d8f8b 100644
--- a/lib/libI77/Notice
+++ b/lib/libI77/Notice
@@ -1,5 +1,5 @@
/****************************************************************
-Copyright 1990 - 1995 by AT&T Bell Laboratories and Bellcore.
+Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
diff --git a/lib/libI77/README b/lib/libI77/README
index 6b0558d1a2a7..8b19130a1d3c 100644
--- a/lib/libI77/README
+++ b/lib/libI77/README
@@ -147,10 +147,6 @@ and an attempt to skip input until the right namelist name is found;
to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip.
3. Namelist writes now insert newlines before each variable; to omit
this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines.
- 4. (Sept. 1995) When looking for the &name that starts namelist
-input, lines whose first non-blank character is something other
-than &, $, or ? are treated as comment lines and ignored, unless
-rsne.c is compiled with -DNo_Namelist_Comments.
Nonstandard extension (Feb. 1993) to open: for sequential files,
ACCESS='APPEND' (or access='anything else starting with "A" or "a"')
@@ -168,12 +164,6 @@ others and thus give no help in finding the bug of reading more
than was written. If you wish to have this behavior, compile
uio.c with -DPad_UDread .
-If you want to be able to catch write failures (e.g., due to a
-disk being full) with an ERR= specifier, compile dfe.c, due.c,
-sfe.c, sue.c, and wsle.c with -DALWAYS_FLUSH. This will lead to
-slower execution and more I/O, but should make ERR= work as
-expected, provided fflush returns an error return when its
-physical write fails.
Carriage controls are meant to be interpreted by the UNIX col
program (or a similar program). Sometimes it's convenient to use
@@ -182,9 +172,3 @@ If you compile lwrite.c and wsfe.c with -DOMIT_BLANK_CC, formatted
external output lines will have an initial ' ' quietly omitted,
making use of the col program unnecessary with output that only
has ' ' for carriage control.
-
-The Fortran 77 Standard leaves it up to the implementation whether
-formatted writes of floating-point numbers of absolute value < 1 have
-a zero before the decimal point. By default, libI77 omits such
-superfluous zeros, but you can cause them to appear by compiling
-lwrite.c, wref.c, and wrtfmt.c with -DWANT_LEAD_0 .
diff --git a/lib/libI77/Version.c b/lib/libI77/Version.c
index ebd3f0b08f7e..3958b77d843c 100644
--- a/lib/libI77/Version.c
+++ b/lib/libI77/Version.c
@@ -1,4 +1,4 @@
-static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19950907\n";
+static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 6 Octt. 1994\n";
/*
2.01 $ format added
@@ -198,27 +198,3 @@ wrtfmt.c:
INTEGER*1, and (under -DAllow_TYQUAD) INTEGER*8
in NAMELISTs. */
/* 6 Oct. 1994: util.c: omit f__mvgbt, as it is never used. */
-/* 2 Nov. 1994: add #ifdef ALWAYS_FLUSH logic. */
-/* 26 Jan. 1995: wref.c: fix glitch in printing the exponent of 0 when
- GOOD_SPRINTF_EXPONENT is not #defined. */
-/* 24 Feb. 1995: iio.c: z_getc: insert (unsigned char *) to allow
- internal reading of characters with high-bit set
- (on machines that sign-extend characters). */
-/* 14 March 1995:lread.c and rsfe.c: adjust s_rsle and s_rsfe to
- check for end-of-file (to prevent infinite loops
- with empty read statements). */
-/* 26 May 1995: iio.c: z_wnew: fix bug in handling T format items
- in internal writes whose last item is written to
- an earlier position than some previous item. */
-/* 29 Aug. 1995: backspace.c: adjust MSDOS logic. */
-/* 6 Sept. 1995: Adjust namelist input to treat a subscripted name
- whose subscripts do not involve colons similarly
- to the name without a subscript: accept several
- values, stored in successive elements starting at
- the indicated subscript. Adjust namelist output
- to quote character strings (avoiding confusion with
- arrays of character strings). Adjust f_init calls
- for people who don't use libF77's main(); now open and
- namelist read statements invoke f_init if needed. */
-/* 7 Sept. 1995: Fix some bugs with -DAllow_TYQUAD (for integer*8).
- Add -DNo_Namelist_Comments lines to rsne.c. */
diff --git a/lib/libI77/backspace.c b/lib/libI77/backspace.c
index 3771cd961571..421342485fec 100644
--- a/lib/libI77/backspace.c
+++ b/lib/libI77/backspace.c
@@ -50,16 +50,14 @@ integer f_back(alist *a)
#ifdef MSDOS
w = -1;
#endif
- for(ndec = 1;; ndec = 0)
+ for(ndec = 2;; ndec = 1)
{
- y = x = ftell(b->ufd);
- if(x < sizeof(buf))
- x = 0;
- else
- x -= sizeof(buf);
+ y = x=ftell(b->ufd);
+ if(x<sizeof(buf)) x=0;
+ else x -= sizeof(buf);
(void) fseek(b->ufd,x,SEEK_SET);
n=fread(buf,1,(int)(y-x), b->ufd);
- for(i = n - ndec; --i >= 0; )
+ for(i=n-ndec;i>=0;i--)
{
if(buf[i]!='\n') continue;
#ifdef MSDOS
@@ -67,17 +65,17 @@ integer f_back(alist *a)
if (buf[j] == '\n')
k++;
fseek(b->ufd,x,SEEK_SET);
- for(;;)
+ do {
if (getc(b->ufd) == '\n') {
- if ((z = ftell(b->ufd)) >= y && ndec) {
+ --k;
+ if ((z = ftell(b->ufd)) >= y) {
if (w == -1)
goto break2;
break;
}
- if (--k <= 0)
- return 0;
w = z;
}
+ } while(k > 0);
fseek(b->ufd, w, SEEK_SET);
#else
fseek(b->ufd,(long)(i+1-n),SEEK_CUR);
diff --git a/lib/libI77/dfe.c b/lib/libI77/dfe.c
index 86fbe8ebb28a..669c3bd8b1db 100644
--- a/lib/libI77/dfe.c
+++ b/lib/libI77/dfe.c
@@ -152,5 +152,6 @@ integer e_rdfe(Void)
}
integer e_wdfe(Void)
{
- return en_fio();
+ (void) en_fio();
+ return(0);
}
diff --git a/lib/libI77/due.c b/lib/libI77/due.c
index d5ade7ac0570..33ee02c3cd29 100644
--- a/lib/libI77/due.c
+++ b/lib/libI77/due.c
@@ -60,9 +60,5 @@ integer e_rdue(Void)
}
integer e_wdue(Void)
{
-#ifdef ALWAYS_FLUSH
- if (fflush(f__cf))
- err(f__elist->cierr,errno,"write end");
-#endif
return(e_rdue());
}
diff --git a/lib/libI77/fmt.h b/lib/libI77/fmt.h
index e94bc1cabc3b..d4810a15e82a 100644
--- a/lib/libI77/fmt.h
+++ b/lib/libI77/fmt.h
@@ -80,17 +80,3 @@ extern int f__scale;
#define VAL(x) (x!='\n'?x:' ')
#define PUT(x) (*f__putn)(x)
extern int f__cursor;
-
-#undef TYQUAD
-#ifndef Allow_TYQUAD
-#undef longint
-#define longint long
-#else
-#define TYQUAD 14
-#endif
-
-#ifdef KR_headers
-extern char *f__icvt();
-#else
-extern char *f__icvt(longint, int*, int*, int);
-#endif
diff --git a/lib/libI77/fmtlib.c b/lib/libI77/fmtlib.c
index 1c6801e68b51..37a4cc5f1d5a 100644
--- a/lib/libI77/fmtlib.c
+++ b/lib/libI77/fmtlib.c
@@ -1,39 +1,28 @@
/* @(#)fmtlib.c 1.2 */
#define MAXINTLENGTH 23
-
-#include "f2c.h"
-#ifndef Allow_TYQUAD
-#undef longint
-#define longint long
-#endif
-
#ifdef KR_headers
-char *f__icvt(value,ndigit,sign, base) longint value; int *ndigit,*sign;
+char *f__icvt(value,ndigit,sign, base) long value; int *ndigit,*sign;
register int base;
#else
-char *f__icvt(longint value, int *ndigit, int *sign, int base)
+char *f__icvt(long value, int *ndigit, int *sign, int base)
#endif
{ static char buf[MAXINTLENGTH+1];
register int i;
-
- if(value > 0)
- *sign = 0;
- else if (value < 0) {
- value = -value;
- *sign = 1;
- }
- else {
- *sign = 0;
- *ndigit = 1;
- buf[MAXINTLENGTH-1] = '0';
- return &buf[MAXINTLENGTH-1];
- }
- i = MAXINTLENGTH;
- do {
- buf[--i] = (value%base) + '0';
+ if(value>0) *sign=0;
+ else if(value<0)
+ { value = -value;
+ *sign= 1;
+ }
+ else
+ { *sign=0;
+ *ndigit=1;
+ buf[MAXINTLENGTH]='0';
+ return(&buf[MAXINTLENGTH]);
+ }
+ for(i=MAXINTLENGTH-1;value>0;i--)
+ { *(buf+i)=(int)(value%base)+'0';
value /= base;
- }
- while(value > 0);
- *ndigit = MAXINTLENGTH - i;
- return &buf[i];
}
+ *ndigit=MAXINTLENGTH-1-i;
+ return(&buf[i+1]);
+}
diff --git a/lib/libI77/iio.c b/lib/libI77/iio.c
index 4c8eb9de4b6b..b747826f4b88 100644
--- a/lib/libI77/iio.c
+++ b/lib/libI77/iio.c
@@ -10,7 +10,7 @@ z_getc(Void)
{
if(f__recpos++ < f__svic->icirlen) {
if(f__icptr >= f__icend) err(f__svic->iciend,(EOF),"endfile");
- return(*(unsigned char *)f__icptr++);
+ return(*f__icptr++);
}
return '\n';
}
@@ -95,10 +95,6 @@ integer s_rsfi(icilist *a)
z_wnew(Void)
{
- if (f__recpos < f__hiwater) {
- f__icptr += f__hiwater - f__recpos;
- f__recpos = f__hiwater;
- }
while(f__recpos++ < f__svic->icirlen)
*f__icptr++ = ' ';
f__recpos = 0;
diff --git a/lib/libI77/libI77.xsum b/lib/libI77/libI77.xsum
index c93a1903aec1..00a8cb481fa3 100644
--- a/lib/libI77/libI77.xsum
+++ b/lib/libI77/libI77.xsum
@@ -1,41 +1,41 @@
-Notice fd29c05f 1184
-README ef678ce5 8578
-Version.c 367e2b0 11141
-backspace.c e29c7ec1 1794
+Notice 15a21790 1184
+README 16b752be 7685
+Version.c 11b93284 9820
+backspace.c 198946cc 1759
close.c 175acd02 1336
-dfe.c 16facc04 2891
+dfe.c 3c6b216 2903
dolio.c 17595b24 404
-due.c f05f7fa6 1519
+due.c 1bbe319b 1430
endfile.c 12d875dc 3400
err.c fccb27de 6084
f2ch.add fed3bb7b 6056
fio.h e7e8a21c 2315
fmt.c e37e7c2a 7857
-fmt.h 7686340 1835
-fmtlib.c f79c9df4 704
+fmt.h 1273f9e8 1628
+fmtlib.c e010030f 582
fp.h 100fb355 665
-iio.c fedbf0b5 2374
+iio.c e04c6615 2258
ilnw.c fa459169 1049
inquire.c e1059667 2536
-lio.h a087b39 1564
-lread.c 4dfc73b 12130
-lwrite.c 19137b45 4565
+lio.h ffc2e000 1550
+lread.c e220dbce 11416
+lwrite.c 1a82fbe7 4183
makefile e8266f12 1972
-open.c 1ef408ec 4512
+open.c fd6dc333 4485
rawio.h b9d538d 688
-rdfmt.c 55975ac 8347
+rdfmt.c 1d49cf1d 8344
rewind.c 87b080b 408
-rsfe.c 1d79e4a1 1415
+rsfe.c c949b09 1299
rsli.c 1259dfec 1748
-rsne.c f2e2cad1 11466
-sfe.c 45a6968 793
-sue.c ec169681 1803
+rsne.c ee3a2728 10686
+sfe.c f8a8b265 638
+sue.c ff73457b 1740
typesize.c e5660590 319
uio.c fe44d524 1547
util.c f17978be 824
-wref.c fbed7e10 4507
-wrtfmt.c 7a73318 8090
+wref.c 1d4e4539 4108
+wrtfmt.c f41b0c38 8075
wsfe.c 250d1ef 1658
-wsle.c f74ea563 684
-wsne.c ea4dac25 412
-xwsne.c 16641f3c 1135
+wsle.c 2f94457 611
+wsne.c fd7a0e2f 438
+xwsne.c 7ac1479 1080
diff --git a/lib/libI77/lio.h b/lib/libI77/lio.h
index 012317206aaf..5af9fc45e66f 100644
--- a/lib/libI77/lio.h
+++ b/lib/libI77/lio.h
@@ -23,7 +23,6 @@
#define TYLOGICAL1 12
#define TYLOGICAL2 13
#ifdef Allow_TYQUAD
-#undef TYQUAD
#define TYQUAD 14
#endif
diff --git a/lib/libI77/lread.c b/lib/libI77/lread.c
index c14fd5ba6a67..2da52d8e8f81 100644
--- a/lib/libI77/lread.c
+++ b/lib/libI77/lread.c
@@ -6,12 +6,6 @@
#include "fp.h"
extern char *f__fmtbuf;
-
-#ifdef Allow_TYQUAD
-static longint f__llx;
-static int quad_read;
-#endif
-
#ifdef KR_headers
extern double atof();
extern char *malloc(), *realloc();
@@ -108,9 +102,6 @@ l_R(int poststar)
return(0);
f__lcount = 1;
}
-#ifdef Allow_TYQUAD
- f__llx = 0;
-#endif
f__ltype = 0;
exp = 0;
havestar = 0;
@@ -193,22 +184,6 @@ bad:
else
sp[1] = 0;
f__lx = atof(s);
-#ifdef Allow_TYQUAD
- if (quad_read && (se = sp - sp1 + exp) > 14 && se < 20) {
- /* Assuming 64-bit longint and 32-bit long. */
- if (exp < 0)
- sp += exp;
- if (sp1 <= sp) {
- f__llx = *sp1 - '0';
- while(++sp1 <= sp)
- f__llx = 10*f__llx + (*sp1 - '0');
- }
- while(--exp >= 0)
- f__llx *= 10;
- if (*s == '-')
- f__llx = -f__llx;
- }
-#endif
}
else
f__lx = 0.;
@@ -305,9 +280,6 @@ l_C(Void)
if(ch!=')') errfl(f__elist->cierr,112,"no )");
f__ly = f__lx;
f__lx = lz;
-#ifdef Allow_TYQUAD
- f__llx = 0;
-#endif
nml_read = nml_save;
return(0);
}
@@ -484,8 +456,6 @@ c_le(a) cilist *a;
c_le(cilist *a)
#endif
{
- if(!f__init)
- f_init();
f__fmtbuf="list io";
if(a->ciunit>=MXUNIT || a->ciunit<0)
err(a->cierr,101,"stler");
@@ -542,19 +512,13 @@ l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
case TYINT1:
case TYSHORT:
case TYLONG:
+#ifdef TYQUAD
+ case TYQUAD:
+#endif
case TYREAL:
case TYDREAL:
ERR(l_R(0));
break;
-#ifdef TYQUAD
- case TYQUAD:
- quad_read = 1;
- n = l_R(0);
- quad_read = 0;
- if (n)
- return n;
- break;
-#endif
case TYCOMPLEX:
case TYDCOMPLEX:
ERR(l_C());
@@ -596,10 +560,9 @@ l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
case TYLONG:
Ptr->flint=f__lx;
break;
-#ifdef Allow_TYQUAD
+#ifdef TYQUAD
case TYQUAD:
- if (!(Ptr->fllongint = f__llx))
- Ptr->fllongint = f__lx;
+ Ptr->fllongint = f__lx;
break;
#endif
case TYREAL:
@@ -639,6 +602,7 @@ integer s_rsle(cilist *a)
{
int n;
+ if(!f__init) f_init();
if(n=c_le(a)) return(n);
f__reading=1;
f__external=1;
@@ -649,8 +613,6 @@ integer s_rsle(cilist *a)
l_eof = 0;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr,errno,"read start");
- if(f__curunit->uend)
- err(f__elist->ciend,(EOF),"read start");
l_getc = t_getc;
l_ungetc = un_getc;
f__doend = xrd_SL;
diff --git a/lib/libI77/lwrite.c b/lib/libI77/lwrite.c
index 5da7dfbb972a..ca038ccb7b42 100644
--- a/lib/libI77/lwrite.c
+++ b/lib/libI77/lwrite.c
@@ -2,9 +2,7 @@
#include "fio.h"
#include "fmt.h"
#include "lio.h"
-
ftnint L_len;
-int f__Aquote;
static VOID
donewrec(Void)
@@ -25,22 +23,20 @@ t_putc(int c)
}
static VOID
#ifdef KR_headers
-lwrt_I(n) longint n;
+lwrt_I(n) long n;
#else
-lwrt_I(longint n)
+lwrt_I(long n)
#endif
{
- char *p;
- int ndigit, sign;
-
- p = f__icvt(n, &ndigit, &sign, 10);
- if(f__recpos + ndigit >= L_len)
+ char buf[LINTW],*p;
+#ifdef USE_STRLEN
+ (void) sprintf(buf," %ld",n);
+ if(f__recpos+strlen(buf)>=L_len)
+#else
+ if(f__recpos + sprintf(buf," %ld",n) >= L_len)
+#endif
donewrec();
- PUT(' ');
- if (sign)
- PUT('-');
- while(*p)
- PUT(*p++);
+ for(p=buf;*p;PUT(*p++));
}
static VOID
#ifdef KR_headers
@@ -60,42 +56,14 @@ lwrt_A(p,len) char *p; ftnlen len;
lwrt_A(char *p, ftnlen len)
#endif
{
- int a;
- char *p1, *pe;
-
- a = 0;
- pe = p + len;
- if (f__Aquote) {
- a = 3;
- if (len > 1 && p[len-1] == ' ') {
- while(--len > 1 && p[len-1] == ' ');
- pe = p + len;
- }
- p1 = p;
- while(p1 < pe)
- if (*p1++ == '\'')
- a++;
- }
- if(f__recpos+len+a >= L_len)
+ int i;
+ if(f__recpos+len>=L_len)
donewrec();
- if (a
#ifndef OMIT_BLANK_CC
- || !f__recpos
-#endif
- )
+ if (!f__recpos)
PUT(' ');
- if (a) {
- PUT('\'');
- while(p < pe) {
- if (*p == '\'')
- PUT('\'');
- PUT(*p++);
- }
- PUT('\'');
- }
- else
- while(p < pe)
- PUT(*p++);
+#endif
+ for(i=0;i<len;i++) PUT(*p++);
}
static int
@@ -139,12 +107,10 @@ l_g(char *buf, double n)
}
sprintf(b, LGFMT, n);
switch(*b) {
-#ifndef WANT_LEAD_0
case '0':
while(b[0] = b[1])
b++;
break;
-#endif
case 'i':
case 'I':
/* Infinity */
@@ -247,7 +213,7 @@ l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
{
#define Ptr ((flex *)ptr)
int i;
- longint x;
+ long x;
double y,z;
real *xx;
doublereal *yy;
@@ -262,7 +228,7 @@ l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
case TYSHORT:
x=Ptr->flshort;
goto xint;
-#ifdef Allow_TYQUAD
+#ifdef TYQUAD
case TYQUAD:
x = Ptr->fllongint;
goto xint;
diff --git a/lib/libI77/open.c b/lib/libI77/open.c
index 75386b9ca9f5..15d887a4016f 100644
--- a/lib/libI77/open.c
+++ b/lib/libI77/open.c
@@ -83,8 +83,6 @@ integer f_open(olist *a)
#endif
if(a->ounit>=MXUNIT || a->ounit<0)
err(a->oerr,101,"open")
- if (!f__init)
- f_init();
f__curunit = b = &f__units[a->ounit];
if(b->ufd) {
if(a->ofnm==0)
diff --git a/lib/libI77/rdfmt.c b/lib/libI77/rdfmt.c
index eef745b118e9..9fd854515b65 100644
--- a/lib/libI77/rdfmt.c
+++ b/lib/libI77/rdfmt.c
@@ -97,7 +97,7 @@ rd_I(n,w,len, base) Uint *n; int w; ftnlen len; register int base;
#else
rd_I(Uint *n, int w, ftnlen len, register int base)
#endif
-{ longint x;
+{ long x;
int sign,ch;
char s[84], *ps;
ps=s; x=0;
diff --git a/lib/libI77/rsfe.c b/lib/libI77/rsfe.c
index 5ff0a338b2f7..5d29bee6847e 100644
--- a/lib/libI77/rsfe.c
+++ b/lib/libI77/rsfe.c
@@ -6,11 +6,7 @@
xrd_SL(Void)
{ int ch;
if(!f__curunit->uend)
- while((ch=getc(f__cf))!='\n')
- if (ch == EOF) {
- f__curunit->uend = 1;
- break;
- }
+ while((ch=getc(f__cf))!='\n' && ch!=EOF);
f__cursor=f__recpos=0;
return(1);
}
@@ -73,7 +69,5 @@ integer s_rsfe(cilist *a) /* start */
f__cplus=0;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr,errno,"read start");
- if(f__curunit->uend)
- err(f__elist->ciend,(EOF),"read start");
return(0);
}
diff --git a/lib/libI77/rsne.c b/lib/libI77/rsne.c
index ad7ad26c8fb9..66a1c02d8c9c 100644
--- a/lib/libI77/rsne.c
+++ b/lib/libI77/rsne.c
@@ -31,7 +31,6 @@
static hashtab *nl_cache;
static n_nlcache;
static hashentry **zot;
- static int colonseen;
extern ftnlen f__typesize[];
extern flag f__lquit;
@@ -248,7 +247,6 @@ getdimen(int *chp, dimen *d, ftnlen delta, ftnlen extent, ftnlen *x1)
if (!x3)
return 123;
x2 /= x3;
- colonseen = 1;
}
if (x2 < 0 || x2 >= extent)
return 123;
@@ -296,7 +294,7 @@ x_rsne(a) cilist *a;
x_rsne(cilist *a)
#endif
{
- int ch, got1, k, n, nd, quote, readall;
+ int ch, got1, k, n, nd, quote;
Namelist *nl;
static char where[] = "namelist read";
char buf[64];
@@ -318,7 +316,6 @@ x_rsne(cilist *a)
top:
for(;;) switch(GETC(ch)) {
case EOF:
- eof:
err(a->ciend,(EOF),where0);
case '&':
case '$':
@@ -331,13 +328,7 @@ x_rsne(cilist *a)
default:
if (ch <= ' ' && ch >= 0)
continue;
-#ifndef No_Namelist_Comments
- while(GETC(ch) != '\n')
- if (ch == EOF)
- goto eof;
-#else
errfl(a->cierr, 115, where0);
-#endif
}
have_amp:
if (ch = getname(buf,sizeof(buf)))
@@ -413,7 +404,7 @@ x_rsne(cilist *a)
else
size = f__typesize[type];
ivae = size;
- iva = readall = 0;
+ iva = 0;
if (ch == '(' /*)*/ ) {
dn = dimens;
if (!(dims = v->dims)) {
@@ -435,7 +426,6 @@ x_rsne(cilist *a)
nd = (int)dims[0];
nomax = span = dims[1];
ivae = iva + size*nomax;
- colonseen = 0;
if (k = getdimen(&ch, dn, size, nomax, &b))
errfl(a->cierr, k, where);
no = dn->extent;
@@ -457,7 +447,6 @@ x_rsne(cilist *a)
}
if (ch != ')')
errfl(a->cierr, 115, where);
- readall = 1 - colonseen;
b -= b0;
if (b < 0 || b >= nomax)
errfl(a->cierr, 125, where);
@@ -481,8 +470,6 @@ x_rsne(cilist *a)
if (b1 < b0)
goto delta_adj;
}
- if (readall)
- goto delta_adj;
for(; dn0 < dn; dn0++) {
if (dn0->extent != *dims++ || dn0->stride != 1)
break;
@@ -526,34 +513,8 @@ x_rsne(cilist *a)
return k;
if (f__lquit == 1)
return 0;
- if (readall) {
- iva += dn0->delta;
- if (f__lcount > 0) {
- no1 = (ivae - iva)/size;
- if (no1 > f__lcount)
- no1 = f__lcount;
- iva += no1 * dn0->delta;
- if (k = l_read(&no1, vaddr + iva,
- size, type))
- return k;
- }
- }
mustend:
- GETC(ch);
- if (readall)
- if (iva >= ivae)
- readall = 0;
- else for(;;) {
- switch(ch) {
- case ' ':
- case '\t':
- case '\n':
- GETC(ch);
- continue;
- }
- break;
- }
- if (ch == '/' || ch == '$' || ch == '&') {
+ if (GETC(ch) == '/' || ch == '$' || ch == '&') {
f__lquit = 1;
return 0;
}
@@ -566,8 +527,6 @@ x_rsne(cilist *a)
break;
}
Ungetc(ch,f__cf);
- if (readall && !Alpha[ch & 0xff])
- goto readloop;
if ((no -= no1) <= 0)
break;
for(dn1 = dn0; dn1 <= dn; dn1++) {
diff --git a/lib/libI77/sfe.c b/lib/libI77/sfe.c
index eea9078eee42..6dea23af40fe 100644
--- a/lib/libI77/sfe.c
+++ b/lib/libI77/sfe.c
@@ -28,15 +28,5 @@ c_sfe(cilist *a) /* check */
return(0);
}
integer e_wsfe(Void)
-{
-#ifdef ALWAYS_FLUSH
- int n;
- n = en_fio();
- f__fmtbuf=NULL;
- if (!n && fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
- return n;
-#else
- return(e_rsfe());
-#endif
+{ return(e_rsfe());
}
diff --git a/lib/libI77/sue.c b/lib/libI77/sue.c
index b1b8bc385489..21f30bf76f12 100644
--- a/lib/libI77/sue.c
+++ b/lib/libI77/sue.c
@@ -65,15 +65,11 @@ integer s_wsue(cilist *a)
}
integer e_wsue(Void)
{ long loc;
- fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
-#ifdef ALWAYS_FLUSH
- if (fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
-#endif
+ (void) fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
loc=ftell(f__cf);
- fseek(f__cf,f__recloc,SEEK_SET);
- fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
- fseek(f__cf,loc,SEEK_SET);
+ (void) fseek(f__cf,f__recloc,SEEK_SET);
+ (void) fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
+ (void) fseek(f__cf,loc,SEEK_SET);
return(0);
}
integer e_rsue(Void)
diff --git a/lib/libI77/wref.c b/lib/libI77/wref.c
index eda9a8fa763b..1ef2c474e64b 100644
--- a/lib/libI77/wref.c
+++ b/lib/libI77/wref.c
@@ -23,9 +23,6 @@ wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
char buf[FMAX+EXPMAXDIGS+4], *s, *se;
int d1, delta, e1, i, sign, signspace;
double dd;
-#ifdef WANT_LEAD_0
- int insert0 = 0;
-#endif
#ifndef VAX
int e0 = e;
#endif
@@ -56,13 +53,6 @@ wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
}
delta = w - (2 /* for the . and the d adjustment above */
+ 2 /* for the E+ */ + signspace + d + e);
-#ifdef WANT_LEAD_0
- if (f__scale <= 0 && delta > 0) {
- delta--;
- insert0 = 1;
- }
- else
-#endif
if (delta < 0) {
nogood:
while(--w >= 0)
@@ -101,13 +91,8 @@ nogood:
se = buf + d + 3;
#ifdef GOOD_SPRINTF_EXPONENT /* When possible, exponent has 2 digits. */
if (f__scale != 1 && dd)
- sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
-#else
- if (dd)
- sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
- else
- strcpy(se, "+00");
#endif
+ sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
s = ++se;
if (e < 2) {
if (*s != '0')
@@ -154,10 +139,6 @@ nogood:
s = buf;
i = f__scale;
if (f__scale <= 0) {
-#ifdef WANT_LEAD_0
- if (insert0)
- PUT('0');
-#endif
PUT('.');
for(; i < 0; ++i)
PUT('0');
@@ -230,10 +211,8 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
n = sprintf(b = buf, "%#.*f", d, x) + d1;
#endif
-#ifndef WANT_LEAD_0
if (buf[0] == '0' && d)
{ ++b; --n; }
-#endif
if (sign) {
/* check for all zeros */
for(s = b;;) {
@@ -250,16 +229,9 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
if (sign || f__cplus)
++n;
if (n > w) {
-#ifdef WANT_LEAD_0
- if (buf[0] == '0' && --n == w)
- ++b;
- else
-#endif
- {
- while(--w >= 0)
- PUT('*');
- return 0;
- }
+ while(--w >= 0)
+ PUT('*');
+ return 0;
}
for(w -= n; --w >= 0; )
PUT(' ');
diff --git a/lib/libI77/wrtfmt.c b/lib/libI77/wrtfmt.c
index 545dcb92407a..b08b7a89e397 100644
--- a/lib/libI77/wrtfmt.c
+++ b/lib/libI77/wrtfmt.c
@@ -1,8 +1,12 @@
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
-
extern int f__cursor;
+#ifdef KR_headers
+extern char *f__icvt();
+#else
+extern char *f__icvt(long, int*, int*, int);
+#endif
int f__hiwater;
icilist *f__svic;
char *f__icptr;
@@ -147,7 +151,7 @@ wrt_I(n,w,len, base) Uint *n; ftnlen len; register int base;
wrt_I(Uint *n, int w, ftnlen len, register int base)
#endif
{ int ndigit,sign,spare,i;
- longint x;
+ long x;
char *ans;
if(len==sizeof(integer)) x=n->il;
else if(len == sizeof(char)) x = n->ic;
@@ -175,13 +179,10 @@ wrt_IM(n,w,m,len,base) Uint *n; ftnlen len; int base;
wrt_IM(Uint *n, int w, int m, ftnlen len, int base)
#endif
{ int ndigit,sign,spare,i,xsign;
- longint x;
+ long x;
char *ans;
if(sizeof(integer)==len) x=n->il;
else if(len == sizeof(char)) x = n->ic;
-#ifdef Allow_TYQUAD
- else if (len == sizeof(longint)) x = n->ili;
-#endif
else x=n->is;
ans=f__icvt(x,&ndigit,&sign, base);
if(sign || f__cplus) xsign=1;
@@ -287,9 +288,6 @@ wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
if(x<.1) {
if (x != 0.)
return(wrt_E(p,w,d,e,len));
-#ifdef WANT_LEAD_0
- i = 1;
-#endif
goto have_i;
}
for(;i<=d;i++,up*=10)
diff --git a/lib/libI77/wsle.c b/lib/libI77/wsle.c
index 44b69729761c..470191be0145 100644
--- a/lib/libI77/wsle.c
+++ b/lib/libI77/wsle.c
@@ -10,6 +10,7 @@ integer s_wsle(cilist *a)
#endif
{
int n;
+ if(!f__init) f_init();
if(n=c_le(a)) return(n);
f__reading=0;
f__external=1;
@@ -27,14 +28,9 @@ integer e_wsle(Void)
{
t_putc('\n');
f__recpos=0;
-#ifdef ALWAYS_FLUSH
- if (fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
-#else
if (f__cf == stdout)
fflush(stdout);
else if (f__cf == stderr)
fflush(stderr);
-#endif
return(0);
}
diff --git a/lib/libI77/wsne.c b/lib/libI77/wsne.c
index 0febd52634fd..c3f06234d3c2 100644
--- a/lib/libI77/wsne.c
+++ b/lib/libI77/wsne.c
@@ -11,6 +11,8 @@ s_wsne(cilist *a)
{
int n;
+ if(!f__init)
+ f_init();
if(n=c_le(a))
return(n);
f__reading=0;
diff --git a/lib/libI77/xwsne.c b/lib/libI77/xwsne.c
index 41c929b0796b..49e6f0ec4596 100644
--- a/lib/libI77/xwsne.c
+++ b/lib/libI77/xwsne.c
@@ -3,8 +3,6 @@
#include "lio.h"
#include "fmt.h"
-extern int f__Aquote;
-
static VOID
nl_donewrec(Void)
{
@@ -35,7 +33,6 @@ x_wsne(cilist *a)
for(s = nl->name; *s; s++)
PUT(*s);
PUT(' ');
- f__Aquote = 1;
vd = nl->vars;
vde = vd + nl->nvars;
while(vd < vde) {
@@ -67,6 +64,5 @@ x_wsne(cilist *a)
else if (f__recpos+1 >= L_len)
nl_donewrec();
}
- f__Aquote = 0;
PUT('/');
}
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 4fdc2f2d27f6..d02e1eed812c 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -6,8 +6,8 @@
# from CFLAGS below. To remove these strings from just the system call
# stubs, remove just -DSYSLIBC_RCS from CFLAGS.
LIB=c
-SHLIB_MAJOR= 3
-SHLIB_MINOR= 0
+SHLIB_MAJOR= 2
+SHLIB_MINOR= 2
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS
AINC= -I${.CURDIR}/${MACHINE}
CLEANFILES+=tags
@@ -53,7 +53,7 @@ libkern.${MACHINE}:: ${KMSRCS}
.endif
#beforeinstall: tags
-# ${INSTALL} ${COPY} -o bin -g bin -m 444 tags /var/db/libc.tags
+# install -c -o bin -g bin -m 444 tags /var/db/libc.tags
tags: ${SRCS}
ctags ${.ALLSRC:M*.c}
diff --git a/lib/libc/compat-43/gethostid.3 b/lib/libc/compat-43/gethostid.3
index 72222cc57287..8f56a282f2dd 100644
--- a/lib/libc/compat-43/gethostid.3
+++ b/lib/libc/compat-43/gethostid.3
@@ -57,10 +57,10 @@ returns the 32-bit identifier for the current processor.
.Pp
This function has been deprecated.
The hostid should be set or retrieved by use of
-.Xr sysctl 3 .
+.Xr sysctl 2 .
.Sh SEE ALSO
+.Xr sysctl 2 ,
.Xr gethostname 3 ,
-.Xr sysctl 3 ,
.Xr sysctl 8 .
.Sh BUGS
32 bits for the identifier is too small.
diff --git a/lib/libc/compat-43/sigvec.2 b/lib/libc/compat-43/sigvec.2
index a37c988d5baa..1b5244f25fe3 100644
--- a/lib/libc/compat-43/sigvec.2
+++ b/lib/libc/compat-43/sigvec.2
@@ -102,9 +102,9 @@ must arrange to restore the previous context itself.
When a signal is delivered to a process a new signal mask is
installed for the duration of the process' signal handler
(or until a
-.Xr sigblock 2
+.Xr sigblock
or
-.Xr sigsetmask 2
+.Xr sigsetmask
call is made).
This mask is formed by taking the current signal mask,
adding the signal to be delivered, and
@@ -140,7 +140,7 @@ with names as in the include file
.It Dv SIGQUIT No " create core image" " quit program"
.It Dv SIGILL No " create core image" " illegal instruction"
.It Dv SIGTRAP No " create core image" " trace trap"
-.It Dv SIGABRT No " create core image" Xr abort 3
+.It Dv SIGABRT No " create core image" Xr abort 2
call (formerly
.Dv SIGIOT )
.It Dv SIGEMT No " create core image" " emulate instruction executed"
@@ -148,7 +148,7 @@ call (formerly
.It Dv SIGKILL No " terminate process" " kill program"
.It Dv SIGBUS No " create core image" " bus error"
.It Dv SIGSEGV No " create core image" " segmentation violation"
-.It Dv SIGSYS No " create core image" " non-existent system call invoked"
+.It Dv SIGSYS No " create core image" " system call given invalid argument"
.It Dv SIGPIPE No " terminate process" " write on a pipe with no reader"
.It Dv SIGALRM No " terminate process" " real-time timer expired"
.It Dv SIGTERM No " terminate process" " software termination signal"
diff --git a/lib/libc/db/btree/Makefile.inc b/lib/libc/db/btree/Makefile.inc
index 8ed76494aabf..71f8dfcf9e4d 100644
--- a/lib/libc/db/btree/Makefile.inc
+++ b/lib/libc/db/btree/Makefile.inc
@@ -1,7 +1,7 @@
-# @(#)Makefile.inc 8.2 (Berkeley) 7/14/94
+# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
.PATH: ${.CURDIR}/db/btree
SRCS+= bt_close.c bt_conv.c bt_debug.c bt_delete.c bt_get.c bt_open.c \
bt_overflow.c bt_page.c bt_put.c bt_search.c bt_seq.c bt_split.c \
- bt_utils.c
+ bt_stack.c bt_utils.c
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c
index 27f9ab660f98..6269bd5c8ac0 100644
--- a/lib/libc/db/btree/bt_close.c
+++ b/lib/libc/db/btree/bt_close.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94";
+static char sccsid[] = "@(#)bt_close.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -75,30 +75,25 @@ __bt_close(dbp)
t->bt_pinned = NULL;
}
- /* Sync the tree. */
+ /*
+ * Delete any already deleted record that we've been saving
+ * because the cursor pointed to it.
+ */
+ if (ISSET(t, B_DELCRSR) && __bt_crsrdel(t, &t->bt_bcursor))
+ return (RET_ERROR);
+
if (__bt_sync(dbp, 0) == RET_ERROR)
return (RET_ERROR);
- /* Close the memory pool. */
if (mpool_close(t->bt_mp) == RET_ERROR)
return (RET_ERROR);
- /* Free random memory. */
- if (t->bt_cursor.key.data != NULL) {
- free(t->bt_cursor.key.data);
- t->bt_cursor.key.size = 0;
- t->bt_cursor.key.data = NULL;
- }
- if (t->bt_rkey.data) {
- free(t->bt_rkey.data);
- t->bt_rkey.size = 0;
- t->bt_rkey.data = NULL;
- }
- if (t->bt_rdata.data) {
- free(t->bt_rdata.data);
- t->bt_rdata.size = 0;
- t->bt_rdata.data = NULL;
- }
+ if (t->bt_stack)
+ free(t->bt_stack);
+ if (t->bt_kbuf)
+ free(t->bt_kbuf);
+ if (t->bt_dbuf)
+ free(t->bt_dbuf);
fd = t->bt_fd;
free(t);
@@ -122,6 +117,8 @@ __bt_sync(dbp, flags)
{
BTREE *t;
int status;
+ PAGE *h;
+ void *p;
t = dbp->internal;
@@ -137,15 +134,40 @@ __bt_sync(dbp, flags)
return (RET_ERROR);
}
- if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED))
+ if (ISSET(t, B_INMEM | B_RDONLY) || !ISSET(t, B_MODIFIED))
return (RET_SUCCESS);
- if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR)
+ if (ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR)
return (RET_ERROR);
- if ((status = mpool_sync(t->bt_mp)) == RET_SUCCESS)
- F_CLR(t, B_MODIFIED);
+ /*
+ * Nastiness. If the cursor has been marked for deletion, but not
+ * actually deleted, we have to make a copy of the page, delete the
+ * key/data item, sync the file, and then restore the original page
+ * contents.
+ */
+ if (ISSET(t, B_DELCRSR)) {
+ if ((p = (void *)malloc(t->bt_psize)) == NULL)
+ return (RET_ERROR);
+ if ((h = mpool_get(t->bt_mp, t->bt_bcursor.pgno, 0)) == NULL)
+ return (RET_ERROR);
+ memmove(p, h, t->bt_psize);
+ if ((status =
+ __bt_dleaf(t, h, t->bt_bcursor.index)) == RET_ERROR)
+ goto ecrsr;
+ mpool_put(t->bt_mp, h, MPOOL_DIRTY);
+ }
+ if ((status = mpool_sync(t->bt_mp)) == RET_SUCCESS)
+ CLR(t, B_MODIFIED);
+
+ecrsr: if (ISSET(t, B_DELCRSR)) {
+ if ((h = mpool_get(t->bt_mp, t->bt_bcursor.pgno, 0)) == NULL)
+ return (RET_ERROR);
+ memmove(h, p, t->bt_psize);
+ free(p);
+ mpool_put(t->bt_mp, h, MPOOL_DIRTY);
+ }
return (status);
}
@@ -169,12 +191,12 @@ bt_meta(t)
return (RET_ERROR);
/* Fill in metadata. */
- m.magic = BTREEMAGIC;
- m.version = BTREEVERSION;
- m.psize = t->bt_psize;
- m.free = t->bt_free;
- m.nrecs = t->bt_nrecs;
- m.flags = F_ISSET(t, SAVEMETA);
+ m.m_magic = BTREEMAGIC;
+ m.m_version = BTREEVERSION;
+ m.m_psize = t->bt_psize;
+ m.m_free = t->bt_free;
+ m.m_nrecs = t->bt_nrecs;
+ m.m_flags = t->bt_flags & SAVEMETA;
memmove(p, &m, sizeof(BTMETA));
mpool_put(t->bt_mp, p, MPOOL_DIRTY);
diff --git a/lib/libc/db/btree/bt_conv.c b/lib/libc/db/btree/bt_conv.c
index 1cb208b14d94..eb4934090b58 100644
--- a/lib/libc/db/btree/bt_conv.c
+++ b/lib/libc/db/btree/bt_conv.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_conv.c 8.5 (Berkeley) 8/17/94";
+static char sccsid[] = "@(#)bt_conv.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -68,7 +68,7 @@ __bt_pgin(t, pg, pp)
u_char flags;
char *p;
- if (!F_ISSET(((BTREE *)t), B_NEEDSWAP))
+ if (!ISSET(((BTREE *)t), B_NEEDSWAP))
return;
if (pg == P_META) {
mswap(pp);
@@ -89,7 +89,7 @@ __bt_pgin(t, pg, pp)
M_16_SWAP(h->linp[i]);
p = (char *)GETBINTERNAL(h, i);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
p += sizeof(pgno_t);
if (*(u_char *)p & P_BIGKEY) {
@@ -104,9 +104,9 @@ __bt_pgin(t, pg, pp)
M_16_SWAP(h->linp[i]);
p = (char *)GETBLEAF(h, i);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
flags = *(u_char *)p;
if (flags & (P_BIGKEY | P_BIGDATA)) {
p += sizeof(u_char);
@@ -116,7 +116,7 @@ __bt_pgin(t, pg, pp)
P_32_SWAP(p);
}
if (flags & P_BIGDATA) {
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
p += sizeof(pgno_t);
P_32_SWAP(p);
@@ -136,7 +136,7 @@ __bt_pgout(t, pg, pp)
u_char flags;
char *p;
- if (!F_ISSET(((BTREE *)t), B_NEEDSWAP))
+ if (!ISSET(((BTREE *)t), B_NEEDSWAP))
return;
if (pg == P_META) {
mswap(pp);
@@ -149,7 +149,7 @@ __bt_pgout(t, pg, pp)
for (i = 0; i < top; i++) {
p = (char *)GETBINTERNAL(h, i);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
p += sizeof(pgno_t);
if (*(u_char *)p & P_BIGKEY) {
@@ -164,9 +164,9 @@ __bt_pgout(t, pg, pp)
for (i = 0; i < top; i++) {
p = (char *)GETBLEAF(h, i);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
flags = *(u_char *)p;
if (flags & (P_BIGKEY | P_BIGDATA)) {
p += sizeof(u_char);
@@ -176,7 +176,7 @@ __bt_pgout(t, pg, pp)
P_32_SWAP(p);
}
if (flags & P_BIGDATA) {
- p += sizeof(u_int32_t);
+ p += sizeof(size_t);
P_32_SWAP(p);
p += sizeof(pgno_t);
P_32_SWAP(p);
@@ -206,16 +206,16 @@ mswap(pg)
char *p;
p = (char *)pg;
- P_32_SWAP(p); /* magic */
+ P_32_SWAP(p); /* m_magic */
p += sizeof(u_int32_t);
- P_32_SWAP(p); /* version */
+ P_32_SWAP(p); /* m_version */
p += sizeof(u_int32_t);
- P_32_SWAP(p); /* psize */
+ P_32_SWAP(p); /* m_psize */
p += sizeof(u_int32_t);
- P_32_SWAP(p); /* free */
+ P_32_SWAP(p); /* m_free */
p += sizeof(u_int32_t);
- P_32_SWAP(p); /* nrecs */
+ P_32_SWAP(p); /* m_nrecs */
p += sizeof(u_int32_t);
- P_32_SWAP(p); /* flags */
+ P_32_SWAP(p); /* m_flags */
p += sizeof(u_int32_t);
}
diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c
index 3aefbe762244..5f9ac1ded8b3 100644
--- a/lib/libc/db/btree/bt_debug.c
+++ b/lib/libc/db/btree/bt_debug.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94";
+static char sccsid[] = "@(#)bt_debug.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -65,22 +65,24 @@ __bt_dump(dbp)
t = dbp->internal;
(void)fprintf(stderr, "%s: pgsz %d",
- F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize);
- if (F_ISSET(t, R_RECNO))
+ ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize);
+ if (ISSET(t, R_RECNO))
(void)fprintf(stderr, " keys %lu", t->bt_nrecs);
#undef X
#define X(flag, name) \
- if (F_ISSET(t, flag)) { \
+ if (ISSET(t, flag)) { \
(void)fprintf(stderr, "%s%s", sep, name); \
sep = ", "; \
}
- if (t->flags != 0) {
+ if (t->bt_flags) {
sep = " flags (";
+ X(B_DELCRSR, "DELCRSR");
X(R_FIXLEN, "FIXLEN");
X(B_INMEM, "INMEM");
X(B_NODUPS, "NODUPS");
X(B_RDONLY, "RDONLY");
X(R_RECNO, "RECNO");
+ X(B_SEQINIT, "SEQINIT");
X(B_METADIRTY,"METADIRTY");
(void)fprintf(stderr, ")\n");
}
@@ -106,19 +108,19 @@ __bt_dmpage(h)
char *sep;
m = (BTMETA *)h;
- (void)fprintf(stderr, "magic %lx\n", m->magic);
- (void)fprintf(stderr, "version %lu\n", m->version);
- (void)fprintf(stderr, "psize %lu\n", m->psize);
- (void)fprintf(stderr, "free %lu\n", m->free);
- (void)fprintf(stderr, "nrecs %lu\n", m->nrecs);
- (void)fprintf(stderr, "flags %lu", m->flags);
+ (void)fprintf(stderr, "magic %lx\n", m->m_magic);
+ (void)fprintf(stderr, "version %lu\n", m->m_version);
+ (void)fprintf(stderr, "psize %lu\n", m->m_psize);
+ (void)fprintf(stderr, "free %lu\n", m->m_free);
+ (void)fprintf(stderr, "nrecs %lu\n", m->m_nrecs);
+ (void)fprintf(stderr, "flags %lu", m->m_flags);
#undef X
#define X(flag, name) \
- if (m->flags & flag) { \
+ if (m->m_flags & flag) { \
(void)fprintf(stderr, "%s%s", sep, name); \
sep = ", "; \
}
- if (m->flags) {
+ if (m->m_flags) {
sep = " (";
X(B_NODUPS, "NODUPS");
X(R_RECNO, "RECNO");
@@ -190,7 +192,7 @@ __bt_dpage(h)
h->lower, h->upper, top);
for (cur = 0; cur < top; cur++) {
(void)fprintf(stderr, "\t[%03d] %4d ", cur, h->linp[cur]);
- switch (h->flags & P_TYPE) {
+ switch(h->flags & P_TYPE) {
case P_BINTERNAL:
bi = GETBINTERNAL(h, cur);
(void)fprintf(stderr,
@@ -212,14 +214,14 @@ __bt_dpage(h)
(void)fprintf(stderr,
"big key page %lu size %u/",
*(pgno_t *)bl->bytes,
- *(u_int32_t *)(bl->bytes + sizeof(pgno_t)));
+ *(size_t *)(bl->bytes + sizeof(pgno_t)));
else if (bl->ksize)
(void)fprintf(stderr, "%s/", bl->bytes);
if (bl->flags & P_BIGDATA)
(void)fprintf(stderr,
"big data page %lu size %u",
*(pgno_t *)(bl->bytes + bl->ksize),
- *(u_int32_t *)(bl->bytes + bl->ksize +
+ *(size_t *)(bl->bytes + bl->ksize +
sizeof(pgno_t)));
else if (bl->dsize)
(void)fprintf(stderr, "%.*s",
@@ -231,7 +233,7 @@ __bt_dpage(h)
(void)fprintf(stderr,
"big data page %lu size %u",
*(pgno_t *)rl->bytes,
- *(u_int32_t *)(rl->bytes + sizeof(pgno_t)));
+ *(size_t *)(rl->bytes + sizeof(pgno_t)));
else if (rl->dsize)
(void)fprintf(stderr,
"%.*s", (int)rl->dsize, rl->bytes);
@@ -265,7 +267,7 @@ __bt_stat(dbp)
pcont = pinternal = pleaf = 0;
nkeys = ifree = lfree = 0;
for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) {
- switch (h->flags & P_TYPE) {
+ switch(h->flags & P_TYPE) {
case P_BINTERNAL:
case P_RINTERNAL:
++pinternal;
@@ -293,7 +295,7 @@ __bt_stat(dbp)
(void)mpool_put(t->bt_mp, h, 0);
break;
}
- i = F_ISSET(t, R_RECNO) ?
+ i = ISSET(t, R_RECNO) ?
GETRINTERNAL(h, 0)->pgno :
GETBINTERNAL(h, 0)->pgno;
(void)mpool_put(t->bt_mp, h, 0);
@@ -301,7 +303,7 @@ __bt_stat(dbp)
(void)fprintf(stderr, "%d level%s with %ld keys",
levels, levels == 1 ? "" : "s", nkeys);
- if (F_ISSET(t, R_RECNO))
+ if (ISSET(t, R_RECNO))
(void)fprintf(stderr, " (%ld header count)", t->bt_nrecs);
(void)fprintf(stderr,
"\n%lu pages (leaf %ld, internal %ld, overflow %ld)\n",
diff --git a/lib/libc/db/btree/bt_delete.c b/lib/libc/db/btree/bt_delete.c
index ece1ab656e62..5dba534850c9 100644
--- a/lib/libc/db/btree/bt_delete.c
+++ b/lib/libc/db/btree/bt_delete.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_delete.c 8.13 (Berkeley) 7/28/94";
+static char sccsid[] = "@(#)bt_delete.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -47,17 +47,18 @@ static char sccsid[] = "@(#)bt_delete.c 8.13 (Berkeley) 7/28/94";
#include <db.h>
#include "btree.h"
-static int __bt_bdelete __P((BTREE *, const DBT *));
-static int __bt_curdel __P((BTREE *, const DBT *, PAGE *, u_int));
-static int __bt_pdelete __P((BTREE *, PAGE *));
-static int __bt_relink __P((BTREE *, PAGE *));
-static int __bt_stkacq __P((BTREE *, PAGE **, CURSOR *));
+static int bt_bdelete __P((BTREE *, const DBT *));
/*
- * __bt_delete
- * Delete the item(s) referenced by a key.
+ * __BT_DELETE -- Delete the item(s) referenced by a key.
*
- * Return RET_SPECIAL if the key is not found.
+ * Parameters:
+ * dbp: pointer to access method
+ * key: key to delete
+ * flags: R_CURSOR if deleting what the cursor references
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found.
*/
int
__bt_delete(dbp, key, flags)
@@ -66,8 +67,6 @@ __bt_delete(dbp, key, flags)
u_int flags;
{
BTREE *t;
- CURSOR *c;
- PAGE *h;
int status;
t = dbp->internal;
@@ -78,433 +77,242 @@ __bt_delete(dbp, key, flags)
t->bt_pinned = NULL;
}
- /* Check for change to a read-only tree. */
- if (F_ISSET(t, B_RDONLY)) {
+ if (ISSET(t, B_RDONLY)) {
errno = EPERM;
return (RET_ERROR);
}
- switch (flags) {
+ switch(flags) {
case 0:
- status = __bt_bdelete(t, key);
+ status = bt_bdelete(t, key);
break;
case R_CURSOR:
/*
- * If flags is R_CURSOR, delete the cursor. Must already
- * have started a scan and not have already deleted it.
+ * If flags is R_CURSOR, delete the cursor; must already have
+ * started a scan and not have already deleted the record. For
+ * the delete cursor bit to have been set requires that the
+ * scan be initialized, so no reason to check.
*/
- c = &t->bt_cursor;
- if (F_ISSET(c, CURS_INIT)) {
- if (F_ISSET(c, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE))
- return (RET_SPECIAL);
- if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL)
- return (RET_ERROR);
-
- /*
- * If the page is about to be emptied, we'll need to
- * delete it, which means we have to acquire a stack.
- */
- if (NEXTINDEX(h) == 1)
- if (__bt_stkacq(t, &h, &t->bt_cursor))
- return (RET_ERROR);
-
- status = __bt_dleaf(t, NULL, h, c->pg.index);
-
- if (NEXTINDEX(h) == 0 && status == RET_SUCCESS) {
- if (__bt_pdelete(t, h))
- return (RET_ERROR);
- } else
- mpool_put(t->bt_mp,
- h, status == RET_SUCCESS ? MPOOL_DIRTY : 0);
- break;
- }
- /* FALLTHROUGH */
+ if (!ISSET(t, B_SEQINIT))
+ goto einval;
+ status = ISSET(t, B_DELCRSR) ?
+ RET_SPECIAL : __bt_crsrdel(t, &t->bt_bcursor);
+ break;
default:
- errno = EINVAL;
+einval: errno = EINVAL;
return (RET_ERROR);
}
if (status == RET_SUCCESS)
- F_SET(t, B_MODIFIED);
+ SET(t, B_MODIFIED);
return (status);
}
/*
- * __bt_stkacq --
- * Acquire a stack so we can delete a cursor entry.
+ * BT_BDELETE -- Delete all key/data pairs matching the specified key.
*
* Parameters:
- * t: tree
- * hp: pointer to current, pinned PAGE pointer
- * c: pointer to the cursor
- *
- * Returns:
- * 0 on success, 1 on failure
- */
-static int
-__bt_stkacq(t, hp, c)
- BTREE *t;
- PAGE **hp;
- CURSOR *c;
-{
- BINTERNAL *bi;
- EPG *e;
- EPGNO *parent;
- PAGE *h;
- indx_t index;
- pgno_t pgno;
- recno_t nextpg, prevpg;
- int exact, level;
-
- /*
- * Find the first occurrence of the key in the tree. Toss the
- * currently locked page so we don't hit an already-locked page.
- */
- h = *hp;
- mpool_put(t->bt_mp, h, 0);
- if ((e = __bt_search(t, &c->key, &exact)) == NULL)
- return (1);
- h = e->page;
-
- /* See if we got it in one shot. */
- if (h->pgno == c->pg.pgno)
- goto ret;
-
- /*
- * Move right, looking for the page. At each move we have to move
- * up the stack until we don't have to move to the next page. If
- * we have to change pages at an internal level, we have to fix the
- * stack back up.
- */
- while (h->pgno != c->pg.pgno) {
- if ((nextpg = h->nextpg) == P_INVALID)
- break;
- mpool_put(t->bt_mp, h, 0);
-
- /* Move up the stack. */
- for (level = 0; (parent = BT_POP(t)) != NULL; ++level) {
- /* Get the parent page. */
- if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
- return (1);
-
- /* Move to the next index. */
- if (parent->index != NEXTINDEX(h) - 1) {
- index = parent->index + 1;
- BT_PUSH(t, h->pgno, index);
- break;
- }
- mpool_put(t->bt_mp, h, 0);
- }
-
- /* Restore the stack. */
- while (level--) {
- /* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
- pgno = bi->pgno;
- BT_PUSH(t, pgno, 0);
-
- /* Lose the currently pinned page. */
- mpool_put(t->bt_mp, h, 0);
-
- /* Get the next level down. */
- if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
- return (1);
- index = 0;
- }
- mpool_put(t->bt_mp, h, 0);
- if ((h = mpool_get(t->bt_mp, nextpg, 0)) == NULL)
- return (1);
- }
-
- if (h->pgno == c->pg.pgno)
- goto ret;
-
- /* Reacquire the original stack. */
- mpool_put(t->bt_mp, h, 0);
- if ((e = __bt_search(t, &c->key, &exact)) == NULL)
- return (1);
- h = e->page;
-
- /*
- * Move left, looking for the page. At each move we have to move
- * up the stack until we don't have to change pages to move to the
- * next page. If we have to change pages at an internal level, we
- * have to fix the stack back up.
- */
- while (h->pgno != c->pg.pgno) {
- if ((prevpg = h->prevpg) == P_INVALID)
- break;
- mpool_put(t->bt_mp, h, 0);
-
- /* Move up the stack. */
- for (level = 0; (parent = BT_POP(t)) != NULL; ++level) {
- /* Get the parent page. */
- if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
- return (1);
-
- /* Move to the next index. */
- if (parent->index != 0) {
- index = parent->index - 1;
- BT_PUSH(t, h->pgno, index);
- break;
- }
- mpool_put(t->bt_mp, h, 0);
- }
-
- /* Restore the stack. */
- while (level--) {
- /* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
- pgno = bi->pgno;
-
- /* Lose the currently pinned page. */
- mpool_put(t->bt_mp, h, 0);
-
- /* Get the next level down. */
- if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
- return (1);
-
- index = NEXTINDEX(h) - 1;
- BT_PUSH(t, pgno, index);
- }
- mpool_put(t->bt_mp, h, 0);
- if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL)
- return (1);
- }
-
-
-ret: mpool_put(t->bt_mp, h, 0);
- return ((*hp = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL);
-}
-
-/*
- * __bt_bdelete --
- * Delete all key/data pairs matching the specified key.
- *
- * Parameters:
- * t: tree
+ * tree: tree
* key: key to delete
*
* Returns:
* RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found.
*/
static int
-__bt_bdelete(t, key)
+bt_bdelete(t, key)
BTREE *t;
const DBT *key;
{
- EPG *e;
+ EPG *e, save;
PAGE *h;
- int deleted, exact, redo;
-
- deleted = 0;
+ pgno_t cpgno, pg;
+ indx_t cindex;
+ int deleted, dirty1, dirty2, exact;
/* Find any matching record; __bt_search pins the page. */
-loop: if ((e = __bt_search(t, key, &exact)) == NULL)
- return (deleted ? RET_SUCCESS : RET_ERROR);
+ if ((e = __bt_search(t, key, &exact)) == NULL)
+ return (RET_ERROR);
if (!exact) {
mpool_put(t->bt_mp, e->page, 0);
- return (deleted ? RET_SUCCESS : RET_SPECIAL);
+ return (RET_SPECIAL);
}
/*
- * Delete forward, then delete backward, from the found key. If
- * there are duplicates and we reach either side of the page, do
- * the key search again, so that we get them all.
+ * Delete forward, then delete backward, from the found key. The
+ * ordering is so that the deletions don't mess up the page refs.
+ * The first loop deletes the key from the original page, the second
+ * unpins the original page. In the first loop, dirty1 is set if
+ * the original page is modified, and dirty2 is set if any subsequent
+ * pages are modified. In the second loop, dirty1 starts off set if
+ * the original page has been modified, and is set if any subsequent
+ * pages are modified.
+ *
+ * If find the key referenced by the cursor, don't delete it, just
+ * flag it for future deletion. The cursor page number is P_INVALID
+ * unless the sequential scan is initialized, so no reason to check.
+ * A special case is when the already deleted cursor record was the
+ * only record found. If so, then the delete opertion fails as no
+ * records were deleted.
+ *
+ * Cycle in place in the current page until the current record doesn't
+ * match the key or the page is empty. If the latter, walk forward,
+ * skipping empty pages and repeating until a record doesn't match
+ * the key or the end of the tree is reached.
*/
- redo = 0;
- h = e->page;
- do {
- if (__bt_dleaf(t, key, h, e->index)) {
- mpool_put(t->bt_mp, h, 0);
- return (RET_ERROR);
- }
- if (F_ISSET(t, B_NODUPS)) {
- if (NEXTINDEX(h) == 0) {
- if (__bt_pdelete(t, h))
+ cpgno = t->bt_bcursor.pgno;
+ cindex = t->bt_bcursor.index;
+ save = *e;
+ dirty1 = 0;
+ for (h = e->page, deleted = 0;;) {
+ dirty2 = 0;
+ do {
+ if (h->pgno == cpgno && e->index == cindex) {
+ if (!ISSET(t, B_DELCRSR)) {
+ SET(t, B_DELCRSR);
+ deleted = 1;
+ }
+ ++e->index;
+ } else {
+ if (__bt_dleaf(t, h, e->index)) {
+ if (h->pgno != save.page->pgno)
+ mpool_put(t->bt_mp, h, dirty2);
+ mpool_put(t->bt_mp, save.page, dirty1);
return (RET_ERROR);
- } else
- mpool_put(t->bt_mp, h, MPOOL_DIRTY);
- return (RET_SUCCESS);
- }
- deleted = 1;
- } while (e->index < NEXTINDEX(h) && __bt_cmp(t, key, e) == 0);
-
- /* Check for right-hand edge of the page. */
- if (e->index == NEXTINDEX(h))
- redo = 1;
+ }
+ if (h->pgno == save.page->pgno)
+ dirty1 = MPOOL_DIRTY;
+ else
+ dirty2 = MPOOL_DIRTY;
+ deleted = 1;
+ }
+ } while (e->index < NEXTINDEX(h) && __bt_cmp(t, key, e) == 0);
- /* Delete from the key to the beginning of the page. */
- while (e->index-- > 0) {
- if (__bt_cmp(t, key, e) != 0)
+ /*
+ * Quit if didn't find a match, no next page, or first key on
+ * the next page doesn't match. Don't unpin the original page
+ * unless an error occurs.
+ */
+ if (e->index < NEXTINDEX(h))
break;
- if (__bt_dleaf(t, key, h, e->index) == RET_ERROR) {
- mpool_put(t->bt_mp, h, 0);
- return (RET_ERROR);
+ for (;;) {
+ if ((pg = h->nextpg) == P_INVALID)
+ goto done1;
+ if (h->pgno != save.page->pgno)
+ mpool_put(t->bt_mp, h, dirty2);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) {
+ mpool_put(t->bt_mp, save.page, dirty1);
+ return (RET_ERROR);
+ }
+ if (NEXTINDEX(h) != 0) {
+ e->page = h;
+ e->index = 0;
+ break;
+ }
}
- if (e->index == 0)
- redo = 1;
- }
- /* Check for an empty page. */
- if (NEXTINDEX(h) == 0) {
- if (__bt_pdelete(t, h))
- return (RET_ERROR);
- goto loop;
+ if (__bt_cmp(t, key, e) != 0)
+ break;
}
- /* Put the page. */
- mpool_put(t->bt_mp, h, MPOOL_DIRTY);
-
- if (redo)
- goto loop;
- return (RET_SUCCESS);
-}
-
-/*
- * __bt_pdelete --
- * Delete a single page from the tree.
- *
- * Parameters:
- * t: tree
- * h: leaf page
- *
- * Returns:
- * RET_SUCCESS, RET_ERROR.
- *
- * Side-effects:
- * mpool_put's the page
- */
-static int
-__bt_pdelete(t, h)
- BTREE *t;
- PAGE *h;
-{
- BINTERNAL *bi;
- PAGE *pg;
- EPGNO *parent;
- indx_t cnt, index, *ip, offset;
- u_int32_t nksize;
- char *from;
-
/*
- * Walk the parent page stack -- a LIFO stack of the pages that were
- * traversed when we searched for the page where the delete occurred.
- * Each stack entry is a page number and a page index offset. The
- * offset is for the page traversed on the search. We've just deleted
- * a page, so we have to delete the key from the parent page.
- *
- * If the delete from the parent page makes it empty, this process may
- * continue all the way up the tree. We stop if we reach the root page
- * (which is never deleted, it's just not worth the effort) or if the
- * delete does not empty the page.
+ * Reach here with the original page and the last page referenced
+ * pinned (they may be the same). Release it if not the original.
*/
- while ((parent = BT_POP(t)) != NULL) {
- /* Get the parent page. */
- if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
- return (RET_ERROR);
-
- index = parent->index;
- bi = GETBINTERNAL(pg, index);
-
- /* Free any overflow pages. */
- if (bi->flags & P_BIGKEY &&
- __ovfl_delete(t, bi->bytes) == RET_ERROR) {
- mpool_put(t->bt_mp, pg, 0);
- return (RET_ERROR);
- }
+done1: if (h->pgno != save.page->pgno)
+ mpool_put(t->bt_mp, h, dirty2);
- /*
- * Free the parent if it has only the one key and it's not the
- * root page. If it's the rootpage, turn it back into an empty
- * leaf page.
- */
- if (NEXTINDEX(pg) == 1)
- if (pg->pgno == P_ROOT) {
- pg->lower = BTDATAOFF;
- pg->upper = t->bt_psize;
- pg->flags = P_BLEAF;
+ /*
+ * Walk backwards from the record previous to the record returned by
+ * __bt_search, skipping empty pages, until a record doesn't match
+ * the key or reach the beginning of the tree.
+ */
+ *e = save;
+ for (;;) {
+ if (e->index)
+ --e->index;
+ for (h = e->page; e->index; --e->index) {
+ if (__bt_cmp(t, key, e) != 0)
+ goto done2;
+ if (h->pgno == cpgno && e->index == cindex) {
+ if (!ISSET(t, B_DELCRSR)) {
+ SET(t, B_DELCRSR);
+ deleted = 1;
+ }
} else {
- if (__bt_relink(t, pg) || __bt_free(t, pg))
+ if (__bt_dleaf(t, h, e->index) == RET_ERROR) {
+ mpool_put(t->bt_mp, h, dirty1);
return (RET_ERROR);
- continue;
+ }
+ if (h->pgno == save.page->pgno)
+ dirty1 = MPOOL_DIRTY;
+ deleted = 1;
}
- else {
- /* Pack remaining key items at the end of the page. */
- nksize = NBINTERNAL(bi->ksize);
- from = (char *)pg + pg->upper;
- memmove(from + nksize, from, (char *)bi - from);
- pg->upper += nksize;
-
- /* Adjust indices' offsets, shift the indices down. */
- offset = pg->linp[index];
- for (cnt = index, ip = &pg->linp[0]; cnt--; ++ip)
- if (ip[0] < offset)
- ip[0] += nksize;
- for (cnt = NEXTINDEX(pg) - index; --cnt; ++ip)
- ip[0] = ip[1] < offset ? ip[1] + nksize : ip[1];
- pg->lower -= sizeof(indx_t);
}
- mpool_put(t->bt_mp, pg, MPOOL_DIRTY);
- break;
+ if ((pg = h->prevpg) == P_INVALID)
+ goto done2;
+ mpool_put(t->bt_mp, h, dirty1);
+ dirty1 = 0;
+ if ((e->page = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ e->index = NEXTINDEX(e->page);
}
- /* Free the leaf page, as long as it wasn't the root. */
- if (h->pgno == P_ROOT) {
- mpool_put(t->bt_mp, h, MPOOL_DIRTY);
- return (RET_SUCCESS);
- }
- return (__bt_relink(t, h) || __bt_free(t, h));
+ /*
+ * Reach here with the last page that was looked at pinned. Release
+ * it.
+ */
+done2: mpool_put(t->bt_mp, h, dirty1);
+ return (deleted ? RET_SUCCESS : RET_SPECIAL);
}
/*
- * __bt_dleaf --
- * Delete a single record from a leaf page.
+ * __BT_DLEAF -- Delete a single record from a leaf page.
*
* Parameters:
* t: tree
- * key: referenced key
- * h: page
- * index: index on page to delete
+ * index: index on current page to delete
*
* Returns:
* RET_SUCCESS, RET_ERROR.
*/
int
-__bt_dleaf(t, key, h, index)
+__bt_dleaf(t, h, index)
BTREE *t;
- const DBT *key;
PAGE *h;
- u_int index;
+ indx_t index;
{
- BLEAF *bl;
- indx_t cnt, *ip, offset;
- u_int32_t nbytes;
- void *to;
+ register BLEAF *bl;
+ register indx_t cnt, *ip, offset;
+ register size_t nbytes;
char *from;
+ void *to;
- /* If this record is referenced by the cursor, delete the cursor. */
- if (F_ISSET(&t->bt_cursor, CURS_INIT) &&
- !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) &&
- t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index == index &&
- __bt_curdel(t, key, h, index))
- return (RET_ERROR);
-
- /* If the entry uses overflow pages, make them available for reuse. */
+ /*
+ * Delete a record from a btree leaf page. Internal records are never
+ * deleted from internal pages, regardless of the records that caused
+ * them to be added being deleted. Pages made empty by deletion are
+ * not reclaimed. They are, however, made available for reuse.
+ *
+ * Pack the remaining entries at the end of the page, shift the indices
+ * down, overwriting the deleted record and its index. If the record
+ * uses overflow pages, make them available for reuse.
+ */
to = bl = GETBLEAF(h, index);
if (bl->flags & P_BIGKEY && __ovfl_delete(t, bl->bytes) == RET_ERROR)
return (RET_ERROR);
if (bl->flags & P_BIGDATA &&
__ovfl_delete(t, bl->bytes + bl->ksize) == RET_ERROR)
return (RET_ERROR);
-
- /* Pack the remaining key/data items at the end of the page. */
nbytes = NBLEAF(bl);
+
+ /*
+ * Compress the key/data pairs. Compress and adjust the [BR]LEAF
+ * offsets. Reset the headers.
+ */
from = (char *)h + h->upper;
memmove(from + nbytes, from, (char *)to - from);
h->upper += nbytes;
- /* Adjust the indices' offsets, shift the indices down. */
offset = h->linp[index];
for (cnt = index, ip = &h->linp[0]; cnt--; ++ip)
if (ip[0] < offset)
@@ -512,146 +320,5 @@ __bt_dleaf(t, key, h, index)
for (cnt = NEXTINDEX(h) - index; --cnt; ++ip)
ip[0] = ip[1] < offset ? ip[1] + nbytes : ip[1];
h->lower -= sizeof(indx_t);
-
- /* If the cursor is on this page, adjust it as necessary. */
- if (F_ISSET(&t->bt_cursor, CURS_INIT) &&
- !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) &&
- t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index > index)
- --t->bt_cursor.pg.index;
-
return (RET_SUCCESS);
}
-
-/*
- * __bt_curdel --
- * Delete the cursor.
- *
- * Parameters:
- * t: tree
- * key: referenced key (or NULL)
- * h: page
- * index: index on page to delete
- *
- * Returns:
- * RET_SUCCESS, RET_ERROR.
- */
-static int
-__bt_curdel(t, key, h, index)
- BTREE *t;
- const DBT *key;
- PAGE *h;
- u_int index;
-{
- CURSOR *c;
- EPG e;
- PAGE *pg;
- int curcopy, status;
-
- /*
- * If there are duplicates, move forward or backward to one.
- * Otherwise, copy the key into the cursor area.
- */
- c = &t->bt_cursor;
- F_CLR(c, CURS_AFTER | CURS_BEFORE | CURS_ACQUIRE);
-
- curcopy = 0;
- if (!F_ISSET(t, B_NODUPS)) {
- /*
- * We're going to have to do comparisons. If we weren't
- * provided a copy of the key, i.e. the user is deleting
- * the current cursor position, get one.
- */
- if (key == NULL) {
- e.page = h;
- e.index = index;
- if ((status = __bt_ret(t, &e,
- &c->key, &c->key, NULL, NULL, 1)) != RET_SUCCESS)
- return (status);
- curcopy = 1;
- key = &c->key;
- }
- /* Check previous key, if not at the beginning of the page. */
- if (index > 0) {
- e.page = h;
- e.index = index - 1;
- if (__bt_cmp(t, key, &e) == 0) {
- F_SET(c, CURS_BEFORE);
- goto dup2;
- }
- }
- /* Check next key, if not at the end of the page. */
- if (index < NEXTINDEX(h) - 1) {
- e.page = h;
- e.index = index + 1;
- if (__bt_cmp(t, key, &e) == 0) {
- F_SET(c, CURS_AFTER);
- goto dup2;
- }
- }
- /* Check previous key if at the beginning of the page. */
- if (index == 0 && h->prevpg != P_INVALID) {
- if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL)
- return (RET_ERROR);
- e.page = pg;
- e.index = NEXTINDEX(pg) - 1;
- if (__bt_cmp(t, key, &e) == 0) {
- F_SET(c, CURS_BEFORE);
- goto dup1;
- }
- mpool_put(t->bt_mp, pg, 0);
- }
- /* Check next key if at the end of the page. */
- if (index == NEXTINDEX(h) - 1 && h->nextpg != P_INVALID) {
- if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL)
- return (RET_ERROR);
- e.page = pg;
- e.index = 0;
- if (__bt_cmp(t, key, &e) == 0) {
- F_SET(c, CURS_AFTER);
-dup1: mpool_put(t->bt_mp, pg, 0);
-dup2: c->pg.pgno = e.page->pgno;
- c->pg.index = e.index;
- return (RET_SUCCESS);
- }
- mpool_put(t->bt_mp, pg, 0);
- }
- }
- e.page = h;
- e.index = index;
- if (curcopy || (status =
- __bt_ret(t, &e, &c->key, &c->key, NULL, NULL, 1)) == RET_SUCCESS) {
- F_SET(c, CURS_ACQUIRE);
- return (RET_SUCCESS);
- }
- return (status);
-}
-
-/*
- * __bt_relink --
- * Link around a deleted page.
- *
- * Parameters:
- * t: tree
- * h: page to be deleted
- */
-static int
-__bt_relink(t, h)
- BTREE *t;
- PAGE *h;
-{
- PAGE *pg;
-
- if (h->nextpg != P_INVALID) {
- if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL)
- return (RET_ERROR);
- pg->prevpg = h->prevpg;
- mpool_put(t->bt_mp, pg, MPOOL_DIRTY);
- }
- if (h->prevpg != P_INVALID) {
- if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL)
- return (RET_ERROR);
- pg->nextpg = h->nextpg;
- mpool_put(t->bt_mp, pg, MPOOL_DIRTY);
- }
- return (0);
-}
diff --git a/lib/libc/db/btree/bt_get.c b/lib/libc/db/btree/bt_get.c
index 74824c73f4b2..28b2d603dfe5 100644
--- a/lib/libc/db/btree/bt_get.c
+++ b/lib/libc/db/btree/bt_get.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_get.c 8.6 (Berkeley) 7/20/94";
+static char sccsid[] = "@(#)bt_get.c 8.2 (Berkeley) 9/7/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -91,15 +91,148 @@ __bt_get(dbp, key, data, flags)
return (RET_SPECIAL);
}
- status = __bt_ret(t, e, NULL, NULL, data, &t->bt_rdata, 0);
+ /*
+ * A special case is if we found the record but it's flagged for
+ * deletion. In this case, we want to find another record with the
+ * same key, if it exists. Rather than look around the tree we call
+ * __bt_first and have it redo the search, as __bt_first will not
+ * return keys marked for deletion. Slow, but should never happen.
+ */
+ if (ISSET(t, B_DELCRSR) && e->page->pgno == t->bt_bcursor.pgno &&
+ e->index == t->bt_bcursor.index) {
+ mpool_put(t->bt_mp, e->page, 0);
+ if ((e = __bt_first(t, key, &exact)) == NULL)
+ return (RET_ERROR);
+ if (!exact)
+ return (RET_SPECIAL);
+ }
+ status = __bt_ret(t, e, NULL, data);
/*
* If the user is doing concurrent access, we copied the
* key/data, toss the page.
*/
- if (F_ISSET(t, B_DB_LOCK))
+ if (ISSET(t, B_DB_LOCK))
mpool_put(t->bt_mp, e->page, 0);
else
t->bt_pinned = e->page;
return (status);
}
+
+/*
+ * __BT_FIRST -- Find the first entry.
+ *
+ * Parameters:
+ * t: the tree
+ * key: the key
+ *
+ * Returns:
+ * The first entry in the tree greater than or equal to key.
+ */
+EPG *
+__bt_first(t, key, exactp)
+ BTREE *t;
+ const DBT *key;
+ int *exactp;
+{
+ register PAGE *h;
+ register EPG *e;
+ EPG save;
+ pgno_t cpgno, pg;
+ indx_t cindex;
+ int found;
+
+ /*
+ * Find any matching record; __bt_search pins the page. Only exact
+ * matches are tricky, otherwise just return the location of the key
+ * if it were to be inserted into the tree.
+ */
+ if ((e = __bt_search(t, key, exactp)) == NULL)
+ return (NULL);
+ if (!*exactp)
+ return (e);
+
+ if (ISSET(t, B_DELCRSR)) {
+ cpgno = t->bt_bcursor.pgno;
+ cindex = t->bt_bcursor.index;
+ } else {
+ cpgno = P_INVALID;
+ cindex = 0; /* GCC thinks it's uninitialized. */
+ }
+
+ /*
+ * Walk backwards, skipping empty pages, as long as the entry matches
+ * and there are keys left in the tree. Save a copy of each match in
+ * case we go too far. A special case is that we don't return a match
+ * on records that the cursor references that have already been flagged
+ * for deletion.
+ */
+ save = *e;
+ h = e->page;
+ found = 0;
+ do {
+ if (cpgno != h->pgno || cindex != e->index) {
+ if (save.page->pgno != e->page->pgno) {
+ mpool_put(t->bt_mp, save.page, 0);
+ save = *e;
+ } else
+ save.index = e->index;
+ found = 1;
+ }
+ /*
+ * Make a special effort not to unpin the page the last (or
+ * original) match was on, but also make sure it's unpinned
+ * if an error occurs.
+ */
+ while (e->index == 0) {
+ if (h->prevpg == P_INVALID)
+ goto done1;
+ if (h->pgno != save.page->pgno)
+ mpool_put(t->bt_mp, h, 0);
+ if ((h = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL) {
+ if (h->pgno == save.page->pgno)
+ mpool_put(t->bt_mp, save.page, 0);
+ return (NULL);
+ }
+ e->page = h;
+ e->index = NEXTINDEX(h);
+ }
+ --e->index;
+ } while (__bt_cmp(t, key, e) == 0);
+
+ /*
+ * Reach here with the last page that was looked at pinned, which may
+ * or may not be the same as the last (or original) match page. If
+ * it's not useful, release it.
+ */
+done1: if (h->pgno != save.page->pgno)
+ mpool_put(t->bt_mp, h, 0);
+
+ /*
+ * If still haven't found a record, the only possibility left is the
+ * next one. Move forward one slot, skipping empty pages and check.
+ */
+ if (!found) {
+ h = save.page;
+ if (++save.index == NEXTINDEX(h)) {
+ do {
+ pg = h->nextpg;
+ mpool_put(t->bt_mp, h, 0);
+ if (pg == P_INVALID) {
+ *exactp = 0;
+ return (e);
+ }
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (NULL);
+ } while ((save.index = NEXTINDEX(h)) == 0);
+ save.page = h;
+ }
+ if (__bt_cmp(t, key, &save) != 0) {
+ *exactp = 0;
+ return (e);
+ }
+ }
+ *e = save;
+ *exactp = 1;
+ return (e);
+}
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c
index f052249777d6..f156745f9700 100644
--- a/lib/libc/db/btree/bt_open.c
+++ b/lib/libc/db/btree/bt_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94";
+static char sccsid[] = "@(#)bt_open.c 8.5 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
/*
@@ -61,11 +61,6 @@ static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94";
#include <db.h>
#include "btree.h"
-#ifdef DEBUG
-#undef MINPSIZE
-#define MINPSIZE 128
-#endif
-
static int byteorder __P((void));
static int nroot __P((BTREE *));
static int tmp __P((void));
@@ -162,6 +157,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if ((t = (BTREE *)malloc(sizeof(BTREE))) == NULL)
goto err;
memset(t, 0, sizeof(BTREE));
+ t->bt_bcursor.pgno = P_INVALID;
t->bt_fd = -1; /* Don't close unopened fd on error. */
t->bt_lorder = b.lorder;
t->bt_order = NOT;
@@ -171,9 +167,9 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if ((t->bt_dbp = dbp = (DB *)malloc(sizeof(DB))) == NULL)
goto err;
- memset(t->bt_dbp, 0, sizeof(DB));
+ t->bt_flags = 0;
if (t->bt_lorder != machine_lorder)
- F_SET(t, B_NEEDSWAP);
+ SET(t, B_NEEDSWAP);
dbp->type = DB_BTREE;
dbp->internal = t;
@@ -190,9 +186,9 @@ __bt_open(fname, flags, mode, openinfo, dflags)
* open a backing temporary file. Otherwise, it's a disk-based tree.
*/
if (fname) {
- switch (flags & O_ACCMODE) {
+ switch(flags & O_ACCMODE) {
case O_RDONLY:
- F_SET(t, B_RDONLY);
+ SET(t, B_RDONLY);
break;
case O_RDWR:
break;
@@ -200,7 +196,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
default:
goto einval;
}
-
+
if ((t->bt_fd = open(fname, flags, mode)) < 0)
goto err;
@@ -209,7 +205,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
goto einval;
if ((t->bt_fd = tmp()) == -1)
goto err;
- F_SET(t, B_INMEM);
+ SET(t, B_INMEM);
}
if (fcntl(t->bt_fd, F_SETFD, 1) == -1)
@@ -218,7 +214,8 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if (fstat(t->bt_fd, &sb))
goto err;
if (sb.st_size) {
- if ((nr = read(t->bt_fd, &m, sizeof(BTMETA))) < 0)
+ nr = read(t->bt_fd, &m, sizeof(BTMETA));
+ if (nr < 0)
goto err;
if (nr != sizeof(BTMETA))
goto eftype;
@@ -231,28 +228,28 @@ __bt_open(fname, flags, mode, openinfo, dflags)
* don't bother to return an error, we just clear the NEEDSWAP
* bit.
*/
- if (m.magic == BTREEMAGIC)
- F_CLR(t, B_NEEDSWAP);
+ if (m.m_magic == BTREEMAGIC)
+ CLR(t, B_NEEDSWAP);
else {
- F_SET(t, B_NEEDSWAP);
- M_32_SWAP(m.magic);
- M_32_SWAP(m.version);
- M_32_SWAP(m.psize);
- M_32_SWAP(m.free);
- M_32_SWAP(m.nrecs);
- M_32_SWAP(m.flags);
+ SET(t, B_NEEDSWAP);
+ M_32_SWAP(m.m_magic);
+ M_32_SWAP(m.m_version);
+ M_32_SWAP(m.m_psize);
+ M_32_SWAP(m.m_free);
+ M_32_SWAP(m.m_nrecs);
+ M_32_SWAP(m.m_flags);
}
- if (m.magic != BTREEMAGIC || m.version != BTREEVERSION)
+ if (m.m_magic != BTREEMAGIC || m.m_version != BTREEVERSION)
goto eftype;
- if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
- m.psize & sizeof(indx_t) - 1)
+ if (m.m_psize < MINPSIZE || m.m_psize > MAX_PAGE_OFFSET + 1 ||
+ m.m_psize & sizeof(indx_t) - 1)
goto eftype;
- if (m.flags & ~SAVEMETA)
+ if (m.m_flags & ~SAVEMETA)
goto eftype;
- b.psize = m.psize;
- F_SET(t, m.flags);
- t->bt_free = m.free;
- t->bt_nrecs = m.nrecs;
+ b.psize = m.m_psize;
+ t->bt_flags |= m.m_flags;
+ t->bt_free = m.m_free;
+ t->bt_nrecs = m.m_nrecs;
} else {
/*
* Set the page size to the best value for I/O to this file.
@@ -268,11 +265,11 @@ __bt_open(fname, flags, mode, openinfo, dflags)
/* Set flag if duplicates permitted. */
if (!(b.flags & R_DUP))
- F_SET(t, B_NODUPS);
+ SET(t, B_NODUPS);
t->bt_free = P_INVALID;
t->bt_nrecs = 0;
- F_SET(t, B_METADIRTY);
+ SET(t, B_METADIRTY);
}
t->bt_psize = b.psize;
@@ -307,7 +304,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if ((t->bt_mp =
mpool_open(NULL, t->bt_fd, t->bt_psize, ncache)) == NULL)
goto err;
- if (!F_ISSET(t, B_INMEM))
+ if (!ISSET(t, B_INMEM))
mpool_filter(t->bt_mp, __bt_pgin, __bt_pgout, t);
/* Create a root page if new tree. */
@@ -316,11 +313,11 @@ __bt_open(fname, flags, mode, openinfo, dflags)
/* Global flags. */
if (dflags & DB_LOCK)
- F_SET(t, B_DB_LOCK);
+ SET(t, B_DB_LOCK);
if (dflags & DB_SHMEM)
- F_SET(t, B_DB_SHMEM);
+ SET(t, B_DB_SHMEM);
if (dflags & DB_TXN)
- F_SET(t, B_DB_TXN);
+ SET(t, B_DB_TXN);
return (dbp);
@@ -360,9 +357,8 @@ nroot(t)
mpool_put(t->bt_mp, meta, 0);
return (RET_SUCCESS);
}
- if (errno != EINVAL) /* It's OK to not exist. */
+ if (errno != EINVAL)
return (RET_ERROR);
- errno = 0;
if ((meta = mpool_new(t->bt_mp, &npg)) == NULL)
return (RET_ERROR);
@@ -436,7 +432,7 @@ __bt_fd(dbp)
}
/* In-memory database can't have a file descriptor. */
- if (F_ISSET(t, B_INMEM)) {
+ if (ISSET(t, B_INMEM)) {
errno = ENOENT;
return (-1);
}
diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c
index b28b8e04711a..0057a03cd73e 100644
--- a/lib/libc/db/btree/bt_overflow.c
+++ b/lib/libc/db/btree/bt_overflow.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94";
+static char sccsid[] = "@(#)bt_overflow.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -69,7 +69,7 @@ static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94";
*
* Parameters:
* t: tree
- * p: pointer to { pgno_t, u_int32_t }
+ * p: pointer to { pgno_t, size_t }
* buf: storage address
* bufsz: storage size
*
@@ -81,16 +81,15 @@ __ovfl_get(t, p, ssz, buf, bufsz)
BTREE *t;
void *p;
size_t *ssz;
- void **buf;
+ char **buf;
size_t *bufsz;
{
PAGE *h;
pgno_t pg;
- size_t nb, plen;
- u_int32_t sz;
+ size_t nb, plen, sz;
memmove(&pg, p, sizeof(pgno_t));
- memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(u_int32_t));
+ memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(size_t));
*ssz = sz;
#ifdef DEBUG
@@ -99,8 +98,7 @@ __ovfl_get(t, p, ssz, buf, bufsz)
#endif
/* Make the buffer bigger as necessary. */
if (*bufsz < sz) {
- *buf = (char *)(*buf == NULL ? malloc(sz) : realloc(*buf, sz));
- if (*buf == NULL)
+ if ((*buf = (char *)realloc(*buf, sz)) == NULL)
return (RET_ERROR);
*bufsz = sz;
}
@@ -144,8 +142,7 @@ __ovfl_put(t, dbt, pg)
PAGE *h, *last;
void *p;
pgno_t npg;
- size_t nb, plen;
- u_int32_t sz;
+ size_t nb, plen, sz;
/*
* Allocate pages and copy the key/data record into them. Store the
@@ -184,7 +181,7 @@ __ovfl_put(t, dbt, pg)
*
* Parameters:
* t: tree
- * p: pointer to { pgno_t, u_int32_t }
+ * p: pointer to { pgno_t, size_t }
*
* Returns:
* RET_ERROR, RET_SUCCESS
@@ -196,11 +193,10 @@ __ovfl_delete(t, p)
{
PAGE *h;
pgno_t pg;
- size_t plen;
- u_int32_t sz;
+ size_t plen, sz;
memmove(&pg, p, sizeof(pgno_t));
- memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(u_int32_t));
+ memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(size_t));
#ifdef DEBUG
if (pg == P_INVALID || sz == 0)
diff --git a/lib/libc/db/btree/bt_page.c b/lib/libc/db/btree/bt_page.c
index 0d9d138d5cee..f71a40d84716 100644
--- a/lib/libc/db/btree/bt_page.c
+++ b/lib/libc/db/btree/bt_page.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
+static char sccsid[] = "@(#)bt_page.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -43,8 +43,7 @@ static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
#include "btree.h"
/*
- * __bt_free --
- * Put a page on the freelist.
+ * __BT_FREE -- Put a page on the freelist.
*
* Parameters:
* t: tree
@@ -52,16 +51,13 @@ static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
*
* Returns:
* RET_ERROR, RET_SUCCESS
- *
- * Side-effect:
- * mpool_put's the page.
*/
int
__bt_free(t, h)
BTREE *t;
PAGE *h;
{
- /* Insert the page at the head of the free list. */
+ /* Insert the page at the start of the free list. */
h->prevpg = P_INVALID;
h->nextpg = t->bt_free;
t->bt_free = h->pgno;
@@ -71,8 +67,7 @@ __bt_free(t, h)
}
/*
- * __bt_new --
- * Get a new page, preferably from the freelist.
+ * __BT_NEW -- Get a new page, preferably from the freelist.
*
* Parameters:
* t: tree
@@ -90,9 +85,9 @@ __bt_new(t, npg)
if (t->bt_free != P_INVALID &&
(h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
- *npg = t->bt_free;
- t->bt_free = h->nextpg;
- return (h);
+ *npg = t->bt_free;
+ t->bt_free = h->nextpg;
+ return (h);
}
return (mpool_new(t->bt_mp, npg));
}
diff --git a/lib/libc/db/btree/bt_put.c b/lib/libc/db/btree/bt_put.c
index 952be09e551f..11a211b15a63 100644
--- a/lib/libc/db/btree/bt_put.c
+++ b/lib/libc/db/btree/bt_put.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_put.c 8.8 (Berkeley) 7/26/94";
+static char sccsid[] = "@(#)bt_put.c 8.3 (Berkeley) 9/16/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -76,7 +76,7 @@ __bt_put(dbp, key, data, flags)
PAGE *h;
indx_t index, nxtindex;
pgno_t pg;
- u_int32_t nbytes;
+ size_t nbytes;
int dflags, exact, status;
char *dest, db[NOVFLSIZE], kb[NOVFLSIZE];
@@ -88,38 +88,33 @@ __bt_put(dbp, key, data, flags)
t->bt_pinned = NULL;
}
- /* Check for change to a read-only tree. */
- if (F_ISSET(t, B_RDONLY)) {
- errno = EPERM;
- return (RET_ERROR);
- }
-
switch (flags) {
+ case R_CURSOR:
+ if (!ISSET(t, B_SEQINIT))
+ goto einval;
+ if (ISSET(t, B_DELCRSR))
+ goto einval;
+ break;
case 0:
case R_NOOVERWRITE:
break;
- case R_CURSOR:
- /*
- * If flags is R_CURSOR, put the cursor. Must already
- * have started a scan and not have already deleted it.
- */
- if (F_ISSET(&t->bt_cursor, CURS_INIT) &&
- !F_ISSET(&t->bt_cursor,
- CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE))
- break;
- /* FALLTHROUGH */
default:
- errno = EINVAL;
+einval: errno = EINVAL;
+ return (RET_ERROR);
+ }
+
+ if (ISSET(t, B_RDONLY)) {
+ errno = EPERM;
return (RET_ERROR);
}
/*
- * If the key/data pair won't fit on a page, store it on overflow
- * pages. Only put the key on the overflow page if the pair are
- * still too big after moving the data to an overflow page.
+ * If the key/data won't fit on a page, store it on indirect pages.
+ * Only store the key on the overflow page if it's too big after the
+ * data is on an overflow page.
*
* XXX
- * If the insert fails later on, the overflow pages aren't recovered.
+ * If the insert fails later on, these pages aren't recovered.
*/
dflags = 0;
if (key->size + data->size > t->bt_ovflsize) {
@@ -130,7 +125,7 @@ storekey: if (__ovfl_put(t, key, &pg) == RET_ERROR)
tkey.size = NOVFLSIZE;
memmove(kb, &pg, sizeof(pgno_t));
memmove(kb + sizeof(pgno_t),
- &key->size, sizeof(u_int32_t));
+ &key->size, sizeof(size_t));
dflags |= P_BIGKEY;
key = &tkey;
}
@@ -141,7 +136,7 @@ storekey: if (__ovfl_put(t, key, &pg) == RET_ERROR)
tdata.size = NOVFLSIZE;
memmove(db, &pg, sizeof(pgno_t));
memmove(db + sizeof(pgno_t),
- &data->size, sizeof(u_int32_t));
+ &data->size, sizeof(size_t));
dflags |= P_BIGDATA;
data = &tdata;
}
@@ -151,15 +146,15 @@ storekey: if (__ovfl_put(t, key, &pg) == RET_ERROR)
/* Replace the cursor. */
if (flags == R_CURSOR) {
- if ((h = mpool_get(t->bt_mp, t->bt_cursor.pg.pgno, 0)) == NULL)
+ if ((h = mpool_get(t->bt_mp, t->bt_bcursor.pgno, 0)) == NULL)
return (RET_ERROR);
- index = t->bt_cursor.pg.index;
+ index = t->bt_bcursor.index;
goto delete;
}
/*
- * Find the key to delete, or, the location at which to insert.
- * Bt_fast and __bt_search both pin the returned page.
+ * Find the key to delete, or, the location at which to insert. Bt_fast
+ * and __bt_search pin the returned page.
*/
if (t->bt_order == NOT || (e = bt_fast(t, key, data, &exact)) == NULL)
if ((e = __bt_search(t, key, &exact)) == NULL)
@@ -168,26 +163,34 @@ storekey: if (__ovfl_put(t, key, &pg) == RET_ERROR)
index = e->index;
/*
- * Add the key/data pair to the tree. If an identical key is already
- * in the tree, and R_NOOVERWRITE is set, an error is returned. If
- * R_NOOVERWRITE is not set, the key is either added (if duplicates are
- * permitted) or an error is returned.
+ * Add the specified key/data pair to the tree. If an identical key
+ * is already in the tree, and R_NOOVERWRITE is set, an error is
+ * returned. If R_NOOVERWRITE is not set, the key is either added (if
+ * duplicates are permitted) or an error is returned.
+ *
+ * Pages are split as required.
*/
switch (flags) {
case R_NOOVERWRITE:
if (!exact)
break;
+ /*
+ * One special case is if the cursor references the record and
+ * it's been flagged for deletion. Then, we delete the record,
+ * leaving the cursor there -- this means that the inserted
+ * record will not be seen in a cursor scan.
+ */
+ if (ISSET(t, B_DELCRSR) && t->bt_bcursor.pgno == h->pgno &&
+ t->bt_bcursor.index == index) {
+ CLR(t, B_DELCRSR);
+ goto delete;
+ }
mpool_put(t->bt_mp, h, 0);
return (RET_SPECIAL);
default:
- if (!exact || !F_ISSET(t, B_NODUPS))
+ if (!exact || !ISSET(t, B_NODUPS))
break;
- /*
- * !!!
- * Note, the delete may empty the page, so we need to put a
- * new entry into the page immediately.
- */
-delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
+delete: if (__bt_dleaf(t, h, index) == RET_ERROR) {
mpool_put(t->bt_mp, h, 0);
return (RET_ERROR);
}
@@ -217,12 +220,6 @@ delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
dest = (char *)h + h->upper;
WR_BLEAF(dest, key, data, dflags);
- /* If the cursor is on this page, adjust it as necessary. */
- if (F_ISSET(&t->bt_cursor, CURS_INIT) &&
- !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) &&
- t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index >= index)
- ++t->bt_cursor.pg.index;
-
if (t->bt_order == NOT)
if (h->nextpg == P_INVALID) {
if (index == NEXTINDEX(h) - 1) {
@@ -241,10 +238,11 @@ delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
mpool_put(t->bt_mp, h, MPOOL_DIRTY);
success:
- if (flags == R_SETCURSOR)
- __bt_setcur(t, e->page->pgno, e->index);
-
- F_SET(t, B_MODIFIED);
+ if (flags == R_SETCURSOR) {
+ t->bt_bcursor.pgno = e->page->pgno;
+ t->bt_bcursor.index = e->index;
+ }
+ SET(t, B_MODIFIED);
return (RET_SUCCESS);
}
@@ -269,7 +267,7 @@ bt_fast(t, key, data, exactp)
int *exactp;
{
PAGE *h;
- u_int32_t nbytes;
+ size_t nbytes;
int cmp;
if ((h = mpool_get(t->bt_mp, t->bt_last.pgno, 0)) == NULL) {
@@ -280,8 +278,8 @@ bt_fast(t, key, data, exactp)
t->bt_cur.index = t->bt_last.index;
/*
- * If won't fit in this page or have too many keys in this page,
- * have to search to get split stack.
+ * If won't fit in this page or have too many keys in this page, have
+ * to search to get split stack.
*/
nbytes = NBLEAFDBT(key->size, data->size);
if (h->upper - h->lower < nbytes + sizeof(indx_t))
diff --git a/lib/libc/db/btree/bt_search.c b/lib/libc/db/btree/bt_search.c
index 485afcbbf025..ff334216d019 100644
--- a/lib/libc/db/btree/bt_search.c
+++ b/lib/libc/db/btree/bt_search.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_search.c 8.8 (Berkeley) 7/31/94";
+static char sccsid[] = "@(#)bt_search.c 8.6 (Berkeley) 3/15/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -45,12 +45,11 @@ static char sccsid[] = "@(#)bt_search.c 8.8 (Berkeley) 7/31/94";
#include <db.h>
#include "btree.h"
-static int __bt_snext __P((BTREE *, PAGE *, const DBT *, int *));
-static int __bt_sprev __P((BTREE *, PAGE *, const DBT *, int *));
+static int bt_snext __P((BTREE *, PAGE *, const DBT *, int *));
+static int bt_sprev __P((BTREE *, PAGE *, const DBT *, int *));
/*
- * __bt_search --
- * Search a btree for a key.
+ * __BT_SEARCH -- Search a btree for a key.
*
* Parameters:
* t: tree to search
@@ -96,26 +95,24 @@ __bt_search(t, key, exactp)
}
/*
- * If it's a leaf page, we're almost done. If no duplicates
- * are allowed, or we have an exact match, we're done. Else,
- * it's possible that there were matching keys on this page,
- * which later deleted, and we're on a page with no matches
- * while there are matches on other pages. If at the start or
- * end of a page, check the adjacent page.
+ * If it's a leaf page, and duplicates aren't allowed, we're
+ * done. If duplicates are allowed, it's possible that there
+ * were duplicate keys on duplicate pages, and they were later
+ * deleted, so we could be on a page with no matches while
+ * there are matches on other pages. If we're at the start or
+ * end of a page, check on both sides.
*/
if (h->flags & P_BLEAF) {
- if (!F_ISSET(t, B_NODUPS)) {
+ t->bt_cur.index = base;
+ *exactp = 0;
+ if (!ISSET(t, B_NODUPS)) {
if (base == 0 &&
- h->prevpg != P_INVALID &&
- __bt_sprev(t, h, key, exactp))
+ bt_sprev(t, h, key, exactp))
return (&t->bt_cur);
if (base == NEXTINDEX(h) &&
- h->nextpg != P_INVALID &&
- __bt_snext(t, h, key, exactp))
+ bt_snext(t, h, key, exactp))
return (&t->bt_cur);
}
- *exactp = 0;
- t->bt_cur.index = base;
return (&t->bt_cur);
}
@@ -128,86 +125,111 @@ __bt_search(t, key, exactp)
*/
index = base ? base - 1 : base;
-next: BT_PUSH(t, h->pgno, index);
+next: if (__bt_push(t, h->pgno, index) == RET_ERROR)
+ return (NULL);
pg = GETBINTERNAL(h, index)->pgno;
mpool_put(t->bt_mp, h, 0);
}
}
/*
- * __bt_snext --
- * Check for an exact match after the key.
+ * BT_SNEXT -- Check for an exact match after the key.
*
* Parameters:
- * t: tree
- * h: current page
- * key: key
+ * t: tree to search
+ * h: current page.
+ * key: key to find
* exactp: pointer to exact match flag
*
* Returns:
* If an exact match found.
*/
static int
-__bt_snext(t, h, key, exactp)
+bt_snext(t, h, key, exactp)
BTREE *t;
PAGE *h;
const DBT *key;
int *exactp;
{
EPG e;
+ PAGE *tp;
+ pgno_t pg;
+ /* Skip until reach the end of the tree or a key. */
+ for (pg = h->nextpg; pg != P_INVALID;) {
+ if ((tp = mpool_get(t->bt_mp, pg, 0)) == NULL) {
+ mpool_put(t->bt_mp, h, 0);
+ return (NULL);
+ }
+ if (NEXTINDEX(tp) != 0)
+ break;
+ pg = tp->prevpg;
+ mpool_put(t->bt_mp, tp, 0);
+ }
/*
- * Get the next page. The key is either an exact
- * match, or not as good as the one we already have.
+ * The key is either an exact match, or not as good as
+ * the one we already have.
*/
- if ((e.page = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL)
- return (0);
- e.index = 0;
- if (__bt_cmp(t, key, &e) == 0) {
- mpool_put(t->bt_mp, h, 0);
- t->bt_cur = e;
- *exactp = 1;
- return (1);
+ if (pg != P_INVALID) {
+ e.page = tp;
+ e.index = NEXTINDEX(tp) - 1;
+ if (__bt_cmp(t, key, &e) == 0) {
+ mpool_put(t->bt_mp, h, 0);
+ t->bt_cur = e;
+ *exactp = 1;
+ return (1);
+ }
}
- mpool_put(t->bt_mp, e.page, 0);
return (0);
}
/*
- * __bt_sprev --
- * Check for an exact match before the key.
+ * BT_SPREV -- Check for an exact match before the key.
*
* Parameters:
- * t: tree
- * h: current page
- * key: key
+ * t: tree to search
+ * h: current page.
+ * key: key to find
* exactp: pointer to exact match flag
*
* Returns:
* If an exact match found.
*/
static int
-__bt_sprev(t, h, key, exactp)
+bt_sprev(t, h, key, exactp)
BTREE *t;
PAGE *h;
const DBT *key;
int *exactp;
{
EPG e;
+ PAGE *tp;
+ pgno_t pg;
+ /* Skip until reach the beginning of the tree or a key. */
+ for (pg = h->prevpg; pg != P_INVALID;) {
+ if ((tp = mpool_get(t->bt_mp, pg, 0)) == NULL) {
+ mpool_put(t->bt_mp, h, 0);
+ return (NULL);
+ }
+ if (NEXTINDEX(tp) != 0)
+ break;
+ pg = tp->prevpg;
+ mpool_put(t->bt_mp, tp, 0);
+ }
/*
- * Get the previous page. The key is either an exact
- * match, or not as good as the one we already have.
+ * The key is either an exact match, or not as good as
+ * the one we already have.
*/
- if ((e.page = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL)
- return (0);
- e.index = NEXTINDEX(e.page) - 1;
- if (__bt_cmp(t, key, &e) == 0) {
- mpool_put(t->bt_mp, h, 0);
- t->bt_cur = e;
- *exactp = 1;
- return (1);
+ if (pg != P_INVALID) {
+ e.page = tp;
+ e.index = NEXTINDEX(tp) - 1;
+ if (__bt_cmp(t, key, &e) == 0) {
+ mpool_put(t->bt_mp, h, 0);
+ t->bt_cur = e;
+ *exactp = 1;
+ return (1);
+ }
}
- mpool_put(t->bt_mp, e.page, 0);
return (0);
}
diff --git a/lib/libc/db/btree/bt_seq.c b/lib/libc/db/btree/bt_seq.c
index 303b4819031f..182ef7080d5e 100644
--- a/lib/libc/db/btree/bt_seq.c
+++ b/lib/libc/db/btree/bt_seq.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_seq.c 8.7 (Berkeley) 7/20/94";
+static char sccsid[] = "@(#)bt_seq.c 8.2 (Berkeley) 9/7/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -48,21 +48,24 @@ static char sccsid[] = "@(#)bt_seq.c 8.7 (Berkeley) 7/20/94";
#include <db.h>
#include "btree.h"
-static int __bt_first __P((BTREE *, const DBT *, EPG *, int *));
-static int __bt_seqadv __P((BTREE *, EPG *, int));
-static int __bt_seqset __P((BTREE *, EPG *, DBT *, int));
+static int bt_seqadv __P((BTREE *, EPG *, int));
+static int bt_seqset __P((BTREE *, EPG *, DBT *, int));
/*
* Sequential scan support.
*
- * The tree can be scanned sequentially, starting from either end of the
- * tree or from any specific key. A scan request before any scanning is
- * done is initialized as starting from the least node.
+ * The tree can be scanned sequentially, starting from either end of the tree
+ * or from any specific key. A scan request before any scanning is done is
+ * initialized as starting from the least node.
+ *
+ * Each tree has an EPGNO which has the current position of the cursor. The
+ * cursor has to survive deletions/insertions in the tree without losing its
+ * position. This is done by noting deletions without doing them, and then
+ * doing them when the cursor moves (or the tree is closed).
*/
/*
- * __bt_seq --
- * Btree sequential scan interface.
+ * __BT_SEQ -- Btree sequential scan interface.
*
* Parameters:
* dbp: pointer to access method
@@ -93,21 +96,21 @@ __bt_seq(dbp, key, data, flags)
/*
* If scan unitialized as yet, or starting at a specific record, set
- * the scan to a specific key. Both __bt_seqset and __bt_seqadv pin
- * the page the cursor references if they're successful.
+ * the scan to a specific key. Both bt_seqset and bt_seqadv pin the
+ * page the cursor references if they're successful.
*/
- switch (flags) {
+ switch(flags) {
case R_NEXT:
case R_PREV:
- if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
- status = __bt_seqadv(t, &e, flags);
+ if (ISSET(t, B_SEQINIT)) {
+ status = bt_seqadv(t, &e, flags);
break;
}
/* FALLTHROUGH */
+ case R_CURSOR:
case R_FIRST:
case R_LAST:
- case R_CURSOR:
- status = __bt_seqset(t, &e, key, flags);
+ status = bt_seqset(t, &e, key, flags);
break;
default:
errno = EINVAL;
@@ -115,26 +118,27 @@ __bt_seq(dbp, key, data, flags)
}
if (status == RET_SUCCESS) {
- __bt_setcur(t, e.page->pgno, e.index);
+ status = __bt_ret(t, &e, key, data);
- status =
- __bt_ret(t, &e, key, &t->bt_rkey, data, &t->bt_rdata, 0);
+ /* Update the actual cursor. */
+ t->bt_bcursor.pgno = e.page->pgno;
+ t->bt_bcursor.index = e.index;
/*
* If the user is doing concurrent access, we copied the
* key/data, toss the page.
*/
- if (F_ISSET(t, B_DB_LOCK))
+ if (ISSET(t, B_DB_LOCK))
mpool_put(t->bt_mp, e.page, 0);
else
t->bt_pinned = e.page;
+ SET(t, B_SEQINIT);
}
return (status);
}
/*
- * __bt_seqset --
- * Set the sequential scan to a specific key.
+ * BT_SEQSET -- Set the sequential scan to a specific key.
*
* Parameters:
* t: tree
@@ -149,50 +153,87 @@ __bt_seq(dbp, key, data, flags)
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
*/
static int
-__bt_seqset(t, ep, key, flags)
+bt_seqset(t, ep, key, flags)
BTREE *t;
EPG *ep;
DBT *key;
int flags;
{
+ EPG *e;
PAGE *h;
pgno_t pg;
int exact;
/*
- * Find the first, last or specific key in the tree and point the
- * cursor at it. The cursor may not be moved until a new key has
- * been found.
+ * Delete any already deleted record that we've been saving because
+ * the cursor pointed to it. Since going to a specific key, should
+ * delete any logically deleted records so they aren't found.
+ */
+ if (ISSET(t, B_DELCRSR) && __bt_crsrdel(t, &t->bt_bcursor))
+ return (RET_ERROR);
+
+ /*
+ * Find the first, last or specific key in the tree and point the cursor
+ * at it. The cursor may not be moved until a new key has been found.
*/
- switch (flags) {
+ switch(flags) {
case R_CURSOR: /* Keyed scan. */
/*
- * Find the first instance of the key or the smallest key
- * which is greater than or equal to the specified key.
+ * Find the first instance of the key or the smallest key which
+ * is greater than or equal to the specified key. If run out
+ * of keys, return RET_SPECIAL.
*/
if (key->data == NULL || key->size == 0) {
errno = EINVAL;
return (RET_ERROR);
}
- return (__bt_first(t, key, ep, &exact));
+ e = __bt_first(t, key, &exact); /* Returns pinned page. */
+ if (e == NULL)
+ return (RET_ERROR);
+ /*
+ * If at the end of a page, skip any empty pages and find the
+ * next entry.
+ */
+ if (e->index == NEXTINDEX(e->page)) {
+ h = e->page;
+ do {
+ pg = h->nextpg;
+ mpool_put(t->bt_mp, h, 0);
+ if (pg == P_INVALID)
+ return (RET_SPECIAL);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ } while (NEXTINDEX(h) == 0);
+ e->index = 0;
+ e->page = h;
+ }
+ *ep = *e;
+ break;
case R_FIRST: /* First record. */
case R_NEXT:
/* Walk down the left-hand side of the tree. */
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
-
- /* Check for an empty tree. */
- if (NEXTINDEX(h) == 0) {
- mpool_put(t->bt_mp, h, 0);
- return (RET_SPECIAL);
- }
-
if (h->flags & (P_BLEAF | P_RLEAF))
break;
pg = GETBINTERNAL(h, 0)->pgno;
mpool_put(t->bt_mp, h, 0);
}
+
+ /* Skip any empty pages. */
+ while (NEXTINDEX(h) == 0 && h->nextpg != P_INVALID) {
+ pg = h->nextpg;
+ mpool_put(t->bt_mp, h, 0);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ }
+
+ if (NEXTINDEX(h) == 0) {
+ mpool_put(t->bt_mp, h, 0);
+ return (RET_SPECIAL);
+ }
+
ep->page = h;
ep->index = 0;
break;
@@ -202,19 +243,25 @@ __bt_seqset(t, ep, key, flags)
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
-
- /* Check for an empty tree. */
- if (NEXTINDEX(h) == 0) {
- mpool_put(t->bt_mp, h, 0);
- return (RET_SPECIAL);
- }
-
if (h->flags & (P_BLEAF | P_RLEAF))
break;
pg = GETBINTERNAL(h, NEXTINDEX(h) - 1)->pgno;
mpool_put(t->bt_mp, h, 0);
}
+ /* Skip any empty pages. */
+ while (NEXTINDEX(h) == 0 && h->prevpg != P_INVALID) {
+ pg = h->prevpg;
+ mpool_put(t->bt_mp, h, 0);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ }
+
+ if (NEXTINDEX(h) == 0) {
+ mpool_put(t->bt_mp, h, 0);
+ return (RET_SPECIAL);
+ }
+
ep->page = h;
ep->index = NEXTINDEX(h) - 1;
break;
@@ -223,8 +270,7 @@ __bt_seqset(t, ep, key, flags)
}
/*
- * __bt_seqadvance --
- * Advance the sequential scan.
+ * BT_SEQADVANCE -- Advance the sequential scan.
*
* Parameters:
* t: tree
@@ -237,224 +283,98 @@ __bt_seqset(t, ep, key, flags)
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
*/
static int
-__bt_seqadv(t, ep, flags)
+bt_seqadv(t, e, flags)
BTREE *t;
- EPG *ep;
+ EPG *e;
int flags;
{
- CURSOR *c;
+ EPGNO *c, delc;
PAGE *h;
indx_t index;
pgno_t pg;
- int exact;
- /*
- * There are a couple of states that we can be in. The cursor has
- * been initialized by the time we get here, but that's all we know.
- */
- c = &t->bt_cursor;
+ /* Save the current cursor if going to delete it. */
+ c = &t->bt_bcursor;
+ if (ISSET(t, B_DELCRSR))
+ delc = *c;
- /*
- * The cursor was deleted where there weren't any duplicate records,
- * so the key was saved. Find out where that key would go in the
- * current tree. It doesn't matter if the returned key is an exact
- * match or not -- if it's an exact match, the record was added after
- * the delete so we can just return it. If not, as long as there's
- * a record there, return it.
- */
- if (F_ISSET(c, CURS_ACQUIRE))
- return (__bt_first(t, &c->key, ep, &exact));
-
- /* Get the page referenced by the cursor. */
- if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL)
+ if ((h = mpool_get(t->bt_mp, c->pgno, 0)) == NULL)
return (RET_ERROR);
/*
- * Find the next/previous record in the tree and point the cursor at
- * it. The cursor may not be moved until a new key has been found.
+ * Find the next/previous record in the tree and point the cursor at it.
+ * The cursor may not be moved until a new key has been found.
*/
- switch (flags) {
+ index = c->index;
+ switch(flags) {
case R_NEXT: /* Next record. */
- /*
- * The cursor was deleted in duplicate records, and moved
- * forward to a record that has yet to be returned. Clear
- * that flag, and return the record.
- */
- if (F_ISSET(c, CURS_AFTER))
- goto usecurrent;
- index = c->pg.index;
if (++index == NEXTINDEX(h)) {
- pg = h->nextpg;
- mpool_put(t->bt_mp, h, 0);
- if (pg == P_INVALID)
- return (RET_SPECIAL);
- if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
- return (RET_ERROR);
+ do {
+ pg = h->nextpg;
+ mpool_put(t->bt_mp, h, 0);
+ if (pg == P_INVALID)
+ return (RET_SPECIAL);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ } while (NEXTINDEX(h) == 0);
index = 0;
}
break;
case R_PREV: /* Previous record. */
- /*
- * The cursor was deleted in duplicate records, and moved
- * backward to a record that has yet to be returned. Clear
- * that flag, and return the record.
- */
- if (F_ISSET(c, CURS_BEFORE)) {
-usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE);
- ep->page = h;
- ep->index = c->pg.index;
- return (RET_SUCCESS);
- }
- index = c->pg.index;
- if (index == 0) {
- pg = h->prevpg;
- mpool_put(t->bt_mp, h, 0);
- if (pg == P_INVALID)
- return (RET_SPECIAL);
- if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
- return (RET_ERROR);
+ if (index-- == 0) {
+ do {
+ pg = h->prevpg;
+ mpool_put(t->bt_mp, h, 0);
+ if (pg == P_INVALID)
+ return (RET_SPECIAL);
+ if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ return (RET_ERROR);
+ } while (NEXTINDEX(h) == 0);
index = NEXTINDEX(h) - 1;
- } else
- --index;
+ }
break;
}
- ep->page = h;
- ep->index = index;
- return (RET_SUCCESS);
-}
-
-/*
- * __bt_first --
- * Find the first entry.
- *
- * Parameters:
- * t: the tree
- * key: the key
- * erval: return EPG
- * exactp: pointer to exact match flag
- *
- * Returns:
- * The first entry in the tree greater than or equal to key,
- * or RET_SPECIAL if no such key exists.
- */
-static int
-__bt_first(t, key, erval, exactp)
- BTREE *t;
- const DBT *key;
- EPG *erval;
- int *exactp;
-{
- PAGE *h;
- EPG *ep, save;
- pgno_t pg;
+ e->page = h;
+ e->index = index;
/*
- * Find any matching record; __bt_search pins the page.
- *
- * If it's an exact match and duplicates are possible, walk backwards
- * in the tree until we find the first one. Otherwise, make sure it's
- * a valid key (__bt_search may return an index just past the end of a
- * page) and return it.
+ * Delete any already deleted record that we've been saving because the
+ * cursor pointed to it. This could cause the new index to be shifted
+ * down by one if the record we're deleting is on the same page and has
+ * a larger index.
*/
- if ((ep = __bt_search(t, key, exactp)) == NULL)
- return (NULL);
- if (*exactp) {
- if (F_ISSET(t, B_NODUPS)) {
- *erval = *ep;
- return (RET_SUCCESS);
- }
-
- /*
- * Walk backwards, as long as the entry matches and there are
- * keys left in the tree. Save a copy of each match in case
- * we go too far.
- */
- save = *ep;
- h = ep->page;
- do {
- if (save.page->pgno != ep->page->pgno) {
- mpool_put(t->bt_mp, save.page, 0);
- save = *ep;
- } else
- save.index = ep->index;
-
- /*
- * Don't unpin the page the last (or original) match
- * was on, but make sure it's unpinned if an error
- * occurs.
- */
- if (ep->index == 0) {
- if (h->prevpg == P_INVALID)
- break;
- if (h->pgno != save.page->pgno)
- mpool_put(t->bt_mp, h, 0);
- if ((h = mpool_get(t->bt_mp,
- h->prevpg, 0)) == NULL) {
- if (h->pgno == save.page->pgno)
- mpool_put(t->bt_mp,
- save.page, 0);
- return (RET_ERROR);
- }
- ep->page = h;
- ep->index = NEXTINDEX(h);
- }
- --ep->index;
- } while (__bt_cmp(t, key, ep) == 0);
-
- /*
- * Reach here with the last page that was looked at pinned,
- * which may or may not be the same as the last (or original)
- * match page. If it's not useful, release it.
- */
- if (h->pgno != save.page->pgno)
- mpool_put(t->bt_mp, h, 0);
-
- *erval = save;
- return (RET_SUCCESS);
- }
-
- /* If at the end of a page, find the next entry. */
- if (ep->index == NEXTINDEX(ep->page)) {
- h = ep->page;
- pg = h->nextpg;
- mpool_put(t->bt_mp, h, 0);
- if (pg == P_INVALID)
- return (RET_SPECIAL);
- if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
+ if (ISSET(t, B_DELCRSR)) {
+ CLR(t, B_DELCRSR); /* Don't try twice. */
+ if (c->pgno == delc.pgno && c->index > delc.index)
+ --c->index;
+ if (__bt_crsrdel(t, &delc))
return (RET_ERROR);
- ep->index = 0;
- ep->page = h;
}
- *erval = *ep;
return (RET_SUCCESS);
}
/*
- * __bt_setcur --
- * Set the cursor to an entry in the tree.
+ * __BT_CRSRDEL -- Delete the record referenced by the cursor.
*
* Parameters:
- * t: the tree
- * pgno: page number
- * index: page index
+ * t: tree
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
-void
-__bt_setcur(t, pgno, index)
+int
+__bt_crsrdel(t, c)
BTREE *t;
- pgno_t pgno;
- u_int index;
+ EPGNO *c;
{
- /* Lose any already deleted key. */
- if (t->bt_cursor.key.data != NULL) {
- free(t->bt_cursor.key.data);
- t->bt_cursor.key.size = 0;
- t->bt_cursor.key.data = NULL;
- }
- F_CLR(&t->bt_cursor, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE);
+ PAGE *h;
+ int status;
- /* Update the cursor. */
- t->bt_cursor.pg.pgno = pgno;
- t->bt_cursor.pg.index = index;
- F_SET(&t->bt_cursor, CURS_INIT);
+ CLR(t, B_DELCRSR); /* Don't try twice. */
+ if ((h = mpool_get(t->bt_mp, c->pgno, 0)) == NULL)
+ return (RET_ERROR);
+ status = __bt_dleaf(t, h, c->index);
+ mpool_put(t->bt_mp, h, MPOOL_DIRTY);
+ return (status);
}
diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c
index 1646d8215950..4a572c04c682 100644
--- a/lib/libc/db/btree/bt_split.c
+++ b/lib/libc/db/btree/bt_split.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_split.c 8.9 (Berkeley) 7/26/94";
+static char sccsid[] = "@(#)bt_split.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -79,13 +79,13 @@ u_long bt_rootsplit, bt_split, bt_sortsplit, bt_pfxsaved;
* RET_ERROR, RET_SUCCESS
*/
int
-__bt_split(t, sp, key, data, flags, ilen, argskip)
+__bt_split(t, sp, key, data, flags, ilen, skip)
BTREE *t;
PAGE *sp;
const DBT *key, *data;
int flags;
size_t ilen;
- u_int32_t argskip;
+ indx_t skip;
{
BINTERNAL *bi;
BLEAF *bl, *tbl;
@@ -93,8 +93,7 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
EPGNO *parent;
PAGE *h, *l, *r, *lchild, *rchild;
indx_t nxtindex;
- u_int16_t skip;
- u_int32_t n, nbytes, nksize;
+ size_t n, nbytes, nksize;
int parentsplit;
char *dest;
@@ -104,7 +103,6 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
* skip set to the offset which should be used. Additionally, l and r
* are pinned.
*/
- skip = argskip;
h = sp->pgno == P_ROOT ?
bt_root(t, sp, &l, &r, &skip, ilen) :
bt_page(t, sp, &l, &r, &skip, ilen);
@@ -117,14 +115,14 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
*/
h->linp[skip] = h->upper -= ilen;
dest = (char *)h + h->upper;
- if (F_ISSET(t, R_RECNO))
+ if (ISSET(t, R_RECNO))
WR_RLEAF(dest, data, flags)
else
WR_BLEAF(dest, key, data, flags)
/* If the root page was split, make it look right. */
if (sp->pgno == P_ROOT &&
- (F_ISSET(t, R_RECNO) ?
+ (ISSET(t, R_RECNO) ?
bt_rroot(t, sp, l, r) : bt_broot(t, sp, l, r)) == RET_ERROR)
goto err2;
@@ -232,7 +230,7 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
}
/* Insert the key into the parent page. */
- switch (rchild->flags & P_TYPE) {
+ switch(rchild->flags & P_TYPE) {
case P_BINTERNAL:
h->linp[skip] = h->upper -= nbytes;
dest = (char *)h + h->linp[skip];
@@ -297,7 +295,7 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
/* If the root page was split, make it look right. */
if (sp->pgno == P_ROOT &&
- (F_ISSET(t, R_RECNO) ?
+ (ISSET(t, R_RECNO) ?
bt_rroot(t, sp, l, r) : bt_broot(t, sp, l, r)) == RET_ERROR)
goto err1;
@@ -390,9 +388,6 @@ bt_page(t, h, lp, rp, skip, ilen)
mpool_put(t->bt_mp, r, 0);
return (NULL);
}
-#ifdef PURIFY
- memset(l, 0xff, t->bt_psize);
-#endif
l->pgno = h->pgno;
l->nextpg = r->pgno;
l->prevpg = h->prevpg;
@@ -408,7 +403,7 @@ bt_page(t, h, lp, rp, skip, ilen)
return (NULL);
}
tp->prevpg = r->pgno;
- mpool_put(t->bt_mp, tp, MPOOL_DIRTY);
+ mpool_put(t->bt_mp, tp, 0);
}
/*
@@ -539,7 +534,7 @@ bt_broot(t, h, l, r)
{
BINTERNAL *bi;
BLEAF *bl;
- u_int32_t nbytes;
+ size_t nbytes;
char *dest;
/*
@@ -555,7 +550,7 @@ bt_broot(t, h, l, r)
dest = (char *)h + h->upper;
WR_BINTERNAL(dest, 0, l->pgno, 0);
- switch (h->flags & P_TYPE) {
+ switch(h->flags & P_TYPE) {
case P_BLEAF:
bl = GETBLEAF(r, 0);
nbytes = NBINTERNAL(bl->ksize);
@@ -618,12 +613,12 @@ bt_psplit(t, h, l, r, pskip, ilen)
{
BINTERNAL *bi;
BLEAF *bl;
- CURSOR *c;
RLEAF *rl;
+ EPGNO *c;
PAGE *rval;
void *src;
indx_t full, half, nxt, off, skip, top, used;
- u_int32_t nbytes;
+ size_t nbytes;
int bigkeycnt, isbigkey;
/*
@@ -707,16 +702,19 @@ bt_psplit(t, h, l, r, pskip, ilen)
* cursor is at or past the skipped slot, the cursor is incremented by
* one. If the cursor is on the right page, it is decremented by the
* number of records split to the left page.
+ *
+ * Don't bother checking for the B_SEQINIT flag, the page number will
+ * be P_INVALID.
*/
- c = &t->bt_cursor;
- if (F_ISSET(c, CURS_INIT) && c->pg.pgno == h->pgno) {
- if (c->pg.index >= skip)
- ++c->pg.index;
- if (c->pg.index < nxt) /* Left page. */
- c->pg.pgno = l->pgno;
+ c = &t->bt_bcursor;
+ if (c->pgno == h->pgno) {
+ if (c->index >= skip)
+ ++c->index;
+ if (c->index < nxt) /* Left page. */
+ c->pgno = l->pgno;
else { /* Right page. */
- c->pg.pgno = r->pgno;
- c->pg.index -= nxt;
+ c->pgno = r->pgno;
+ c->index -= nxt;
}
}
diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c
index 9c1438eb8425..d2d1f739e94d 100644
--- a/lib/libc/db/btree/bt_utils.c
+++ b/lib/libc/db/btree/bt_utils.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94";
+static char sccsid[] = "@(#)bt_utils.c 8.4 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -48,91 +48,78 @@ static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94";
#include "btree.h"
/*
- * __bt_ret --
- * Build return key/data pair.
+ * __BT_RET -- Build return key/data pair as a result of search or scan.
*
* Parameters:
* t: tree
- * e: key/data pair to be returned
+ * d: LEAF to be returned to the user.
* key: user's key structure (NULL if not to be filled in)
- * rkey: memory area to hold key
- * data: user's data structure (NULL if not to be filled in)
- * rdata: memory area to hold data
- * copy: always copy the key/data item
+ * data: user's data structure
*
* Returns:
* RET_SUCCESS, RET_ERROR.
*/
int
-__bt_ret(t, e, key, rkey, data, rdata, copy)
+__bt_ret(t, e, key, data)
BTREE *t;
EPG *e;
- DBT *key, *rkey, *data, *rdata;
- int copy;
+ DBT *key, *data;
{
- BLEAF *bl;
- void *p;
+ register BLEAF *bl;
+ register void *p;
bl = GETBLEAF(e->page, e->index);
/*
- * We must copy big keys/data to make them contigous. Otherwise,
- * leave the page pinned and don't copy unless the user specified
+ * We always copy big keys/data to make them contigous. Otherwise,
+ * we leave the page pinned and don't copy unless the user specified
* concurrent access.
*/
- if (key == NULL)
- goto dataonly;
-
- if (bl->flags & P_BIGKEY) {
- if (__ovfl_get(t, bl->bytes,
- &key->size, &rkey->data, &rkey->size))
+ if (bl->flags & P_BIGDATA) {
+ if (__ovfl_get(t, bl->bytes + bl->ksize,
+ &data->size, &t->bt_dbuf, &t->bt_dbufsz))
return (RET_ERROR);
- key->data = rkey->data;
- } else if (copy || F_ISSET(t, B_DB_LOCK)) {
- if (bl->ksize > rkey->size) {
- p = (void *)(rkey->data == NULL ?
- malloc(bl->ksize) : realloc(rkey->data, bl->ksize));
- if (p == NULL)
+ data->data = t->bt_dbuf;
+ } else if (ISSET(t, B_DB_LOCK)) {
+ /* Use +1 in case the first record retrieved is 0 length. */
+ if (bl->dsize + 1 > t->bt_dbufsz) {
+ if ((p =
+ (void *)realloc(t->bt_dbuf, bl->dsize + 1)) == NULL)
return (RET_ERROR);
- rkey->data = p;
- rkey->size = bl->ksize;
+ t->bt_dbuf = p;
+ t->bt_dbufsz = bl->dsize + 1;
}
- memmove(rkey->data, bl->bytes, bl->ksize);
- key->size = bl->ksize;
- key->data = rkey->data;
+ memmove(t->bt_dbuf, bl->bytes + bl->ksize, bl->dsize);
+ data->size = bl->dsize;
+ data->data = t->bt_dbuf;
} else {
- key->size = bl->ksize;
- key->data = bl->bytes;
+ data->size = bl->dsize;
+ data->data = bl->bytes + bl->ksize;
}
-dataonly:
- if (data == NULL)
+ if (key == NULL)
return (RET_SUCCESS);
- if (bl->flags & P_BIGDATA) {
- if (__ovfl_get(t, bl->bytes + bl->ksize,
- &data->size, &rdata->data, &rdata->size))
+ if (bl->flags & P_BIGKEY) {
+ if (__ovfl_get(t, bl->bytes,
+ &key->size, &t->bt_kbuf, &t->bt_kbufsz))
return (RET_ERROR);
- data->data = rdata->data;
- } else if (copy || F_ISSET(t, B_DB_LOCK)) {
- /* Use +1 in case the first record retrieved is 0 length. */
- if (bl->dsize + 1 > rdata->size) {
- p = (void *)(rdata->data == NULL ?
- malloc(bl->dsize + 1) :
- realloc(rdata->data, bl->dsize + 1));
- if (p == NULL)
+ key->data = t->bt_kbuf;
+ } else if (ISSET(t, B_DB_LOCK)) {
+ if (bl->ksize > t->bt_kbufsz) {
+ if ((p =
+ (void *)realloc(t->bt_kbuf, bl->ksize)) == NULL)
return (RET_ERROR);
- rdata->data = p;
- rdata->size = bl->dsize + 1;
+ t->bt_kbuf = p;
+ t->bt_kbufsz = bl->ksize;
}
- memmove(rdata->data, bl->bytes + bl->ksize, bl->dsize);
- data->size = bl->dsize;
- data->data = rdata->data;
+ memmove(t->bt_kbuf, bl->bytes, bl->ksize);
+ key->size = bl->ksize;
+ key->data = t->bt_kbuf;
} else {
- data->size = bl->dsize;
- data->data = bl->bytes + bl->ksize;
+ key->size = bl->ksize;
+ key->data = bl->bytes;
}
-
return (RET_SUCCESS);
}
@@ -193,9 +180,9 @@ __bt_cmp(t, k1, e)
if (bigkey) {
if (__ovfl_get(t, bigkey,
- &k2.size, &t->bt_rdata.data, &t->bt_rdata.size))
+ &k2.size, &t->bt_dbuf, &t->bt_dbufsz))
return (RET_ERROR);
- k2.data = t->bt_rdata.data;
+ k2.data = t->bt_dbuf;
}
return ((*t->bt_cmp)(k1, &k2));
}
diff --git a/lib/libc/db/btree/btree.h b/lib/libc/db/btree/btree.h
index 36d35c998bfd..dd798ecc3919 100644
--- a/lib/libc/db/btree/btree.h
+++ b/lib/libc/db/btree/btree.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1991, 1993, 1994
+ * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -33,14 +33,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)btree.h 8.11 (Berkeley) 8/17/94
+ * @(#)btree.h 8.5 (Berkeley) 2/21/94
*/
-/* Macros to set/clear/test flags. */
-#define F_SET(p, f) (p)->flags |= (f)
-#define F_CLR(p, f) (p)->flags &= ~(f)
-#define F_ISSET(p, f) ((p)->flags & (f))
-
#include <mpool.h>
#define DEFMINKEYPAGE (2) /* Minimum keys per page */
@@ -84,9 +79,8 @@ typedef struct _page {
} PAGE;
/* First and next index. */
-#define BTDATAOFF \
- (sizeof(pgno_t) + sizeof(pgno_t) + sizeof(pgno_t) + \
- sizeof(u_int32_t) + sizeof(indx_t) + sizeof(indx_t))
+#define BTDATAOFF (sizeof(pgno_t) + sizeof(pgno_t) + sizeof(pgno_t) + \
+ sizeof(u_int32_t) + sizeof(indx_t) + sizeof(indx_t))
#define NEXTINDEX(p) (((p)->lower - BTDATAOFF) / sizeof(indx_t))
/*
@@ -105,8 +99,9 @@ typedef struct _page {
* be manipulated without copying. (This presumes that 32 bit items can be
* manipulated on this system.)
*/
-#define LALIGN(n) (((n) + sizeof(pgno_t) - 1) & ~(sizeof(pgno_t) - 1))
-#define NOVFLSIZE (sizeof(pgno_t) + sizeof(u_int32_t))
+#define LALIGN(n) \
+ (((n) + sizeof(pgno_t) - 1) & ~(sizeof(pgno_t) - 1))
+#define NOVFLSIZE (sizeof(pgno_t) + sizeof(size_t))
/*
* For the btree internal pages, the item is a key. BINTERNALs are {key, pgno}
@@ -118,7 +113,7 @@ typedef struct _page {
* some minor modifications of the above rule.
*/
typedef struct _binternal {
- u_int32_t ksize; /* key size */
+ size_t ksize; /* key size */
pgno_t pgno; /* page number stored on */
#define P_BIGDATA 0x01 /* overflow data */
#define P_BIGKEY 0x02 /* overflow key */
@@ -127,21 +122,21 @@ typedef struct _binternal {
} BINTERNAL;
/* Get the page's BINTERNAL structure at index indx. */
-#define GETBINTERNAL(pg, indx) \
+#define GETBINTERNAL(pg, indx) \
((BINTERNAL *)((char *)(pg) + (pg)->linp[indx]))
/* Get the number of bytes in the entry. */
-#define NBINTERNAL(len) \
- LALIGN(sizeof(u_int32_t) + sizeof(pgno_t) + sizeof(u_char) + (len))
+#define NBINTERNAL(len) \
+ LALIGN(sizeof(size_t) + sizeof(pgno_t) + sizeof(u_char) + (len))
/* Copy a BINTERNAL entry to the page. */
-#define WR_BINTERNAL(p, size, pgno, flags) { \
- *(u_int32_t *)p = size; \
- p += sizeof(u_int32_t); \
- *(pgno_t *)p = pgno; \
- p += sizeof(pgno_t); \
- *(u_char *)p = flags; \
- p += sizeof(u_char); \
+#define WR_BINTERNAL(p, size, pgno, flags) { \
+ *(size_t *)p = size; \
+ p += sizeof(size_t); \
+ *(pgno_t *)p = pgno; \
+ p += sizeof(pgno_t); \
+ *(u_char *)p = flags; \
+ p += sizeof(u_char); \
}
/*
@@ -154,78 +149,78 @@ typedef struct _rinternal {
} RINTERNAL;
/* Get the page's RINTERNAL structure at index indx. */
-#define GETRINTERNAL(pg, indx) \
+#define GETRINTERNAL(pg, indx) \
((RINTERNAL *)((char *)(pg) + (pg)->linp[indx]))
/* Get the number of bytes in the entry. */
-#define NRINTERNAL \
+#define NRINTERNAL \
LALIGN(sizeof(recno_t) + sizeof(pgno_t))
/* Copy a RINTERAL entry to the page. */
-#define WR_RINTERNAL(p, nrecs, pgno) { \
- *(recno_t *)p = nrecs; \
- p += sizeof(recno_t); \
- *(pgno_t *)p = pgno; \
+#define WR_RINTERNAL(p, nrecs, pgno) { \
+ *(recno_t *)p = nrecs; \
+ p += sizeof(recno_t); \
+ *(pgno_t *)p = pgno; \
}
/* For the btree leaf pages, the item is a key and data pair. */
typedef struct _bleaf {
- u_int32_t ksize; /* size of key */
- u_int32_t dsize; /* size of data */
+ size_t ksize; /* size of key */
+ size_t dsize; /* size of data */
u_char flags; /* P_BIGDATA, P_BIGKEY */
char bytes[1]; /* data */
} BLEAF;
/* Get the page's BLEAF structure at index indx. */
-#define GETBLEAF(pg, indx) \
+#define GETBLEAF(pg, indx) \
((BLEAF *)((char *)(pg) + (pg)->linp[indx]))
/* Get the number of bytes in the entry. */
#define NBLEAF(p) NBLEAFDBT((p)->ksize, (p)->dsize)
/* Get the number of bytes in the user's key/data pair. */
-#define NBLEAFDBT(ksize, dsize) \
- LALIGN(sizeof(u_int32_t) + sizeof(u_int32_t) + sizeof(u_char) + \
+#define NBLEAFDBT(ksize, dsize) \
+ LALIGN(sizeof(size_t) + sizeof(size_t) + sizeof(u_char) + \
(ksize) + (dsize))
/* Copy a BLEAF entry to the page. */
-#define WR_BLEAF(p, key, data, flags) { \
- *(u_int32_t *)p = key->size; \
- p += sizeof(u_int32_t); \
- *(u_int32_t *)p = data->size; \
- p += sizeof(u_int32_t); \
- *(u_char *)p = flags; \
- p += sizeof(u_char); \
- memmove(p, key->data, key->size); \
- p += key->size; \
- memmove(p, data->data, data->size); \
+#define WR_BLEAF(p, key, data, flags) { \
+ *(size_t *)p = key->size; \
+ p += sizeof(size_t); \
+ *(size_t *)p = data->size; \
+ p += sizeof(size_t); \
+ *(u_char *)p = flags; \
+ p += sizeof(u_char); \
+ memmove(p, key->data, key->size); \
+ p += key->size; \
+ memmove(p, data->data, data->size); \
}
/* For the recno leaf pages, the item is a data entry. */
typedef struct _rleaf {
- u_int32_t dsize; /* size of data */
+ size_t dsize; /* size of data */
u_char flags; /* P_BIGDATA */
char bytes[1];
} RLEAF;
/* Get the page's RLEAF structure at index indx. */
-#define GETRLEAF(pg, indx) \
+#define GETRLEAF(pg, indx) \
((RLEAF *)((char *)(pg) + (pg)->linp[indx]))
/* Get the number of bytes in the entry. */
#define NRLEAF(p) NRLEAFDBT((p)->dsize)
/* Get the number of bytes from the user's data. */
-#define NRLEAFDBT(dsize) \
- LALIGN(sizeof(u_int32_t) + sizeof(u_char) + (dsize))
+#define NRLEAFDBT(dsize) \
+ LALIGN(sizeof(size_t) + sizeof(u_char) + (dsize))
/* Copy a RLEAF entry to the page. */
-#define WR_RLEAF(p, data, flags) { \
- *(u_int32_t *)p = data->size; \
- p += sizeof(u_int32_t); \
- *(u_char *)p = flags; \
- p += sizeof(u_char); \
- memmove(p, data->data, data->size); \
+#define WR_RLEAF(p, data, flags) { \
+ *(size_t *)p = data->size; \
+ p += sizeof(size_t); \
+ *(u_char *)p = flags; \
+ p += sizeof(u_char); \
+ memmove(p, data->data, data->size); \
}
/*
@@ -237,6 +232,12 @@ typedef struct _rleaf {
* record less than key in the tree so that descents work. Leaf page searches
* must find the smallest record greater than key so that the returned index
* is the record's correct position for insertion.
+ *
+ * One comment about cursors. The cursor key is never removed from the tree,
+ * even if deleted. This is because it is quite difficult to decide where the
+ * cursor should be when other keys have been inserted/deleted in the tree;
+ * duplicate keys make it impossible. This scheme does require extra work
+ * though, to make sure that we don't perform an operation on a deleted key.
*/
typedef struct _epgno {
pgno_t pgno; /* the page number */
@@ -249,90 +250,53 @@ typedef struct _epg {
} EPG;
/*
- * About cursors. The cursor (and the page that contained the key/data pair
- * that it referenced) can be deleted, which makes things a bit tricky. If
- * there are no duplicates of the cursor key in the tree (i.e. B_NODUPS is set
- * or there simply aren't any duplicates of the key) we copy the key that it
- * referenced when it's deleted, and reacquire a new cursor key if the cursor
- * is used again. If there are duplicates keys, we move to the next/previous
- * key, and set a flag so that we know what happened. NOTE: if duplicate (to
- * the cursor) keys are added to the tree during this process, it is undefined
- * if they will be returned or not in a cursor scan.
- *
- * The flags determine the possible states of the cursor:
- *
- * CURS_INIT The cursor references *something*.
- * CURS_ACQUIRE The cursor was deleted, and a key has been saved so that
- * we can reacquire the right position in the tree.
- * CURS_AFTER, CURS_BEFORE
- * The cursor was deleted, and now references a key/data pair
- * that has not yet been returned, either before or after the
- * deleted key/data pair.
- * XXX
- * This structure is broken out so that we can eventually offer multiple
- * cursors as part of the DB interface.
- */
-typedef struct _cursor {
- EPGNO pg; /* B: Saved tree reference. */
- DBT key; /* B: Saved key, or key.data == NULL. */
- recno_t rcursor; /* R: recno cursor (1-based) */
-
-#define CURS_ACQUIRE 0x01 /* B: Cursor needs to be reacquired. */
-#define CURS_AFTER 0x02 /* B: Unreturned cursor after key. */
-#define CURS_BEFORE 0x04 /* B: Unreturned cursor before key. */
-#define CURS_INIT 0x08 /* RB: Cursor initialized. */
- u_int8_t flags;
-} CURSOR;
-
-/*
- * The metadata of the tree. The nrecs field is used only by the RECNO code.
+ * The metadata of the tree. The m_nrecs field is used only by the RECNO code.
* This is because the btree doesn't really need it and it requires that every
* put or delete call modify the metadata.
*/
typedef struct _btmeta {
- u_int32_t magic; /* magic number */
- u_int32_t version; /* version */
- u_int32_t psize; /* page size */
- u_int32_t free; /* page number of first free page */
- u_int32_t nrecs; /* R: number of records */
-
+ u_int32_t m_magic; /* magic number */
+ u_int32_t m_version; /* version */
+ u_int32_t m_psize; /* page size */
+ u_int32_t m_free; /* page number of first free page */
+ u_int32_t m_nrecs; /* R: number of records */
#define SAVEMETA (B_NODUPS | R_RECNO)
- u_int32_t flags; /* bt_flags & SAVEMETA */
+ u_int32_t m_flags; /* bt_flags & SAVEMETA */
+ u_int32_t m_unused; /* unused */
} BTMETA;
/* The in-memory btree/recno data structure. */
typedef struct _btree {
- MPOOL *bt_mp; /* memory pool cookie */
+ MPOOL *bt_mp; /* memory pool cookie */
- DB *bt_dbp; /* pointer to enclosing DB */
+ DB *bt_dbp; /* pointer to enclosing DB */
- EPG bt_cur; /* current (pinned) page */
- PAGE *bt_pinned; /* page pinned across calls */
+ EPG bt_cur; /* current (pinned) page */
+ PAGE *bt_pinned; /* page pinned across calls */
- CURSOR bt_cursor; /* cursor */
+ EPGNO bt_bcursor; /* B: btree cursor */
+ recno_t bt_rcursor; /* R: recno cursor (1-based) */
-#define BT_PUSH(t, p, i) { \
- t->bt_sp->pgno = p; \
- t->bt_sp->index = i; \
- ++t->bt_sp; \
-}
-#define BT_POP(t) (t->bt_sp == t->bt_stack ? NULL : --t->bt_sp)
-#define BT_CLR(t) (t->bt_sp = t->bt_stack)
- EPGNO bt_stack[50]; /* stack of parent pages */
- EPGNO *bt_sp; /* current stack pointer */
+#define BT_POP(t) (t->bt_sp ? t->bt_stack + --t->bt_sp : NULL)
+#define BT_CLR(t) (t->bt_sp = 0)
+ EPGNO *bt_stack; /* stack of parent pages */
+ u_int bt_sp; /* current stack pointer */
+ u_int bt_maxstack; /* largest stack */
- DBT bt_rkey; /* returned key */
- DBT bt_rdata; /* returned data */
+ char *bt_kbuf; /* key buffer */
+ size_t bt_kbufsz; /* key buffer size */
+ char *bt_dbuf; /* data buffer */
+ size_t bt_dbufsz; /* data buffer size */
- int bt_fd; /* tree file descriptor */
+ int bt_fd; /* tree file descriptor */
- pgno_t bt_free; /* next free page */
+ pgno_t bt_free; /* next free page */
u_int32_t bt_psize; /* page size */
- indx_t bt_ovflsize; /* cut-off for key/data overflow */
- int bt_lorder; /* byte order */
+ indx_t bt_ovflsize; /* cut-off for key/data overflow */
+ int bt_lorder; /* byte order */
/* sorted order */
enum { NOT, BACK, FORWARD } bt_order;
- EPGNO bt_last; /* last insert */
+ EPGNO bt_last; /* last insert */
/* B: key comparison function */
int (*bt_cmp) __P((const DBT *, const DBT *));
@@ -341,43 +305,49 @@ typedef struct _btree {
/* R: recno input function */
int (*bt_irec) __P((struct _btree *, recno_t));
- FILE *bt_rfp; /* R: record FILE pointer */
- int bt_rfd; /* R: record file descriptor */
+ FILE *bt_rfp; /* R: record FILE pointer */
+ int bt_rfd; /* R: record file descriptor */
- caddr_t bt_cmap; /* R: current point in mapped space */
- caddr_t bt_smap; /* R: start of mapped space */
- caddr_t bt_emap; /* R: end of mapped space */
- size_t bt_msize; /* R: size of mapped region. */
+ caddr_t bt_cmap; /* R: current point in mapped space */
+ caddr_t bt_smap; /* R: start of mapped space */
+ caddr_t bt_emap; /* R: end of mapped space */
+ size_t bt_msize; /* R: size of mapped region. */
- recno_t bt_nrecs; /* R: number of records */
- size_t bt_reclen; /* R: fixed record length */
- u_char bt_bval; /* R: delimiting byte/pad character */
+ recno_t bt_nrecs; /* R: number of records */
+ size_t bt_reclen; /* R: fixed record length */
+ u_char bt_bval; /* R: delimiting byte/pad character */
/*
* NB:
* B_NODUPS and R_RECNO are stored on disk, and may not be changed.
*/
-#define B_INMEM 0x00001 /* in-memory tree */
-#define B_METADIRTY 0x00002 /* need to write metadata */
-#define B_MODIFIED 0x00004 /* tree modified */
-#define B_NEEDSWAP 0x00008 /* if byte order requires swapping */
-#define B_RDONLY 0x00010 /* read-only tree */
-
+#define B_DELCRSR 0x00001 /* cursor has been deleted */
+#define B_INMEM 0x00002 /* in-memory tree */
+#define B_METADIRTY 0x00004 /* need to write metadata */
+#define B_MODIFIED 0x00008 /* tree modified */
+#define B_NEEDSWAP 0x00010 /* if byte order requires swapping */
#define B_NODUPS 0x00020 /* no duplicate keys permitted */
+#define B_RDONLY 0x00040 /* read-only tree */
#define R_RECNO 0x00080 /* record oriented tree */
+#define B_SEQINIT 0x00100 /* sequential scan initialized */
-#define R_CLOSEFP 0x00040 /* opened a file pointer */
-#define R_EOF 0x00100 /* end of input file reached. */
-#define R_FIXLEN 0x00200 /* fixed length records */
-#define R_MEMMAPPED 0x00400 /* memory mapped file. */
-#define R_INMEM 0x00800 /* in-memory file */
-#define R_MODIFIED 0x01000 /* modified file */
-#define R_RDONLY 0x02000 /* read-only file */
-
-#define B_DB_LOCK 0x04000 /* DB_LOCK specified. */
-#define B_DB_SHMEM 0x08000 /* DB_SHMEM specified. */
-#define B_DB_TXN 0x10000 /* DB_TXN specified. */
- u_int32_t flags;
+#define R_CLOSEFP 0x00200 /* opened a file pointer */
+#define R_EOF 0x00400 /* end of input file reached. */
+#define R_FIXLEN 0x00800 /* fixed length records */
+#define R_MEMMAPPED 0x01000 /* memory mapped file. */
+#define R_INMEM 0x02000 /* in-memory file */
+#define R_MODIFIED 0x04000 /* modified file */
+#define R_RDONLY 0x08000 /* read-only file */
+
+#define B_DB_LOCK 0x10000 /* DB_LOCK specified. */
+#define B_DB_SHMEM 0x20000 /* DB_SHMEM specified. */
+#define B_DB_TXN 0x40000 /* DB_TXN specified. */
+
+ u_int32_t bt_flags; /* btree state */
} BTREE;
+#define SET(t, f) ((t)->bt_flags |= (f))
+#define CLR(t, f) ((t)->bt_flags &= ~(f))
+#define ISSET(t, f) ((t)->bt_flags & (f))
+
#include "extern.h"
diff --git a/lib/libc/db/btree/extern.h b/lib/libc/db/btree/extern.h
index ebd9c5492308..4007bc708500 100644
--- a/lib/libc/db/btree/extern.h
+++ b/lib/libc/db/btree/extern.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1991, 1993, 1994
+ * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)extern.h 8.10 (Berkeley) 7/20/94
+ * @(#)extern.h 8.3 (Berkeley) 2/21/94
*/
int __bt_close __P((DB *));
@@ -39,8 +39,9 @@ int __bt_crsrdel __P((BTREE *, EPGNO *));
int __bt_defcmp __P((const DBT *, const DBT *));
size_t __bt_defpfx __P((const DBT *, const DBT *));
int __bt_delete __P((const DB *, const DBT *, u_int));
-int __bt_dleaf __P((BTREE *, const DBT *, PAGE *, u_int));
+int __bt_dleaf __P((BTREE *, PAGE *, int));
int __bt_fd __P((const DB *));
+EPG *__bt_first __P((BTREE *, const DBT *, int *));
int __bt_free __P((BTREE *, PAGE *));
int __bt_get __P((const DB *, const DBT *, DBT *, u_int));
PAGE *__bt_new __P((BTREE *, pgno_t *));
@@ -48,16 +49,15 @@ void __bt_pgin __P((void *, pgno_t, void *));
void __bt_pgout __P((void *, pgno_t, void *));
int __bt_push __P((BTREE *, pgno_t, int));
int __bt_put __P((const DB *dbp, DBT *, const DBT *, u_int));
-int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int));
+int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *));
EPG *__bt_search __P((BTREE *, const DBT *, int *));
int __bt_seq __P((const DB *, DBT *, DBT *, u_int));
-void __bt_setcur __P((BTREE *, pgno_t, u_int));
int __bt_split __P((BTREE *, PAGE *,
- const DBT *, const DBT *, int, size_t, u_int32_t));
+ const DBT *, const DBT *, int, size_t, indx_t));
int __bt_sync __P((const DB *, u_int));
int __ovfl_delete __P((BTREE *, void *));
-int __ovfl_get __P((BTREE *, void *, size_t *, void **, size_t *));
+int __ovfl_get __P((BTREE *, void *, size_t *, char **, size_t *));
int __ovfl_put __P((BTREE *, const DBT *, pgno_t *));
#ifdef DEBUG
diff --git a/lib/libc/db/doc/hash.usenix.ps b/lib/libc/db/doc/hash.usenix.ps
index c884778830d2..03a01cbf0e90 100644
--- a/lib/libc/db/doc/hash.usenix.ps
+++ b/lib/libc/db/doc/hash.usenix.ps
@@ -7,7 +7,7 @@
% lib/psdit.pro -- prolog for psdit (ditroff) files
% Copyright (c) 1984, 1985 Adobe Systems Incorporated. All Rights Reserved.
% last edit: shore Sat Nov 23 20:28:03 1985
-% RCSID: $Header: psdit.pro,v 2.1 85/11/24 12:19:43 shore Rel $
+% RCSID: $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libc/db/doc/Attic/hash.usenix.ps,v 1.2 1994/08/05 01:17:43 wollman Exp $
% Changed by Edward Wang (edward@ucbarpa.berkeley.edu) to handle graphics,
% 17 Feb, 87.
diff --git a/lib/libc/db/doc/libtp.usenix.ps b/lib/libc/db/doc/libtp.usenix.ps
index ea821a9145e2..ebe73cdfc102 100644
--- a/lib/libc/db/doc/libtp.usenix.ps
+++ b/lib/libc/db/doc/libtp.usenix.ps
@@ -7,7 +7,7 @@
% lib/psdit.pro -- prolog for psdit (ditroff) files
% Copyright (c) 1984, 1985 Adobe Systems Incorporated. All Rights Reserved.
% last edit: shore Sat Nov 23 20:28:03 1985
-% RCSID: $Header: psdit.pro,v 2.1 85/11/24 12:19:43 shore Rel $
+% RCSID: $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libc/db/doc/Attic/libtp.usenix.ps,v 1.2 1994/08/05 01:17:46 wollman Exp $
% Changed by Edward Wang (edward@ucbarpa.berkeley.edu) to handle graphics,
% 17 Feb, 87.
diff --git a/lib/libc/db/hash/extern.h b/lib/libc/db/hash/extern.h
index 3167e6d0f754..b7ef37ada29a 100644
--- a/lib/libc/db/hash/extern.h
+++ b/lib/libc/db/hash/extern.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1991, 1993, 1994
+ * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)extern.h 8.4 (Berkeley) 6/16/94
+ * @(#)extern.h 8.2 (Berkeley) 2/21/94
*/
BUFHEAD *__add_ovflpage __P((HTAB *, BUFHEAD *));
@@ -40,26 +40,26 @@ int __big_insert __P((HTAB *, BUFHEAD *, const DBT *, const DBT *));
int __big_keydata __P((HTAB *, BUFHEAD *, DBT *, DBT *, int));
int __big_return __P((HTAB *, BUFHEAD *, int, DBT *, int));
int __big_split __P((HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
- int, u_int32_t, SPLIT_RETURN *));
+ int, u_int, SPLIT_RETURN *));
int __buf_free __P((HTAB *, int, int));
void __buf_init __P((HTAB *, int));
-u_int32_t __call_hash __P((HTAB *, char *, int));
+u_int __call_hash __P((HTAB *, char *, int));
int __delpair __P((HTAB *, BUFHEAD *, int));
int __expand_table __P((HTAB *));
int __find_bigpair __P((HTAB *, BUFHEAD *, int, char *, int));
-u_int16_t __find_last_page __P((HTAB *, BUFHEAD **));
+u_short __find_last_page __P((HTAB *, BUFHEAD **));
void __free_ovflpage __P((HTAB *, BUFHEAD *));
-BUFHEAD *__get_buf __P((HTAB *, u_int32_t, BUFHEAD *, int));
-int __get_page __P((HTAB *, char *, u_int32_t, int, int, int));
-int __ibitmap __P((HTAB *, int, int, int));
-u_int32_t __log2 __P((u_int32_t));
-int __put_page __P((HTAB *, char *, u_int32_t, int, int));
+BUFHEAD *__get_buf __P((HTAB *, u_int, BUFHEAD *, int));
+int __get_page __P((HTAB *, char *, u_int, int, int, int));
+int __init_bitmap __P((HTAB *, int, int, int));
+u_int __log2 __P((u_int));
+int __put_page __P((HTAB *, char *, u_int, int, int));
void __reclaim_buf __P((HTAB *, BUFHEAD *));
-int __split_page __P((HTAB *, u_int32_t, u_int32_t));
+int __split_page __P((HTAB *, u_int, u_int));
/* Default hash routine. */
extern u_int32_t (*__default_hash) __P((const void *, size_t));
#ifdef HASH_STATISTICS
-extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows;
+extern long hash_accesses, hash_collisions, hash_expansions, hash_overflows;
#endif
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 68176e404ff4..6a23f3d801cb 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
+static char sccsid[] = "@(#)hash.c 8.7 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -60,13 +60,13 @@ static int alloc_segs __P((HTAB *, int));
static int flush_meta __P((HTAB *));
static int hash_access __P((HTAB *, ACTION, DBT *, DBT *));
static int hash_close __P((DB *));
-static int hash_delete __P((const DB *, const DBT *, u_int32_t));
+static int hash_delete __P((const DB *, const DBT *, u_int));
static int hash_fd __P((const DB *));
-static int hash_get __P((const DB *, const DBT *, DBT *, u_int32_t));
-static int hash_put __P((const DB *, DBT *, const DBT *, u_int32_t));
+static int hash_get __P((const DB *, const DBT *, DBT *, u_int));
+static int hash_put __P((const DB *, DBT *, const DBT *, u_int));
static void *hash_realloc __P((SEGMENT **, int, int));
-static int hash_seq __P((const DB *, DBT *, DBT *, u_int32_t));
-static int hash_sync __P((const DB *, u_int32_t));
+static int hash_seq __P((const DB *, DBT *, DBT *, u_int));
+static int hash_sync __P((const DB *, u_int));
static int hdestroy __P((HTAB *));
static HTAB *init_hash __P((HTAB *, const char *, HASHINFO *));
static int init_htab __P((HTAB *, int));
@@ -86,7 +86,7 @@ static void swap_header_copy __P((HASHHDR *, HASHHDR *));
#define ABNORMAL (1)
#ifdef HASH_STATISTICS
-int hash_accesses, hash_collisions, hash_expansions, hash_overflows;
+long hash_accesses, hash_collisions, hash_expansions, hash_overflows;
#endif
/************************** INTERFACE ROUTINES ***************************/
@@ -130,13 +130,6 @@ __hash_open(file, flags, mode, info, dflags)
if (file) {
if ((hashp->fp = open(file, flags, mode)) == -1)
RETURN_ERROR(errno, error0);
-
- /* if the .db file is empty, and we had permission to create
- a new .db file, then reinitialize the database */
- if ((flags & O_CREAT) &&
- fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
- new_table = 1;
-
(void)fcntl(hashp->fp, F_SETFD, 1);
}
if (new_table) {
@@ -186,7 +179,7 @@ __hash_open(file, flags, mode, info, dflags)
(hashp->BSHIFT + BYTE_SHIFT);
hashp->nmaps = bpages;
- (void)memset(&hashp->mapp[0], 0, bpages * sizeof(u_int32_t *));
+ (void)memset(&hashp->mapp[0], 0, bpages * sizeof(u_long *));
}
/* Initialize Buffer Manager */
@@ -373,7 +366,7 @@ init_htab(hashp, nelem)
hashp->LAST_FREED = 2;
/* First bitmap page is at: splitpoint l2 page offset 1 */
- if (__ibitmap(hashp, OADDR_OF(l2, 1), l2 + 1, 0))
+ if (__init_bitmap(hashp, OADDR_OF(l2, 1), l2 + 1, 0))
return (-1);
hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1;
@@ -458,7 +451,7 @@ hdestroy(hashp)
static int
hash_sync(dbp, flags)
const DB *dbp;
- u_int32_t flags;
+ u_int flags;
{
HTAB *hashp;
@@ -512,7 +505,7 @@ flush_meta(hashp)
else
if (wsize != sizeof(HASHHDR)) {
errno = EFTYPE;
- hashp->error = errno;
+ hashp->errno = errno;
return (-1);
}
for (i = 0; i < NCACHED; i++)
@@ -537,13 +530,13 @@ hash_get(dbp, key, data, flag)
const DB *dbp;
const DBT *key;
DBT *data;
- u_int32_t flag;
+ u_int flag;
{
HTAB *hashp;
hashp = (HTAB *)dbp->internal;
if (flag) {
- hashp->error = errno = EINVAL;
+ hashp->errno = errno = EINVAL;
return (ERROR);
}
return (hash_access(hashp, HASH_GET, (DBT *)key, data));
@@ -554,17 +547,17 @@ hash_put(dbp, key, data, flag)
const DB *dbp;
DBT *key;
const DBT *data;
- u_int32_t flag;
+ u_int flag;
{
HTAB *hashp;
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_NOOVERWRITE) {
- hashp->error = errno = EINVAL;
+ hashp->errno = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->error = errno = EPERM;
+ hashp->errno = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, flag == R_NOOVERWRITE ?
@@ -575,17 +568,17 @@ static int
hash_delete(dbp, key, flag)
const DB *dbp;
const DBT *key;
- u_int32_t flag; /* Ignored */
+ u_int flag; /* Ignored */
{
HTAB *hashp;
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_CURSOR) {
- hashp->error = errno = EINVAL;
+ hashp->errno = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->error = errno = EPERM;
+ hashp->errno = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
@@ -602,10 +595,10 @@ hash_access(hashp, action, key, val)
{
register BUFHEAD *rbufp;
BUFHEAD *bufp, *save_bufp;
- register u_int16_t *bp;
+ register u_short *bp;
register int n, ndx, off, size;
register char *kp;
- u_int16_t pageno;
+ u_short pageno;
#ifdef HASH_STATISTICS
hash_accesses++;
@@ -621,7 +614,7 @@ hash_access(hashp, action, key, val)
/* Pin the bucket chain */
rbufp->flags |= BUF_PIN;
- for (bp = (u_int16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
+ for (bp = (u_short *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
if (bp[1] >= REAL_KEY) {
/* Real key/data pair */
if (size == off - *bp &&
@@ -640,7 +633,7 @@ hash_access(hashp, action, key, val)
return (ERROR);
}
/* FOR LOOP INIT */
- bp = (u_int16_t *)rbufp->page;
+ bp = (u_short *)rbufp->page;
n = *bp++;
ndx = 1;
off = hashp->BSIZE;
@@ -662,7 +655,7 @@ hash_access(hashp, action, key, val)
return (ERROR);
}
/* FOR LOOP INIT */
- bp = (u_int16_t *)rbufp->page;
+ bp = (u_short *)rbufp->page;
n = *bp++;
ndx = 1;
off = hashp->BSIZE;
@@ -696,7 +689,7 @@ found:
save_bufp->flags &= ~BUF_PIN;
return (ABNORMAL);
case HASH_GET:
- bp = (u_int16_t *)rbufp->page;
+ bp = (u_short *)rbufp->page;
if (bp[ndx + 1] < REAL_KEY) {
if (__big_return(hashp, rbufp, ndx, val, 0))
return (ERROR);
@@ -727,16 +720,16 @@ static int
hash_seq(dbp, key, data, flag)
const DB *dbp;
DBT *key, *data;
- u_int32_t flag;
+ u_int flag;
{
- register u_int32_t bucket;
+ register u_int bucket;
register BUFHEAD *bufp;
HTAB *hashp;
- u_int16_t *bp, ndx;
+ u_short *bp, ndx;
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_FIRST && flag != R_NEXT) {
- hashp->error = errno = EINVAL;
+ hashp->errno = errno = EINVAL;
return (ERROR);
}
#ifdef HASH_STATISTICS
@@ -757,7 +750,7 @@ hash_seq(dbp, key, data, flag)
if (!bufp)
return (ERROR);
hashp->cpage = bufp;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
if (bp[0])
break;
}
@@ -767,7 +760,7 @@ hash_seq(dbp, key, data, flag)
return (ABNORMAL);
}
} else
- bp = (u_int16_t *)hashp->cpage->page;
+ bp = (u_short *)hashp->cpage->page;
#ifdef DEBUG
assert(bp);
@@ -778,7 +771,7 @@ hash_seq(dbp, key, data, flag)
__get_buf(hashp, bp[hashp->cndx], bufp, 0);
if (!bufp)
return (ERROR);
- bp = (u_int16_t *)(bufp->page);
+ bp = (u_short *)(bufp->page);
hashp->cndx = 1;
}
if (!bp[0]) {
@@ -817,7 +810,7 @@ extern int
__expand_table(hashp)
HTAB *hashp;
{
- u_int32_t old_bucket, new_bucket;
+ u_int old_bucket, new_bucket;
int dirsize, new_segnum, spare_ndx;
#ifdef HASH_STATISTICS
@@ -884,7 +877,7 @@ hash_realloc(p_ptr, oldsize, newsize)
return (p);
}
-extern u_int32_t
+extern u_int
__call_hash(hashp, k, len)
HTAB *hashp;
char *k;
diff --git a/lib/libc/db/hash/hash.h b/lib/libc/db/hash/hash.h
index 504a9b603e52..1c80f83c69d5 100644
--- a/lib/libc/db/hash/hash.h
+++ b/lib/libc/db/hash/hash.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)hash.h 8.3 (Berkeley) 5/31/94
+ * @(#)hash.h 8.2 (Berkeley) 2/21/94
*/
/* Operations */
@@ -45,12 +45,12 @@ typedef enum {
typedef struct _bufhead BUFHEAD;
struct _bufhead {
- BUFHEAD *prev; /* LRU links */
- BUFHEAD *next; /* LRU links */
- BUFHEAD *ovfl; /* Overflow page buffer header */
- u_int32_t addr; /* Address of this page */
- char *page; /* Actual page data */
- char flags;
+ BUFHEAD *prev; /* LRU links */
+ BUFHEAD *next; /* LRU links */
+ BUFHEAD *ovfl; /* Overflow page buffer header */
+ u_int addr; /* Address of this page */
+ char *page; /* Actual page data */
+ char flags;
#define BUF_MOD 0x0001
#define BUF_DISK 0x0002
#define BUF_BUCKET 0x0004
@@ -62,60 +62,51 @@ struct _bufhead {
typedef BUFHEAD **SEGMENT;
/* Hash Table Information */
-typedef struct hashhdr { /* Disk resident portion */
- int magic; /* Magic NO for hash tables */
- int version; /* Version ID */
- u_int32_t lorder; /* Byte Order */
- int bsize; /* Bucket/Page Size */
- int bshift; /* Bucket shift */
- int dsize; /* Directory Size */
- int ssize; /* Segment Size */
- int sshift; /* Segment shift */
- int ovfl_point; /* Where overflow pages are being
- * allocated */
- int last_freed; /* Last overflow page freed */
- int max_bucket; /* ID of Maximum bucket in use */
- int high_mask; /* Mask to modulo into entire table */
- int low_mask; /* Mask to modulo into lower half of
- * table */
- int ffactor; /* Fill factor */
- int nkeys; /* Number of keys in hash table */
- int hdrpages; /* Size of table header */
- int h_charkey; /* value of hash(CHARKEY) */
-#define NCACHED 32 /* number of bit maps and spare
- * points */
- int spares[NCACHED];/* spare pages for overflow */
- u_int16_t bitmaps[NCACHED]; /* address of overflow page
- * bitmaps */
+typedef struct hashhdr { /* Disk resident portion */
+ int magic; /* Magic NO for hash tables */
+ int version; /* Version ID */
+ long lorder; /* Byte Order */
+ int bsize; /* Bucket/Page Size */
+ int bshift; /* Bucket shift */
+ int dsize; /* Directory Size */
+ int ssize; /* Segment Size */
+ int sshift; /* Segment shift */
+ int ovfl_point; /* Where overflow pages are being allocated */
+ int last_freed; /* Last overflow page freed */
+ int max_bucket; /* ID of Maximum bucket in use */
+ int high_mask; /* Mask to modulo into entire table */
+ int low_mask; /* Mask to modulo into lower half of table */
+ int ffactor; /* Fill factor */
+ int nkeys; /* Number of keys in hash table */
+ int hdrpages; /* Size of table header */
+ int h_charkey; /* value of hash(CHARKEY) */
+#define NCACHED 32 /* number of bit maps and spare points */
+ int spares[NCACHED];/* spare pages for overflow */
+ u_short bitmaps[NCACHED]; /* address of overflow page bitmaps */
} HASHHDR;
-typedef struct htab { /* Memory resident data structure */
- HASHHDR hdr; /* Header */
- int nsegs; /* Number of allocated segments */
- int exsegs; /* Number of extra allocated
- * segments */
- u_int32_t /* Hash function */
+typedef struct htab { /* Memory resident data structure */
+ HASHHDR hdr; /* Header */
+ int nsegs; /* Number of allocated segments */
+ int exsegs; /* Number of extra allocated segments */
+ u_int32_t /* Hash function */
(*hash)__P((const void *, size_t));
- int flags; /* Flag values */
- int fp; /* File pointer */
- char *tmp_buf; /* Temporary Buffer for BIG data */
- char *tmp_key; /* Temporary Buffer for BIG keys */
- BUFHEAD *cpage; /* Current page */
- int cbucket; /* Current bucket */
- int cndx; /* Index of next item on cpage */
- int error; /* Error Number -- for DBM
- * compatability */
- int new_file; /* Indicates if fd is backing store
- * or no */
- int save_file; /* Indicates whether we need to flush
- * file at
- * exit */
- u_int32_t *mapp[NCACHED]; /* Pointers to page maps */
- int nmaps; /* Initial number of bitmaps */
- int nbufs; /* Number of buffers left to
- * allocate */
- BUFHEAD bufhead; /* Header of buffer lru list */
- SEGMENT *dir; /* Hash Bucket directory */
+ int flags; /* Flag values */
+ int fp; /* File pointer */
+ char *tmp_buf; /* Temporary Buffer for BIG data */
+ char *tmp_key; /* Temporary Buffer for BIG keys */
+ BUFHEAD *cpage; /* Current page */
+ int cbucket; /* Current bucket */
+ int cndx; /* Index of next item on cpage */
+ int errno; /* Error Number -- for DBM compatability */
+ int new_file; /* Indicates if fd is backing store or no */
+ int save_file; /* Indicates whether we need to flush file at
+ * exit */
+ u_long *mapp[NCACHED]; /* Pointers to page maps */
+ int nmaps; /* Initial number of bitmaps */
+ int nbufs; /* Number of buffers left to allocate */
+ BUFHEAD bufhead; /* Header of buffer lru list */
+ SEGMENT *dir; /* Hash Bucket directory */
} HTAB;
/*
@@ -138,14 +129,14 @@ typedef struct htab { /* Memory resident data structure */
#define BYTE_SHIFT 3
#define INT_TO_BYTE 2
#define INT_BYTE_SHIFT 5
-#define ALL_SET ((u_int32_t)0xFFFFFFFF)
+#define ALL_SET ((u_int)0xFFFFFFFF)
#define ALL_CLEAR 0
-#define PTROF(X) ((BUFHEAD *)((ptrdiff_t)(X)&~0x3))
-#define ISMOD(X) ((u_int32_t)(ptrdiff_t)(X)&0x1)
-#define DOMOD(X) ((X) = (char *)((ptrdiff_t)(X)|0x1))
-#define ISDISK(X) ((u_int32_t)(ptrdiff_t)(X)&0x2)
-#define DODISK(X) ((X) = (char *)((ptrdiff_t)(X)|0x2))
+#define PTROF(X) ((BUFHEAD *)((u_int)(X)&~0x3))
+#define ISMOD(X) ((u_int)(X)&0x1)
+#define DOMOD(X) ((X) = (char *)((u_int)(X)|0x1))
+#define ISDISK(X) ((u_int)(X)&0x2)
+#define DODISK(X) ((X) = (char *)((u_int)(X)|0x2))
#define BITS_PER_MAP 32
@@ -165,9 +156,9 @@ typedef struct htab { /* Memory resident data structure */
#define SPLITSHIFT 11
#define SPLITMASK 0x7FF
-#define SPLITNUM(N) (((u_int32_t)(N)) >> SPLITSHIFT)
+#define SPLITNUM(N) (((u_int)(N)) >> SPLITSHIFT)
#define OPAGENUM(N) ((N) & SPLITMASK)
-#define OADDR_OF(S,O) ((u_int32_t)((u_int32_t)(S) << SPLITSHIFT) + (O))
+#define OADDR_OF(S,O) ((u_int)((u_int)(S) << SPLITSHIFT) + (O))
#define BUCKET_TO_PAGE(B) \
(B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((B)+1)-1] : 0)
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c
index 578314a6455e..b747fbce69f1 100644
--- a/lib/libc/db/hash/hash_bigkey.c
+++ b/lib/libc/db/hash/hash_bigkey.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94";
+static char sccsid[] = "@(#)hash_bigkey.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
/*
@@ -90,13 +90,13 @@ __big_insert(hashp, bufp, key, val)
BUFHEAD *bufp;
const DBT *key, *val;
{
- register u_int16_t *p;
+ register u_short *p;
int key_size, n, val_size;
- u_int16_t space, move_bytes, off;
+ u_short space, move_bytes, off;
char *cp, *key_data, *val_data;
cp = bufp->page; /* Character pointer of p. */
- p = (u_int16_t *)cp;
+ p = (u_short *)cp;
key_data = (char *)key->data;
key_size = key->size;
@@ -134,7 +134,7 @@ __big_insert(hashp, bufp, key, val)
OFFSET(p) = off;
} else
p[n - 2] = FULL_KEY;
- p = (u_int16_t *)bufp->page;
+ p = (u_short *)bufp->page;
cp = bufp->page;
bufp->flags |= BUF_MOD;
}
@@ -164,7 +164,7 @@ __big_insert(hashp, bufp, key, val)
if (!bufp)
return (-1);
cp = bufp->page;
- p = (u_int16_t *)cp;
+ p = (u_short *)cp;
} else
p[n] = FULL_KEY_DATA;
bufp->flags |= BUF_MOD;
@@ -189,12 +189,12 @@ __big_delete(hashp, bufp)
BUFHEAD *bufp;
{
register BUFHEAD *last_bfp, *rbufp;
- u_int16_t *bp, pageno;
+ u_short *bp, pageno;
int key_done, n;
rbufp = bufp;
last_bfp = NULL;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
pageno = 0;
key_done = 0;
@@ -217,7 +217,7 @@ __big_delete(hashp, bufp)
last_bfp = rbufp;
if (!rbufp)
return (-1); /* Error. */
- bp = (u_int16_t *)rbufp->page;
+ bp = (u_short *)rbufp->page;
}
/*
@@ -232,7 +232,7 @@ __big_delete(hashp, bufp)
pageno = bp[n - 1];
/* Now, bp is the first page of the pair. */
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
if (n > 2) {
/* There is an overflow page. */
bp[1] = pageno;
@@ -270,13 +270,13 @@ __find_bigpair(hashp, bufp, ndx, key, size)
char *key;
int size;
{
- register u_int16_t *bp;
+ register u_short *bp;
register char *p;
int ksize;
- u_int16_t bytes;
+ u_short bytes;
char *kkey;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
p = bufp->page;
ksize = size;
kkey = key;
@@ -292,7 +292,7 @@ __find_bigpair(hashp, bufp, ndx, key, size)
if (!bufp)
return (-3);
p = bufp->page;
- bp = (u_int16_t *)p;
+ bp = (u_short *)p;
ndx = 1;
}
@@ -314,17 +314,17 @@ __find_bigpair(hashp, bufp, ndx, key, size)
* of the pair; 0 if there isn't any (i.e. big pair is the last key in the
* bucket)
*/
-extern u_int16_t
+extern u_short
__find_last_page(hashp, bpp)
HTAB *hashp;
BUFHEAD **bpp;
{
BUFHEAD *bufp;
- u_int16_t *bp, pageno;
+ u_short *bp, pageno;
int n;
bufp = *bpp;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
for (;;) {
n = bp[0];
@@ -341,7 +341,7 @@ __find_last_page(hashp, bpp)
bufp = __get_buf(hashp, pageno, bufp, 0);
if (!bufp)
return (0); /* Need to indicate an error! */
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
}
*bpp = bufp;
@@ -364,15 +364,15 @@ __big_return(hashp, bufp, ndx, val, set_current)
int set_current;
{
BUFHEAD *save_p;
- u_int16_t *bp, len, off, save_addr;
+ u_short *bp, len, off, save_addr;
char *tp;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
while (bp[ndx + 1] == PARTIAL_KEY) {
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
ndx = 1;
}
@@ -380,7 +380,7 @@ __big_return(hashp, bufp, ndx, val, set_current)
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
save_p = bufp;
save_addr = save_p->addr;
off = bp[1];
@@ -401,7 +401,7 @@ __big_return(hashp, bufp, ndx, val, set_current)
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
} else {
/* The data is all on one page. */
tp = (char *)bp;
@@ -420,7 +420,7 @@ __big_return(hashp, bufp, ndx, val, set_current)
if (!hashp->cpage)
return (-1);
hashp->cndx = 1;
- if (!((u_int16_t *)
+ if (!((u_short *)
hashp->cpage->page)[0]) {
hashp->cbucket++;
hashp->cpage = NULL;
@@ -452,14 +452,14 @@ collect_data(hashp, bufp, len, set)
BUFHEAD *bufp;
int len, set;
{
- register u_int16_t *bp;
+ register u_short *bp;
register char *p;
BUFHEAD *xbp;
- u_int16_t save_addr;
+ u_short save_addr;
int mylen, totlen;
p = bufp->page;
- bp = (u_int16_t *)p;
+ bp = (u_short *)p;
mylen = hashp->BSIZE - bp[1];
save_addr = bufp->addr;
@@ -479,7 +479,7 @@ collect_data(hashp, bufp, len, set)
__get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!hashp->cpage)
return (-1);
- else if (!((u_int16_t *)hashp->cpage->page)[0]) {
+ else if (!((u_short *)hashp->cpage->page)[0]) {
hashp->cbucket++;
hashp->cpage = NULL;
}
@@ -531,10 +531,10 @@ collect_key(hashp, bufp, len, val, set)
BUFHEAD *xbp;
char *p;
int mylen, totlen;
- u_int16_t *bp, save_addr;
+ u_short *bp, save_addr;
p = bufp->page;
- bp = (u_int16_t *)p;
+ bp = (u_short *)p;
mylen = hashp->BSIZE - bp[1];
save_addr = bufp->addr;
@@ -573,15 +573,15 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret)
/* Pointer to first page containing the big key/data */
BUFHEAD *big_keyp;
int addr; /* Address of big_keyp */
- u_int32_t obucket;/* Old Bucket */
+ u_int obucket;/* Old Bucket */
SPLIT_RETURN *ret;
{
register BUFHEAD *tmpp;
- register u_int16_t *tp;
+ register u_short *tp;
BUFHEAD *bp;
DBT key, val;
- u_int32_t change;
- u_int16_t free_space, n, off;
+ u_int change;
+ u_short free_space, n, off;
bp = big_keyp;
@@ -613,14 +613,14 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret)
(tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
#endif
tmpp->ovfl = bp; /* one of op/np point to big_keyp */
- tp = (u_int16_t *)tmpp->page;
+ tp = (u_short *)tmpp->page;
#ifdef DEBUG
assert(FREESPACE(tp) >= OVFLSIZE);
#endif
n = tp[0];
off = OFFSET(tp);
free_space = FREESPACE(tp);
- tp[++n] = (u_int16_t)addr;
+ tp[++n] = (u_short)addr;
tp[++n] = OVFLPAGE;
tp[0] = n;
OFFSET(tp) = off;
@@ -636,7 +636,7 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret)
ret->newp = np;
ret->oldp = op;
- tp = (u_int16_t *)big_keyp->page;
+ tp = (u_short *)big_keyp->page;
big_keyp->flags |= BUF_MOD;
if (tp[0] > 2) {
/*
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index 92e1f933adb2..1362c83e1a3d 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
+static char sccsid[] = "@(#)hash_buf.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,10 +57,8 @@ static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
#include <sys/param.h>
#include <errno.h>
-#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-
#ifdef DEBUG
#include <assert.h>
#endif
@@ -70,7 +68,7 @@ static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
#include "page.h"
#include "extern.h"
-static BUFHEAD *newbuf __P((HTAB *, u_int32_t, BUFHEAD *));
+static BUFHEAD *newbuf __P((HTAB *, u_int, BUFHEAD *));
/* Unlink B from its place in the lru */
#define BUF_REMOVE(B) { \
@@ -104,12 +102,12 @@ static BUFHEAD *newbuf __P((HTAB *, u_int32_t, BUFHEAD *));
extern BUFHEAD *
__get_buf(hashp, addr, prev_bp, newpage)
HTAB *hashp;
- u_int32_t addr;
+ u_int addr;
BUFHEAD *prev_bp;
int newpage; /* If prev_bp set, indicates a new overflow page. */
{
register BUFHEAD *bp;
- register u_int32_t is_disk_mask;
+ register u_int is_disk_mask;
register int is_disk, segment_ndx;
SEGMENT segp;
@@ -142,7 +140,7 @@ __get_buf(hashp, addr, prev_bp, newpage)
return (NULL);
if (!prev_bp)
segp[segment_ndx] =
- (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
+ (BUFHEAD *)((u_int)bp | is_disk_mask);
} else {
BUF_REMOVE(bp);
MRU_INSERT(bp);
@@ -159,7 +157,7 @@ __get_buf(hashp, addr, prev_bp, newpage)
static BUFHEAD *
newbuf(hashp, addr, prev_bp)
HTAB *hashp;
- u_int32_t addr;
+ u_int addr;
BUFHEAD *prev_bp;
{
register BUFHEAD *bp; /* The buffer we're going to use */
@@ -167,7 +165,7 @@ newbuf(hashp, addr, prev_bp)
register BUFHEAD *next_xbp;
SEGMENT segp;
int segment_ndx;
- u_int16_t oaddr, *shortp;
+ u_short oaddr, *shortp;
oaddr = 0;
bp = LRU;
@@ -179,16 +177,10 @@ newbuf(hashp, addr, prev_bp)
/* Allocate a new one */
if ((bp = (BUFHEAD *)malloc(sizeof(BUFHEAD))) == NULL)
return (NULL);
-#ifdef PURIFY
- memset(bp, 0xff, sizeof(BUFHEAD));
-#endif
if ((bp->page = (char *)malloc(hashp->BSIZE)) == NULL) {
free(bp);
return (NULL);
}
-#ifdef PURIFY
- memset(bp->page, 0xff, hashp->BSIZE);
-#endif
if (hashp->nbufs)
hashp->nbufs--;
} else {
@@ -203,7 +195,7 @@ newbuf(hashp, addr, prev_bp)
* Set oaddr before __put_page so that you get it
* before bytes are swapped.
*/
- shortp = (u_int16_t *)bp->page;
+ shortp = (u_short *)bp->page;
if (shortp[0])
oaddr = shortp[shortp[0] - 1];
if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
@@ -246,7 +238,7 @@ newbuf(hashp, addr, prev_bp)
(oaddr != xbp->addr))
break;
- shortp = (u_int16_t *)xbp->page;
+ shortp = (u_short *)xbp->page;
if (shortp[0])
/* set before __put_page */
oaddr = shortp[shortp[0] - 1];
diff --git a/lib/libc/db/hash/hash_log2.c b/lib/libc/db/hash/hash_log2.c
index c8c56bff2dcc..b773707ebae2 100644
--- a/lib/libc/db/hash/hash_log2.c
+++ b/lib/libc/db/hash/hash_log2.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,18 +35,16 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94";
+static char sccsid[] = "@(#)hash_log2.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
-#include <db.h>
-
-u_int32_t
+u_int
__log2(num)
- u_int32_t num;
+ u_int num;
{
- register u_int32_t i, limit;
+ register u_int i, limit;
limit = 1;
for (i = 0; limit < num; limit = limit << 1, i++);
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c
index 2c050909f212..7b018cbea45c 100644
--- a/lib/libc/db/hash/hash_page.c
+++ b/lib/libc/db/hash/hash_page.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
+static char sccsid[] = "@(#)hash_page.c 8.4 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
/*
@@ -72,19 +72,19 @@ static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
#include "page.h"
#include "extern.h"
-static u_int32_t *fetch_bitmap __P((HTAB *, int));
-static u_int32_t first_free __P((u_int32_t));
+static u_long *fetch_bitmap __P((HTAB *, int));
+static u_long first_free __P((u_long));
static int open_temp __P((HTAB *));
-static u_int16_t overflow_page __P((HTAB *));
+static u_short overflow_page __P((HTAB *));
static void putpair __P((char *, const DBT *, const DBT *));
-static void squeeze_key __P((u_int16_t *, const DBT *, const DBT *));
+static void squeeze_key __P((u_short *, const DBT *, const DBT *));
static int ugly_split
- __P((HTAB *, u_int32_t, BUFHEAD *, BUFHEAD *, int, int));
+ __P((HTAB *, u_int, BUFHEAD *, BUFHEAD *, int, int));
#define PAGE_INIT(P) { \
- ((u_int16_t *)(P))[0] = 0; \
- ((u_int16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(u_int16_t); \
- ((u_int16_t *)(P))[2] = hashp->BSIZE; \
+ ((u_short *)(P))[0] = 0; \
+ ((u_short *)(P))[1] = hashp->BSIZE - 3 * sizeof(u_short); \
+ ((u_short *)(P))[2] = hashp->BSIZE; \
}
/*
@@ -97,9 +97,9 @@ putpair(p, key, val)
char *p;
const DBT *key, *val;
{
- register u_int16_t *bp, n, off;
+ register u_short *bp, n, off;
- bp = (u_int16_t *)p;
+ bp = (u_short *)p;
/* Enter the key first. */
n = bp[0];
@@ -115,7 +115,7 @@ putpair(p, key, val)
/* Adjust page info. */
bp[0] = n;
- bp[n + 1] = off - ((n + 3) * sizeof(u_int16_t));
+ bp[n + 1] = off - ((n + 3) * sizeof(u_short));
bp[n + 2] = off;
}
@@ -130,11 +130,11 @@ __delpair(hashp, bufp, ndx)
BUFHEAD *bufp;
register int ndx;
{
- register u_int16_t *bp, newoff;
+ register u_short *bp, newoff;
register int n;
- u_int16_t pairlen;
+ u_short pairlen;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
n = bp[0];
if (bp[ndx + 1] < REAL_KEY)
@@ -165,7 +165,7 @@ __delpair(hashp, bufp, ndx)
}
/* Finally adjust the page data */
bp[n] = OFFSET(bp) + pairlen;
- bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(u_int16_t);
+ bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(u_short);
bp[0] = n - 2;
hashp->NKEYS--;
@@ -180,18 +180,18 @@ __delpair(hashp, bufp, ndx)
extern int
__split_page(hashp, obucket, nbucket)
HTAB *hashp;
- u_int32_t obucket, nbucket;
+ u_int obucket, nbucket;
{
register BUFHEAD *new_bufp, *old_bufp;
- register u_int16_t *ino;
+ register u_short *ino;
register char *np;
DBT key, val;
int n, ndx, retval;
- u_int16_t copyto, diff, off, moved;
+ u_short copyto, diff, off, moved;
char *op;
- copyto = (u_int16_t)hashp->BSIZE;
- off = (u_int16_t)hashp->BSIZE;
+ copyto = (u_short)hashp->BSIZE;
+ off = (u_short)hashp->BSIZE;
old_bufp = __get_buf(hashp, obucket, NULL, 0);
if (old_bufp == NULL)
return (-1);
@@ -202,7 +202,7 @@ __split_page(hashp, obucket, nbucket)
old_bufp->flags |= (BUF_MOD | BUF_PIN);
new_bufp->flags |= (BUF_MOD | BUF_PIN);
- ino = (u_int16_t *)(op = old_bufp->page);
+ ino = (u_short *)(op = old_bufp->page);
np = new_bufp->page;
moved = 0;
@@ -244,13 +244,13 @@ __split_page(hashp, obucket, nbucket)
/* Now clean up the page */
ino[0] -= moved;
- FREESPACE(ino) = copyto - sizeof(u_int16_t) * (ino[0] + 3);
+ FREESPACE(ino) = copyto - sizeof(u_short) * (ino[0] + 3);
OFFSET(ino) = copyto;
#ifdef DEBUG3
(void)fprintf(stderr, "split %d/%d\n",
- ((u_int16_t *)np)[0] / 2,
- ((u_int16_t *)op)[0] / 2);
+ ((u_short *)np)[0] / 2,
+ ((u_short *)op)[0] / 2);
#endif
/* unpin both pages */
old_bufp->flags &= ~BUF_PIN;
@@ -276,28 +276,28 @@ __split_page(hashp, obucket, nbucket)
static int
ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved)
HTAB *hashp;
- u_int32_t obucket; /* Same as __split_page. */
+ u_int obucket; /* Same as __split_page. */
BUFHEAD *old_bufp, *new_bufp;
int copyto; /* First byte on page which contains key/data values. */
int moved; /* Number of pairs moved to new page. */
{
register BUFHEAD *bufp; /* Buffer header for ino */
- register u_int16_t *ino; /* Page keys come off of */
- register u_int16_t *np; /* New page */
- register u_int16_t *op; /* Page keys go on to if they aren't moving */
+ register u_short *ino; /* Page keys come off of */
+ register u_short *np; /* New page */
+ register u_short *op; /* Page keys go on to if they aren't moving */
BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */
DBT key, val;
SPLIT_RETURN ret;
- u_int16_t n, off, ov_addr, scopyto;
+ u_short n, off, ov_addr, scopyto;
char *cino; /* Character value of ino */
bufp = old_bufp;
- ino = (u_int16_t *)old_bufp->page;
- np = (u_int16_t *)new_bufp->page;
- op = (u_int16_t *)old_bufp->page;
+ ino = (u_short *)old_bufp->page;
+ np = (u_short *)new_bufp->page;
+ op = (u_short *)old_bufp->page;
last_bfp = NULL;
- scopyto = (u_int16_t)copyto; /* ANSI */
+ scopyto = (u_short)copyto; /* ANSI */
n = ino[0] - 1;
while (n < ino[0]) {
@@ -308,16 +308,16 @@ ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved)
old_bufp = ret.oldp;
if (!old_bufp)
return (-1);
- op = (u_int16_t *)old_bufp->page;
+ op = (u_short *)old_bufp->page;
new_bufp = ret.newp;
if (!new_bufp)
return (-1);
- np = (u_int16_t *)new_bufp->page;
+ np = (u_short *)new_bufp->page;
bufp = ret.nextp;
if (!bufp)
return (0);
cino = (char *)bufp->page;
- ino = (u_int16_t *)cino;
+ ino = (u_short *)cino;
last_bfp = ret.nextp;
} else if (ino[n + 1] == OVFLPAGE) {
ov_addr = ino[n];
@@ -327,14 +327,14 @@ ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved)
*/
ino[0] -= (moved + 2);
FREESPACE(ino) =
- scopyto - sizeof(u_int16_t) * (ino[0] + 3);
+ scopyto - sizeof(u_short) * (ino[0] + 3);
OFFSET(ino) = scopyto;
bufp = __get_buf(hashp, ov_addr, bufp, 0);
if (!bufp)
return (-1);
- ino = (u_int16_t *)bufp->page;
+ ino = (u_short *)bufp->page;
n = 1;
scopyto = hashp->BSIZE;
moved = 0;
@@ -362,7 +362,7 @@ ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved)
__add_ovflpage(hashp, old_bufp);
if (!old_bufp)
return (-1);
- op = (u_int16_t *)old_bufp->page;
+ op = (u_short *)old_bufp->page;
putpair((char *)op, &key, &val);
}
old_bufp->flags |= BUF_MOD;
@@ -375,7 +375,7 @@ ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved)
__add_ovflpage(hashp, new_bufp);
if (!new_bufp)
return (-1);
- np = (u_int16_t *)new_bufp->page;
+ np = (u_short *)new_bufp->page;
putpair((char *)np, &key, &val);
}
new_bufp->flags |= BUF_MOD;
@@ -400,10 +400,10 @@ __addel(hashp, bufp, key, val)
BUFHEAD *bufp;
const DBT *key, *val;
{
- register u_int16_t *bp, *sop;
+ register u_short *bp, *sop;
int do_expand;
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
do_expand = 0;
while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
/* Exception case */
@@ -415,7 +415,7 @@ __addel(hashp, bufp, key, val)
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
} else
/* Try to squeeze key on this page */
if (FREESPACE(bp) > PAIRSIZE(key, val)) {
@@ -425,7 +425,7 @@ __addel(hashp, bufp, key, val)
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
- bp = (u_int16_t *)bufp->page;
+ bp = (u_short *)bufp->page;
}
if (PAIRFITS(bp, key, val))
@@ -435,7 +435,7 @@ __addel(hashp, bufp, key, val)
bufp = __add_ovflpage(hashp, bufp);
if (!bufp)
return (-1);
- sop = (u_int16_t *)bufp->page;
+ sop = (u_short *)bufp->page;
if (PAIRFITS(sop, key, val))
putpair((char *)sop, key, val);
@@ -466,12 +466,12 @@ __add_ovflpage(hashp, bufp)
HTAB *hashp;
BUFHEAD *bufp;
{
- register u_int16_t *sp;
- u_int16_t ndx, ovfl_num;
+ register u_short *sp;
+ u_short ndx, ovfl_num;
#ifdef DEBUG1
int tmp1, tmp2;
#endif
- sp = (u_int16_t *)bufp->page;
+ sp = (u_short *)bufp->page;
/* Check if we are dynamically determining the fill factor */
if (hashp->FFACTOR == DEF_FFACTOR) {
@@ -518,12 +518,12 @@ extern int
__get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap)
HTAB *hashp;
char *p;
- u_int32_t bucket;
+ u_int bucket;
int is_bucket, is_disk, is_bitmap;
{
register int fd, page, size;
int rsize;
- u_int16_t *bp;
+ u_short *bp;
fd = hashp->fp;
size = hashp->BSIZE;
@@ -539,7 +539,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap)
if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
((rsize = read(fd, p, size)) == -1))
return (-1);
- bp = (u_int16_t *)p;
+ bp = (u_short *)p;
if (!rsize)
bp[0] = 0; /* We hit the EOF, so initialize a new page */
else
@@ -556,7 +556,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap)
if (is_bitmap) {
max = hashp->BSIZE >> 2; /* divide by 4 */
for (i = 0; i < max; i++)
- M_32_SWAP(((int *)p)[i]);
+ M_32_SWAP(((long *)p)[i]);
} else {
M_16_SWAP(bp[0]);
max = bp[0] + 2;
@@ -578,7 +578,7 @@ extern int
__put_page(hashp, p, bucket, is_bucket, is_bitmap)
HTAB *hashp;
char *p;
- u_int32_t bucket;
+ u_int bucket;
int is_bucket, is_bitmap;
{
register int fd, page, size;
@@ -596,11 +596,11 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap)
if (is_bitmap) {
max = hashp->BSIZE >> 2; /* divide by 4 */
for (i = 0; i < max; i++)
- M_32_SWAP(((int *)p)[i]);
+ M_32_SWAP(((long *)p)[i]);
} else {
- max = ((u_int16_t *)p)[0] + 2;
+ max = ((u_short *)p)[0] + 2;
for (i = 0; i <= max; i++)
- M_16_SWAP(((u_int16_t *)p)[i]);
+ M_16_SWAP(((u_short *)p)[i]);
}
}
if (is_bucket)
@@ -624,14 +624,14 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap)
* once they are read in.
*/
extern int
-__ibitmap(hashp, pnum, nbits, ndx)
+__init_bitmap(hashp, pnum, nbits, ndx)
HTAB *hashp;
int pnum, nbits, ndx;
{
- u_int32_t *ip;
+ u_long *ip;
int clearbytes, clearints;
- if ((ip = (u_int32_t *)malloc(hashp->BSIZE)) == NULL)
+ if ((ip = (u_long *)malloc(hashp->BSIZE)) == NULL)
return (1);
hashp->nmaps++;
clearints = ((nbits - 1) >> INT_BYTE_SHIFT) + 1;
@@ -641,16 +641,16 @@ __ibitmap(hashp, pnum, nbits, ndx)
hashp->BSIZE - clearbytes);
ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
SETBIT(ip, 0);
- hashp->BITMAPS[ndx] = (u_int16_t)pnum;
+ hashp->BITMAPS[ndx] = (u_short)pnum;
hashp->mapp[ndx] = ip;
return (0);
}
-static u_int32_t
+static u_long
first_free(map)
- u_int32_t map;
+ u_long map;
{
- register u_int32_t i, mask;
+ register u_long i, mask;
mask = 0x1;
for (i = 0; i < BITS_PER_MAP; i++) {
@@ -661,13 +661,13 @@ first_free(map)
return (i);
}
-static u_int16_t
+static u_short
overflow_page(hashp)
HTAB *hashp;
{
- register u_int32_t *freep;
+ register u_long *freep;
register int max_free, offset, splitnum;
- u_int16_t addr;
+ u_short addr;
int bit, first_page, free_bit, free_page, i, in_use_bits, j;
#ifdef DEBUG2
int tmp1, tmp2;
@@ -681,9 +681,9 @@ overflow_page(hashp)
/* Look through all the free maps to find the first free block */
first_page = hashp->LAST_FREED >>(hashp->BSHIFT + BYTE_SHIFT);
for ( i = first_page; i <= free_page; i++ ) {
- if (!(freep = (u_int32_t *)hashp->mapp[i]) &&
+ if (!(freep = (u_long *)hashp->mapp[i]) &&
!(freep = fetch_bitmap(hashp, i)))
- return (0);
+ return (NULL);
if (i == free_page)
in_use_bits = free_bit;
else
@@ -713,7 +713,7 @@ overflow_page(hashp)
if (offset > SPLITMASK) {
if (++splitnum >= NCACHED) {
(void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
- return (0);
+ return (NULL);
}
hashp->OVFL_POINT = splitnum;
hashp->SPARES[splitnum] = hashp->SPARES[splitnum-1];
@@ -726,7 +726,7 @@ overflow_page(hashp)
free_page++;
if (free_page >= NCACHED) {
(void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
- return (0);
+ return (NULL);
}
/*
* This is tricky. The 1 indicates that you want the new page
@@ -739,9 +739,9 @@ overflow_page(hashp)
* don't have to if we tell init_bitmap not to leave it clear
* in the first place.
*/
- if (__ibitmap(hashp,
- (int)OADDR_OF(splitnum, offset), 1, free_page))
- return (0);
+ if (__init_bitmap(hashp, (int)OADDR_OF(splitnum, offset),
+ 1, free_page))
+ return (NULL);
hashp->SPARES[splitnum]++;
#ifdef DEBUG2
free_bit = 2;
@@ -751,7 +751,7 @@ overflow_page(hashp)
if (++splitnum >= NCACHED) {
(void)write(STDERR_FILENO, OVMSG,
sizeof(OVMSG) - 1);
- return (0);
+ return (NULL);
}
hashp->OVFL_POINT = splitnum;
hashp->SPARES[splitnum] = hashp->SPARES[splitnum-1];
@@ -795,7 +795,7 @@ found:
for (i = 0; (i < splitnum) && (bit > hashp->SPARES[i]); i++);
offset = (i ? bit - hashp->SPARES[i - 1] : bit);
if (offset >= SPLITMASK)
- return (0); /* Out of overflow pages */
+ return (NULL); /* Out of overflow pages */
addr = OADDR_OF(i, offset);
#ifdef DEBUG2
(void)fprintf(stderr, "OVERFLOW_PAGE: ADDR: %d BIT: %d PAGE %d\n",
@@ -814,16 +814,16 @@ __free_ovflpage(hashp, obufp)
HTAB *hashp;
BUFHEAD *obufp;
{
- register u_int16_t addr;
- u_int32_t *freep;
+ register u_short addr;
+ u_long *freep;
int bit_address, free_page, free_bit;
- u_int16_t ndx;
+ u_short ndx;
addr = obufp->addr;
#ifdef DEBUG1
(void)fprintf(stderr, "Freeing %d\n", addr);
#endif
- ndx = (((u_int16_t)addr) >> SPLITSHIFT);
+ ndx = (((u_short)addr) >> SPLITSHIFT);
bit_address =
(ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
if (bit_address < hashp->LAST_FREED)
@@ -879,11 +879,11 @@ open_temp(hashp)
*/
static void
squeeze_key(sp, key, val)
- u_int16_t *sp;
+ u_short *sp;
const DBT *key, *val;
{
register char *p;
- u_int16_t free_space, n, off, pageno;
+ u_short free_space, n, off, pageno;
p = (char *)sp;
n = sp[0];
@@ -904,14 +904,14 @@ squeeze_key(sp, key, val)
OFFSET(sp) = off;
}
-static u_int32_t *
+static u_long *
fetch_bitmap(hashp, ndx)
HTAB *hashp;
int ndx;
{
if (ndx >= hashp->nmaps)
return (NULL);
- if ((hashp->mapp[ndx] = (u_int32_t *)malloc(hashp->BSIZE)) == NULL)
+ if ((hashp->mapp[ndx] = (u_long *)malloc(hashp->BSIZE)) == NULL)
return (NULL);
if (__get_page(hashp,
(char *)hashp->mapp[ndx], hashp->BITMAPS[ndx], 0, 1, 1)) {
diff --git a/lib/libc/db/hash/hsearch.c b/lib/libc/db/hash/hsearch.c
index cc8f7a4aad1f..e4914b1bb077 100644
--- a/lib/libc/db/hash/hsearch.c
+++ b/lib/libc/db/hash/hsearch.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hsearch.c 8.4 (Berkeley) 7/21/94";
+static char sccsid[] = "@(#)hsearch.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -58,7 +58,7 @@ hcreate(nel)
info.nelem = nel;
info.bsize = 256;
info.ffactor = 8;
- info.cachesize = 0;
+ info.cachesize = NULL;
info.hash = NULL;
info.lorder = 0;
dbp = (DB *)__hash_open(NULL, O_CREAT | O_RDWR, 0600, &info, 0);
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 28adce4f9435..89b9916566b2 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94";
+static char sccsid[] = "@(#)ndbm.c 8.2 (Berkeley) 9/11/93";
#endif /* LIBC_SCCS and not lint */
/*
@@ -45,10 +45,10 @@ static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94";
#include <sys/param.h>
+#include <ndbm.h>
#include <stdio.h>
#include <string.h>
-#include <ndbm.h>
#include "hash.h"
/*
@@ -67,7 +67,7 @@ dbm_open(file, flags, mode)
info.bsize = 4096;
info.ffactor = 40;
info.nelem = 1;
- info.cachesize = 0;
+ info.cachesize = NULL;
info.hash = NULL;
info.lorder = 0;
(void)strcpy(path, file);
@@ -180,7 +180,7 @@ dbm_error(db)
HTAB *hp;
hp = (HTAB *)db->internal;
- return (hp->error);
+ return (hp->errno);
}
extern int
@@ -190,7 +190,7 @@ dbm_clearerr(db)
HTAB *hp;
hp = (HTAB *)db->internal;
- hp->error = 0;
+ hp->errno = 0;
return (0);
}
diff --git a/lib/libc/db/hash/page.h b/lib/libc/db/hash/page.h
index 0fc0d5a3e96d..dae82aebdd74 100644
--- a/lib/libc/db/hash/page.h
+++ b/lib/libc/db/hash/page.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)page.h 8.2 (Berkeley) 5/31/94
+ * @(#)page.h 8.1 (Berkeley) 6/6/93
*/
/*
@@ -73,20 +73,20 @@
* You might as well do this up front.
*/
-#define PAIRSIZE(K,D) (2*sizeof(u_int16_t) + (K)->size + (D)->size)
-#define BIGOVERHEAD (4*sizeof(u_int16_t))
-#define KEYSIZE(K) (4*sizeof(u_int16_t) + (K)->size);
-#define OVFLSIZE (2*sizeof(u_int16_t))
+#define PAIRSIZE(K,D) (2*sizeof(u_short) + (K)->size + (D)->size)
+#define BIGOVERHEAD (4*sizeof(u_short))
+#define KEYSIZE(K) (4*sizeof(u_short) + (K)->size);
+#define OVFLSIZE (2*sizeof(u_short))
#define FREESPACE(P) ((P)[(P)[0]+1])
#define OFFSET(P) ((P)[(P)[0]+2])
#define PAIRFITS(P,K,D) \
(((P)[2] >= REAL_KEY) && \
(PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
-#define PAGE_META(N) (((N)+3) * sizeof(u_int16_t))
+#define PAGE_META(N) (((N)+3) * sizeof(u_short))
typedef struct {
BUFHEAD *newp;
BUFHEAD *oldp;
BUFHEAD *nextp;
- u_int16_t next_addr;
+ u_short next_addr;
} SPLIT_RETURN;
diff --git a/lib/libc/db/man/btree.3 b/lib/libc/db/man/btree.3
index 8284b21aaeec..a51e1e562c3d 100644
--- a/lib/libc/db/man/btree.3
+++ b/lib/libc/db/man/btree.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)btree.3 8.4 (Berkeley) 8/18/94
+.\" @(#)btree.3 8.3 (Berkeley) 2/21/94
.\"
-.TH BTREE 3 "August 18, 1994"
+.TH BTREE 3 "February 21, 1994"
.\".UC 7
.SH NAME
btree \- btree database access method
@@ -207,13 +207,6 @@ O lg base N where base is the average fill factor.
Often, inserting ordered data into btrees results in a low fill factor.
This implementation has been modified to make ordered insertion the best
case, resulting in a much better than normal page fill factor.
-.SH ERRORS
-The
-.I btree
-access method routines may fail and set
-.I errno
-for any of the errors specified for the library routine
-.IR dbopen (3).
.SH "SEE ALSO"
.IR dbopen (3),
.IR hash (3),
diff --git a/lib/libc/db/man/hash.3 b/lib/libc/db/man/hash.3
index d408b5dcbca3..3ae00a20d80d 100644
--- a/lib/libc/db/man/hash.3
+++ b/lib/libc/db/man/hash.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)hash.3 8.6 (Berkeley) 8/18/94
+.\" @(#)hash.3 8.5 (Berkeley) 2/21/94
.\"
-.TH HASH 3 "August 18, 1994"
+.TH HASH 3 "February 21, 1994"
.UC 7
.SH NAME
hash \- hash database access method
@@ -131,19 +131,12 @@ If a hash function is specified,
will attempt to determine if the hash function specified is the same as
the one with which the database was created, and will fail if it is not.
.PP
-Backward compatible interfaces to the older
-.I dbm
+Backward compatible interfaces to the routines described in
+.IR dbm (3),
and
-.I ndbm
-routines are provided, however these interfaces are not compatible with
+.IR ndbm (3)
+are provided, however these interfaces are not compatible with
previous file formats.
-.SH ERRORS
-The
-.I hash
-access method routines may fail and set
-.I errno
-for any of the errors specified for the library routine
-.IR dbopen (3).
.SH "SEE ALSO"
.IR btree (3),
.IR dbopen (3),
diff --git a/lib/libc/db/man/recno.3 b/lib/libc/db/man/recno.3
index 516bef0a9007..a40e6c941a54 100644
--- a/lib/libc/db/man/recno.3
+++ b/lib/libc/db/man/recno.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)recno.3 8.5 (Berkeley) 8/18/94
+.\" @(#)recno.3 8.3 (Berkeley) 2/21/94
.\"
-.TH RECNO 3 "August 18, 1994"
+.TH RECNO 3 "February 21, 1994"
.UC 7
.SH NAME
recno \- record number database access method
@@ -97,9 +97,6 @@ The structure element
specifies the length of the record, and the structure element
.I bval
is used as the pad character.
-Any records, inserted into the database, that are less than
-.I reclen
-bytes long are automatically padded.
.TP
R_NOKEY
In the interface specified by
@@ -179,11 +176,6 @@ The
.I size
field of the key should be the size of that type.
.PP
-Because there can be no meta-data associated with the underlying
-recno access method files, any changes made to the default values
-(e.g. fixed record length or byte separator value) must be explicitly
-specified each time the file is opened.
-.PP
In the interface specified by
.IR dbopen ,
using the
@@ -191,23 +183,11 @@ using the
interface to create a new record will cause the creation of multiple,
empty records if the record number is more than one greater than the
largest record currently in the database.
-.SH ERRORS
-The
-.I recno
-access method routines may fail and set
-.I errno
-for any of the errors specified for the library routine
-.IR dbopen (3)
-or the following:
-.TP
-[EINVAL]
-An attempt was made to add a record to a fixed-length database that
-was too large to fit.
.SH "SEE ALSO"
-.IR btree (3)
.IR dbopen (3),
.IR hash (3),
.IR mpool (3),
+.IR recno (3)
.sp
.IR "Document Processing in a Relational Database System" ,
Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman,
diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c
index a61041e09160..562c7f5e98fc 100644
--- a/lib/libc/db/mpool/mpool.c
+++ b/lib/libc/db/mpool/mpool.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,11 +32,10 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
+static char sccsid[] = "@(#)mpool.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
-#include <sys/queue.h>
#include <sys/stat.h>
#include <errno.h>
@@ -46,21 +45,31 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#include <unistd.h>
#include <db.h>
-
#define __MPOOLINTERFACE_PRIVATE
-#include <mpool.h>
+#include "mpool.h"
static BKT *mpool_bkt __P((MPOOL *));
static BKT *mpool_look __P((MPOOL *, pgno_t));
static int mpool_write __P((MPOOL *, BKT *));
+#ifdef DEBUG
+static void __mpoolerr __P((const char *fmt, ...));
+#endif
/*
- * mpool_open --
- * Initialize a memory pool.
+ * MPOOL_OPEN -- initialize a memory pool.
+ *
+ * Parameters:
+ * key: Shared buffer key.
+ * fd: File descriptor.
+ * pagesize: File page size.
+ * maxcache: Max number of cached pages.
+ *
+ * Returns:
+ * MPOOL pointer, NULL on error.
*/
MPOOL *
mpool_open(key, fd, pagesize, maxcache)
- void *key;
+ DBT *key;
int fd;
pgno_t pagesize, maxcache;
{
@@ -68,35 +77,49 @@ mpool_open(key, fd, pagesize, maxcache)
MPOOL *mp;
int entry;
- /*
- * Get information about the file.
- *
- * XXX
- * We don't currently handle pipes, although we should.
- */
if (fstat(fd, &sb))
return (NULL);
+ /* XXX
+ * We should only set st_size to 0 for pipes -- 4.4BSD has the fix so
+ * that stat(2) returns true for ISSOCK on pipes. Until then, this is
+ * fairly close.
+ */
if (!S_ISREG(sb.st_mode)) {
errno = ESPIPE;
return (NULL);
}
- /* Allocate and initialize the MPOOL cookie. */
- if ((mp = (MPOOL *)calloc(1, sizeof(MPOOL))) == NULL)
+ if ((mp = (MPOOL *)malloc(sizeof(MPOOL))) == NULL)
return (NULL);
- CIRCLEQ_INIT(&mp->lqh);
+ mp->free.cnext = mp->free.cprev = (BKT *)&mp->free;
+ mp->lru.cnext = mp->lru.cprev = (BKT *)&mp->lru;
for (entry = 0; entry < HASHSIZE; ++entry)
- CIRCLEQ_INIT(&mp->hqh[entry]);
+ mp->hashtable[entry].hnext = mp->hashtable[entry].hprev =
+ mp->hashtable[entry].cnext = mp->hashtable[entry].cprev =
+ (BKT *)&mp->hashtable[entry];
+ mp->curcache = 0;
mp->maxcache = maxcache;
- mp->npages = sb.st_size / pagesize;
mp->pagesize = pagesize;
+ mp->npages = sb.st_size / pagesize;
mp->fd = fd;
+ mp->pgcookie = NULL;
+ mp->pgin = mp->pgout = NULL;
+
+#ifdef STATISTICS
+ mp->cachehit = mp->cachemiss = mp->pagealloc = mp->pageflush =
+ mp->pageget = mp->pagenew = mp->pageput = mp->pageread =
+ mp->pagewrite = 0;
+#endif
return (mp);
}
/*
- * mpool_filter --
- * Initialize input/output filters.
+ * MPOOL_FILTER -- initialize input/output filters.
+ *
+ * Parameters:
+ * pgin: Page in conversion routine.
+ * pgout: Page out conversion routine.
+ * pgcookie: Cookie for page in/out routines.
*/
void
mpool_filter(mp, pgin, pgout, pgcookie)
@@ -109,130 +132,126 @@ mpool_filter(mp, pgin, pgout, pgcookie)
mp->pgout = pgout;
mp->pgcookie = pgcookie;
}
-
+
/*
- * mpool_new --
- * Get a new page of memory.
+ * MPOOL_NEW -- get a new page
+ *
+ * Parameters:
+ * mp: mpool cookie
+ * pgnoadddr: place to store new page number
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
void *
mpool_new(mp, pgnoaddr)
MPOOL *mp;
pgno_t *pgnoaddr;
{
- struct _hqh *head;
- BKT *bp;
+ BKT *b;
+ BKTHDR *hp;
- if (mp->npages == MAX_PAGE_NUMBER) {
- (void)fprintf(stderr, "mpool_new: page allocation overflow.\n");
- abort();
- }
#ifdef STATISTICS
++mp->pagenew;
#endif
/*
- * Get a BKT from the cache. Assign a new page number, attach
- * it to the head of the hash chain, the tail of the lru chain,
- * and return.
+ * Get a BKT from the cache. Assign a new page number, attach it to
+ * the hash and lru chains and return.
*/
- if ((bp = mpool_bkt(mp)) == NULL)
+ if ((b = mpool_bkt(mp)) == NULL)
return (NULL);
- *pgnoaddr = bp->pgno = mp->npages++;
- bp->flags = MPOOL_PINNED;
-
- head = &mp->hqh[HASHKEY(bp->pgno)];
- CIRCLEQ_INSERT_HEAD(head, bp, hq);
- CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q);
- return (bp->page);
+ *pgnoaddr = b->pgno = mp->npages++;
+ b->flags = MPOOL_PINNED;
+ inshash(b, b->pgno);
+ inschain(b, &mp->lru);
+ return (b->page);
}
/*
- * mpool_get
- * Get a page.
+ * MPOOL_GET -- get a page from the pool
+ *
+ * Parameters:
+ * mp: mpool cookie
+ * pgno: page number
+ * flags: not used
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
void *
mpool_get(mp, pgno, flags)
MPOOL *mp;
pgno_t pgno;
- u_int flags; /* XXX not used? */
+ u_int flags; /* XXX not used? */
{
- struct _hqh *head;
- BKT *bp;
+ BKT *b;
+ BKTHDR *hp;
off_t off;
int nr;
- /* Check for attempt to retrieve a non-existent page. */
- if (pgno >= mp->npages) {
- errno = EINVAL;
- return (NULL);
- }
-
+ /*
+ * If asking for a specific page that is already in the cache, find
+ * it and return it.
+ */
+ if (b = mpool_look(mp, pgno)) {
#ifdef STATISTICS
- ++mp->pageget;
+ ++mp->pageget;
#endif
-
- /* Check for a page that is cached. */
- if ((bp = mpool_look(mp, pgno)) != NULL) {
#ifdef DEBUG
- if (bp->flags & MPOOL_PINNED) {
- (void)fprintf(stderr,
- "mpool_get: page %d already pinned\n", bp->pgno);
- abort();
- }
+ if (b->flags & MPOOL_PINNED)
+ __mpoolerr("mpool_get: page %d already pinned",
+ b->pgno);
#endif
- /*
- * Move the page to the head of the hash chain and the tail
- * of the lru chain.
- */
- head = &mp->hqh[HASHKEY(bp->pgno)];
- CIRCLEQ_REMOVE(head, bp, hq);
- CIRCLEQ_INSERT_HEAD(head, bp, hq);
- CIRCLEQ_REMOVE(&mp->lqh, bp, q);
- CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q);
-
- /* Return a pinned page. */
- bp->flags |= MPOOL_PINNED;
- return (bp->page);
+ rmchain(b);
+ inschain(b, &mp->lru);
+ b->flags |= MPOOL_PINNED;
+ return (b->page);
+ }
+
+ /* Not allowed to retrieve a non-existent page. */
+ if (pgno >= mp->npages) {
+ errno = EINVAL;
+ return (NULL);
}
/* Get a page from the cache. */
- if ((bp = mpool_bkt(mp)) == NULL)
+ if ((b = mpool_bkt(mp)) == NULL)
return (NULL);
+ b->pgno = pgno;
+ b->flags = MPOOL_PINNED;
- /* Read in the contents. */
#ifdef STATISTICS
++mp->pageread;
#endif
+ /* Read in the contents. */
off = mp->pagesize * pgno;
if (lseek(mp->fd, off, SEEK_SET) != off)
return (NULL);
- if ((nr = read(mp->fd, bp->page, mp->pagesize)) != mp->pagesize) {
+ if ((nr = read(mp->fd, b->page, mp->pagesize)) != mp->pagesize) {
if (nr >= 0)
errno = EFTYPE;
return (NULL);
}
+ if (mp->pgin)
+ (mp->pgin)(mp->pgcookie, b->pgno, b->page);
- /* Set the page number, pin the page. */
- bp->pgno = pgno;
- bp->flags = MPOOL_PINNED;
-
- /*
- * Add the page to the head of the hash chain and the tail
- * of the lru chain.
- */
- head = &mp->hqh[HASHKEY(bp->pgno)];
- CIRCLEQ_INSERT_HEAD(head, bp, hq);
- CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q);
-
- /* Run through the user's filter. */
- if (mp->pgin != NULL)
- (mp->pgin)(mp->pgcookie, bp->pgno, bp->page);
-
- return (bp->page);
+ inshash(b, b->pgno);
+ inschain(b, &mp->lru);
+#ifdef STATISTICS
+ ++mp->pageget;
+#endif
+ return (b->page);
}
/*
- * mpool_put
- * Return a page.
+ * MPOOL_PUT -- return a page to the pool
+ *
+ * Parameters:
+ * mp: mpool cookie
+ * page: page pointer
+ * pgno: page number
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
int
mpool_put(mp, page, flags)
@@ -240,172 +259,193 @@ mpool_put(mp, page, flags)
void *page;
u_int flags;
{
- BKT *bp;
+ BKT *baddr;
+#ifdef DEBUG
+ BKT *b;
+#endif
#ifdef STATISTICS
++mp->pageput;
#endif
- bp = (BKT *)((char *)page - sizeof(BKT));
+ baddr = (BKT *)((char *)page - sizeof(BKT));
#ifdef DEBUG
- if (!(bp->flags & MPOOL_PINNED)) {
- (void)fprintf(stderr,
- "mpool_put: page %d not pinned\n", bp->pgno);
- abort();
+ if (!(baddr->flags & MPOOL_PINNED))
+ __mpoolerr("mpool_put: page %d not pinned", b->pgno);
+ for (b = mp->lru.cnext; b != (BKT *)&mp->lru; b = b->cnext) {
+ if (b == (BKT *)&mp->lru)
+ __mpoolerr("mpool_put: %0x: bad address", baddr);
+ if (b == baddr)
+ break;
}
#endif
- bp->flags &= ~MPOOL_PINNED;
- bp->flags |= flags & MPOOL_DIRTY;
+ baddr->flags &= ~MPOOL_PINNED;
+ baddr->flags |= flags & MPOOL_DIRTY;
return (RET_SUCCESS);
}
/*
- * mpool_close
- * Close the buffer pool.
+ * MPOOL_CLOSE -- close the buffer pool
+ *
+ * Parameters:
+ * mp: mpool cookie
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
int
mpool_close(mp)
MPOOL *mp;
{
- BKT *bp;
+ BKT *b, *next;
/* Free up any space allocated to the lru pages. */
- while ((bp = mp->lqh.cqh_first) != (void *)&mp->lqh) {
- CIRCLEQ_REMOVE(&mp->lqh, mp->lqh.cqh_first, q);
- free(bp);
+ for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = next) {
+ next = b->cprev;
+ free(b);
}
-
- /* Free the MPOOL cookie. */
free(mp);
return (RET_SUCCESS);
}
/*
- * mpool_sync
- * Sync the pool to disk.
+ * MPOOL_SYNC -- sync the file to disk.
+ *
+ * Parameters:
+ * mp: mpool cookie
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
int
mpool_sync(mp)
MPOOL *mp;
{
- BKT *bp;
+ BKT *b;
- /* Walk the lru chain, flushing any dirty pages to disk. */
- for (bp = mp->lqh.cqh_first;
- bp != (void *)&mp->lqh; bp = bp->q.cqe_next)
- if (bp->flags & MPOOL_DIRTY &&
- mpool_write(mp, bp) == RET_ERROR)
+ for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev)
+ if (b->flags & MPOOL_DIRTY && mpool_write(mp, b) == RET_ERROR)
return (RET_ERROR);
-
- /* Sync the file descriptor. */
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
}
/*
- * mpool_bkt
- * Get a page from the cache (or create one).
+ * MPOOL_BKT -- get/create a BKT from the cache
+ *
+ * Parameters:
+ * mp: mpool cookie
+ *
+ * Returns:
+ * NULL on failure and a pointer to the BKT on success
*/
static BKT *
mpool_bkt(mp)
MPOOL *mp;
{
- struct _hqh *head;
- BKT *bp;
+ BKT *b;
- /* If under the max cached, always create a new page. */
if (mp->curcache < mp->maxcache)
goto new;
/*
- * If the cache is max'd out, walk the lru list for a buffer we
- * can flush. If we find one, write it (if necessary) and take it
- * off any lists. If we don't find anything we grow the cache anyway.
+ * If the cache is maxxed out, search the lru list for a buffer we
+ * can flush. If we find one, write it if necessary and take it off
+ * any lists. If we don't find anything we grow the cache anyway.
* The cache never shrinks.
*/
- for (bp = mp->lqh.cqh_first;
- bp != (void *)&mp->lqh; bp = bp->q.cqe_next)
- if (!(bp->flags & MPOOL_PINNED)) {
- /* Flush if dirty. */
- if (bp->flags & MPOOL_DIRTY &&
- mpool_write(mp, bp) == RET_ERROR)
+ for (b = mp->lru.cprev; b != (BKT *)&mp->lru; b = b->cprev)
+ if (!(b->flags & MPOOL_PINNED)) {
+ if (b->flags & MPOOL_DIRTY &&
+ mpool_write(mp, b) == RET_ERROR)
return (NULL);
+ rmhash(b);
+ rmchain(b);
#ifdef STATISTICS
++mp->pageflush;
#endif
- /* Remove from the hash and lru queues. */
- head = &mp->hqh[HASHKEY(bp->pgno)];
- CIRCLEQ_REMOVE(head, bp, hq);
- CIRCLEQ_REMOVE(&mp->lqh, bp, q);
#ifdef DEBUG
- { void *spage;
- spage = bp->page;
- memset(bp, 0xff, sizeof(BKT) + mp->pagesize);
- bp->page = spage;
+ {
+ void *spage;
+ spage = b->page;
+ memset(b, 0xff, sizeof(BKT) + mp->pagesize);
+ b->page = spage;
}
#endif
- return (bp);
+ return (b);
}
-new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL)
+new: if ((b = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL)
return (NULL);
#ifdef STATISTICS
++mp->pagealloc;
#endif
-#if defined(DEBUG) || defined(PURIFY)
- memset(bp, 0xff, sizeof(BKT) + mp->pagesize);
+#ifdef DEBUG
+ memset(b, 0xff, sizeof(BKT) + mp->pagesize);
#endif
- bp->page = (char *)bp + sizeof(BKT);
+ b->page = (char *)b + sizeof(BKT);
++mp->curcache;
- return (bp);
+ return (b);
}
/*
- * mpool_write
- * Write a page to disk.
+ * MPOOL_WRITE -- sync a page to disk
+ *
+ * Parameters:
+ * mp: mpool cookie
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
*/
static int
-mpool_write(mp, bp)
+mpool_write(mp, b)
MPOOL *mp;
- BKT *bp;
+ BKT *b;
{
off_t off;
+ if (mp->pgout)
+ (mp->pgout)(mp->pgcookie, b->pgno, b->page);
+
#ifdef STATISTICS
++mp->pagewrite;
#endif
-
- /* Run through the user's filter. */
- if (mp->pgout)
- (mp->pgout)(mp->pgcookie, bp->pgno, bp->page);
-
- off = mp->pagesize * bp->pgno;
+ off = mp->pagesize * b->pgno;
if (lseek(mp->fd, off, SEEK_SET) != off)
return (RET_ERROR);
- if (write(mp->fd, bp->page, mp->pagesize) != mp->pagesize)
+ if (write(mp->fd, b->page, mp->pagesize) != mp->pagesize)
return (RET_ERROR);
-
- bp->flags &= ~MPOOL_DIRTY;
+ b->flags &= ~MPOOL_DIRTY;
return (RET_SUCCESS);
}
/*
- * mpool_look
- * Lookup a page in the cache.
+ * MPOOL_LOOK -- lookup a page
+ *
+ * Parameters:
+ * mp: mpool cookie
+ * pgno: page number
+ *
+ * Returns:
+ * NULL on failure and a pointer to the BKT on success
*/
static BKT *
mpool_look(mp, pgno)
MPOOL *mp;
pgno_t pgno;
{
- struct _hqh *head;
- BKT *bp;
+ register BKT *b;
+ register BKTHDR *tb;
- head = &mp->hqh[HASHKEY(pgno)];
- for (bp = head->cqh_first; bp != (void *)head; bp = bp->hq.cqe_next)
- if (bp->pgno == pgno) {
+ /* XXX
+ * If find the buffer, put it first on the hash chain so can
+ * find it again quickly.
+ */
+ tb = &mp->hashtable[HASHKEY(pgno)];
+ for (b = tb->hnext; b != (BKT *)tb; b = b->hnext)
+ if (b->pgno == pgno) {
#ifdef STATISTICS
++mp->cachehit;
#endif
- return (bp);
+ return (b);
}
#ifdef STATISTICS
++mp->cachemiss;
@@ -415,14 +455,16 @@ mpool_look(mp, pgno)
#ifdef STATISTICS
/*
- * mpool_stat
- * Print out cache statistics.
+ * MPOOL_STAT -- cache statistics
+ *
+ * Parameters:
+ * mp: mpool cookie
*/
void
mpool_stat(mp)
MPOOL *mp;
{
- BKT *bp;
+ BKT *b;
int cnt;
char *sep;
@@ -436,7 +478,7 @@ mpool_stat(mp)
mp->pagealloc, mp->pageflush);
if (mp->cachehit + mp->cachemiss)
(void)fprintf(stderr,
- "%.0f%% cache hit rate (%lu hits, %lu misses)\n",
+ "%.0f%% cache hit rate (%lu hits, %lu misses)\n",
((double)mp->cachehit / (mp->cachehit + mp->cachemiss))
* 100, mp->cachehit, mp->cachemiss);
(void)fprintf(stderr, "%lu page reads, %lu page writes\n",
@@ -444,20 +486,49 @@ mpool_stat(mp)
sep = "";
cnt = 0;
- for (bp = mp->lqh.cqh_first;
- bp != (void *)&mp->lqh; bp = bp->q.cqe_next) {
- (void)fprintf(stderr, "%s%d", sep, bp->pgno);
- if (bp->flags & MPOOL_DIRTY)
+ for (b = mp->lru.cnext; b != (BKT *)&mp->lru; b = b->cnext) {
+ (void)fprintf(stderr, "%s%d", sep, b->pgno);
+ if (b->flags & MPOOL_DIRTY)
(void)fprintf(stderr, "d");
- if (bp->flags & MPOOL_PINNED)
+ if (b->flags & MPOOL_PINNED)
(void)fprintf(stderr, "P");
if (++cnt == 10) {
sep = "\n";
cnt = 0;
} else
sep = ", ";
-
+
}
(void)fprintf(stderr, "\n");
}
#endif
+
+#ifdef DEBUG
+#if __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+static void
+#if __STDC__
+__mpoolerr(const char *fmt, ...)
+#else
+__mpoolerr(fmt, va_alist)
+ char *fmt;
+ va_dcl
+#endif
+{
+ va_list ap;
+#if __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ (void)vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ (void)fprintf(stderr, "\n");
+ abort();
+ /* NOTREACHED */
+}
+#endif
diff --git a/lib/libc/db/recno/extern.h b/lib/libc/db/recno/extern.h
index feed43445332..218813169f93 100644
--- a/lib/libc/db/recno/extern.h
+++ b/lib/libc/db/recno/extern.h
@@ -30,14 +30,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)extern.h 8.3 (Berkeley) 6/4/94
+ * @(#)extern.h 8.2 (Berkeley) 2/21/94
*/
#include "../btree/extern.h"
int __rec_close __P((DB *));
int __rec_delete __P((const DB *, const DBT *, u_int));
-int __rec_dleaf __P((BTREE *, PAGE *, u_int32_t));
+int __rec_dleaf __P((BTREE *, PAGE *, indx_t));
int __rec_fd __P((const DB *));
int __rec_fmap __P((BTREE *, recno_t));
int __rec_fout __P((BTREE *));
diff --git a/lib/libc/db/recno/rec_close.c b/lib/libc/db/recno/rec_close.c
index 16fb0b4ecab0..a96d4f1a1edf 100644
--- a/lib/libc/db/recno/rec_close.c
+++ b/lib/libc/db/recno/rec_close.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94";
+static char sccsid[] = "@(#)rec_close.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -76,11 +76,11 @@ __rec_close(dbp)
/* Committed to closing. */
status = RET_SUCCESS;
- if (F_ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize))
+ if (ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize))
status = RET_ERROR;
- if (!F_ISSET(t, R_INMEM))
- if (F_ISSET(t, R_CLOSEFP)) {
+ if (!ISSET(t, R_INMEM))
+ if (ISSET(t, R_CLOSEFP)) {
if (fclose(t->bt_rfp))
status = RET_ERROR;
} else
@@ -125,58 +125,39 @@ __rec_sync(dbp, flags)
if (flags == R_RECNOSYNC)
return (__bt_sync(dbp, 0));
- if (F_ISSET(t, R_RDONLY | R_INMEM) || !F_ISSET(t, R_MODIFIED))
+ if (ISSET(t, R_RDONLY | R_INMEM) || !ISSET(t, R_MODIFIED))
return (RET_SUCCESS);
/* Read any remaining records into the tree. */
- if (!F_ISSET(t, R_EOF) && t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
+ if (!ISSET(t, R_EOF) && t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
return (RET_ERROR);
/* Rewind the file descriptor. */
if (lseek(t->bt_rfd, (off_t)0, SEEK_SET) != 0)
return (RET_ERROR);
- /* Save the cursor. */
- scursor = t->bt_cursor.rcursor;
+ iov[1].iov_base = "\n";
+ iov[1].iov_len = 1;
+ scursor = t->bt_rcursor;
key.size = sizeof(recno_t);
key.data = &trec;
- if (F_ISSET(t, R_FIXLEN)) {
- /*
- * We assume that fixed length records are all fixed length.
- * Any that aren't are either EINVAL'd or corrected by the
- * record put code.
- */
- status = (dbp->seq)(dbp, &key, &data, R_FIRST);
- while (status == RET_SUCCESS) {
- if (write(t->bt_rfd, data.data, data.size) != data.size)
- return (RET_ERROR);
- status = (dbp->seq)(dbp, &key, &data, R_NEXT);
- }
- } else {
- iov[1].iov_base = &t->bt_bval;
- iov[1].iov_len = 1;
-
- status = (dbp->seq)(dbp, &key, &data, R_FIRST);
- while (status == RET_SUCCESS) {
- iov[0].iov_base = data.data;
- iov[0].iov_len = data.size;
- if (writev(t->bt_rfd, iov, 2) != data.size + 1)
- return (RET_ERROR);
- status = (dbp->seq)(dbp, &key, &data, R_NEXT);
- }
- }
-
- /* Restore the cursor. */
- t->bt_cursor.rcursor = scursor;
-
+ status = (dbp->seq)(dbp, &key, &data, R_FIRST);
+ while (status == RET_SUCCESS) {
+ iov[0].iov_base = data.data;
+ iov[0].iov_len = data.size;
+ if (writev(t->bt_rfd, iov, 2) != data.size + 1)
+ return (RET_ERROR);
+ status = (dbp->seq)(dbp, &key, &data, R_NEXT);
+ }
+ t->bt_rcursor = scursor;
if (status == RET_ERROR)
return (RET_ERROR);
if ((off = lseek(t->bt_rfd, (off_t)0, SEEK_CUR)) == -1)
return (RET_ERROR);
if (ftruncate(t->bt_rfd, off))
return (RET_ERROR);
- F_CLR(t, R_MODIFIED);
+ CLR(t, R_MODIFIED);
return (RET_SUCCESS);
}
diff --git a/lib/libc/db/recno/rec_delete.c b/lib/libc/db/recno/rec_delete.c
index a16593d4e6a1..35f56b999460 100644
--- a/lib/libc/db/recno/rec_delete.c
+++ b/lib/libc/db/recno/rec_delete.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_delete.c 8.7 (Berkeley) 7/14/94";
+static char sccsid[] = "@(#)rec_delete.c 8.4 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -88,13 +88,13 @@ __rec_delete(dbp, key, flags)
status = rec_rdelete(t, nrec);
break;
case R_CURSOR:
- if (!F_ISSET(&t->bt_cursor, CURS_INIT))
+ if (!ISSET(t, B_SEQINIT))
goto einval;
if (t->bt_nrecs == 0)
return (RET_SPECIAL);
- status = rec_rdelete(t, t->bt_cursor.rcursor - 1);
+ status = rec_rdelete(t, t->bt_rcursor - 1);
if (status == RET_SUCCESS)
- --t->bt_cursor.rcursor;
+ --t->bt_rcursor;
break;
default:
einval: errno = EINVAL;
@@ -102,7 +102,7 @@ einval: errno = EINVAL;
}
if (status == RET_SUCCESS)
- F_SET(t, B_MODIFIED | R_MODIFIED);
+ SET(t, B_MODIFIED | R_MODIFIED);
return (status);
}
@@ -154,11 +154,11 @@ int
__rec_dleaf(t, h, index)
BTREE *t;
PAGE *h;
- u_int32_t index;
+ indx_t index;
{
- RLEAF *rl;
- indx_t *ip, cnt, offset;
- u_int32_t nbytes;
+ register RLEAF *rl;
+ register indx_t *ip, cnt, offset;
+ register size_t nbytes;
char *from;
void *to;
diff --git a/lib/libc/db/recno/rec_get.c b/lib/libc/db/recno/rec_get.c
index 47dd773fb97f..35555755c7ad 100644
--- a/lib/libc/db/recno/rec_get.c
+++ b/lib/libc/db/recno/rec_get.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_get.c 8.9 (Berkeley) 8/18/94";
+static char sccsid[] = "@(#)rec_get.c 8.4 (Berkeley) 3/1/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -90,7 +90,7 @@ __rec_get(dbp, key, data, flags)
* original file.
*/
if (nrec > t->bt_nrecs) {
- if (F_ISSET(t, R_EOF | R_INMEM))
+ if (ISSET(t, R_EOF | R_INMEM))
return (RET_SPECIAL);
if ((status = t->bt_irec(t, nrec)) != RET_SUCCESS)
return (status);
@@ -101,7 +101,7 @@ __rec_get(dbp, key, data, flags)
return (RET_ERROR);
status = __rec_ret(t, e, 0, NULL, data);
- if (F_ISSET(t, B_DB_LOCK))
+ if (ISSET(t, B_DB_LOCK))
mpool_put(t->bt_mp, e->page, 0);
else
t->bt_pinned = e->page;
@@ -127,38 +127,31 @@ __rec_fpipe(t, top)
recno_t nrec;
size_t len;
int ch;
- u_char *p;
+ char *p;
- if (t->bt_rdata.size < t->bt_reclen) {
- t->bt_rdata.data = t->bt_rdata.data == NULL ?
- malloc(t->bt_reclen) :
- realloc(t->bt_rdata.data, t->bt_reclen);
- if (t->bt_rdata.data == NULL)
+ if (t->bt_dbufsz < t->bt_reclen) {
+ if ((t->bt_dbuf =
+ (char *)realloc(t->bt_dbuf, t->bt_reclen)) == NULL)
return (RET_ERROR);
- t->bt_rdata.size = t->bt_reclen;
+ t->bt_dbufsz = t->bt_reclen;
}
- data.data = t->bt_rdata.data;
+ data.data = t->bt_dbuf;
data.size = t->bt_reclen;
- for (nrec = t->bt_nrecs; nrec < top;) {
+ for (nrec = t->bt_nrecs; nrec < top; ++nrec) {
len = t->bt_reclen;
- for (p = t->bt_rdata.data;; *p++ = ch)
- if ((ch = getc(t->bt_rfp)) == EOF || !--len) {
- if (ch != EOF)
- *p = ch;
- if (len != 0)
- memset(p, t->bt_bval, len);
- if (__rec_iput(t,
- nrec, &data, 0) != RET_SUCCESS)
+ for (p = t->bt_dbuf;; *p++ = ch)
+ if ((ch = getc(t->bt_rfp)) == EOF || !len--) {
+ if (__rec_iput(t, nrec, &data, 0)
+ != RET_SUCCESS)
return (RET_ERROR);
- ++nrec;
break;
}
if (ch == EOF)
break;
}
if (nrec < top) {
- F_SET(t, R_EOF);
+ SET(t, R_EOF);
return (RET_SPECIAL);
}
return (RET_SUCCESS);
@@ -184,15 +177,14 @@ __rec_vpipe(t, top)
indx_t len;
size_t sz;
int bval, ch;
- u_char *p;
+ char *p;
bval = t->bt_bval;
for (nrec = t->bt_nrecs; nrec < top; ++nrec) {
- for (p = t->bt_rdata.data,
- sz = t->bt_rdata.size;; *p++ = ch, --sz) {
+ for (p = t->bt_dbuf, sz = t->bt_dbufsz;; *p++ = ch, --sz) {
if ((ch = getc(t->bt_rfp)) == EOF || ch == bval) {
- data.data = t->bt_rdata.data;
- data.size = p - (u_char *)t->bt_rdata.data;
+ data.data = t->bt_dbuf;
+ data.size = p - t->bt_dbuf;
if (ch == EOF && data.size == 0)
break;
if (__rec_iput(t, nrec, &data, 0)
@@ -201,21 +193,19 @@ __rec_vpipe(t, top)
break;
}
if (sz == 0) {
- len = p - (u_char *)t->bt_rdata.data;
- t->bt_rdata.size += (sz = 256);
- t->bt_rdata.data = t->bt_rdata.data == NULL ?
- malloc(t->bt_rdata.size) :
- realloc(t->bt_rdata.data, t->bt_rdata.size);
- if (t->bt_rdata.data == NULL)
+ len = p - t->bt_dbuf;
+ t->bt_dbufsz += (sz = 256);
+ if ((t->bt_dbuf = (char *)realloc(t->bt_dbuf,
+ t->bt_dbufsz)) == NULL)
return (RET_ERROR);
- p = (u_char *)t->bt_rdata.data + len;
+ p = t->bt_dbuf + len;
}
}
if (ch == EOF)
break;
}
if (nrec < top) {
- F_SET(t, R_EOF);
+ SET(t, R_EOF);
return (RET_SPECIAL);
}
return (RET_SUCCESS);
@@ -238,36 +228,33 @@ __rec_fmap(t, top)
{
DBT data;
recno_t nrec;
- u_char *sp, *ep, *p;
+ caddr_t sp, ep;
size_t len;
+ char *p;
- if (t->bt_rdata.size < t->bt_reclen) {
- t->bt_rdata.data = t->bt_rdata.data == NULL ?
- malloc(t->bt_reclen) :
- realloc(t->bt_rdata.data, t->bt_reclen);
- if (t->bt_rdata.data == NULL)
+ if (t->bt_dbufsz < t->bt_reclen) {
+ if ((t->bt_dbuf =
+ (char *)realloc(t->bt_dbuf, t->bt_reclen)) == NULL)
return (RET_ERROR);
- t->bt_rdata.size = t->bt_reclen;
+ t->bt_dbufsz = t->bt_reclen;
}
- data.data = t->bt_rdata.data;
+ data.data = t->bt_dbuf;
data.size = t->bt_reclen;
- sp = (u_char *)t->bt_cmap;
- ep = (u_char *)t->bt_emap;
+ sp = t->bt_cmap;
+ ep = t->bt_emap;
for (nrec = t->bt_nrecs; nrec < top; ++nrec) {
if (sp >= ep) {
- F_SET(t, R_EOF);
+ SET(t, R_EOF);
return (RET_SPECIAL);
}
len = t->bt_reclen;
- for (p = t->bt_rdata.data;
- sp < ep && len > 0; *p++ = *sp++, --len);
- if (len != 0)
- memset(p, t->bt_bval, len);
+ for (p = t->bt_dbuf; sp < ep && len--; *p++ = *sp++);
+ memset(p, t->bt_bval, len);
if (__rec_iput(t, nrec, &data, 0) != RET_SUCCESS)
return (RET_ERROR);
}
- t->bt_cmap = (caddr_t)sp;
+ t->bt_cmap = sp;
return (RET_SUCCESS);
}
@@ -287,25 +274,25 @@ __rec_vmap(t, top)
recno_t top;
{
DBT data;
- u_char *sp, *ep;
+ caddr_t sp, ep;
recno_t nrec;
int bval;
- sp = (u_char *)t->bt_cmap;
- ep = (u_char *)t->bt_emap;
+ sp = t->bt_cmap;
+ ep = t->bt_emap;
bval = t->bt_bval;
for (nrec = t->bt_nrecs; nrec < top; ++nrec) {
if (sp >= ep) {
- F_SET(t, R_EOF);
+ SET(t, R_EOF);
return (RET_SPECIAL);
}
for (data.data = sp; sp < ep && *sp != bval; ++sp);
- data.size = sp - (u_char *)data.data;
+ data.size = sp - (caddr_t)data.data;
if (__rec_iput(t, nrec, &data, 0) != RET_SUCCESS)
return (RET_ERROR);
++sp;
}
- t->bt_cmap = (caddr_t)sp;
+ t->bt_cmap = sp;
return (RET_SUCCESS);
}
diff --git a/lib/libc/db/recno/rec_open.c b/lib/libc/db/recno/rec_open.c
index 51d8a3c260fd..2a0f354227a6 100644
--- a/lib/libc/db/recno/rec_open.c
+++ b/lib/libc/db/recno/rec_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94";
+static char sccsid[] = "@(#)rec_open.c 8.6 (Berkeley) 2/22/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -98,7 +98,7 @@ __rec_open(fname, flags, mode, openinfo, dflags)
t = dbp->internal;
if (openinfo) {
if (openinfo->flags & R_FIXEDLEN) {
- F_SET(t, R_FIXLEN);
+ SET(t, R_FIXLEN);
t->bt_reclen = openinfo->reclen;
if (t->bt_reclen == 0)
goto einval;
@@ -107,11 +107,12 @@ __rec_open(fname, flags, mode, openinfo, dflags)
} else
t->bt_bval = '\n';
- F_SET(t, R_RECNO);
+ SET(t, R_RECNO);
if (fname == NULL)
- F_SET(t, R_EOF | R_INMEM);
+ SET(t, R_EOF | R_INMEM);
else
t->bt_rfd = rfd;
+ t->bt_rcursor = 0;
if (fname != NULL) {
/*
@@ -123,20 +124,20 @@ __rec_open(fname, flags, mode, openinfo, dflags)
if (lseek(rfd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) {
switch (flags & O_ACCMODE) {
case O_RDONLY:
- F_SET(t, R_RDONLY);
+ SET(t, R_RDONLY);
break;
default:
goto einval;
}
slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
goto err;
- F_SET(t, R_CLOSEFP);
+ SET(t, R_CLOSEFP);
t->bt_irec =
- F_ISSET(t, R_FIXLEN) ? __rec_fpipe : __rec_vpipe;
+ ISSET(t, R_FIXLEN) ? __rec_fpipe : __rec_vpipe;
} else {
switch (flags & O_ACCMODE) {
case O_RDONLY:
- F_SET(t, R_RDONLY);
+ SET(t, R_RDONLY);
break;
case O_RDWR:
break;
@@ -156,16 +157,8 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
* fails if the file is too large.
*/
if (sb.st_size == 0)
- F_SET(t, R_EOF);
+ SET(t, R_EOF);
else {
-#ifdef MMAP_NOT_AVAILABLE
- /*
- * XXX
- * Mmap doesn't work correctly on many current
- * systems. In particular, it can fail subtly,
- * with cache coherency problems. Don't use it
- * for now.
- */
t->bt_msize = sb.st_size;
if ((t->bt_smap = mmap(NULL, t->bt_msize,
PROT_READ, MAP_PRIVATE, rfd,
@@ -173,12 +166,9 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
goto slow;
t->bt_cmap = t->bt_smap;
t->bt_emap = t->bt_smap + sb.st_size;
- t->bt_irec = F_ISSET(t, R_FIXLEN) ?
+ t->bt_irec = ISSET(t, R_FIXLEN) ?
__rec_fmap : __rec_vmap;
- F_SET(t, R_MEMMAPPED);
-#else
- goto slow;
-#endif
+ SET(t, R_MEMMAPPED);
}
}
}
@@ -196,14 +186,13 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
if ((h = mpool_get(t->bt_mp, P_ROOT, 0)) == NULL)
goto err;
if ((h->flags & P_TYPE) == P_BLEAF) {
- F_CLR(h, P_TYPE);
- F_SET(h, P_RLEAF);
+ h->flags = h->flags & ~P_TYPE | P_RLEAF;
mpool_put(t->bt_mp, h, MPOOL_DIRTY);
} else
mpool_put(t->bt_mp, h, 0);
if (openinfo && openinfo->flags & R_SNAPSHOT &&
- !F_ISSET(t, R_EOF | R_INMEM) &&
+ !ISSET(t, R_EOF | R_INMEM) &&
t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
goto err;
return (dbp);
@@ -233,7 +222,7 @@ __rec_fd(dbp)
}
/* In-memory database can't have a file descriptor. */
- if (F_ISSET(t, R_INMEM)) {
+ if (ISSET(t, R_INMEM)) {
errno = ENOENT;
return (-1);
}
diff --git a/lib/libc/db/recno/rec_put.c b/lib/libc/db/recno/rec_put.c
index 1afae0d5a675..590d45b4f919 100644
--- a/lib/libc/db/recno/rec_put.c
+++ b/lib/libc/db/recno/rec_put.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_put.c 8.7 (Berkeley) 8/18/94";
+static char sccsid[] = "@(#)rec_put.c 8.3 (Berkeley) 3/1/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -66,7 +66,7 @@ __rec_put(dbp, key, data, flags)
u_int flags;
{
BTREE *t;
- DBT fdata, tdata;
+ DBT tdata;
recno_t nrec;
int status;
@@ -78,38 +78,11 @@ __rec_put(dbp, key, data, flags)
t->bt_pinned = NULL;
}
- /*
- * If using fixed-length records, and the record is long, return
- * EINVAL. If it's short, pad it out. Use the record data return
- * memory, it's only short-term.
- */
- if (F_ISSET(t, R_FIXLEN) && data->size != t->bt_reclen) {
- if (data->size > t->bt_reclen)
- goto einval;
-
- if (t->bt_rdata.size < t->bt_reclen) {
- t->bt_rdata.data = t->bt_rdata.data == NULL ?
- malloc(t->bt_reclen) :
- realloc(t->bt_rdata.data, t->bt_reclen);
- if (t->bt_rdata.data == NULL)
- return (RET_ERROR);
- t->bt_rdata.size = t->bt_reclen;
- }
- memmove(t->bt_rdata.data, data->data, data->size);
- memset((char *)t->bt_rdata.data + data->size,
- t->bt_bval, t->bt_reclen - data->size);
- fdata.data = t->bt_rdata.data;
- fdata.size = t->bt_reclen;
- } else {
- fdata.data = data->data;
- fdata.size = data->size;
- }
-
switch (flags) {
case R_CURSOR:
- if (!F_ISSET(&t->bt_cursor, CURS_INIT))
+ if (!ISSET(t, B_SEQINIT))
goto einval;
- nrec = t->bt_cursor.rcursor;
+ nrec = t->bt_rcursor;
break;
case R_SETCURSOR:
if ((nrec = *(recno_t *)key->data) == 0)
@@ -142,11 +115,11 @@ einval: errno = EINVAL;
* already in the database. If skipping records, create empty ones.
*/
if (nrec > t->bt_nrecs) {
- if (!F_ISSET(t, R_EOF | R_INMEM) &&
+ if (!ISSET(t, R_EOF | R_INMEM) &&
t->bt_irec(t, nrec) == RET_ERROR)
return (RET_ERROR);
if (nrec > t->bt_nrecs + 1) {
- if (F_ISSET(t, R_FIXLEN)) {
+ if (ISSET(t, R_FIXLEN)) {
if ((tdata.data =
(void *)malloc(t->bt_reclen)) == NULL)
return (RET_ERROR);
@@ -160,18 +133,18 @@ einval: errno = EINVAL;
if (__rec_iput(t,
t->bt_nrecs, &tdata, 0) != RET_SUCCESS)
return (RET_ERROR);
- if (F_ISSET(t, R_FIXLEN))
+ if (ISSET(t, R_FIXLEN))
free(tdata.data);
}
}
- if ((status = __rec_iput(t, nrec - 1, &fdata, flags)) != RET_SUCCESS)
+ if ((status = __rec_iput(t, nrec - 1, data, flags)) != RET_SUCCESS)
return (status);
if (flags == R_SETCURSOR)
- t->bt_cursor.rcursor = nrec;
-
- F_SET(t, R_MODIFIED);
+ t->bt_rcursor = nrec;
+
+ SET(t, R_MODIFIED);
return (__rec_ret(t, NULL, nrec, key, NULL));
}
@@ -198,7 +171,7 @@ __rec_iput(t, nrec, data, flags)
PAGE *h;
indx_t index, nxtindex;
pgno_t pg;
- u_int32_t nbytes;
+ size_t nbytes;
int dflags, status;
char *dest, db[NOVFLSIZE];
@@ -214,7 +187,7 @@ __rec_iput(t, nrec, data, flags)
tdata.data = db;
tdata.size = NOVFLSIZE;
*(pgno_t *)db = pg;
- *(u_int32_t *)(db + sizeof(pgno_t)) = data->size;
+ *(size_t *)(db + sizeof(pgno_t)) = data->size;
dflags = P_BIGDATA;
data = &tdata;
} else
@@ -273,7 +246,7 @@ __rec_iput(t, nrec, data, flags)
WR_RLEAF(dest, data, dflags);
++t->bt_nrecs;
- F_SET(t, B_MODIFIED);
+ SET(t, B_MODIFIED);
mpool_put(t->bt_mp, h, MPOOL_DIRTY);
return (RET_SUCCESS);
diff --git a/lib/libc/db/recno/rec_search.c b/lib/libc/db/recno/rec_search.c
index acc109e9925b..a1feff8a4173 100644
--- a/lib/libc/db/recno/rec_search.c
+++ b/lib/libc/db/recno/rec_search.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_search.c 8.4 (Berkeley) 7/14/94";
+static char sccsid[] = "@(#)rec_search.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -91,8 +91,9 @@ __rec_search(t, recno, op)
total += r->nrecs;
}
- BT_PUSH(t, pg, index - 1);
-
+ if (__bt_push(t, pg, index - 1) == RET_ERROR)
+ return (NULL);
+
pg = r->pgno;
switch (op) {
case SDELETE:
diff --git a/lib/libc/db/recno/rec_seq.c b/lib/libc/db/recno/rec_seq.c
index f80992c5982d..56f78e764c51 100644
--- a/lib/libc/db/recno/rec_seq.c
+++ b/lib/libc/db/recno/rec_seq.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1991, 1993, 1994
+ * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)rec_seq.c 8.3 (Berkeley) 7/14/94";
+static char sccsid[] = "@(#)rec_seq.c 8.2 (Berkeley) 9/7/93";
#endif /* not lint */
#include <sys/types.h>
@@ -82,8 +82,8 @@ __rec_seq(dbp, key, data, flags)
goto einval;
break;
case R_NEXT:
- if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
- nrec = t->bt_cursor.rcursor + 1;
+ if (ISSET(t, B_SEQINIT)) {
+ nrec = t->bt_rcursor + 1;
break;
}
/* FALLTHROUGH */
@@ -91,14 +91,14 @@ __rec_seq(dbp, key, data, flags)
nrec = 1;
break;
case R_PREV:
- if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
- if ((nrec = t->bt_cursor.rcursor - 1) == 0)
+ if (ISSET(t, B_SEQINIT)) {
+ if ((nrec = t->bt_rcursor - 1) == 0)
return (RET_SPECIAL);
break;
}
/* FALLTHROUGH */
case R_LAST:
- if (!F_ISSET(t, R_EOF | R_INMEM) &&
+ if (!ISSET(t, R_EOF | R_INMEM) &&
t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
return (RET_ERROR);
nrec = t->bt_nrecs;
@@ -107,9 +107,9 @@ __rec_seq(dbp, key, data, flags)
einval: errno = EINVAL;
return (RET_ERROR);
}
-
+
if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) {
- if (!F_ISSET(t, R_EOF | R_INMEM) &&
+ if (!ISSET(t, R_EOF | R_INMEM) &&
(status = t->bt_irec(t, nrec)) != RET_SUCCESS)
return (status);
if (t->bt_nrecs == 0 || nrec > t->bt_nrecs)
@@ -119,11 +119,11 @@ einval: errno = EINVAL;
if ((e = __rec_search(t, nrec - 1, SEARCH)) == NULL)
return (RET_ERROR);
- F_SET(&t->bt_cursor, CURS_INIT);
- t->bt_cursor.rcursor = nrec;
+ SET(t, B_SEQINIT);
+ t->bt_rcursor = nrec;
status = __rec_ret(t, e, nrec, key, data);
- if (F_ISSET(t, B_DB_LOCK))
+ if (ISSET(t, B_DB_LOCK))
mpool_put(t->bt_mp, e->page, 0);
else
t->bt_pinned = e->page;
diff --git a/lib/libc/db/recno/rec_utils.c b/lib/libc/db/recno/rec_utils.c
index baea3fad5066..f7fb145024a1 100644
--- a/lib/libc/db/recno/rec_utils.c
+++ b/lib/libc/db/recno/rec_utils.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993, 1994
+ * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_utils.c 8.6 (Berkeley) 7/16/94";
+static char sccsid[] = "@(#)rec_utils.c 8.3 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -45,14 +45,11 @@ static char sccsid[] = "@(#)rec_utils.c 8.6 (Berkeley) 7/16/94";
#include "recno.h"
/*
- * __rec_ret --
- * Build return data.
+ * __REC_RET -- Build return data as a result of search or scan.
*
* Parameters:
* t: tree
- * e: key/data pair to be returned
- * nrec: record number
- * key: user's key structure
+ * d: LEAF to be returned to the user.
* data: user's data structure
*
* Returns:
@@ -65,58 +62,53 @@ __rec_ret(t, e, nrec, key, data)
recno_t nrec;
DBT *key, *data;
{
- RLEAF *rl;
- void *p;
+ register RLEAF *rl;
+ register void *p;
- if (key == NULL)
- goto dataonly;
-
- /* We have to copy the key, it's not on the page. */
- if (sizeof(recno_t) > t->bt_rkey.size) {
- p = (void *)(t->bt_rkey.data == NULL ?
- malloc(sizeof(recno_t)) :
- realloc(t->bt_rkey.data, sizeof(recno_t)));
- if (p == NULL)
- return (RET_ERROR);
- t->bt_rkey.data = p;
- t->bt_rkey.size = sizeof(recno_t);
- }
- memmove(t->bt_rkey.data, &nrec, sizeof(recno_t));
- key->size = sizeof(recno_t);
- key->data = t->bt_rkey.data;
-
-dataonly:
if (data == NULL)
- return (RET_SUCCESS);
+ goto retkey;
+
+ rl = GETRLEAF(e->page, e->index);
/*
- * We must copy big keys/data to make them contigous. Otherwise,
+ * We always copy big data to make it contigous. Otherwise, we
* leave the page pinned and don't copy unless the user specified
* concurrent access.
*/
- rl = GETRLEAF(e->page, e->index);
if (rl->flags & P_BIGDATA) {
if (__ovfl_get(t, rl->bytes,
- &data->size, &t->bt_rdata.data, &t->bt_rdata.size))
+ &data->size, &t->bt_dbuf, &t->bt_dbufsz))
return (RET_ERROR);
- data->data = t->bt_rdata.data;
- } else if (F_ISSET(t, B_DB_LOCK)) {
+ data->data = t->bt_dbuf;
+ } else if (ISSET(t, B_DB_LOCK)) {
/* Use +1 in case the first record retrieved is 0 length. */
- if (rl->dsize + 1 > t->bt_rdata.size) {
- p = (void *)(t->bt_rdata.data == NULL ?
- malloc(rl->dsize + 1) :
- realloc(t->bt_rdata.data, rl->dsize + 1));
- if (p == NULL)
+ if (rl->dsize + 1 > t->bt_dbufsz) {
+ if ((p =
+ (void *)realloc(t->bt_dbuf, rl->dsize + 1)) == NULL)
return (RET_ERROR);
- t->bt_rdata.data = p;
- t->bt_rdata.size = rl->dsize + 1;
+ t->bt_dbuf = p;
+ t->bt_dbufsz = rl->dsize + 1;
}
- memmove(t->bt_rdata.data, rl->bytes, rl->dsize);
+ memmove(t->bt_dbuf, rl->bytes, rl->dsize);
data->size = rl->dsize;
- data->data = t->bt_rdata.data;
+ data->data = t->bt_dbuf;
} else {
data->size = rl->dsize;
data->data = rl->bytes;
}
+
+retkey: if (key == NULL)
+ return (RET_SUCCESS);
+
+ /* We have to copy the key, it's not on the page. */
+ if (sizeof(recno_t) > t->bt_kbufsz) {
+ if ((p = (void *)realloc(t->bt_kbuf, sizeof(recno_t))) == NULL)
+ return (RET_ERROR);
+ t->bt_kbuf = p;
+ t->bt_kbufsz = sizeof(recno_t);
+ }
+ memmove(t->bt_kbuf, &nrec, sizeof(recno_t));
+ key->size = sizeof(recno_t);
+ key->data = t->bt_kbuf;
return (RET_SUCCESS);
}
diff --git a/lib/libc/db/test/Makefile b/lib/libc/db/test/Makefile
index a5dd08ae58b8..c816432551d4 100644
--- a/lib/libc/db/test/Makefile
+++ b/lib/libc/db/test/Makefile
@@ -1,23 +1,17 @@
-# @(#)Makefile 8.15 (Berkeley) 7/28/94
+# @(#)Makefile 8.9 (Berkeley) 2/21/94
PROG= dbtest
OBJS= dbtest.o strerror.o
-# Uncomment the STAT line get hash and btree statistical use info. This
-# also forces ld to load the btree debug functions for use by gdb, which
-# is useful. The db library has to be compiled with -DSTATISTICS as well.
-INC= -I${PORTDIR}/include -I${PORTDIR}
-OORG= -g
-#STAT= -DSTATISTICS
-CFLAGS= -D__DBINTERFACE_PRIVATE -DDEBUG ${STAT} ${OORG} ${INC}
+# Add -DSTATISTICS to CFLAGS to get btree statistical use info.
+# Note, the db library has to be compiled for statistics as well.
+CFLAGS= -D__DBINTERFACE_PRIVATE -DDEBUG -O ${INC}
-dbtest: ${OBJS} ${PORTDIR}/libdb.a
- ${CC} -o $@ ${OBJS} ${PORTDIR}/libdb.a
+dbtest: ${OBJS} ${LIB}
+ ${CC} -o $@ ${OBJS} ${LIB}
-strerror.o: ${PORTDIR}/clib/strerror.c
- ${CC} -c ${PORTDIR}/clib/strerror.c
+strerror.o: ../PORT/clib/strerror.c
+ ${CC} -c ../PORT/clib/strerror.c
clean:
- rm -f dbtest.core gmon.out ${OBJS} ${PROG} t1 t2 t3
-
-${OBJS}: Makefile
+ rm -f gmon.out ${OBJS} ${PROG} t1 t2 t3
diff --git a/lib/libc/db/test/README b/lib/libc/db/test/README
index 0c0cd13d8fa0..8631c77cfd85 100644
--- a/lib/libc/db/test/README
+++ b/lib/libc/db/test/README
@@ -1,25 +1,17 @@
-# @(#)README 8.8 (Berkeley) 7/31/94
+# @(#)README 8.2 (Berkeley) 2/21/94
To build this portably, try something like:
- make PORTDIR="../PORT/MACH"
+ make INC="-I../PORT/MACH/ -I../PORT/MACH/include" LIB=../PORT/MACH/libdb.a
where MACH is the machine, i.e. "sunos.4.1.1".
To run the tests, enter "sh run.test". If your system dictionary isn't
in /usr/share/dict/words, edit run.test to reflect the correct place.
-Fairly large files (the command files) are built in this directory during
-the test runs, and even larger files (the database files) are created in
-"/var/tmp". If the latter directory doesn't exist, set the environmental
-variable TMPDIR to a directory where the files can be built.
-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-The script file consists of lines with an initial character which is
-the command for that line, or an initial character indicating a key
-or data entry for a previous command.
-
-Legal command characters are as follows:
+The script file consists of lines with a initial character which is
+the "command" for that line. Legal characters are as follows:
c: compare a record
+ must be followed by [kK][dD]; the data value in the database
@@ -28,24 +20,17 @@ c: compare a record
e: echo a string
+ writes out the rest of the line into the output file; if the
last character is not a carriage-return, a newline is appended.
-f: set the flags for the next command
- + no value zero's the flags
g: do a get command
+ must be followed by [kK]
+ writes out the retrieved data DBT.
-o [r]: dump [reverse]
- + dump the database out, if 'r' is set, in reverse order.
p: do a put command
+ must be followed by [kK][dD]
r: do a del command
- + must be followed by [kK] unless R_CURSOR flag set.
-S: sync the database
+ + must be followed by [kK]
s: do a seq command
- + must be followed by [kK] if R_CURSOR flag set.
+ writes out the retrieved data DBT.
-
-Legal key/data characters are as follows:
-
+f: set the flags for the next command
+ + no value zero's the flags
D [file]: data file
+ set the current data value to the contents of the file
d [data]:
@@ -54,21 +39,17 @@ K [file]: key file
+ set the current key value to the contents of the file
k [data]:
+ set the current key value to the contents of the line.
-
-Blank lines, lines with leading white space, and lines with leading
-hash marks (#) are ignored.
+o [r]: dump [reverse]
+ + dump the database out, if 'r' is set, in reverse order.
Options to dbtest are as follows:
- -d: Set the DB_LOCK flag.
-f: Use the file argument as the database file.
-i: Use the rest of the argument to set elements in the info
structure. If the type is btree, then "-i cachesize=10240"
will set BTREEINFO.cachesize to 10240.
-o: The rest of the argument is the output file instead of
using stdout.
- -s: Don't delete the database file before opening it, i.e.
- use the database file from a previous run.
-Dbtest requires two arguments, the type of access "hash", "recno"
-or "btree", and the script name or "-" to indicate stdin.
+Dbtest requires two arguments, the type of access "hash", "recno" or
+"btree", and the script name.
diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c
index 4341b4c4709c..c526415a7a09 100644
--- a/lib/libc/db/test/dbtest.c
+++ b/lib/libc/db/test/dbtest.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1992, 1993, 1994
+ * Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,12 +33,12 @@
#ifndef lint
static char copyright[] =
-"@(#) Copyright (c) 1992, 1993, 1994\n\
+"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94";
+static char sccsid[] = "@(#)dbtest.c 8.8 (Berkeley) 2/21/94";
#endif /* not lint */
#include <sys/param.h>
@@ -65,8 +65,6 @@ void get __P((DB *, DBT *));
void getdata __P((DB *, DBT *, DBT *));
void put __P((DB *, DBT *, DBT *));
void rem __P((DB *, DBT *));
-char *sflags __P((int));
-void synk __P((DB *));
void *rfile __P((char *, size_t *));
void seq __P((DB *, DBT *));
u_int setflags __P((char *));
@@ -74,14 +72,13 @@ void *setinfo __P((DBTYPE, char *));
void usage __P((void));
void *xmalloc __P((char *, size_t));
-DBTYPE type; /* Database type. */
-void *infop; /* Iflags. */
-u_long lineno; /* Current line in test script. */
-u_int flags; /* Current DB flags. */
-int ofd = STDOUT_FILENO; /* Standard output fd. */
+DBTYPE type;
+void *infop;
+u_long lineno;
+u_int flags;
+int ofd = STDOUT_FILENO;
DB *XXdbp; /* Global for gdb. */
-int XXlineno; /* Fast breakpoint for gdb. */
int
main(argc, argv)
@@ -94,15 +91,14 @@ main(argc, argv)
DB *dbp;
DBT data, key, keydata;
size_t len;
- int ch, oflags, sflag;
- char *fname, *infoarg, *p, *t, buf[8 * 1024];
+ int ch, oflags;
+ char *fname, *infoarg, *p, buf[8 * 1024];
infoarg = NULL;
fname = NULL;
oflags = O_CREAT | O_RDWR;
- sflag = 0;
- while ((ch = getopt(argc, argv, "f:i:lo:s")) != EOF)
- switch (ch) {
+ while ((ch = getopt(argc, argv, "f:i:lo:")) != EOF)
+ switch(ch) {
case 'f':
fname = optarg;
break;
@@ -117,9 +113,6 @@ main(argc, argv)
O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
err("%s: %s", optarg, strerror(errno));
break;
- case 's':
- sflag = 1;
- break;
case '?':
default:
usage();
@@ -134,8 +127,8 @@ main(argc, argv)
type = dbtype(*argv++);
/* Open the descriptor file. */
- if (strcmp(*argv, "-") && freopen(*argv, "r", stdin) == NULL)
- err("%s: %s", *argv, strerror(errno));
+ if (freopen(*argv, "r", stdin) == NULL)
+ err("%s: %s", *argv, strerror(errno));
/* Set up the db structure as necessary. */
if (infoarg == NULL)
@@ -146,10 +139,7 @@ main(argc, argv)
if (*p != '\0')
infop = setinfo(type, p);
- /*
- * Open the DB. Delete any preexisting copy, you almost never
- * want it around, and it often screws up tests.
- */
+ /* Open the DB. */
if (fname == NULL) {
p = getenv("TMPDIR");
if (p == NULL)
@@ -157,9 +147,7 @@ main(argc, argv)
(void)sprintf(buf, "%s/__dbtest", p);
fname = buf;
(void)unlink(buf);
- } else if (!sflag)
- (void)unlink(fname);
-
+ }
if ((dbp = dbopen(fname,
oflags, S_IRUSR | S_IWUSR, type, infop)) == NULL)
err("dbopen: %s", strerror(errno));
@@ -168,16 +156,8 @@ main(argc, argv)
state = COMMAND;
for (lineno = 1;
(p = fgets(buf, sizeof(buf), stdin)) != NULL; ++lineno) {
- /* Delete the newline, displaying the key/data is easier. */
- if (ofd == STDOUT_FILENO && (t = strchr(p, '\n')) != NULL)
- *t = '\0';
- if ((len = strlen(buf)) == 0 || isspace(*p) || *p == '#')
- continue;
-
- /* Convenient gdb break point. */
- if (XXlineno == lineno)
- XXlineno = 1;
- switch (*p) {
+ len = strlen(buf);
+ switch(*p) {
case 'c': /* compare */
if (state != COMMAND)
err("line %lu: not expecting command", lineno);
@@ -190,8 +170,7 @@ main(argc, argv)
/* Don't display the newline, if CR at EOL. */
if (p[len - 2] == '\r')
--len;
- if (write(ofd, p + 1, len - 1) != len - 1 ||
- write(ofd, "\n", 1) != 1)
+ if (write(ofd, p + 1, len - 1) != len - 1)
err("write: %s", strerror(errno));
break;
case 'g': /* get */
@@ -209,19 +188,8 @@ main(argc, argv)
case 'r': /* remove */
if (state != COMMAND)
err("line %lu: not expecting command", lineno);
- if (flags == R_CURSOR) {
- rem(dbp, &key);
- state = COMMAND;
- } else {
- state = KEY;
- command = REMOVE;
- }
- break;
- case 'S': /* sync */
- if (state != COMMAND)
- err("line %lu: not expecting command", lineno);
- synk(dbp);
- state = COMMAND;
+ state = KEY;
+ command = REMOVE;
break;
case 's': /* seq */
if (state != COMMAND)
@@ -245,7 +213,7 @@ main(argc, argv)
err("line %lu: not expecting data", lineno);
data.data = xmalloc(p + 1, len - 1);
data.size = len - 1;
-ldata: switch (command) {
+ldata: switch(command) {
case COMPARE:
compare(&keydata, &data);
break;
@@ -281,7 +249,7 @@ ldata: switch (command) {
key.data = xmalloc(p + 1, len - 1);
key.size = len - 1;
}
-lkey: switch (command) {
+lkey: switch(command) {
case COMPARE:
getdata(dbp, &key, &keydata);
state = DATA;
@@ -297,13 +265,13 @@ lkey: switch (command) {
break;
case REMOVE:
rem(dbp, &key);
- if ((type != DB_RECNO) && (flags != R_CURSOR))
+ if (type != DB_RECNO)
free(key.data);
state = COMMAND;
break;
case SEQ:
seq(dbp, &key);
- if ((type != DB_RECNO) && (flags != R_CURSOR))
+ if (type != DB_RECNO)
free(key.data);
state = COMMAND;
break;
@@ -317,15 +285,11 @@ lkey: switch (command) {
break;
default:
err("line %lu: %s: unknown command character",
- lineno, p);
+ p, lineno);
}
}
#ifdef STATISTICS
- /*
- * -l must be used (DB_LOCK must be set) for this to be
- * used, otherwise a page will be locked and it will fail.
- */
- if (type == DB_BTREE && oflags & DB_LOCK)
+ if (type == DB_BTREE)
__bt_stat(dbp);
#endif
if (dbp->close(dbp))
@@ -335,6 +299,7 @@ lkey: switch (command) {
}
#define NOOVERWRITE "put failed, would overwrite key\n"
+#define NOSUCHKEY "get failed, no such key\n"
void
compare(db1, db2)
@@ -363,23 +328,17 @@ get(dbp, kp)
{
DBT data;
- switch (dbp->get(dbp, kp, &data, flags)) {
+ switch(dbp->get(dbp, kp, &data, flags)) {
case 0:
(void)write(ofd, data.data, data.size);
- if (ofd == STDOUT_FILENO)
- (void)write(ofd, "\n", 1);
break;
case -1:
err("line %lu: get: %s", lineno, strerror(errno));
/* NOTREACHED */
case 1:
-#define NOSUCHKEY "get failed, no such key\n"
- if (ofd != STDOUT_FILENO)
- (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
- else
- (void)fprintf(stderr, "%d: %.*s: %s",
- lineno, MIN(kp->size, 20), kp->data, NOSUCHKEY);
-#undef NOSUCHKEY
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
+ (void)fprintf(stderr, "%d: %.*s: %s\n",
+ lineno, kp->size, kp->data, NOSUCHKEY);
break;
}
}
@@ -389,14 +348,14 @@ getdata(dbp, kp, dp)
DB *dbp;
DBT *kp, *dp;
{
- switch (dbp->get(dbp, kp, dp, flags)) {
+ switch(dbp->get(dbp, kp, dp, flags)) {
case 0:
return;
case -1:
err("line %lu: getdata: %s", lineno, strerror(errno));
/* NOTREACHED */
case 1:
- err("line %lu: getdata failed, no such key", lineno);
+ err("line %lu: get failed, no such key", lineno);
/* NOTREACHED */
}
}
@@ -406,7 +365,7 @@ put(dbp, kp, dp)
DB *dbp;
DBT *kp, *dp;
{
- switch (dbp->put(dbp, kp, dp, flags)) {
+ switch(dbp->put(dbp, kp, dp, flags)) {
case 0:
break;
case -1:
@@ -423,67 +382,34 @@ rem(dbp, kp)
DB *dbp;
DBT *kp;
{
- switch (dbp->del(dbp, kp, flags)) {
+ switch(dbp->del(dbp, kp, flags)) {
case 0:
break;
case -1:
- err("line %lu: rem: %s", lineno, strerror(errno));
+ err("line %lu: get: %s", lineno, strerror(errno));
/* NOTREACHED */
case 1:
-#define NOSUCHKEY "rem failed, no such key\n"
- if (ofd != STDOUT_FILENO)
- (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
- else if (flags != R_CURSOR)
- (void)fprintf(stderr, "%d: %.*s: %s",
- lineno, MIN(kp->size, 20), kp->data, NOSUCHKEY);
- else
- (void)fprintf(stderr,
- "%d: rem of cursor failed\n", lineno);
-#undef NOSUCHKEY
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
break;
}
}
void
-synk(dbp)
- DB *dbp;
-{
- switch (dbp->sync(dbp, flags)) {
- case 0:
- break;
- case -1:
- err("line %lu: synk: %s", lineno, strerror(errno));
- /* NOTREACHED */
- }
-}
-
-void
seq(dbp, kp)
DB *dbp;
DBT *kp;
{
DBT data;
- switch (dbp->seq(dbp, kp, &data, flags)) {
+ switch(dbp->seq(dbp, kp, &data, flags)) {
case 0:
(void)write(ofd, data.data, data.size);
- if (ofd == STDOUT_FILENO)
- (void)write(ofd, "\n", 1);
break;
case -1:
err("line %lu: seq: %s", lineno, strerror(errno));
/* NOTREACHED */
case 1:
-#define NOSUCHKEY "seq failed, no such key\n"
- if (ofd != STDOUT_FILENO)
- (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
- else if (flags == R_CURSOR)
- (void)fprintf(stderr, "%d: %.*s: %s",
- lineno, MIN(kp->size, 20), kp->data, NOSUCHKEY);
- else
- (void)fprintf(stderr,
- "%d: seq (%s) failed\n", lineno, sflags(flags));
-#undef NOSUCHKEY
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
break;
}
}
@@ -504,11 +430,9 @@ dump(dbp, rev)
nflags = R_NEXT;
}
for (;; flags = nflags)
- switch (dbp->seq(dbp, &key, &data, flags)) {
+ switch(dbp->seq(dbp, &key, &data, flags)) {
case 0:
(void)write(ofd, data.data, data.size);
- if (ofd == STDOUT_FILENO)
- (void)write(ofd, "\n", 1);
break;
case 1:
goto done;
@@ -519,7 +443,7 @@ dump(dbp, rev)
}
done: return;
}
-
+
u_int
setflags(s)
char *s;
@@ -527,43 +451,32 @@ setflags(s)
char *p, *index();
for (; isspace(*s); ++s);
- if (*s == '\n' || *s == '\0')
+ if (*s == '\n')
return (0);
if ((p = index(s, '\n')) != NULL)
*p = '\0';
- if (!strcmp(s, "R_CURSOR")) return (R_CURSOR);
- if (!strcmp(s, "R_FIRST")) return (R_FIRST);
- if (!strcmp(s, "R_IAFTER")) return (R_IAFTER);
- if (!strcmp(s, "R_IBEFORE")) return (R_IBEFORE);
- if (!strcmp(s, "R_LAST")) return (R_LAST);
- if (!strcmp(s, "R_NEXT")) return (R_NEXT);
- if (!strcmp(s, "R_NOOVERWRITE")) return (R_NOOVERWRITE);
- if (!strcmp(s, "R_PREV")) return (R_PREV);
- if (!strcmp(s, "R_SETCURSOR")) return (R_SETCURSOR);
-
+ if (!strcmp(s, "R_CURSOR"))
+ return (R_CURSOR);
+ if (!strcmp(s, "R_FIRST"))
+ return (R_FIRST);
+ if (!strcmp(s, "R_IAFTER"))
+ return (R_IAFTER);
+ if (!strcmp(s, "R_IBEFORE"))
+ return (R_IBEFORE);
+ if (!strcmp(s, "R_LAST"))
+ return (R_LAST);
+ if (!strcmp(s, "R_NEXT"))
+ return (R_NEXT);
+ if (!strcmp(s, "R_NOOVERWRITE"))
+ return (R_NOOVERWRITE);
+ if (!strcmp(s, "R_PREV"))
+ return (R_PREV);
+ if (!strcmp(s, "R_SETCURSOR"))
+ return (R_SETCURSOR);
err("line %lu: %s: unknown flag", lineno, s);
/* NOTREACHED */
}
-char *
-sflags(flags)
- int flags;
-{
- switch (flags) {
- case R_CURSOR: return ("R_CURSOR");
- case R_FIRST: return ("R_FIRST");
- case R_IAFTER: return ("R_IAFTER");
- case R_IBEFORE: return ("R_IBEFORE");
- case R_LAST: return ("R_LAST");
- case R_NEXT: return ("R_NEXT");
- case R_NOOVERWRITE: return ("R_NOOVERWRITE");
- case R_PREV: return ("R_PREV");
- case R_SETCURSOR: return ("R_SETCURSOR");
- }
-
- return ("UNKNOWN!");
-}
-
DBTYPE
dbtype(s)
char *s;
@@ -593,8 +506,8 @@ setinfo(type, s)
*eq++ = '\0';
if (!isdigit(*eq))
err("%s: structure set statement must be a number", s);
-
- switch (type) {
+
+ switch(type) {
case DB_BTREE:
if (!strcmp("flags", s)) {
ib.flags = atoi(eq);
diff --git a/lib/libc/db/test/run.test b/lib/libc/db/test/run.test
index 52b74c316199..5eeaf743dd68 100644
--- a/lib/libc/db/test/run.test
+++ b/lib/libc/db/test/run.test
@@ -1,26 +1,19 @@
#!/bin/sh -
#
-# @(#)run.test 8.10 (Berkeley) 7/26/94
+# @(#)run.test 8.7 (Berkeley) 9/16/93
#
# db regression tests
main()
{
- PROG=./dbtest
- TMP1=t1
- TMP2=t2
- TMP3=t3
+DICT=/usr/share/dict/words
+#DICT=/usr/dict/words
+PROG=./dbtest
+TMP1=t1
+TMP2=t2
+TMP3=t3
- if [ -f /usr/share/dict/words ]; then
- DICT=/usr/share/dict/words
- elif [ -f /usr/dict/words ]; then
- DICT=/usr/dict/words
- else
- echo 'run.test: no dictionary'
- exit 1
- fi
-
if [ $# -eq 0 ]; then
for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20; do
test$t
@@ -352,7 +345,7 @@ test7()
for (i = 1; i <= 120; ++i)
printf("%05d: input key %d: %s\n", i, i, $0);
printf("%05d: input key %d: %s\n", 120, 120, $0);
- printf("seq failed, no such key\n");
+ printf("get failed, no such key\n");
printf("%05d: input key %d: %s\n", 1, 1, $0);
printf("%05d: input key %d: %s\n", 2, 2, $0);
exit;
@@ -371,10 +364,10 @@ test7()
for (i = 1; i <= 120; ++i)
printf("s\n");
printf("fR_CURSOR\ns\nk120\n");
- printf("r\n");
+ printf("r\nk120\n");
printf("fR_NEXT\ns\n");
printf("fR_CURSOR\ns\nk1\n");
- printf("r\n");
+ printf("r\nk1\n");
printf("fR_FIRST\ns\n");
}' > $TMP2
$PROG -o $TMP3 recno $TMP2
@@ -399,11 +392,13 @@ test8()
if (i % 8 == 0) {
printf("c\nkkey2\nD/bin/csh\n");
printf("c\nkkey1\nD/bin/sh\n");
- printf("e\t%d of 10 (comparison)\n", i);
+ printf("e\t%d of 10 (comparison)\r\n", i);
} else
- printf("e\t%d of 10 \n", i);
+ printf("e\t%d of 10 \r\n", i);
printf("r\nkkey1\nr\nkkey2\n");
}
+ printf("e\n");
+ printf("eend of test8 run\n");
}' > $TMP1
$PROG btree $TMP1
# $PROG hash $TMP1
@@ -464,7 +459,7 @@ test10()
printf("p\nk%d\nd%s\n", ++i, $0);
}
END {
- printf("fR_CURSOR\nr\n");
+ printf("fR_CURSOR\nr\nk1\n");
printf("eR_CURSOR SHOULD HAVE FAILED\n");
}' > $TMP2
$PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
@@ -578,8 +573,7 @@ test13()
echo g
echo k$i
done > $TMP2
- $PROG -s \
- -ilorder=$order -f byte.file -o $TMP3 $type $TMP2
+ $PROG -ilorder=$order -f byte.file -o $TMP3 $type $TMP2
if (cmp -s $TMP1 $TMP3) ; then :
else
echo "test13: $type/$order get failed"
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index c4fa5140f7e8..f91be48502df 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -19,7 +19,7 @@ SRCS+= alarm.c assert.c clock.c closedir.c config.c confstr.c crypt.c \
sigsetops.c sleep.c sysconf.c sysctl.c syslog.c \
telldir.c termios.c time.c times.c timezone.c ttyname.c ttyslot.c \
ualarm.c uname.c unvis.c usleep.c utime.c valloc.c vis.c wait.c \
- wait3.c waitpid.c _thread_init.c
+ wait3.c waitpid.c
# *rand48 family, from 1.1.5
SRCS+= _rand48.c drand48.c erand48.c jrand48.c lcong48.c lrand48.c \
@@ -46,9 +46,7 @@ MAN3+= gen/alarm.3 gen/clock.3 gen/confstr.3 gen/config_open.3 \
gen/getmntinfo.3 gen/getnetgrent.3 gen/getpagesize.3 gen/getpass.3 \
gen/getpwent.3 gen/getttyent.3 gen/getvfsent.3 gen/getusershell.3 \
gen/glob.3 \
- gen/initgroups.3 gen/isinf.3 gen/ldexp.3 \
- gen/msgctl.3 gen/msgget.3 gen/msgrcv.3 gen/msgsnd.3 \
- gen/modf.3 gen/nice.3 \
+ gen/initgroups.3 gen/isinf.3 gen/ldexp.3 gen/modf.3 gen/nice.3 \
gen/nlist.3 gen/pause.3 gen/popen.3 gen/psignal.3 gen/pwcache.3 \
gen/raise.3 gen/rand48.3 gen/scandir.3 gen/setjmp.3 gen/setmode.3 \
gen/siginterrupt.3 gen/signal.3 gen/sigsetops.3 gen/sleep.3 \
@@ -59,16 +57,14 @@ MAN3+= gen/alarm.3 gen/clock.3 gen/confstr.3 gen/config_open.3 \
MLINKS+=config_open.3 config_next.3 config_open.3 config_close.3 \
config_open.3 config_skip.3
-MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3 crypt.3 des_setkey.3 \
- crypt.3 des_cipher.3
+MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3
MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \
directory.3 readdir.3 directory.3 rewinddir.3 directory.3 seekdir.3 \
directory.3 telldir.3
MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 execv.3 \
- exec.3 execvp.3 exec.3 exect.3
+ exec.3 execvp.3
MLINKS+=err.3 verr.3 err.3 errx.3 err.3 verrx.3 err.3 warn.3 err.3 vwarn.3 \
- err.3 warnx.3 err.3 vwarnx.3 err.3 err_set_file.3 \
- err.3 err_set_exit.3
+ err.3 warnx.3 err.3 vwarnx.3
MLINKS+=isinf.3 isnan.3
MLINKS+=getcap.3 cgetcap.3 getcap.3 cgetclose.3 getcap.3 cgetent.3 \
getcap.3 cgetfirst.3 getcap.3 cgetmatch.3 getcap.3 cgetnext.3 \
@@ -92,7 +88,7 @@ MLINKS+=getvfsent.3 getvfsbyname.3 getvfsent.3 getvfsbytype.3 \
MLINKS+=getusershell.3 endusershell.3 getusershell.3 setusershell.3
MLINKS+=glob.3 globfree.3
MLINKS+=popen.3 pclose.3
-MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3
+MLINKS+=psignal.3 sys_siglist.3
MLINKS+=pwcache.3 user_from_uid.3 pwcache.3 group_from_gid.3
MLINKS+=rand48.3 _rand48.3 rand48.3 drand48.3 rand48.3 erand48.3 \
rand48.3 jrand48.3 rand48.3 lcong48.3 rand48.3 lrand48.3 \
@@ -116,6 +112,3 @@ MLINKS+=tcsetattr.3 tcgetattr.3 tcsetattr.3 cfsetospeed.3 \
MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyslot.3
MLINKS+=tzset.3 tzsetwall.3
MLINKS+=vis.3 strvis.3 vis.3 strvisx.3
-MLINKS+=unvis.3 strunvis.3
-MLINKS+=fts.3 fts_open.3 fts.3 fts_read.3 fts.3 fts_children.3 \
- fts.3 fts_close.3
diff --git a/lib/libc/gen/assert.c b/lib/libc/gen/assert.c
index eb2748ce6d44..4914acac157f 100644
--- a/lib/libc/gen/assert.c
+++ b/lib/libc/gen/assert.c
@@ -35,6 +35,7 @@
static char sccsid[] = "@(#)assert.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/types.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index 0a7078e7f347..cc4df538c40b 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -42,7 +42,6 @@ static char sccsid[] = "@(#)confstr.c 8.1 (Berkeley) 6/4/93";
#include <paths.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
size_t
confstr(name, buf, len)
diff --git a/lib/libc/gen/crypt.c b/lib/libc/gen/crypt.c
index c1417b8e4a61..59cb92008dbe 100644
--- a/lib/libc/gen/crypt.c
+++ b/lib/libc/gen/crypt.c
@@ -36,12 +36,11 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* from static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; */
-static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.3 1995/05/30 05:40:10 rgrimes Exp $";
+static char rcsid[] = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libc/gen/crypt.c,v 1.3 1995/05/30 05:40:10 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
#include <stdio.h>
-#include <string.h>
/*
* UNIX password, and DES, encryption.
@@ -50,10 +49,6 @@ static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.3 1995/0
* encryption, make sure you've got libcrypt.a around.
*/
-__warn_references(des_setkey,
- "WARNING! des_setkey(3) not present in the system!");
-
-int
des_setkey(key)
register const char *key;
{
@@ -61,10 +56,6 @@ des_setkey(key)
return (0);
}
-__warn_references(des_cipher,
- "WARNING! des_cipher(3) not present in the system!");
-
-int
des_cipher(in, out, salt, num_iter)
const char *in;
char *out;
@@ -76,10 +67,6 @@ des_cipher(in, out, salt, num_iter)
return (0);
}
-__warn_references(setkey,
- "WARNING! setkey(3) not present in the system!");
-
-int
setkey(key)
register const char *key;
{
@@ -87,10 +74,6 @@ setkey(key)
return (0);
}
-__warn_references(encrypt,
- "WARNING! encrypt(3) not present in the system!");
-
-int
encrypt(block, flag)
register char *block;
int flag;
diff --git a/lib/libc/gen/daemon.3 b/lib/libc/gen/daemon.3
index 97646d7855f2..1905923a66f7 100644
--- a/lib/libc/gen/daemon.3
+++ b/lib/libc/gen/daemon.3
@@ -37,7 +37,6 @@
.Nm daemon
.Nd run in the background
.Sh SYNOPSIS
-.Fd #include <stdlib.h>
.Fn daemon "int nochdir" "int noclose"
.Sh DESCRIPTION
.Pp
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index ac2894e3bd07..cc4c3dff45a6 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -32,11 +32,7 @@
*/
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 5/3/95";
-#endif
-static const char rcsid[] =
- "$Id$";
+static char sccsid[] = "@(#)disklabel.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
#include <sys/param.h>
@@ -50,8 +46,8 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
+static int error __P((int));
static int gettype __P((char *, char **));
struct disklabel *
@@ -66,7 +62,7 @@ getdiskbyname(name)
char *cp, *cq; /* can't be register */
char p, max, psize[3], pbsize[3],
pfsize[3], poffset[3], ptype[3];
- u_int32_t *dx;
+ u_long *dx;
if (cgetent(&buf, db_array, (char *) name) < 0)
return NULL;
@@ -171,3 +167,17 @@ gettype(t, names)
return (atoi(t));
return (0);
}
+
+static int
+error(err)
+ int err;
+{
+ char *p;
+
+ (void)write(STDERR_FILENO, "disktab: ", 9);
+ (void)write(STDERR_FILENO, _PATH_DISKTAB, sizeof(_PATH_DISKTAB) - 1);
+ (void)write(STDERR_FILENO, ": ", 2);
+ p = strerror(err);
+ (void)write(STDERR_FILENO, p, strlen(p));
+ (void)write(STDERR_FILENO, "\n", 1);
+}
diff --git a/lib/libc/gen/exec.3 b/lib/libc/gen/exec.3
index 367d71ae86d6..bda6e9e6169f 100644
--- a/lib/libc/gen/exec.3
+++ b/lib/libc/gen/exec.3
@@ -185,7 +185,7 @@ The return value is \-1, and the global variable
.Va errno
will be set to indicate the error.
.Sh FILES
-.Bl -tag -width /bin/sh -compact
+.Bl -tag -width /bin/sh - compact
.It Pa /bin/sh
The shell.
.El
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index a5260687149a..47ad477afbd5 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -46,10 +46,10 @@ static FILE *_fs_fp;
static struct fstab _fs_fstab;
static int LineNo = 0;
-static void error __P((int));
-static int fstabscan __P((void));
+static error __P((int));
+static fstabscan __P((void));
-static int
+static
fstabscan()
{
char *cp, *p;
@@ -77,9 +77,9 @@ fstabscan()
_fs_fstab.fs_vfstype =
strcmp(_fs_fstab.fs_type, FSTAB_SW) ?
"ufs" : "swap";
- if ((cp = strsep(&p, ":\n")) != NULL) {
+ if (cp = strsep(&p, ":\n")) {
_fs_fstab.fs_freq = atoi(cp);
- if ((cp = strsep(&p, ":\n")) != NULL) {
+ if (cp = strsep(&p, ":\n")) {
_fs_fstab.fs_passno = atoi(cp);
return(1);
}
@@ -157,7 +157,7 @@ bad: /* no way to distinguish between EOF and syntax error */
struct fstab *
getfsent()
{
- if ((!_fs_fp && !setfsent()) || !fstabscan())
+ if (!_fs_fp && !setfsent() || !fstabscan())
return((struct fstab *)NULL);
return(&_fs_fstab);
}
@@ -184,7 +184,6 @@ getfsfile(name)
return((struct fstab *)NULL);
}
-int
setfsent()
{
if (_fs_fp) {
@@ -192,7 +191,7 @@ setfsent()
LineNo = 0;
return(1);
}
- if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) {
+ if (_fs_fp = fopen(_PATH_FSTAB, "r")) {
LineNo = 0;
return(1);
}
@@ -209,7 +208,7 @@ endfsent()
}
}
-static void
+static
error(err)
int err;
{
diff --git a/lib/libc/gen/getbsize.3 b/lib/libc/gen/getbsize.3
index b4390390eab2..045557304eae 100644
--- a/lib/libc/gen/getbsize.3
+++ b/lib/libc/gen/getbsize.3
@@ -75,5 +75,5 @@ a block size of 512 bytes.
.Sh HISTORY
The
.Nm getbsize
-function first appeared in
+function call appeared in
.Bx 4.4 .
diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3
index e29437fb0488..c423a98f54bc 100644
--- a/lib/libc/gen/getcap.3
+++ b/lib/libc/gen/getcap.3
@@ -73,7 +73,7 @@
.Fn cgetclose "void"
.Sh DESCRIPTION
.Fn Cgetent
-extracts the capability
+extracts the capability rec
.Fa name
from the database specified by the
.Dv NULL
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 93d195267fc5..6bb44506ecbb 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -192,6 +192,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
int fd, depth;
{
DB *capdbp;
+ DBT key, data;
register char *r_end, *rp, **db_p;
int myfd, eof, foundit, retval, clen;
char *record, *cbuf;
@@ -541,6 +542,8 @@ cdbget(capdbp, bp, name)
char **bp, *name;
{
DBT key, data;
+ char *buf;
+ int st;
key.data = name;
key.size = strlen(name);
diff --git a/lib/libc/gen/getcwd.3 b/lib/libc/gen/getcwd.3
index 8b385be52957..8740a75986a0 100644
--- a/lib/libc/gen/getcwd.3
+++ b/lib/libc/gen/getcwd.3
@@ -35,8 +35,7 @@
.Dt GETCWD 3
.Os BSD 4.2
.Sh NAME
-.Nm getcwd ,
-.Nm getwd
+.Nm getcwd
.Nd get working directory pathname
.Sh SYNOPSIS
.Fd #include <unistd.h>
diff --git a/lib/libc/gen/getfsent.3 b/lib/libc/gen/getfsent.3
index 1cc90bf99376..105183798062 100644
--- a/lib/libc/gen/getfsent.3
+++ b/lib/libc/gen/getfsent.3
@@ -43,7 +43,7 @@
.Nd get file system descriptor file entry
.Sh SYNOPSIS
.Fd #include <fstab.h>
-.Ft struct fstab *
+.Ft fstab *
.Fn getfsent void
.Ft struct fstab *
.Fn getfsspec "const char *spec"
diff --git a/lib/libc/gen/getgrent.3 b/lib/libc/gen/getgrent.3
index 4b02c85becc4..e9bd284312ad 100644
--- a/lib/libc/gen/getgrent.3
+++ b/lib/libc/gen/getgrent.3
@@ -53,7 +53,7 @@
.Fn getgrnam "const char *name"
.Ft struct group *
.Fn getgrgid "gid_t gid"
-.Ft int
+.Ft struct group *
.Fn setgroupent "int stayopen"
.\" .Ft void
.\" .Fn setgrfile "const char *name"
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 6451dc997f22..9ba9a717e54a 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -163,7 +163,7 @@ start_gr()
char *line;
size_t linelen;
_gr_yp_enabled = 0;
- while((line = fgetln(_gr_fp, &linelen)) != NULL) {
+ while(line = fgetln(_gr_fp, &linelen)) {
if(line[0] == '+') {
if(line[1] && !_gr_yp_enabled) {
_gr_yp_enabled = 1;
@@ -301,7 +301,6 @@ grscan(search, gid, name)
return(1);
}
/* NOTREACHED */
- return (0);
}
#ifdef YP
@@ -426,8 +425,7 @@ unpack:
strcpy(resultbuf, result);
free(result);
- if((result = strchr(resultbuf, '\n')) != NULL)
- *result = '\0';
+ if(result = strchr(resultbuf, '\n')) *result = '\0';
if (_gr_breakout_yp(gr, resultbuf))
return(1);
else
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c
index c65e1fa6eb9a..10c4df76f3e8 100644
--- a/lib/libc/gen/getgrouplist.c
+++ b/lib/libc/gen/getgrouplist.c
@@ -50,6 +50,7 @@ getgrouplist(uname, agroup, groups, grpcnt)
int *grpcnt;
{
register struct group *grp;
+ register struct passwd *pw;
register int i, ngroups;
int ret, maxgroups;
diff --git a/lib/libc/gen/getpagesize.c b/lib/libc/gen/getpagesize.c
index 556ff9e032da..d586cf68d534 100644
--- a/lib/libc/gen/getpagesize.c
+++ b/lib/libc/gen/getpagesize.c
@@ -38,24 +38,16 @@ static char sccsid[] = "@(#)getpagesize.c 8.1 (Berkeley) 6/4/93";
#include <sys/param.h>
#include <sys/sysctl.h>
-/*
- * This is unlikely to change over the running time of any
- * program, so we cache the result to save some syscalls.
- */
-
int
getpagesize()
{
- int mib[2];
- static int value;
+ int mib[2], value;
size_t size;
- if (!value) {
- mib[0] = CTL_HW;
- mib[1] = HW_PAGESIZE;
- size = sizeof value;
- if (sysctl(mib, 2, &value, &size, NULL, 0) == -1)
- return (-1);
- }
+ mib[0] = CTL_HW;
+ mib[1] = HW_PAGESIZE;
+ size = sizeof value;
+ if (sysctl(mib, 2, &value, &size, NULL, 0) == -1)
+ return (-1);
return (value);
}
diff --git a/lib/libc/gen/getpass.3 b/lib/libc/gen/getpass.3
index 6582ddd10186..f312d42b8f5a 100644
--- a/lib/libc/gen/getpass.3
+++ b/lib/libc/gen/getpass.3
@@ -64,7 +64,7 @@ turns off character echoing while reading the password.
.Nm Getpass
returns a pointer to the null terminated password.
.Sh FILES
-.Bl -tag -width /dev/tty -compact
+.Bl -tag -width /dev/tty - compact
.It Pa /dev/tty
.El
.Sh SEE ALSO
diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c
index 658f5b6d6ab3..f6391a190433 100644
--- a/lib/libc/gen/getpass.c
+++ b/lib/libc/gen/getpass.c
@@ -36,54 +36,23 @@ static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/termios.h>
-#include <signal.h>
+#include <sys/signal.h>
#include <paths.h>
#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
-static struct termios oterm, term;
-static sig_t ointhandler, oquithandler, otstphandler, oconthandler;
-static FILE *fp;
-
-static void
-sighandler(int signo)
-{
- /* restore tty state */
- (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &oterm);
-
- /* restore old sig handlers */
- (void)signal(SIGINT, ointhandler);
- (void)signal(SIGQUIT, oquithandler);
- (void)signal(SIGTSTP, otstphandler);
-
- /* resend us this signal */
- (void)kill(getpid(), signo);
-}
-
-/* ARGSUSED */
-static void
-sigconthandler(int signo)
-{
- /* re-install our signal handlers */
- ointhandler = signal(SIGINT, sighandler);
- oquithandler = signal(SIGQUIT, sighandler);
- otstphandler = signal(SIGTSTP, sighandler);
-
- /* turn off echo again */
- (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
-}
-
-
char *
getpass(prompt)
const char *prompt;
{
+ struct termios term;
register int ch;
register char *p;
- FILE *outfp;
+ FILE *fp, *outfp;
long omask;
+ int echo;
static char buf[_PASSWORD_LEN + 1];
/*
@@ -94,16 +63,16 @@ getpass(prompt)
outfp = stderr;
fp = stdin;
}
-
- ointhandler = signal(SIGINT, sighandler);
- oquithandler = signal(SIGQUIT, sighandler);
- otstphandler = signal(SIGTSTP, sighandler);
- oconthandler = signal(SIGCONT, sigconthandler);
-
- (void)tcgetattr(fileno(fp), &oterm);
- term = oterm;
- term.c_lflag &= ~ECHO;
- (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
+ /*
+ * note - blocking signals isn't necessarily the
+ * right thing, but we leave it for now.
+ */
+ omask = sigblock(sigmask(SIGINT)|sigmask(SIGTSTP));
+ (void)tcgetattr(fileno(fp), &term);
+ if (echo = (term.c_lflag & ECHO)) {
+ term.c_lflag &= ~ECHO;
+ (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
+ }
(void)fputs(prompt, outfp);
rewind(outfp); /* implied flush */
for (p = buf; (ch = getc(fp)) != EOF && ch != '\n';)
@@ -111,14 +80,11 @@ getpass(prompt)
*p++ = ch;
*p = '\0';
(void)write(fileno(outfp), "\n", 1);
- (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &oterm);
-
- /* restore old sig handlers */
- (void)signal(SIGINT, ointhandler);
- (void)signal(SIGQUIT, oquithandler);
- (void)signal(SIGTSTP, otstphandler);
- (void)signal(SIGCONT, oconthandler);
-
+ if (echo) {
+ term.c_lflag |= ECHO;
+ (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
+ }
+ (void)sigsetmask(omask);
if (fp != stdin)
(void)fclose(fp);
return(buf);
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index da64187d1c2d..d4275394f641 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -38,7 +38,6 @@ static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93";
#include <sys/param.h>
#include <stdio.h>
-#include <err.h>
int
initgroups(uname, agroup)
diff --git a/lib/libc/gen/isatty.c b/lib/libc/gen/isatty.c
index c8356c710342..f6bb04b86316 100644
--- a/lib/libc/gen/isatty.c
+++ b/lib/libc/gen/isatty.c
@@ -37,27 +37,12 @@ static char sccsid[] = "@(#)isatty.c 8.1 (Berkeley) 6/4/93";
#include <termios.h>
#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
int
isatty(fd)
int fd;
{
- int retval;
struct termios t;
-#ifdef _THREAD_SAFE
- if (_thread_fd_lock(fd, FD_READ, NULL,__FILE__,__LINE__) == 0) {
-#endif
- retval = (tcgetattr(fd, &t) != -1);
-#ifdef _THREAD_SAFE
- _thread_fd_unlock(fd, FD_READ);
- } else {
- retval = 0;
- }
-#endif
- return(retval);
+ return(tcgetattr(fd, &t) != -1);
}
diff --git a/lib/libc/gen/ldexp.3 b/lib/libc/gen/ldexp.3
index a19b329c7e64..bffcacf48902 100644
--- a/lib/libc/gen/ldexp.3
+++ b/lib/libc/gen/ldexp.3
@@ -73,5 +73,5 @@ is returned.
.Sh STANDARDS
The
.Fn ldexp
-function conforms to
+function conforms
.St -ansiC .
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index cbece1889383..9993dcabc053 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -73,6 +73,8 @@ __fdnlist(fd, list)
register off_t stroff, symoff;
register u_long symsize;
register int nent;
+ size_t strsize;
+ struct nlist nbuf[1024];
struct exec * exec;
struct stat st;
diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c
index a3db45b18d77..b3c0e096d67e 100644
--- a/lib/libc/gen/opendir.c
+++ b/lib/libc/gen/opendir.c
@@ -56,16 +56,6 @@ opendir(name)
int saved_errno;
struct stat sb;
- /*
- * stat() before open() because opening of special files may be
- * harmful. fstat() after open because the file may have changed.
- */
- if (stat(name, &sb) != 0)
- return NULL;
- if (!S_ISDIR(sb.st_mode)) {
- errno = ENOTDIR;
- return NULL;
- }
if ((fd = open(name, O_RDONLY | O_NONBLOCK)) == -1)
return NULL;
dirp = NULL;
@@ -79,13 +69,18 @@ opendir(name)
(dirp = malloc(sizeof(DIR))) == NULL)
goto fail;
/*
- * Use the system page size if that is a multiple of DIRBLKSIZ
- * this could speed things up in some cases we hope
+ * If CLBYTES is an exact multiple of DIRBLKSIZ, use a CLBYTES
+ * buffer that it cluster boundary aligned.
+ * Hopefully this can be a big win someday by allowing page trades
+ * to user space to be done by getdirentries()
*/
- dirp->dd_len = getpagesize();
- if ((dirp->dd_len % DIRBLKSIZ) != 0)
+ if ((CLBYTES % DIRBLKSIZ) == 0) {
+ dirp->dd_buf = malloc(CLBYTES);
+ dirp->dd_len = CLBYTES;
+ } else {
+ dirp->dd_buf = malloc(DIRBLKSIZ);
dirp->dd_len = DIRBLKSIZ;
- dirp->dd_buf = malloc(dirp->dd_len);
+ }
if (dirp->dd_buf == NULL)
goto fail;
dirp->dd_fd = fd;
diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3
index 0f66f521fa7e..2be78336390f 100644
--- a/lib/libc/gen/psignal.3
+++ b/lib/libc/gen/psignal.3
@@ -36,7 +36,7 @@
.Os BSD 4.2
.Sh NAME
.Nm psignal ,
-.Nm sys_siglist ,
+.Nm sys_siglist
.Nm sys_signame
.Nd system signal messages
.Sh SYNOPSIS
diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c
index b7e7ab66761a..51491b430842 100644
--- a/lib/libc/gen/psignal.c
+++ b/lib/libc/gen/psignal.c
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)psignal.c 8.1 (Berkeley) 6/4/93";
* Print the name of the signal indicated
* along with the supplied message.
*/
-#include <signal.h>
+#include <sys/signal.h>
#include <string.h>
#include <unistd.h>
diff --git a/lib/libc/gen/pwcache.3 b/lib/libc/gen/pwcache.3
index 2e69a04261c4..74afa746ed96 100644
--- a/lib/libc/gen/pwcache.3
+++ b/lib/libc/gen/pwcache.3
@@ -84,7 +84,7 @@ pointer is returned.
.Xr getpwuid 3
.Sh HISTORY
The
-.Fn user_from_uid
+.Fn user_from_id
and
-.Fn group_from_gid
+.Fn group_from_id
functions first appeared in 4.4BSD.
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
index 05773bd7e105..1dcbf5d0f200 100644
--- a/lib/libc/gen/pwcache.c
+++ b/lib/libc/gen/pwcache.c
@@ -38,7 +38,6 @@ static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93";
#include <sys/types.h>
#include <grp.h>
-#include <string.h>
#include <pwd.h>
#include <stdio.h>
#include <utmp.h>
@@ -53,10 +52,10 @@ user_from_uid(uid, nouser)
{
static struct ncache {
uid_t uid;
- int found;
char name[UT_NAMESIZE + 1];
} c_uid[NCACHE];
static int pwopen;
+ static char nbuf[15]; /* 32 bits == 10 digits */
register struct passwd *pw;
register struct ncache *cp;
@@ -66,18 +65,15 @@ user_from_uid(uid, nouser)
setpassent(1);
pwopen = 1;
}
- pw = getpwuid(uid);
- cp->uid = uid;
- if (pw != NULL) {
- cp->found = 1;
- (void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE);
- cp->name[UT_NAMESIZE] = '\0';
- } else {
- cp->found = 0;
- (void)snprintf(cp->name, UT_NAMESIZE, "%u", uid);
+ if ((pw = getpwuid(uid)) == NULL) {
if (nouser)
return (NULL);
+ (void)snprintf(nbuf, sizeof(nbuf), "%u", uid);
+ return (nbuf);
}
+ cp->uid = uid;
+ (void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE);
+ cp->name[UT_NAMESIZE] = '\0';
}
return (cp->name);
}
@@ -89,10 +85,10 @@ group_from_gid(gid, nogroup)
{
static struct ncache {
gid_t gid;
- int found;
char name[UT_NAMESIZE + 1];
} c_gid[NCACHE];
static int gropen;
+ static char nbuf[15]; /* 32 bits == 10 digits */
struct group *gr;
struct ncache *cp;
@@ -102,18 +98,15 @@ group_from_gid(gid, nogroup)
setgroupent(1);
gropen = 1;
}
- gr = getgrgid(gid);
- cp->gid = gid;
- if (gr != NULL) {
- cp->found = 1;
- (void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE);
- cp->name[UT_NAMESIZE] = '\0';
- } else {
- cp->found = 0;
- (void)snprintf(cp->name, UT_NAMESIZE, "%u", gid);
+ if ((gr = getgrgid(gid)) == NULL) {
if (nogroup)
return (NULL);
+ (void)snprintf(nbuf, sizeof(nbuf), "%u", gid);
+ return (nbuf);
}
+ cp->gid = gid;
+ (void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE);
+ cp->name[UT_NAMESIZE] = '\0';
}
return (cp->name);
}
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index c69d77568cdd..2190b4e07d3c 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -67,7 +67,7 @@ typedef struct bitcmd {
#define CMD2_UBITS 0x10
static BITCMD *addcmd __P((BITCMD *, int, int, int, u_int));
-static void compress_mode __P((BITCMD *));
+static int compress_mode __P((BITCMD *));
#ifdef SETMODE_DEBUG
static void dumpmode __P((BITCMD *));
#endif
@@ -172,7 +172,7 @@ setmode(p)
BITCMD *set, *saveset, *endset;
sigset_t sigset, sigoset;
mode_t mask;
- int equalopdone=0, permXbits, setlen;
+ int equalopdone, permXbits, setlen;
if (!*p)
return (NULL);
@@ -402,7 +402,7 @@ dumpmode(set)
* 'g' and 'o' commands continue to be separate. They could probably be
* compacted, but it's not worth the effort.
*/
-static void
+static int
compress_mode(set)
register BITCMD *set;
{
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index b06475d392a5..3c0b8fa31efa 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -36,35 +36,18 @@ static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
-#include <signal.h>
+#include <sys/signal.h>
#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#else
#define setvec(vec, a) \
vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0
static int ringring;
-#endif
unsigned int
sleep(seconds)
unsigned int seconds;
{
-#ifdef _THREAD_SAFE
- struct timespec time_to_sleep;
- struct timespec time_remaining;
-
- if (seconds) {
- time_to_sleep.ts_sec = seconds;
- time_to_sleep.ts_nsec = 0;
- nanosleep(&time_to_sleep,&time_remaining);
- seconds = time_remaining.ts_sec;
- }
- return(seconds);
-#else
register struct itimerval *itp;
struct itimerval itv, oitv;
struct sigvec vec, ovec;
@@ -105,13 +88,10 @@ sleep(seconds)
(void) sigsetmask(omask);
(void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
return 0;
-#endif
}
-#ifndef _THREAD_SAFE
static void
sleephandler()
{
ringring = 1;
}
-#endif
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 16a3efa0026d..2994505e942c 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -39,7 +39,6 @@ static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
-#include <sys/time.h>
#include <sys/sysctl.h>
#include <sys/resource.h>
@@ -63,6 +62,7 @@ long
sysconf(name)
int name;
{
+ struct clockinfo clk;
struct rlimit rl;
size_t len;
int mib[2], value;
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index 35835c847ec4..a7cffcfc73bf 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -51,7 +51,7 @@ The information available from
consists of integers, strings, and tables.
Information may be retrieved and set from the command interface
using the
-.Xr sysctl 8
+.Xr sysctl 1
utility.
.Pp
Unless explicitly noted below,
@@ -117,7 +117,7 @@ listed here, and described in separate sections below.
.Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent
.It Sy Pa Name Next level names Description
.It CTL\_DEBUG sys/sysctl.h Debugging
-.It CTL\_VFS sys/sysctl.h File system
+.It CTL\_FS sys/sysctl.h File system
.It CTL\_HW sys/sysctl.h Generic CPU, I/O
.It CTL\_KERN sys/sysctl.h High kernel limits
.It CTL\_MACHDEP sys/sysctl.h Machine dependent
@@ -176,7 +176,7 @@ as a debugging variable, the following declaration would be used:
int dospecialcheck = 1;
struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck };
.Ed
-.Sh CTL_VFS
+.Sh CTL_FS
There are currently no second level names for the file system.
.Sh CTL_HW
The string and integer information available for the CTL_HW level
@@ -260,7 +260,7 @@ information.
.Bl -tag -width "123456"
.It Li KERN_ARGMAX
The maximum bytes of argument to
-.Xr execve 2 .
+.Xr exec 2 .
.It Li KERN_BOOTTIME
A
.Va struct timeval
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index cb7448af3243..f67a5338d636 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -43,7 +43,6 @@ static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94";
#include <paths.h>
#include <stdio.h>
#include <unistd.h>
-#include <string.h>
int
sysctl(name, namelen, oldp, oldlenp, newp, newlen)
diff --git a/lib/libc/gen/syslog.3 b/lib/libc/gen/syslog.3
index ab1bd9d8e59e..832fd9ce52e5 100644
--- a/lib/libc/gen/syslog.3
+++ b/lib/libc/gen/syslog.3
@@ -173,15 +173,11 @@ The same as
but logged to a file readable only by
selected individuals.
.It Dv LOG_CRON
-The cron daemon:
-.Xr cron 8 .
+The clock daemon.
.It Dv LOG_DAEMON
System daemons, such as
.Xr routed 8 ,
that are not provided for explicitly by other facilities.
-.It Dv LOG_FTP
-The file transfer protocol daemon:
-.Xr ftpd 8 .
.It Dv LOG_KERN
Messages generated by the kernel.
These cannot be generated by any user processes.
@@ -252,10 +248,8 @@ always returns the previous log mask level.
.Bd -literal -offset indent -compact
syslog(LOG_ALERT, "who: internal error 23");
-openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
-
+openlog("ftpd", LOG_PID, LOG_DAEMON);
setlogmask(LOG_UPTO(LOG_ERR));
-
syslog(LOG_INFO, "Connection from host %d", CallingHost);
syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 3873a696fd57..dd5a8cca004f 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -32,11 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*
-static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94";
-*/
-static const char rcsid[] =
- "$Id$";
+static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -61,16 +57,12 @@ static const char rcsid[] =
static int LogFile = -1; /* fd for log */
static int connected; /* have done connect */
-static int opened; /* have done openlog() */
static int LogStat = 0; /* status bits, set by openlog() */
static const char *LogTag = NULL; /* string to tag the entry with */
static int LogFacility = LOG_USER; /* default facility code */
static int LogMask = 0xff; /* mask of priorities to be logged */
extern char *__progname; /* Program name, from crt0. */
-static void disconnectlog __P((void)); /* disconnect from syslogd */
-static void connectlog __P((void)); /* (re)connect to syslogd */
-
/*
* Format of the magic cookie passed through the stdio hook
*/
@@ -84,8 +76,7 @@ struct bufcookie {
* XXX: Maybe one day, dynamically allocate it so that the line length
* is `unlimited'.
*/
-static
-int writehook(cookie, buf, len)
+static writehook(cookie, buf, len)
void *cookie; /* really [struct bufcookie *] */
char *buf; /* characters to copy */
int len; /* length to copy */
@@ -137,7 +128,7 @@ vsyslog(pri, fmt, ap)
va_list ap;
{
register int cnt;
- register char ch, *p;
+ register char ch, *p, *t;
time_t now;
int fd, saved_errno;
char *stdp, tbuf[2048], fmt_cpy[1024];
@@ -238,18 +229,8 @@ vsyslog(pri, fmt, ap)
}
/* Get connected, output the message to the local logger. */
- if (!opened)
+ if (!connected)
openlog(LogTag, LogStat | LOG_NDELAY, 0);
- connectlog();
- if (send(LogFile, tbuf, cnt, 0) >= 0)
- return;
-
- /*
- * If the send() failed, the odds are syslogd was restarted.
- * Make one (only) attempt to reconnect to /dev/log.
- */
- disconnectlog();
- connectlog();
if (send(LogFile, tbuf, cnt, 0) >= 0)
return;
@@ -276,56 +257,33 @@ vsyslog(pri, fmt, ap)
static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
-static void
-disconnectlog()
+void
+openlog(ident, logstat, logfac)
+ const char *ident;
+ int logstat, logfac;
{
- /*
- * If the user closed the FD and opened another in the same slot,
- * that's their problem. They should close it before calling on
- * system services.
- */
- if (LogFile != -1) {
- close(LogFile);
- LogFile = -1;
- }
- connected = 0; /* retry connect */
-}
+ if (ident != NULL)
+ LogTag = ident;
+ LogStat = logstat;
+ if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
+ LogFacility = logfac;
-static void
-connectlog()
-{
if (LogFile == -1) {
SyslogAddr.sa_family = AF_UNIX;
(void)strncpy(SyslogAddr.sa_data, _PATH_LOG,
sizeof(SyslogAddr.sa_data));
- if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
- return;
- (void)fcntl(LogFile, F_SETFD, 1);
+ if (LogStat & LOG_NDELAY) {
+ if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
+ return;
+ (void)fcntl(LogFile, F_SETFD, 1);
+ }
}
- if (LogFile != -1 && !connected) {
+ if (LogFile != -1 && !connected)
if (connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) == -1) {
(void)close(LogFile);
LogFile = -1;
} else
connected = 1;
- }
-}
-
-void
-openlog(ident, logstat, logfac)
- const char *ident;
- int logstat, logfac;
-{
- if (ident != NULL)
- LogTag = ident;
- LogStat = logstat;
- if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
- LogFacility = logfac;
-
- if (LogStat & LOG_NDELAY) /* open immediately */
- connectlog();
-
- opened = 1; /* ident and facility has been set */
}
void
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c
index 5264a2dfceb9..3041987ee7df 100644
--- a/lib/libc/gen/termios.c
+++ b/lib/libc/gen/termios.c
@@ -36,11 +36,15 @@ static char sccsid[] = "@(#)termios.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
-#include <sys/fcntl.h>
#include <sys/ioctl.h>
+#include <sys/tty.h>
#include <sys/time.h>
+#define KERNEL /* XXX - FREAD and FWRITE ifdef'd KERNEL*/
+#include <sys/fcntl.h>
+#undef KERNEL
#include <errno.h>
+#include <stdio.h>
#include <termios.h>
#include <unistd.h>
@@ -95,7 +99,6 @@ tcsetpgrp(fd, pgrp)
pid_t
tcgetpgrp(fd)
- int fd;
{
int s;
@@ -165,12 +168,11 @@ cfmakeraw(t)
t->c_oflag &= ~OPOST;
t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|NOFLSH|TOSTOP|PENDIN);
t->c_cflag &= ~(CSIZE|PARENB);
- t->c_cflag |= CS8|CREAD;
+ t->c_cflag |= CS8;
t->c_cc[VMIN] = 1;
t->c_cc[VTIME] = 0;
}
-int
tcsendbreak(fd, len)
int fd, len;
{
@@ -186,7 +188,6 @@ tcsendbreak(fd, len)
return (0);
}
-int
tcdrain(fd)
int fd;
{
@@ -194,7 +195,6 @@ tcdrain(fd)
return (ioctl(fd, TIOCDRAIN, 0));
}
-int
tcflush(fd, which)
int fd, which;
{
@@ -217,7 +217,6 @@ tcflush(fd, which)
return (ioctl(fd, TIOCFLUSH, &com));
}
-int
tcflow(fd, action)
int fd, action;
{
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 39c640ee5eae..f024f52e20ca 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -39,121 +39,11 @@ static char sccsid[] = "@(#)ttyname.c 8.2 (Berkeley) 1/27/94";
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
-#include <stdlib.h>
#include <termios.h>
-#include <unistd.h>
#include <db.h>
#include <string.h>
#include <paths.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-static pthread_mutex_t ttyname_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_key_t ttyname_key;
-static int ttyname_init = 0;
-
-char *
-ttyname(int fd)
-{
- char *ret;
-
- if (_thread_fd_lock(fd, FD_READ, NULL, __FILE__, __LINE__) == 0) {
- ret = __ttyname_basic(fd);
- _thread_fd_unlock(fd, FD_READ);
- } else {
- ret = NULL;
- }
-
- return (ret);
-}
-
-char *
-__ttyname_r_basic(int fd, char *buf, size_t len)
-{
- register struct dirent *dirp;
- register DIR *dp;
- struct stat dsb;
- struct stat sb;
- char *rval;
- int minlen;
-
- rval = NULL;
-
- /* Must be a terminal. */
- if (!isatty(fd))
- return (rval);
- /* Must be a character device. */
- if (_thread_sys_fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
- return (rval);
- /* Must have enough room */
- if (len <= sizeof(_PATH_DEV))
- return (rval);
-
- if ((dp = opendir(_PATH_DEV)) != NULL) {
- memcpy(buf, _PATH_DEV, sizeof(_PATH_DEV));
- for (rval = NULL; (dirp = readdir(dp)) != NULL;) {
- if (dirp->d_fileno != sb.st_ino)
- continue;
- minlen = (len - (sizeof(_PATH_DEV) - 1)) < (dirp->d_namlen + 1) ?
- (len - (sizeof(_PATH_DEV) - 1)) : (dirp->d_namlen + 1);
- memcpy(buf + sizeof(_PATH_DEV) - 1, dirp->d_name, minlen);
- if (stat(buf, &dsb) || sb.st_dev != dsb.st_dev ||
- sb.st_ino != dsb.st_ino)
- continue;
- rval = buf;
- break;
- }
- (void) closedir(dp);
- }
- return (rval);
-}
-
-char *
-__ttyname_basic(int fd)
-{
- char *buf;
-
- pthread_mutex_lock(&ttyname_lock);
- if (ttyname_init == 0) {
- if (pthread_keycreate(&ttyname_key, free)) {
- pthread_mutex_unlock(&ttyname_lock);
- return (NULL);
- }
- ttyname_init = 1;
- }
- pthread_mutex_unlock(&ttyname_lock);
-
- /* Must have thread specific data field to put data */
- if (pthread_getspecific(ttyname_key, (void **) &buf) != 0) {
- return (NULL);
- } else if (buf == NULL) {
- if ((buf = malloc(sizeof(_PATH_DEV) + MAXNAMLEN)) != NULL) {
- if (pthread_setspecific(ttyname_key, buf) != 0) {
- free(buf);
- return (NULL);
- }
- } else {
- return (NULL);
- }
- }
- return (__ttyname_r_basic(fd, buf, sizeof(_PATH_DEV) + MAXNAMLEN));
-}
-
-char *
-ttyname_r(int fd, char *buf, size_t len)
-{
- char *ret;
-
- if (_thread_fd_lock(fd, FD_READ, NULL, __FILE__, __LINE__) == 0) {
- ret = __ttyname_r_basic(fd, buf, len);
- _thread_fd_unlock(fd, FD_READ);
- } else {
- ret = NULL;
- }
- return (ret);
-}
-#else
static char buf[sizeof(_PATH_DEV) + MAXNAMLEN] = _PATH_DEV;
static char *oldttyname __P((int, struct stat *));
@@ -220,4 +110,3 @@ oldttyname(fd, sb)
(void)closedir(dp);
return (NULL);
}
-#endif
diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c
index ebeb771b235a..547048336c4d 100644
--- a/lib/libc/gen/unvis.c
+++ b/lib/libc/gen/unvis.c
@@ -36,6 +36,7 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
+#include <ctype.h>
#include <vis.h>
/*
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 9e29f314d959..9127bfc4f42e 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -36,12 +36,9 @@ static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
-#include <signal.h>
+#include <sys/signal.h>
#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#else
+
#define TICK 10000 /* system clock resolution in microseconds */
#define USPS 1000000 /* number of microseconds in a second */
@@ -49,22 +46,11 @@ static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93";
vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0
static int ringring;
-#endif
-
void
usleep(useconds)
unsigned int useconds;
{
-#ifdef _THREAD_SAFE
- struct timespec time_to_sleep;
-
- if (useconds) {
- time_to_sleep.ts_nsec = (useconds % 1000000) * 1000;
- time_to_sleep.ts_sec = useconds / 1000000;
- nanosleep(&time_to_sleep,NULL);
- }
-#else
register struct itimerval *itp;
struct itimerval itv, oitv;
struct sigvec vec, ovec;
@@ -104,13 +90,10 @@ usleep(useconds)
(void) sigvec(SIGALRM, &ovec, (struct sigvec *)0);
(void) sigsetmask(omask);
(void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
-#endif
}
-#ifndef _THREAD_SAFE
static void
sleephandler()
{
ringring = 1;
}
-#endif
diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c
index 66954e7cd57e..e12226a593f6 100644
--- a/lib/libc/gen/vis.c
+++ b/lib/libc/gen/vis.c
@@ -51,8 +51,7 @@ vis(dst, c, flag, nextc)
int c, nextc;
register int flag;
{
- c = (unsigned char)c;
- if (isgraph(c) ||
+ if ((u_int)c <= UCHAR_MAX && isgraph(c) ||
((flag & VIS_SP) == 0 && c == ' ') ||
((flag & VIS_TAB) == 0 && c == '\t') ||
((flag & VIS_NL) == 0 && c == '\n') ||
diff --git a/lib/libc/gmon/Makefile.inc b/lib/libc/gmon/Makefile.inc
index 57dc29364566..65a865917db6 100644
--- a/lib/libc/gmon/Makefile.inc
+++ b/lib/libc/gmon/Makefile.inc
@@ -5,7 +5,6 @@
SRCS+= gmon.c mcount.c
MAN3+= gmon/moncontrol.3
-MLINKS+= moncontrol.3 monstartup.3
# mcount cannot be compiled with profiling
mcount.po: mcount.o
diff --git a/lib/libc/i386/DEFS.h b/lib/libc/i386/DEFS.h
index 2ec3019f91cd..27240d7df76c 100644
--- a/lib/libc/i386/DEFS.h
+++ b/lib/libc/i386/DEFS.h
@@ -38,24 +38,6 @@
* $Id: DEFS.h,v 1.2 1994/08/05 01:17:56 wollman Exp $
*/
-#include <sys/cdefs.h>
-
-/*
- * CNAME and HIDENAME manage the relationship between symbol names in C
- * and the equivalent assembly language names. CNAME is given a name as
- * it would be used in a C program. It expands to the equivalent assembly
- * language name. HIDENAME is given an assembly-language name, and expands
- * to a possibly-modified form that will be invisible to C programs.
- */
-#if defined(__ELF__) /* { */
-#define CNAME(csym) csym
-#define HIDENAME(asmsym) __CONCAT(.,asmsym)
-#else /* } { */
-#define CNAME(csym) __CONCAT(_,csym)
-#define HIDENAME(asmsym) asmsym
-#endif /* } */
-
-
/* XXX should use align 4,0x90 for -m486. */
#define _START_ENTRY .align 2,0x90;
#if 0
@@ -69,30 +51,30 @@
#ifdef PROF
#define ALTENTRY(x) _START_ENTRY \
- .globl CNAME(x); .type CNAME(x),@function; CNAME(x):; \
+ .globl _/**/x; .type _/**/x,@function; _/**/x:; \
_MID_ENTRY \
- call HIDENAME(mcount); jmp 9f
+ call mcount; jmp 9f
-#define ENTRY(x) _START_ENTRY \
- .globl CNAME(x); .type CNAME(x),@function; CNAME(x):; \
+#define ENTRY(x) _START_ENTRY \
+ .globl _/**/x; .type _/**/x,@function; _/**/x:; \
_MID_ENTRY \
- call HIDENAME(mcount); 9:
+ call mcount; 9:
#define ALTASENTRY(x) _START_ENTRY \
.globl x; .type x,@function; x:; \
_MID_ENTRY \
- call HIDENAME(mcount); jmp 9f
+ call mcount; jmp 9f
#define ASENTRY(x) _START_ENTRY \
.globl x; .type x,@function; x:; \
_MID_ENTRY \
- call HIDENAME(mcount); 9:
+ call mcount; 9:
#else /* !PROF */
-#define ENTRY(x) _START_ENTRY .globl CNAME(x); .type CNAME(x),@function; \
- CNAME(x):
+#define ENTRY(x) _START_ENTRY .globl _/**/x; .type _/**/x,@function; \
+ _/**/x:
#define ALTENTRY(x) ENTRY(x)
#define ASENTRY(x) _START_ENTRY .globl x; .type x,@function; x:
diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h
index 9a63bf0fcff2..bbd2a1d95eb6 100644
--- a/lib/libc/i386/SYS.h
+++ b/lib/libc/i386/SYS.h
@@ -61,27 +61,13 @@
#define PIC_GOTOFF(x) x
#endif
-#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(x); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
+#define SYSCALL(x) 2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
#define RSYSCALL(x) SYSCALL(x); ret
-
-/*
- * For the thread_safe versions, we prepend _thread_sys_ to the function
- * name so that the 'C' wrapper can go around the real name.
- */
-#ifdef _THREAD_SAFE /* in case */
-#define PSYSCALL(x,y) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(y); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
-#define PRSYSCALL(x,y) PSYSCALL(x,y); ret
-#endif
-
-#define PSEUDO(x,y) ENTRY(x); lea __CONCAT(SYS_,y), %eax; KERNCALL; ret
-#define CALL(x,y) call CNAME(y); addl $4*x,%esp
+#define PSEUDO(x,y) ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0); ret
+#define CALL(x,y) call _/**/y; addl $4*x,%esp
/* gas fucks up offset -- although we don't currently need it, do for BCS */
#define LCALL(x,y) .byte 0x9a ; .long y; .word x
-#ifdef __ELF__
-#define KERNCALL int $0x80 /* Faster */
-#else
-#define KERNCALL LCALL(7,0) /* The old way */
-#endif
-
#define ASMSTR .asciz
+
+ .globl cerror
diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc
index 387aebffef0f..87873af521c9 100644
--- a/lib/libc/i386/gen/Makefile.inc
+++ b/lib/libc/i386/gen/Makefile.inc
@@ -3,3 +3,4 @@
SRCS+= isinf.c infinity.c
SRCS+= _setjmp.S alloca.S fabs.S ldexp.c modf.S setjmp.S sigsetjmp.S
+SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
diff --git a/lib/libc/i386/gen/_setjmp.S b/lib/libc/i386/gen/_setjmp.S
index 23a2cdea0a03..876f3c0aadf8 100644
--- a/lib/libc/i386/gen/_setjmp.S
+++ b/lib/libc/i386/gen/_setjmp.S
@@ -53,11 +53,7 @@
#include "DEFS.h"
-#ifdef _THREAD_SAFE
-ENTRY(__thread_sys_setjmp)
-#else
ENTRY(_setjmp)
-#endif
movl 4(%esp),%eax
movl 0(%esp),%edx
movl %edx, 0(%eax) /* rta */
@@ -70,11 +66,7 @@ ENTRY(_setjmp)
xorl %eax,%eax
ret
-#ifdef _THREAD_SAFE
-ENTRY(__thread_sys_longjmp)
-#else
ENTRY(_longjmp)
-#endif
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
diff --git a/lib/libc/i386/gen/modf.S b/lib/libc/i386/gen/modf.S
index 34a89ed4dbce..bce5a3519ed1 100644
--- a/lib/libc/i386/gen/modf.S
+++ b/lib/libc/i386/gen/modf.S
@@ -50,10 +50,10 @@
*/
/* With CHOP mode on, frndint behaves as TRUNC does. Useful. */
-
-#include "DEFS.h"
-
-ENTRY(modf)
+.text
+.globl _modf
+.type _modf,@function
+_modf:
pushl %ebp
movl %esp,%ebp
subl $16,%esp
diff --git a/lib/libc/i386/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S
index be457fc55b3e..449ea3747fde 100644
--- a/lib/libc/i386/gen/setjmp.S
+++ b/lib/libc/i386/gen/setjmp.S
@@ -54,20 +54,10 @@
#include "DEFS.h"
#include "SYS.h"
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_setjmp)
-#else
ENTRY(setjmp)
-#endif
- PIC_PROLOGUE
pushl $0
-#ifdef _THREAD_SAFE
- call PIC_PLT(CNAME(_thread_sys_sigblock))
-#else
- call PIC_PLT(CNAME(sigblock))
-#endif
+ call PIC_PLT(_sigblock)
popl %edx
- PIC_EPILOGUE
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
@@ -81,21 +71,11 @@ ENTRY(setjmp)
xorl %eax,%eax
ret
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_longjmp)
-#else
ENTRY(longjmp)
-#endif
movl 4(%esp),%edx
- PIC_PROLOGUE
pushl 24(%edx)
-#ifdef _THREAD_SAFE
- call PIC_PLT(CNAME(_thread_sys_sigsetmask))
-#else
- call PIC_PLT(CNAME(sigsetmask)) /* XXX this is not reentrant */
-#endif
+ call PIC_PLT(_sigsetmask) /* XXX this is not reentrant */
popl %eax
- PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S
index 3610a2b5eac0..4ec4538f3453 100644
--- a/lib/libc/i386/gen/sigsetjmp.S
+++ b/lib/libc/i386/gen/sigsetjmp.S
@@ -59,28 +59,18 @@
* use sigreturn() if sigreturn() works.
*/
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_sigsetjmp)
-#else
ENTRY(sigsetjmp)
-#endif
movl 8(%esp),%eax
movl 4(%esp),%ecx
movl %eax,32(%ecx)
testl %eax,%eax
- jz 2f
- PIC_PROLOGUE
+ jz 1f
pushl $0
-#ifdef _THREAD_SAFE
- call PIC_PLT(CNAME(_thread_sys_sigblock))
-#else
- call PIC_PLT(CNAME(sigblock))
-#endif
+ call PIC_PLT(_sigblock)
addl $4,%esp
- PIC_EPILOGUE
movl 4(%esp),%ecx
movl %eax,24(%ecx)
-2: movl 0(%esp),%edx
+1: movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
movl %esp, 8(%ecx)
@@ -91,24 +81,14 @@ ENTRY(sigsetjmp)
xorl %eax,%eax
ret
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_siglongjmp)
-#else
ENTRY(siglongjmp)
-#endif
movl 4(%esp),%edx
cmpl $0,32(%edx)
- jz 2f
- PIC_PROLOGUE
+ jz 1f
pushl 24(%edx)
-#ifdef _THREAD_SAFE
- call PIC_PLT(CNAME(_thread_sys_sigsetmask))
-#else
- call PIC_PLT(CNAME(sigsetmask))
-#endif
+ call PIC_PLT(_sigsetmask)
addl $4,%esp
- PIC_EPILOGUE
-2: movl 4(%esp),%edx
+1: movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
@@ -119,7 +99,7 @@ ENTRY(siglongjmp)
fninit
fldcw 28(%edx)
testl %eax,%eax
- jnz 1f
+ jnz 2f
incl %eax
-1: movl %ecx,0(%esp)
+2: movl %ecx,0(%esp)
ret
diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S
index 6d9993825a04..facfc3a96231 100644
--- a/lib/libc/i386/string/bcopy.S
+++ b/lib/libc/i386/string/bcopy.S
@@ -53,10 +53,8 @@ ENTRY(bcopy)
movl 12(%esp),%esi
movl 16(%esp),%edi
movl 20(%esp),%ecx
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ecx,%eax /* overlapping? */
- jb 1f
+ cmpl %esi,%edi /* potentially overlapping? */
+ jnb 1f
cld /* nope, copy forwards. */
shrl $2,%ecx /* copy by words */
rep
@@ -71,10 +69,10 @@ ENTRY(bcopy)
1:
addl %ecx,%edi /* copy backwards. */
addl %ecx,%esi
+ std
+ andl $3,%ecx /* any fractional bytes? */
decl %edi
decl %esi
- andl $3,%ecx /* any fractional bytes? */
- std
rep
movsb
movl 20(%esp),%ecx /* copy remainder by words */
diff --git a/lib/libc/i386/string/memmove.S b/lib/libc/i386/string/memmove.S
index 497af4fceacc..27d6d3178bf0 100644
--- a/lib/libc/i386/string/memmove.S
+++ b/lib/libc/i386/string/memmove.S
@@ -54,10 +54,8 @@ ENTRY(memmove)
movl 12(%esp),%edi
movl 16(%esp),%esi
movl 20(%esp),%ecx
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ecx,%eax
- jb 1f
+ cmpl %esi,%edi /* potentially overlapping? */
+ jnb 1f
cld /* nope, copy forwards. */
shrl $2,%ecx /* copy by words */
rep
@@ -73,10 +71,10 @@ ENTRY(memmove)
1:
addl %ecx,%edi /* copy backwards. */
addl %ecx,%esi
+ std
+ andl $3,%ecx /* any fractional bytes? */
decl %edi
decl %esi
- andl $3,%ecx /* any fractional bytes? */
- std
rep
movsb
movl 20(%esp),%ecx /* copy remainder by words */
diff --git a/lib/libc/i386/sys/Ovfork.S b/lib/libc/i386/sys/Ovfork.S
index 0161f4a87a19..a941be2d7182 100644
--- a/lib/libc/i386/sys/Ovfork.S
+++ b/lib/libc/i386/sys/Ovfork.S
@@ -41,7 +41,6 @@
.asciz "$Id: Ovfork.S,v 1.2 1995/01/23 01:29:37 davidg Exp $"
#endif /* SYSLIBC_RCS and not lint */
-#include "DEFS.h"
#include "SYS.h"
/*
@@ -51,49 +50,30 @@
* %eax == pid of child in parent, %eax == pid of parent in child.
*
*/
+ .set vfork,66
+.globl _vfork
+.type _vfork,@function
-ENTRY(vfork)
+_vfork:
popl %ecx /* my rta into ecx */
- lea SYS_vfork,%eax
- KERNCALL
+ movl $vfork, %eax
+ LCALL(7,0)
jb verror
vforkok:
cmpl $0,%edx /* child process? */
jne child /* yes */
jmp parent
-#ifdef _THREAD_SAFE
- /*
- * Threaded version using __error().
- */
- .globl CNAME(__error)
- .type CNAME(__error),@function
-verror:
- pushl %eax
-#ifdef PIC
- call PIC_PLT(CNAME(__error))
-#else
- call CNAME(__error)
-#endif
- popl %ecx
- movl %ecx,(%eax)
- movl $-1,%eax
- movl $-1,%edx
-#else /* !_THREAD_SAFE */
- /*
- * Non-threaded version using global errno.
- */
- .globl CNAME(errno)
+.globl _errno
verror:
#ifdef PIC
PIC_PROLOGUE
- movl PIC_GOT(CNAME(errno)), %edx
+ movl PIC_GOT(_errno), %edx
movl %eax,(%edx)
PIC_EPILOGUE
#else
- movl %eax,CNAME(errno)
+ movl %eax,_errno
#endif
movl $-1,%eax
-#endif /* !_THREAD_SAFE */
jmp %ecx
child:
movl $0,%eax
diff --git a/lib/libc/i386/sys/brk.S b/lib/libc/i386/sys/brk.S
index 1636858c0d3e..c66add4905fc 100644
--- a/lib/libc/i386/sys/brk.S
+++ b/lib/libc/i386/sys/brk.S
@@ -43,8 +43,10 @@
#include "SYS.h"
- .globl HIDENAME(curbrk)
- .globl HIDENAME(minbrk)
+#define SYS_brk 17
+
+ .globl curbrk
+ .globl minbrk
ENTRY(_brk)
jmp ok
@@ -52,40 +54,39 @@ ENTRY(brk)
#ifdef PIC
movl 4(%esp),%eax
PIC_PROLOGUE
- movl PIC_GOT(HIDENAME(curbrk)),%edx # set up GOT addressing
- movl PIC_GOT(HIDENAME(minbrk)),%ecx #
+ movl PIC_GOT(curbrk),%edx # set up GOT addressing
+ movl PIC_GOT(minbrk),%ecx #
cmpl %eax,(%ecx)
PIC_EPILOGUE
jl ok
movl (%ecx),%eax
movl %eax,4(%esp)
ok:
- lea SYS_break,%eax
- KERNCALL
+ lea SYS_brk,%eax
+ LCALL(7,0)
jb err
movl 4(%esp),%eax
movl %eax,(%edx)
movl $0,%eax
ret
err:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp PIC_PLT(cerror)
#else
movl 4(%esp),%eax
- cmpl %eax,HIDENAME(minbrk)
+ cmpl %eax,minbrk
jl ok
- movl HIDENAME(minbrk),%eax
+ movl minbrk,%eax
movl %eax,4(%esp)
ok:
- lea SYS_break,%eax
- KERNCALL
+ lea SYS_brk,%eax
+ LCALL(7,0)
jb err
movl 4(%esp),%eax
- movl %eax,HIDENAME(curbrk)
+ movl %eax,curbrk
movl $0,%eax
ret
err:
- jmp HIDENAME(cerror)
+ jmp cerror
#endif
diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S
index a54b55eb2d1f..8c49bd4aeab4 100644
--- a/lib/libc/i386/sys/cerror.S
+++ b/lib/libc/i386/sys/cerror.S
@@ -43,45 +43,16 @@
#include "SYS.h"
- .globl HIDENAME(cerror)
-
-#ifdef _THREAD_SAFE
- /*
- * Threaded version using __error().
- */
- .globl CNAME(__error)
- .type CNAME(__error),@function
-HIDENAME(cerror):
- pushl %eax
-#ifdef PIC
- /* The caller must execute the PIC prologue before jumping to cerror. */
- call PIC_PLT(CNAME(__error))
- popl %ecx
- PIC_EPILOGUE
-#else
- call CNAME(__error)
- popl %ecx
-#endif
- movl %ecx,(%eax)
- movl $-1,%eax
- movl $-1,%edx
- ret
-
-#else /* _THREAD_SAFE */
- /*
- * Non-threaded version using global errno.
- */
- .globl CNAME(errno)
-HIDENAME(cerror):
+ .globl _errno
+cerror:
#ifdef PIC
- /* The caller must execute the PIC prologue before jumping to cerror. */
- movl PIC_GOT(CNAME(errno)),%ecx
+ PIC_PROLOGUE
+ movl PIC_GOT(_errno),%ecx
movl %eax,(%ecx)
PIC_EPILOGUE
#else
- movl %eax,CNAME(errno)
+ movl %eax,_errno
#endif
movl $-1,%eax
movl $-1,%edx
ret
-#endif /* _THREAD_SAFE */
diff --git a/lib/libc/i386/sys/exect.S b/lib/libc/i386/sys/exect.S
index 59ce389f2978..9fe53d21bc57 100644
--- a/lib/libc/i386/sys/exect.S
+++ b/lib/libc/i386/sys/exect.S
@@ -51,6 +51,5 @@ ENTRY(exect)
orl $ PSL_T,%edx
pushl %edx
popf
- KERNCALL
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */
+ LCALL(7,0)
+ jmp cerror /* exect(file, argv, env); */
diff --git a/lib/libc/i386/sys/fork.S b/lib/libc/i386/sys/fork.S
index 27b49d326eed..8b8507711339 100644
--- a/lib/libc/i386/sys/fork.S
+++ b/lib/libc/i386/sys/fork.S
@@ -43,11 +43,7 @@
#include "SYS.h"
-#ifdef _THREAD_SAFE
-PSYSCALL(fork,_thread_sys_fork)
-#else
SYSCALL(fork)
-#endif
cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */
je 1f
movl $0,%eax
diff --git a/lib/libc/i386/sys/pipe.S b/lib/libc/i386/sys/pipe.S
index b415ec0e7fca..1741cd24e7d1 100644
--- a/lib/libc/i386/sys/pipe.S
+++ b/lib/libc/i386/sys/pipe.S
@@ -43,11 +43,7 @@
#include "SYS.h"
-#ifdef _THREAD_SAFE
-PSYSCALL(pipe,_thread_sys_pipe)
-#else
SYSCALL(pipe)
-#endif
movl 4(%esp),%ecx
movl %eax,(%ecx)
movl %edx,4(%ecx)
diff --git a/lib/libc/i386/sys/ptrace.S b/lib/libc/i386/sys/ptrace.S
index 993c9be55056..d18dd0a193a4 100644
--- a/lib/libc/i386/sys/ptrace.S
+++ b/lib/libc/i386/sys/ptrace.S
@@ -47,16 +47,15 @@ ENTRY(ptrace)
xorl %eax,%eax
#ifdef PIC
PIC_PROLOGUE
- movl PIC_GOT(CNAME(errno)),%edx
+ movl PIC_GOT(_errno),%edx
movl %eax,(%edx)
PIC_EPILOGUE
#else
- movl %eax,CNAME(errno)
+ movl %eax,_errno
#endif
lea SYS_ptrace,%eax
- KERNCALL
+ LCALL(7,0)
jb err
ret
err:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp cerror
diff --git a/lib/libc/i386/sys/sbrk.S b/lib/libc/i386/sys/sbrk.S
index 4213114aa4d2..90729f651ca6 100644
--- a/lib/libc/i386/sys/sbrk.S
+++ b/lib/libc/i386/sys/sbrk.S
@@ -43,53 +43,48 @@
#include "SYS.h"
- .globl CNAME(end)
- .globl HIDENAME(minbrk)
- .globl HIDENAME(curbrk)
+#define SYS_brk 17
+
+ .globl _end
+ .globl minbrk
+ .globl curbrk
.data
-HIDENAME(minbrk): .long CNAME(end)
-HIDENAME(curbrk): .long CNAME(end)
+minbrk: .long _end
+curbrk: .long _end
.text
ENTRY(sbrk)
#ifdef PIC
movl 4(%esp),%ecx
PIC_PROLOGUE
- movl PIC_GOT(HIDENAME(curbrk)),%edx
+ movl PIC_GOT(curbrk),%edx
movl (%edx),%eax
PIC_EPILOGUE
- testl %ecx,%ecx
- jz back
addl %eax,4(%esp)
- lea SYS_break,%eax
- KERNCALL
+ lea SYS_brk,%eax
+ LCALL(7,0)
jb err
PIC_PROLOGUE
- movl PIC_GOT(HIDENAME(curbrk)),%edx
+ movl PIC_GOT(curbrk),%edx
movl (%edx),%eax
addl %ecx,(%edx)
PIC_EPILOGUE
-back:
ret
err:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp PIC_PLT(cerror)
-#else /* !PIC */
+#else
movl 4(%esp),%ecx
- movl HIDENAME(curbrk),%eax
- testl %ecx,%ecx
- jz back
+ movl curbrk,%eax
addl %eax,4(%esp)
- lea SYS_break,%eax
- KERNCALL
+ lea SYS_brk,%eax
+ LCALL(7,0)
jb err
- movl HIDENAME(curbrk),%eax
- addl %ecx,HIDENAME(curbrk)
-back:
+ movl curbrk,%eax
+ addl %ecx,curbrk
ret
err:
- jmp HIDENAME(cerror)
-#endif /* PIC */
+ jmp cerror
+#endif
diff --git a/lib/libc/i386/sys/setlogin.S b/lib/libc/i386/sys/setlogin.S
index 1ec31b9ef760..27e23a74ca3b 100644
--- a/lib/libc/i386/sys/setlogin.S
+++ b/lib/libc/i386/sys/setlogin.S
@@ -43,17 +43,17 @@
#include "SYS.h"
-.globl CNAME(_logname_valid) /* in getlogin() */
+.globl __logname_valid /* in getlogin() */
SYSCALL(setlogin)
#ifdef PIC
PIC_PROLOGUE
pushl %eax
- movl PIC_GOT(CNAME(_logname_valid)),%eax
+ movl PIC_GOT(__logname_valid),%eax
movl $0,(%eax)
popl %eax
PIC_EPILOGUE
#else
- movl $0,CNAME(_logname_valid)
+ movl $0,__logname_valid
#endif
ret /* setlogin(name) */
diff --git a/lib/libc/i386/sys/sigpending.S b/lib/libc/i386/sys/sigpending.S
index cbace9d2f05b..d42a765dbf32 100644
--- a/lib/libc/i386/sys/sigpending.S
+++ b/lib/libc/i386/sys/sigpending.S
@@ -43,11 +43,7 @@
#include "SYS.h"
-#ifdef _THREAD_SAFE
-PSYSCALL(sigpending,_thread_sys_sigpending)
-#else
SYSCALL(sigpending)
-#endif
movl 4(%esp),%ecx # fetch pointer to...
movl %eax,(%ecx) # store old mask
xorl %eax,%eax
diff --git a/lib/libc/i386/sys/sigprocmask.S b/lib/libc/i386/sys/sigprocmask.S
index 33112aa0ad17..a433522a1aa5 100644
--- a/lib/libc/i386/sys/sigprocmask.S
+++ b/lib/libc/i386/sys/sigprocmask.S
@@ -44,14 +44,9 @@
#include "SYS.h"
err:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp cerror
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_sigprocmask)
-#else
ENTRY(sigprocmask)
-#endif
movl 8(%esp),%ecx # fetch new sigset pointer
cmpl $0,%ecx # check new sigset pointer
jne 1f # if not null, indirect
@@ -60,8 +55,8 @@ ENTRY(sigprocmask)
jmp 2f
1: movl (%ecx),%ecx # fetch indirect ...
movl %ecx,8(%esp) # to new mask arg
-2: lea SYS_sigprocmask,%eax
- KERNCALL
+2: movl $ SYS_sigprocmask , %eax
+ LCALL(0x7,0)
jb err
movl 12(%esp),%ecx # fetch old mask requested
cmpl $0,%ecx # test if old mask requested
diff --git a/lib/libc/i386/sys/sigreturn.S b/lib/libc/i386/sys/sigreturn.S
index f09c1fea9c06..884fb1ebc58e 100644
--- a/lib/libc/i386/sys/sigreturn.S
+++ b/lib/libc/i386/sys/sigreturn.S
@@ -44,13 +44,14 @@
#include "SYS.h"
/*
- * NOTE: If the profiling ENTRY() code ever changes any registers, they
- * must be saved. On FreeBSD, this is not the case.
+ * We must preserve the state of the registers as the user has set them up.
*/
+#ifdef PROF
+#undef ENTRY
+#define ENTRY(x) \
+ .globl _/**/x; .align 2; _/**/x: pusha ; \
+ .data; 1:; .long 0; .text; movl $1b,%eax; call mcount; popa ; nop
+#endif /* PROF */
-#ifdef _THREAD_SAFE
-PSYSCALL(sigreturn,_thread_sys_sigreturn)
-#else
SYSCALL(sigreturn)
-#endif
ret
diff --git a/lib/libc/i386/sys/sigsuspend.S b/lib/libc/i386/sys/sigsuspend.S
index 825b068a885c..823204187886 100644
--- a/lib/libc/i386/sys/sigsuspend.S
+++ b/lib/libc/i386/sys/sigsuspend.S
@@ -44,19 +44,14 @@
#include "SYS.h"
err:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp cerror
-#ifdef _THREAD_SAFE
-ENTRY(_thread_sys_sigsuspend)
-#else
ENTRY(sigsuspend)
-#endif
movl 4(%esp),%eax # fetch mask arg
movl (%eax),%eax # indirect to mask arg
movl %eax,4(%esp)
- lea SYS_sigsuspend,%eax
- KERNCALL
+ movl $ SYS_sigsuspend ,%eax
+ LCALL(0x7,0)
jb err
xorl %eax,%eax # shouldn t happen
ret
diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S
index ccc1b93e6901..89e91e9c6d50 100644
--- a/lib/libc/i386/sys/syscall.S
+++ b/lib/libc/i386/sys/syscall.S
@@ -47,11 +47,10 @@ ENTRY(syscall)
pop %ecx /* rta */
pop %eax /* syscall number */
push %ecx
- KERNCALL
+ LCALL(7,0)
push %ecx /* need to push a word to keep stack frame intact
upon return; the word must be the return address. */
jb 1f
ret
1:
- PIC_PROLOGUE
- jmp PIC_PLT(HIDENAME(cerror))
+ jmp cerror
diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc
index 5fd09d27a922..795d1f81bf89 100644
--- a/lib/libc/locale/Makefile.inc
+++ b/lib/libc/locale/Makefile.inc
@@ -4,8 +4,9 @@
.PATH: ${.CURDIR}/${MACHINE}/locale ${.CURDIR}/locale
SRCS+= ansi.c ctype.c euc.c frune.c isctype.c lconv.c localeconv.c \
- mbrune.c none.c rune.c setlocale.c table.c utf2.c setrunelocale.c \
- runetype.c tolower.c toupper.c nomacros.c collate.c setinvalidrune.c
+ mbrune.c none.c rune.c common_setlocale.c \
+ startup_setlocale.c read_runemagi.c setlocale.c table.c utf2.c \
+ runetype.c tolower.c toupper.c nomacros.c collate.c
MAN3+= locale/ctype.3 locale/isalnum.3 locale/isalpha.3 locale/isascii.3 \
locale/isblank.3 locale/iscntrl.3 locale/isdigit.3 locale/isgraph.3 \
@@ -14,8 +15,3 @@ MAN3+= locale/ctype.3 locale/isalnum.3 locale/isalpha.3 locale/isascii.3 \
locale/rune.3 locale/setlocale.3 locale/toascii.3 locale/tolower.3 \
locale/toupper.3
MAN4+= locale/euc.4 locale/utf2.4
-MLINKS+= rune.3 setrunelocale.3 rune.3 setinvalidrune.3 rune.3 sgetrune.3 \
- rune.3 sputrune.3 rune.3 fgetrune.3 rune.3 fungetrune.3 \
- rune.3 fputrune.3 mbrune.3 mbrrune.3 mbrune.3 mbmb.3 \
- multibyte.3 mblen.3 multibyte.3 mbstowcs.3 multibyte.3 mbtowc.3 \
- multibyte.3 wcstombs.3 multibyte.3 wctomb.3 setlocale.3 localeconv.3
diff --git a/lib/libc/locale/ansi.c b/lib/libc/locale/ansi.c
index a5a3362d8adf..e5c8e8ff96de 100644
--- a/lib/libc/locale/ansi.c
+++ b/lib/libc/locale/ansi.c
@@ -53,7 +53,7 @@ mblen(s, n)
if (s == 0 || *s == 0)
return (0); /* No support for state dependent encodings. */
- if (sgetrune(s, n, &e) == _INVALID_RUNE)
+ if (sgetrune(s, (int)n, &e) == _INVALID_RUNE)
return (s - e);
return (e - s);
}
@@ -70,7 +70,7 @@ mbtowc(pwc, s, n)
if (s == 0 || *s == 0)
return (0); /* No support for state dependent encodings. */
- if ((r = sgetrune(s, n, &e)) == _INVALID_RUNE)
+ if ((r = sgetrune(s, (int)n, &e)) == _INVALID_RUNE)
return (s - e);
if (pwc)
*pwc = r;
@@ -137,12 +137,11 @@ wcstombs(s, pwcs, n)
*s = 0;
break;
}
- if (!sputrune(*pwcs++, s, n, &e))
+ if (!sputrune(*pwcs++, s, (int)n, &e))
return (-1); /* encoding error */
if (!e) /* too long */
return (cnt);
cnt += e - s;
- n -= e - s;
s = e;
}
return (cnt);
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index ef73cefebb74..d06bd5c3ad3d 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -36,7 +36,6 @@
#include <sysexits.h>
#include "collate.h"
-char *_PathLocale;
int __collate_load_error = 1;
u_char __collate_charmap_table[UCHAR_MAX + 1][STR_LEN];
u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN];
@@ -59,27 +58,20 @@ __collate_load_tables(encoding)
char *encoding;
{
char buf[PATH_MAX];
+ static char *path_locale;
FILE *fp;
- int save_load_error;
- save_load_error = __collate_load_error;
__collate_load_error = 1;
- if (!encoding) {
- __collate_load_error = save_load_error;
+ if (!encoding)
return -1;
- }
- if (!*encoding || !strcmp(encoding, "C") || !strcmp(encoding, "POSIX"))
- return 0;
- if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
- _PathLocale = _PATH_LOCALE;
- strcpy(buf, _PathLocale);
+ if (!path_locale && !(path_locale = getenv("PATH_LOCALE")))
+ path_locale = _PATH_LOCALE;
+ strcpy(buf, path_locale);
strcat(buf, "/");
strcat(buf, encoding);
strcat(buf, "/LC_COLLATE");
- if ((fp = fopen(buf, "r")) == NULL) {
- __collate_load_error = save_load_error;
+ if ((fp = fopen(buf, "r")) == NULL)
return -1;
- }
FREAD(__collate_charmap_table, sizeof(__collate_charmap_table), 1, fp);
FREAD(__collate_substitute_table, sizeof(__collate_substitute_table),
1, fp);
diff --git a/lib/libc/locale/euc.4 b/lib/libc/locale/euc.4
index 9524a4dea503..966b896b657f 100644
--- a/lib/libc/locale/euc.4
+++ b/lib/libc/locale/euc.4
@@ -38,7 +38,7 @@
.Dt EUC 4
.Os
.Sh NAME
-.Nm euc
+.Nm EUC
.Nd EUC encoding of runes
.Sh SYNOPSIS
\fBENCODING "EUC"\fP
diff --git a/lib/libc/locale/euc.c b/lib/libc/locale/euc.c
index bc33ff64ef77..e58c8556087a 100644
--- a/lib/libc/locale/euc.c
+++ b/lib/libc/locale/euc.c
@@ -34,7 +34,6 @@
* SUCH DAMAGE.
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)euc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -219,4 +218,3 @@ CodeSet1:
}
return (len);
}
-#endif /* XPG4 */
diff --git a/lib/libc/locale/isupper.3 b/lib/libc/locale/isupper.3
index f8fb41305914..6035f0915f32 100644
--- a/lib/libc/locale/isupper.3
+++ b/lib/libc/locale/isupper.3
@@ -69,6 +69,6 @@ returns non-zero if the character tests true.
.Xr ascii 7
.Sh STANDARDS
The
-.Fn isupper
+.Xr isupper
function conforms to
.St -ansiC .
diff --git a/lib/libc/locale/none.c b/lib/libc/locale/none.c
index 41f70aef7a10..b5d8e44299cd 100644
--- a/lib/libc/locale/none.c
+++ b/lib/libc/locale/none.c
@@ -64,6 +64,8 @@ _none_sgetrune(string, n, result)
size_t n;
char const **result;
{
+ int c;
+
if (n < 1) {
if (result)
*result = string;
diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c
index bc4d07cf2c24..8075825bd7fa 100644
--- a/lib/libc/locale/rune.c
+++ b/lib/libc/locale/rune.c
@@ -38,136 +38,70 @@
static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
#include <rune.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "common_rune.h"
-_RuneLocale *
-_Read_RuneMagi(fp)
- FILE *fp;
-{
- char *data;
- void *lastp;
- _RuneLocale *rl;
- _RuneEntry *rr;
- struct stat sb;
- int x;
-
- if (fstat(fileno(fp), &sb) < 0)
- return(0);
-
- if (sb.st_size < sizeof(_RuneLocale))
- return(0);
-
- if ((data = malloc(sb.st_size)) == NULL)
- return(0);
-
- rewind(fp); /* Someone might have read the magic number once already */
-
- if (fread(data, sb.st_size, 1, fp) != 1) {
- free(data);
- return(0);
- }
-
- rl = (_RuneLocale *)data;
- lastp = data + sb.st_size;
+char *_PathLocale;
- rl->variable = rl + 1;
-
- if (memcmp(rl->magic, _RUNE_MAGIC_1, sizeof(rl->magic))) {
- free(data);
- return(0);
- }
+extern int _none_init __P((_RuneLocale *));
+extern int _UTF2_init __P((_RuneLocale *));
+extern int _EUC_init __P((_RuneLocale *));
- rl->invalid_rune = ntohl(rl->invalid_rune);
- rl->variable_len = ntohl(rl->variable_len);
- rl->runetype_ext.nranges = ntohl(rl->runetype_ext.nranges);
- rl->maplower_ext.nranges = ntohl(rl->maplower_ext.nranges);
- rl->mapupper_ext.nranges = ntohl(rl->mapupper_ext.nranges);
-
- for (x = 0; x < _CACHED_RUNES; ++x) {
- rl->runetype[x] = ntohl(rl->runetype[x]);
- rl->maplower[x] = ntohl(rl->maplower[x]);
- rl->mapupper[x] = ntohl(rl->mapupper[x]);
- }
-
- rl->runetype_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->runetype_ext.ranges + rl->runetype_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
+int
+setrunelocale(encoding)
+ char *encoding;
+{
+ FILE *fp;
+ char name[PATH_MAX];
+ _RuneLocale *rl;
- rl->maplower_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->maplower_ext.ranges + rl->maplower_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
+ if (!encoding)
+ return(EFAULT);
- rl->mapupper_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->mapupper_ext.ranges + rl->mapupper_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
+ /*
+ * The "C" and "POSIX" locale are always here.
+ */
+ if (!strcmp(encoding, "C") || !strcmp(encoding, "POSIX")) {
+ _CurrentRuneLocale = &_DefaultRuneLocale;
return(0);
}
- for (x = 0; x < rl->runetype_ext.nranges; ++x) {
- rr = rl->runetype_ext.ranges;
-
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- if ((rr[x].map = ntohl(rr[x].map)) == 0) {
- int len = rr[x].max - rr[x].min + 1;
- rr[x].types = rl->variable;
- rl->variable = rr[x].types + len;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
- while (len-- > 0)
- rr[x].types[len] = ntohl(rr[x].types[len]);
- } else
- rr[x].types = 0;
- }
+ if (!PathLocale && !(PathLocale = getenv("PATH_LOCALE")))
+ PathLocale = _PATH_LOCALE;
- for (x = 0; x < rl->maplower_ext.nranges; ++x) {
- rr = rl->maplower_ext.ranges;
-
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- rr[x].map = ntohl(rr[x].map);
- }
+ (void) strcpy(name, PathLocale);
+ (void) strcat(name, "/");
+ (void) strcat(name, encoding);
+ (void) strcat(name, "/LC_CTYPE");
- for (x = 0; x < rl->mapupper_ext.nranges; ++x) {
- rr = rl->mapupper_ext.ranges;
+ if ((fp = fopen(name, "r")) == NULL)
+ return(ENOENT);
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- rr[x].map = ntohl(rr[x].map);
+ if ((rl = _Read_RuneMagi(fp)) == 0) {
+ fclose(fp);
+ return(EFTYPE);
}
- if (((char *)rl->variable) + rl->variable_len > (char *)lastp) {
- free(data);
- return(0);
- }
-
- /*
- * Go out and zero pointers that should be zero.
- */
- if (!rl->variable_len)
- rl->variable = 0;
-
- if (!rl->runetype_ext.nranges)
- rl->runetype_ext.ranges = 0;
-
- if (!rl->maplower_ext.nranges)
- rl->maplower_ext.ranges = 0;
-
- if (!rl->mapupper_ext.nranges)
- rl->mapupper_ext.ranges = 0;
+ fclose(fp);
+
+ if (!rl->encoding[0] || !strcmp(rl->encoding, "UTF2")) {
+ return(_UTF2_init(rl));
+ } else if (!strcmp(rl->encoding, "NONE")) {
+ return(_none_init(rl));
+ } else if (!strcmp(rl->encoding, "EUC")) {
+ return(_EUC_init(rl));
+ } else
+ return(EINVAL);
+}
- return(rl);
+void
+setinvalidrune(ir)
+ rune_t ir;
+{
+ _INVALID_RUNE = ir;
}
+
diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c
index 282f806c2466..b2c0e391f4e2 100644
--- a/lib/libc/locale/runetype.c
+++ b/lib/libc/locale/runetype.c
@@ -1,54 +1,16 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Paul Borman at Krystal Technologies.
- *
- * 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.
- */
-
#include <stdio.h>
#include <rune.h>
unsigned long
___runetype(c)
- _BSD_CT_RUNE_T_ c;
+ _BSD_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->runetype_ext;
_RuneEntry *re = rr->ranges;
- if (c < 0 || c == EOF)
- return(0L);
-
+ if (c == EOF)
+ return(0);
for (x = 0; x < rr->nranges; ++x, ++re) {
if (c < re->min)
return(0L);
@@ -59,6 +21,6 @@ ___runetype(c)
return(re->map);
}
}
-#endif
return(0L);
}
+
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 11f21398e76f..dc8157af0c64 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -43,49 +43,13 @@ static char sccsid[] = "@(#)setlocale.c 8.1 (Berkeley) 7/4/93";
#include <rune.h>
#include <stdlib.h>
#include <string.h>
-#include "collate.h"
+#include "common_setlocale.h"
+#include "common_rune.h"
-/*
- * Category names for getenv()
- */
-static char *categories[_LC_LAST] = {
- "LC_ALL",
- "LC_COLLATE",
- "LC_CTYPE",
- "LC_MONETARY",
- "LC_NUMERIC",
- "LC_TIME",
-};
-
-/*
- * Current locales for each category
- */
-static char current_categories[_LC_LAST][32] = {
- "C",
- "C",
- "C",
- "C",
- "C",
- "C",
-};
-
-/*
- * The locales we are going to try and load
- */
-static char new_categories[_LC_LAST][32];
-
-static char current_locale_string[_LC_LAST * 33];
char *_PathLocale;
-static char *currentlocale __P((void));
static char *loadlocale __P((int));
-extern int __time_load_locale __P((const char *)); /* strftime.c */
-
-#ifdef XPG4
-extern int _xpg4_setrunelocale __P((char *));
-#endif
-
char *
setlocale(category, locale)
int category;
@@ -94,8 +58,8 @@ setlocale(category, locale)
int found, i, len;
char *env, *r;
- if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
- _PathLocale = _PATH_LOCALE;
+ if (!PathLocale && !(PathLocale = getenv("PATH_LOCALE")))
+ PathLocale = _PATH_LOCALE;
if (category < 0 || category >= _LC_LAST)
return (NULL);
@@ -175,47 +139,6 @@ setlocale(category, locale)
return (NULL);
}
-/* To be compatible with crt0 hack */
-void
-_startup_setlocale(category, locale)
- int category;
- const char *locale;
-{
-#ifndef XPG4
- (void) setlocale(category, locale);
-#endif
-}
-
-static char *
-currentlocale()
-{
- int i, len;
-
- (void)strcpy(current_locale_string, current_categories[1]);
-
- for (i = 2; i < _LC_LAST; ++i)
- if (strcmp(current_categories[1], current_categories[i])) {
- len = strlen(current_categories[1]) + 1 +
- strlen(current_categories[2]) + 1 +
- strlen(current_categories[3]) + 1 +
- strlen(current_categories[4]) + 1 +
- strlen(current_categories[5]) + 1;
- if (len > sizeof(current_locale_string))
- return NULL;
- (void) strcpy(current_locale_string, current_categories[1]);
- (void) strcat(current_locale_string, "/");
- (void) strcat(current_locale_string, current_categories[2]);
- (void) strcat(current_locale_string, "/");
- (void) strcat(current_locale_string, current_categories[3]);
- (void) strcat(current_locale_string, "/");
- (void) strcat(current_locale_string, current_categories[4]);
- (void) strcat(current_locale_string, "/");
- (void) strcat(current_locale_string, current_categories[5]);
- break;
- }
- return (current_locale_string);
-}
-
static char *
loadlocale(category)
int category;
@@ -228,11 +151,7 @@ loadlocale(category)
return (current_categories[category]);
if (category == LC_CTYPE) {
-#ifdef XPG4
- if (_xpg4_setrunelocale(new_categories[LC_CTYPE]))
-#else
if (setrunelocale(new_categories[LC_CTYPE]))
-#endif
return (NULL);
(void)strcpy(current_categories[LC_CTYPE],
new_categories[LC_CTYPE]);
@@ -272,13 +191,11 @@ loadlocale(category)
* Some day we will actually look at this file.
*/
(void)snprintf(name, sizeof(name), "%s/%s/%s",
- _PathLocale, new_categories[category], categories[category]);
+ PathLocale, new_categories[category], categories[category]);
#endif
switch (category) {
case LC_MONETARY:
case LC_NUMERIC:
return (NULL);
}
- /* Just in case...*/
- return (NULL);
}
diff --git a/lib/libc/locale/table.c b/lib/libc/locale/table.c
index 9424a5812a1b..fb7344eafad5 100644
--- a/lib/libc/locale/table.c
+++ b/lib/libc/locale/table.c
@@ -38,6 +38,8 @@
static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 6/27/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/types.h>
+
#include <ctype.h>
#include <rune.h>
@@ -84,38 +86,6 @@ _RuneLocale _DefaultRuneLocale = {
_L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A,
/*78*/ _L|_R|_G|_A, _L|_R|_G|_A, _L|_R|_G|_A, _P|_R|_G,
_P|_R|_G, _P|_R|_G, _P|_R|_G, _C,
- /*80*/ _C, _C, _C, _C,
- _C, _C, _C, _C,
- /*88*/ _C, _C, _C, _C,
- _C, _C, _C, _C,
- /*90*/ _C, _C, _C, _C,
- _C, _C, _C, _C,
- /*98*/ _C, _C, _C, _C,
- _C, _C, _C, _C,
- /*A0*/ _R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- /*A8*/ _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- /*B0*/ _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- /*B8*/ _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- _P|_R|_G, _P|_R|_G, _P|_R|_G, _P|_R|_G,
- /*C0*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
- /*C8*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
- /*D0*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _P|_R|_G,
- /*D8*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
- /*E0*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
- /*E8*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
- /*F0*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _P|_R|_G,
- /*F8*/ _R|_G, _R|_G, _R|_G, _R|_G,
- _R|_G, _R|_G, _R|_G, _R|_G,
},
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index 65d5175a7b3c..995cdceab0f1 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -1,60 +1,23 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Paul Borman at Krystal Technologies.
- *
- * 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.
- */
-
#include <stdio.h>
#include <rune.h>
-_BSD_CT_RUNE_T_
+_BSD_RUNE_T_
___tolower(c)
- _BSD_CT_RUNE_T_ c;
+ _BSD_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->maplower_ext;
_RuneEntry *re = rr->ranges;
- if (c < 0 || c == EOF)
- return(c);
-
+ if (c == EOF)
+ return(EOF);
for (x = 0; x < rr->nranges; ++x, ++re) {
if (c < re->min)
return(c);
if (c <= re->max)
return(re->map + c - re->min);
}
-#endif
return(c);
}
+
+
diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c
index d2e4480d8fad..1f6c722a6bd8 100644
--- a/lib/libc/locale/toupper.c
+++ b/lib/libc/locale/toupper.c
@@ -1,60 +1,22 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Paul Borman at Krystal Technologies.
- *
- * 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.
- */
-
#include <stdio.h>
#include <rune.h>
-_BSD_CT_RUNE_T_
+_BSD_RUNE_T_
___toupper(c)
- _BSD_CT_RUNE_T_ c;
+ _BSD_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->mapupper_ext;
_RuneEntry *re = rr->ranges;
- if (c < 0 || c == EOF)
- return(c);
-
+ if (c == EOF)
+ return(EOF);
for (x = 0; x < rr->nranges; ++x, ++re) {
if (c < re->min)
return(c);
if (c <= re->max)
return(re->map + c - re->min);
}
-#endif
return(c);
}
+
diff --git a/lib/libc/locale/utf2.4 b/lib/libc/locale/utf2.4
index e2cf8cc905e3..20a95877d884 100644
--- a/lib/libc/locale/utf2.4
+++ b/lib/libc/locale/utf2.4
@@ -38,7 +38,7 @@
.Dt UTF2 4
.Os
.Sh NAME
-.Nm utf2
+.Nm UTF2
.Nd "Universal character set Transformation Format encoding of runes
.Sh SYNOPSIS
\fBENCODING "UTF2"\fP
diff --git a/lib/libc/locale/utf2.c b/lib/libc/locale/utf2.c
index c46dd93b6125..846fad90ed6f 100644
--- a/lib/libc/locale/utf2.c
+++ b/lib/libc/locale/utf2.c
@@ -34,7 +34,6 @@
* SUCH DAMAGE.
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)utf2.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -147,4 +146,3 @@ _UTF2_sputrune(c, string, n, result)
return (1);
}
}
-#endif /* XPG4 */
diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc
index 4c9bd23c584a..4bcd68265e64 100644
--- a/lib/libc/net/Makefile.inc
+++ b/lib/libc/net/Makefile.inc
@@ -8,20 +8,16 @@ SRCS+= gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \
getproto.c getprotoent.c getprotoname.c getservbyname.c \
getservbyport.c getservent.c herror.c inet_addr.c inet_lnaof.c \
inet_makeaddr.c inet_netof.c inet_network.c inet_ntoa.c \
- linkaddr.c rcmd.c recv.c res_comp.c res_data.c res_debug.c \
- res_init.c res_mkquery.c res_query.c res_send.c send.c ether_addr.c
-
-# iso_addr.c
-# ns_addr.c ns_ntoa.c
+ iso_addr.c linkaddr.c ns_addr.c ns_ntoa.c rcmd.c recv.c res_comp.c \
+ res_debug.c res_init.c res_mkquery.c res_query.c res_send.c \
+ send.c ether_addr.c
# machine-dependent net sources
.include "${.CURDIR}/${MACHINE}/net/Makefile.inc"
MAN3+= net/byteorder.3 net/ethers.3 net/gethostbyname.3 net/getnetent.3 \
net/getprotoent.3 net/getservent.3 net/inet.3 net/linkaddr.3 \
- net/rcmd.3 net/resolver.3
-
-# not installed: net/ns.3 net/iso_addr.3
+ net/ns.3 net/rcmd.3 net/resolver.3
MLINKS+=byteorder.3 htonl.3 byteorder.3 htons.3 byteorder.3 ntohl.3 \
byteorder.3 ntohs.3
@@ -39,8 +35,8 @@ MLINKS+=getservent.3 endservent.3 getservent.3 getservbyname.3 \
MLINKS+=inet.3 addr.3 inet.3 inet_addr.3 inet.3 inet_lnaof.3 \
inet.3 inet_makeaddr.3 inet.3 inet_netof.3 inet.3 inet_network.3 \
inet.3 inet_ntoa.3 inet.3 network.3 inet.3 ntoa.3 inet.3 inet_aton.3
-MLINKS+=linkaddr.3 link_addr.3 linkaddr.3 link_ntoa.3
-#MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3
+MLINKS+=linkaddr.3 linkntoa.3
+MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3
MLINKS+=rcmd.3 rresvport.3 rcmd.3 iruserok.3 rcmd.3 ruserok.3
MLINKS+=resolver.3 dn_comp.3 resolver.3 dn_expand.3 resolver.3 res_init.3 \
resolver.3 res_mkquery.3 resolver.3 res_send.3 resolver.3 res_query.3 \
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index ded2ce349d14..b287f2e361e4 100644
--- a/lib/libc/net/ether_addr.c
+++ b/lib/libc/net/ether_addr.c
@@ -147,6 +147,7 @@ int ether_ntohost(hostname, e)
ether_a = ether_ntoa(e);
if (yp_match(yp_domain, "ethers.byaddr", ether_a,
strlen(ether_a), &result, &resultlen)) {
+ free(result);
continue;
}
strncpy((char *)&buf, result, resultlen);
@@ -196,6 +197,7 @@ int ether_hostton(hostname, e)
continue;
if (yp_match(yp_domain, "ethers.byname", hostname,
strlen(hostname), &result, &resultlen)) {
+ free(result);
continue;
}
strncpy((char *)&buf, result, resultlen);
diff --git a/lib/libc/net/ethers.3 b/lib/libc/net/ethers.3
index a24f177abdf7..0ee4b6c912d1 100644
--- a/lib/libc/net/ethers.3
+++ b/lib/libc/net/ethers.3
@@ -169,8 +169,8 @@ maps in addition to the data in the
.Pa /etc/ethers
file.
.Sh SEE ALSO
-.Xr yp 4 ,
-.Xr ethers 5
+.Xr ethers 5 ,
+.Xr yp 8
.Sh BUGS
.Pp
The
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 05ea8002ac78..4f8bb090f8c8 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -63,7 +63,6 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.4.4.1 1995/08/30 04:06:40 davidg
#include <arpa/nameser.h>
#include <stdio.h>
-#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <resolv.h>
@@ -76,8 +75,10 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.4.4.1 1995/08/30 04:06:40 davidg
#define MAXALIASES 35
#define MAXADDRS 35
+#define MULTI_PTRS_ARE_ALIASES 1 /* XXX - experimental */
+
static const char AskedForGot[] =
- "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
+ "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
static char *h_addr_ptrs[MAXADDRS + 1];
@@ -88,10 +89,6 @@ static struct in_addr host_addr;
static FILE *hostf = NULL;
static int stayopen = 0;
-#ifdef RESOLVSORT
-static void addrsort __P((char **, int));
-#endif
-
#if PACKETSZ > 1024
#define MAXPACKET PACKETSZ
#else
@@ -128,6 +125,51 @@ dprintf(msg, num)
#endif
+#ifdef RESOLVSORT
+static void
+addrsort(ap, num)
+ char **ap;
+ int num;
+{
+ int i, j;
+ char **p;
+ short aval[MAXADDRS];
+ int needsort = 0;
+
+ p = ap;
+ for (i = 0; i < num; i++, p++) {
+ for (j = 0 ; (unsigned)j < _res.nsort; j++)
+ if (_res.sort_list[j].addr.s_addr ==
+ (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
+ break;
+ aval[i] = j;
+ if (needsort == 0 && i > 0 && j < aval[i-1])
+ needsort = i;
+ }
+ if (!needsort)
+ return;
+
+ while (needsort < num) {
+ for (j = needsort - 1; j >= 0; j--) {
+ if (aval[j] > aval[j+1]) {
+ char *hp;
+
+ i = aval[j];
+ aval[j] = aval[j+1];
+ aval[j+1] = i;
+
+ hp = ap[j];
+ ap[j] = ap[j+1];
+ ap[j+1] = hp;
+
+ } else
+ break;
+ }
+ needsort++;
+ }
+}
+#endif
+
static struct hostent *
gethostanswer(answer, anslen, qname, qclass, qtype)
const querybuf *answer;
@@ -144,9 +186,7 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
int haveanswer, had_error;
int toobig = 0;
char tbuf[MAXDNAME+1];
- const char *tname;
- tname = qname;
host.h_name = NULL;
eom = answer->buf + anslen;
/*
@@ -184,9 +224,7 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
host.h_aliases = host_aliases;
hap = h_addr_ptrs;
*hap = NULL;
-#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */
host.h_addr_list = h_addr_ptrs;
-#endif
haveanswer = 0;
had_error = 0;
while (ancount-- > 0 && cp < eom && !had_error) {
@@ -218,7 +256,7 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
cp += n;
if (host.h_name && strcasecmp(host.h_name, bp) != 0) {
syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s\", got CNAME for \"%s\"",
+ "gethostby*.gethostanswer: asked for \"%s\", got CNAME for \"%s\"",
host.h_name, bp);
continue; /* XXX - had_error++ ? */
}
@@ -239,36 +277,19 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
buflen -= n;
continue;
}
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if (n < 0) {
- had_error++;
- continue;
- }
- cp += n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- tname = bp;
- bp += n;
- buflen -= n;
- continue;
- }
if (type != qtype) {
+ /* CNAME->PTR should not cause a log message. */
+ if (!(qtype == T_PTR && type == T_CNAME))
syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(qclass), p_type(qtype),
- p_type(type));
+ "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
+ qname, p_class(qclass), p_type(qtype),
+ p_type(type));
cp += n;
continue; /* XXX - had_error++ ? */
}
switch (type) {
case T_PTR:
- if (strcasecmp(tname, bp) != 0) {
+ if (strcasecmp(qname, bp) != 0) {
syslog(LOG_NOTICE|LOG_AUTH,
AskedForGot, qname, bp);
cp += n;
@@ -279,7 +300,7 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
had_error++;
break;
}
-#ifdef MULTI_PTRS_ARE_ALIASES
+#if MULTI_PTRS_ARE_ALIASES
cp += n;
if (!haveanswer)
host.h_name = bp;
@@ -333,7 +354,7 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
if (!toobig++)
dprintf("Too many addresses (%d)\n",
- MAXADDRS);
+ MAXADDRS);
cp += n;
continue;
}
@@ -362,11 +383,6 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
qclass == C_IN && qtype == T_A)
addrsort(h_addr_ptrs, haveanswer);
# endif /*RESOLVSORT*/
-#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */
- /* nothing */
-#else
- host.h_addr = h_addr_ptrs[0];
-#endif /*BSD*/
if (!host.h_name) {
n = strlen(qname) + 1; /* for the \0 */
strcpy(bp, qname);
@@ -428,15 +444,10 @@ _gethostbydnsname(name)
host.h_length = INT32SZ;
h_addr_ptrs[0] = (char *)&host_addr;
h_addr_ptrs[1] = NULL;
-#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */
host.h_addr_list = h_addr_ptrs;
-#else
- host.h_addr = h_addr_ptrs[0];
-#endif
- h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isdigit(*cp) && *cp != '.')
+ if (!isdigit(*cp) && *cp != '.')
break;
}
@@ -462,7 +473,7 @@ _gethostbydnsaddr(addr, len, type)
u_long old_options;
char hname2[MAXDNAME+1];
#endif /*SUNSECURITY*/
-
+
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
h_errno = NETDB_INTERNAL;
return (NULL);
@@ -523,56 +534,10 @@ _gethostbydnsaddr(addr, len, type)
return (hp);
}
-#ifdef RESOLVSORT
-static void
-addrsort(ap, num)
- char **ap;
- int num;
-{
- int i, j;
- char **p;
- short aval[MAXADDRS];
- int needsort = 0;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < _res.nsort; j++)
- if (_res.sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-#endif
void
_sethostdnsent(stayopen)
int stayopen;
{
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
if (stayopen)
_res.options |= RES_STAYOPEN | RES_USEVC;
}
diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c
index 9f1fa4c7acc2..97f8d1f484f1 100644
--- a/lib/libc/net/gethostbyht.c
+++ b/lib/libc/net/gethostbyht.c
@@ -67,20 +67,21 @@ static char rcsid[] = "$Id: gethostbyht.c,v 1.2 1995/05/30 05:40:44 rgrimes Exp
#include <string.h>
#define MAXALIASES 35
+#define MAXADDRS 35
static struct hostent host;
static char *host_aliases[MAXALIASES];
static char hostbuf[BUFSIZ+1];
static FILE *hostf = NULL;
-static struct in_addr host_addr;
-static char *h_addr_ptrs[2];
+static char hostaddr[MAXADDRS];
+static char *host_addrs[2];
static int stayopen = 0;
void
_sethosthtent(f)
int f;
{
- if (!hostf)
+ if (hostf == NULL)
hostf = fopen(_PATH_HOSTS, "r" );
else
rewind(hostf);
@@ -102,40 +103,33 @@ gethostent()
char *p;
register char *cp, **q;
- if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
- h_errno = NETDB_INTERNAL;
+ if (hostf == NULL && (hostf = fopen(_PATH_HOSTS, "r" )) == NULL)
return (NULL);
- }
again:
- if (!(p = fgets(hostbuf, sizeof hostbuf, hostf))) {
- h_errno = HOST_NOT_FOUND;
+ if ((p = fgets(hostbuf, BUFSIZ, hostf)) == NULL)
return (NULL);
- }
if (*p == '#')
goto again;
- if (!(cp = strpbrk(p, "#\n")))
+ cp = strpbrk(p, "#\n");
+ if (cp == NULL)
goto again;
*cp = '\0';
- if (!(cp = strpbrk(p, " \t")))
+ cp = strpbrk(p, " \t");
+ if (cp == NULL)
goto again;
*cp++ = '\0';
/* THIS STUFF IS INTERNET SPECIFIC */
- if (!inet_aton(p, &host_addr))
- goto again;
- h_addr_ptrs[0] = (char *)&host_addr;
- h_addr_ptrs[1] = NULL;
-#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */
- host.h_addr_list = h_addr_ptrs;
-#else
- host.h_addr = h_addr_ptrs[0];
-#endif
- host.h_length = sizeof(u_int32_t);
+ host.h_addr_list = host_addrs;
+ host.h_addr = hostaddr;
+ *((u_int32_t *)host.h_addr) = inet_addr(p);
+ host.h_length = sizeof (u_int32_t);
host.h_addrtype = AF_INET;
while (*cp == ' ' || *cp == '\t')
cp++;
host.h_name = cp;
q = host.h_aliases = host_aliases;
- if (cp = strpbrk(cp, " \t"))
+ cp = strpbrk(cp, " \t");
+ if (cp != NULL)
*cp++ = '\0';
while (cp && *cp) {
if (*cp == ' ' || *cp == '\t') {
@@ -144,11 +138,11 @@ again:
}
if (q < &host_aliases[MAXALIASES - 1])
*q++ = cp;
- if (cp = strpbrk(cp, " \t"))
+ cp = strpbrk(cp, " \t");
+ if (cp != NULL)
*cp++ = '\0';
}
*q = NULL;
- h_errno = NETDB_SUCCESS;
return (&host);
}
@@ -158,9 +152,9 @@ _gethostbyhtname(name)
{
register struct hostent *p;
register char **cp;
-
+
sethostent(0);
- while (p = gethostent()) {
+ while ((p = gethostent())) {
if (strcasecmp(p->h_name, name) == 0)
break;
for (cp = p->h_aliases; *cp != 0; cp++)
@@ -180,10 +174,9 @@ _gethostbyhtaddr(addr, len, type)
register struct hostent *p;
sethostent(0);
- while (p = gethostent())
+ while ((p = gethostent()))
if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len))
break;
endhostent();
return (p);
}
-
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index f01f1052f36e..397e2fa4308c 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -37,11 +37,6 @@ static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
#define MAXALIASES 35
#define MAXADDRS 35
@@ -62,7 +57,6 @@ _gethostbynis(name, map)
int resultlen;
static struct hostent h;
static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD];
if (domain == (char *)NULL)
if (yp_get_default_domain (&domain))
@@ -71,11 +65,6 @@ _gethostbynis(name, map)
if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
return ((struct hostent *)NULL);
- /* avoid potential memory leak */
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- free(result);
- result = (char *)&ypbuf;
-
if ((cp = index(result, '\n')))
*cp = '\0';
@@ -119,10 +108,8 @@ _gethostbynisname(name)
}
struct hostent *
-_gethostbynisaddr(addr, len, type)
- char *addr;
- int len;
- int type;
+_gethostbynisaddr(name)
+ char *name;
{
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr");
+ return _gethostbynis(name, "hosts.byaddr");
}
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c
index 92d1d4aa5204..6b3eb44a3011 100644
--- a/lib/libc/net/getnetbydns.c
+++ b/lib/libc/net/getnetbydns.c
@@ -50,13 +50,6 @@
* -
* --Copyright--
*/
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
@@ -68,23 +61,19 @@ static char rcsid[] = "$Id: getnetbydns.c,v 1.3 1995/05/30 05:40:46 rgrimes Exp
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
-
-#include <stdio.h>
#include <netdb.h>
#include <resolv.h>
+#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <syslog.h>
-#include "res_config.h"
+#define BYNAME 0
+#define BYADDR 1
-extern int h_errno;
-
-#define BYADDR 0
-#define BYNAME 1
#define MAXALIASES 35
+#define MAXADDRS 35
#if PACKETSZ > 1024
#define MAXPACKET PACKETSZ
@@ -93,15 +82,17 @@ extern int h_errno;
#endif
typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
+ HEADER hdr;
+ u_char buf[MAXPACKET];
} querybuf;
typedef union {
- long al;
- char ac;
+ int32_t al;
+ char ac;
} align;
+extern int h_errno;
+
static struct netent *
getnetanswer(answer, anslen, net_i)
querybuf *answer;
@@ -109,15 +100,20 @@ getnetanswer(answer, anslen, net_i)
int net_i;
{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
- char aux1[30], aux2[30], ans[30], *in, *st, *pauxt, *bp, **ap,
- *paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
-static struct netent net_entry;
-static char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
+ register HEADER *hp;
+ register u_char *cp;
+ register int n;
+ u_char *eom;
+ int type, class, buflen, ancount, qdcount,
+ haveanswer, i, nchar;
+ char aux1[30], aux2[30], ans[30],
+ *in, *st, *pauxt, *bp, **ap,
+ *paux1 = &aux1[0],
+ *paux2 = &aux2[0],
+ flag = 0;
+static struct netent net_entry;
+static char *net_aliases[MAXALIASES],
+ netbuf[BUFSIZ+1];
/*
* find first satisfactory answer
@@ -145,10 +141,12 @@ static char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
h_errno = HOST_NOT_FOUND;
else
h_errno = TRY_AGAIN;
- return (NULL);
+
+ return ((struct netent *) NULL);
}
- while (qdcount-- > 0)
+ while (qdcount-- > 0){
cp += __dn_skipname(cp, eom) + QFIXEDSZ;
+ }
ap = net_aliases;
*ap = NULL;
net_entry.n_aliases = net_aliases;
@@ -170,26 +168,27 @@ static char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
cp += n;
return (NULL);
}
- cp += n;
+ cp += n;
*ap++ = bp;
- bp += strlen(bp) + 1;
- net_entry.n_addrtype =
- (class == C_IN) ? AF_INET : AF_UNSPEC;
+ bp += (strlen(bp) + 1);
+ net_entry.n_addrtype = (class == C_IN)
+ ? AF_INET
+ : AF_UNSPEC;
haveanswer++;
}
}
if (haveanswer) {
*ap = NULL;
switch (net_i) {
- case BYADDR:
+ case BYADDR :
net_entry.n_name = *net_entry.n_aliases;
net_entry.n_net = 0L;
break;
- case BYNAME:
+ case BYNAME :
in = *net_entry.n_aliases;
net_entry.n_name = &ans[0];
aux2[0] = '\0';
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
for (st = in, nchar = 0;
*st != '.';
st++, nchar++)
@@ -197,23 +196,23 @@ static char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
if (nchar != 1 || *in != '0' || flag) {
flag = 1;
(void)strncpy(paux1,
- (i==0) ? in : in-1,
- (i==0) ?nchar : nchar+1);
- paux1[(i==0) ? nchar : nchar+1] = '\0';
+ (i==0) ?in :in-1,
+ (i==0) ?nchar :nchar+1);
+ paux1[(i==0) ?nchar :nchar+1] = '\0';
pauxt = paux2;
paux2 = strcat(paux1, paux2);
paux1 = pauxt;
}
in = ++st;
- }
+ }
net_entry.n_net = inet_network(paux2);
- break;
}
net_entry.n_aliases++;
return (&net_entry);
+ } else {
+ h_errno = TRY_AGAIN;
+ return ((struct netent *) NULL);
}
- h_errno = TRY_AGAIN;
- return (NULL);
}
struct netent *
@@ -221,40 +220,41 @@ _getnetbydnsaddr(net, net_type)
register long net;
register int net_type;
{
- unsigned int netbr[4];
- int nn, anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
- unsigned long net2;
- struct netent *net_entry;
+ unsigned int netbr[4];
+ int nn, anslen;
+ querybuf buf;
+ char qbuf[MAXDNAME];
+ unsigned long net2;
+ struct netent *net_entry;
if (net_type != AF_INET)
return (NULL);
- for (nn = 4, net2 = net; net2; net2 >>= 8)
+ for (nn = 4, net2 = net; net2; net2 >>= 8) {
netbr[--nn] = net2 & 0xff;
+ }
switch (nn) {
- case 3: /* Class A */
- sprintf(qbuf, "0.0.0.%u.in-addr.arpa", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(qbuf, "0.0.%u.%u.in-addr.arpa", netbr[3], netbr[2]);
- break;
- case 1: /* Class C */
- sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1]);
- break;
- case 0: /* Class D - E */
- sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1], netbr[0]);
- break;
+ case 3: /* Class A */
+ (void)sprintf(qbuf, "0.0.0.%u.in-addr.arpa",
+ netbr[3]);
+ break;
+ case 2: /* Class B */
+ (void)sprintf(qbuf, "0.0.%u.%u.in-addr.arpa",
+ netbr[3], netbr[2]);
+ break;
+ case 1: /* Class C */
+ (void)sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa",
+ netbr[3], netbr[2], netbr[1]);
+ break;
+ case 0: /* Class D - E */
+ (void)sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",
+ netbr[3], netbr[2], netbr[1], netbr[0]);
+ break;
}
- anslen = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
+ anslen = res_query(qbuf, C_IN, T_PTR, buf.buf, sizeof buf.buf);
if (anslen < 0) {
-#ifdef DEBUG
if (_res.options & RES_DEBUG)
printf("res_query failed\n");
-#endif
return (NULL);
}
net_entry = getnetanswer(&buf, anslen, BYADDR);
@@ -262,34 +262,28 @@ _getnetbydnsaddr(net, net_type)
unsigned u_net = net; /* maybe net should be unsigned ? */
/* Strip trailing zeros */
- while ((u_net & 0xff) == 0 && u_net != 0)
+ while ((u_net & 0xff) == 0 && u_net != 0) {
u_net >>= 8;
+ }
net_entry->n_net = u_net;
- return (net_entry);
}
- return (NULL);
+ return (net_entry);
}
struct netent *
_getnetbydnsname(net)
register const char *net;
{
- int anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
+ int anslen;
+ querybuf buf;
+ char qbuf[MAXDNAME];
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- strcpy(&qbuf[0], net);
- anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
+ (void)strcpy(&qbuf[0],net);
+ anslen = res_search(qbuf, C_IN, T_PTR, buf.buf, sizeof buf.buf);
if (anslen < 0) {
-#ifdef DEBUG
if (_res.options & RES_DEBUG)
printf("res_query failed\n");
-#endif
- return (NULL);
+ return NULL;
}
return getnetanswer(&buf, anslen, BYNAME);
}
diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c
index 24ca2ed11805..4f6439cc77df 100644
--- a/lib/libc/net/getnetbyht.c
+++ b/lib/libc/net/getnetbyht.c
@@ -31,16 +31,6 @@
* SUCH DAMAGE.
*/
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * from getnetent.c 1.1 (Coimbra) 93/06/02
- */
-
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -49,7 +39,6 @@ static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <arpa/nameser.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
@@ -66,7 +55,6 @@ void
_setnethtent(f)
int f;
{
-
if (netf == NULL)
netf = fopen(_PATH_NETWORKS, "r" );
else
@@ -77,7 +65,6 @@ _setnethtent(f)
void
_endnethtent()
{
-
if (netf) {
fclose(netf);
netf = NULL;
@@ -116,7 +103,7 @@ again:
net.n_net = inet_network(cp);
net.n_addrtype = AF_INET;
q = net.n_aliases = net_aliases;
- if (p != NULL)
+ if (p != NULL)
cp = p;
while (cp && *cp) {
if (*cp == ' ' || *cp == '\t') {
@@ -141,7 +128,7 @@ _getnetbyhtname(name)
register char **cp;
setnetent(_net_stayopen);
- while (p = getnetent()) {
+ while ((p = getnetent())) {
if (strcasecmp(p->n_name, name) == 0)
break;
for (cp = p->n_aliases; *cp != 0; cp++)
@@ -154,6 +141,7 @@ found:
return (p);
}
+
struct netent *
_getnetbyhtaddr(net, type)
register long net;
@@ -162,7 +150,7 @@ _getnetbyhtaddr(net, type)
register struct netent *p;
setnetent(_net_stayopen);
- while (p = getnetent())
+ while ((p = getnetent()))
if (p->n_addrtype == type && p->n_net == net)
break;
if (!_net_stayopen)
diff --git a/lib/libc/net/getnetbynis.c b/lib/libc/net/getnetbynis.c
index 51e026b1ce7d..85c719eb1b15 100644
--- a/lib/libc/net/getnetbynis.c
+++ b/lib/libc/net/getnetbynis.c
@@ -34,16 +34,9 @@ static char rcsid[] = "$Id: getnetbynis.c,v 1.3 1995/05/30 05:40:47 rgrimes Exp
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#include <arpa/nameser.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
#define MAXALIASES 35
#define MAXADDRS 35
@@ -62,19 +55,19 @@ _getnetbynis(name, map)
int resultlen;
static struct netent h;
static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD];
if (domain == (char *)NULL)
if (yp_get_default_domain (&domain))
return (NULL);
+ if (result) {
+ free(result);
+ result = 0;
+ }
+
if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
return (NULL);
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- free(result);
- result = (char *)&ypbuf;
-
if ((cp = index(result, '\n')))
*cp = '\0';
@@ -122,41 +115,19 @@ _getnetbynisaddr(addr, type)
long addr;
int type;
{
+ struct in_addr in;
char *str, *cp;
- unsigned long net2;
- int nn;
- unsigned int netbr[4];
- char buf[MAXDNAME];
+ struct netent *np;
if (type != AF_INET)
return (NULL);
- for (nn = 4, net2 = addr; net2; net2 >>= 8) {
- netbr[--nn] = net2 & 0xff;
- }
-
- switch (nn) {
- case 3: /* Class A */
- sprintf(buf, "%u", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(buf, "%u.%u", netbr[2], netbr[3]);
- break;
- case 1: /* Class C */
- sprintf(buf, "%u.%u.%u", netbr[1], netbr[2], netbr[3]);
- break;
- case 0: /* Class D - E */
- sprintf(buf, "%u.%u.%u.%u", netbr[0], netbr[1],
- netbr[2], netbr[3]);
- break;
- }
-
- str = (char *)&buf;
- cp = str + (strlen(str) - 2);
-
+ in.s_addr = addr;
+ str = inet_ntoa(in);
+ cp = str + strlen(str) - 2;
while(!strcmp(cp, ".0")) {
*cp = '\0';
- cp = str + (strlen(str) - 2);
+ cp = str + strlen(str) - 2;
}
return _getnetbynis(str, "networks.byaddr");
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 35e535a39467..6bee5d3a8beb 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -41,12 +41,6 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-static int serv_stepping_yp = 0;
-#endif
#define MAXALIASES 35
@@ -56,53 +50,6 @@ static struct servent serv;
static char *serv_aliases[MAXALIASES];
int _serv_stayopen;
-#ifdef YP
-static int
-_getypservent(line)
- char *line;
-{
- static char *key = NULL;
- static int keylen;
- static char *yp_domain = NULL;
- char *lastkey, *result;
- int resultlen;
- int rv;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- if (!serv_stepping_yp) {
- if (key)
- free(key);
- if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
- &result, &resultlen))) {
- serv_stepping_yp = 0;
- return(0);
- }
- serv_stepping_yp = 1;
- } else {
- lastkey = key;
- rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
- &keylen, &result, &resultlen);
- free(lastkey);
- if (rv) {
- serv_stepping_yp = 0;
- return (0);
- }
- }
-
- strncpy(line, result, BUFSIZ - 1);
- /* getservent() expects lines terminated with \n -- make it happy */
- strcat(line, "\n");
-
- free(result);
-
- return(1);
-}
-#endif
-
void
setservent(f)
int f;
@@ -130,25 +77,11 @@ getservent()
char *p;
register char *cp, **q;
-#ifdef YP
- if (serv_stepping_yp && _getypservent(line)) {
- p = (char *)&line;
- goto unpack;
- }
-tryagain:
-#endif
if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
return (NULL);
again:
if ((p = fgets(line, BUFSIZ, servf)) == NULL)
return (NULL);
-#ifdef YP
- if (*p == '+') {
- if (!_getypservent(&line))
- goto tryagain;
- }
-unpack:
-#endif
if (*p == '#')
goto again;
cp = strpbrk(p, "#\n");
diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c
index bf57c5546590..207445358c61 100644
--- a/lib/libc/net/herror.c
+++ b/lib/libc/net/herror.c
@@ -69,7 +69,7 @@ const char *h_errlist[] = {
"Unknown server error", /* 3 NO_RECOVERY */
"No address associated with name", /* 4 NO_ADDRESS */
};
-int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
+int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) };
extern int h_errno;
diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c
index a1ac89951970..f69d0fcd8c0f 100644
--- a/lib/libc/net/inet_addr.c
+++ b/lib/libc/net/inet_addr.c
@@ -1,9 +1,7 @@
/*
- * ++Copyright++ 1983, 1990, 1993
- * -
* Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
+ * The Regents of the University of California. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -14,12 +12,12 @@
* 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.
+ * 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
@@ -31,31 +29,10 @@
* 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id$";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -78,7 +55,7 @@ inet_addr(cp)
return (INADDR_NONE);
}
-/*
+/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
@@ -96,52 +73,50 @@ inet_aton(cp, addr)
u_int parts[4];
register u_int *pp = parts;
- c = *cp;
for (;;) {
/*
* Collect number up to ``.''.
* Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
+ * 0x=hex, 0=octal, other=decimal.
*/
- if (!isdigit(c))
- return (0);
val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
+ if (*cp == '0') {
+ if (*++cp == 'x' || *cp == 'X')
+ base = 16, cp++;
else
base = 8;
}
- for (;;) {
+ while ((c = *cp) != '\0') {
if (isascii(c) && isdigit(c)) {
val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
- val = (val << 4) |
+ cp++;
+ continue;
+ }
+ if (base == 16 && isascii(c) && isxdigit(c)) {
+ val = (val << 4) +
(c + 10 - (islower(c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
+ cp++;
+ continue;
+ }
+ break;
}
- if (c == '.') {
+ if (*cp == '.') {
/*
* Internet format:
* a.b.c.d
- * a.b.c (with c treated as 16 bits)
+ * a.b.c (with c treated as 16-bits)
* a.b (with b treated as 24 bits)
*/
- if (pp >= parts + 3)
+ if (pp >= parts + 3 || val > 0xff)
return (0);
- *pp++ = val;
- c = *++cp;
+ *pp++ = val, cp++;
} else
break;
}
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (*cp && (!isascii(*cp) || !isspace(*cp)))
return (0);
/*
* Concoct the address according to
@@ -150,9 +125,6 @@ inet_aton(cp, addr)
n = pp - parts + 1;
switch (n) {
- case 0:
- return (0); /* initial nondigit */
-
case 1: /* a -- 32 bits */
break;
diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c
index c3a96a64e54e..fda53b6ecc61 100644
--- a/lib/libc/net/inet_network.c
+++ b/lib/libc/net/inet_network.c
@@ -74,7 +74,7 @@ again:
break;
}
if (*cp == '.') {
- if (pp >= parts + 3)
+ if (pp >= parts + 4)
return (INADDR_NONE);
*pp++ = val, cp++;
goto again;
@@ -83,6 +83,8 @@ again:
return (INADDR_NONE);
*pp++ = val;
n = pp - parts;
+ if (n > 4)
+ return (INADDR_NONE);
for (val = 0, i = 0; i < n; i++) {
val <<= 8;
val |= parts[i] & 0xff;
diff --git a/lib/libc/net/linkaddr.3 b/lib/libc/net/linkaddr.3
index ae0410443903..54e320602954 100644
--- a/lib/libc/net/linkaddr.3
+++ b/lib/libc/net/linkaddr.3
@@ -75,7 +75,7 @@ may contain
an optional network interface identifier of the form
.Dq "name unit-number" ,
suitable for the first argument to
-.Xr ifconfig 8 ,
+.Xr ifconfig 4 ,
followed in all cases by a colon and
an interface address in the form of
groups of hexadecimal digits
@@ -100,8 +100,8 @@ always returns a null terminated string.
has no return value.
(See
.Sx BUGS . )
-.\" .Sh SEE ALSO
-.\" .Xr iso 4
+.Sh SEE ALSO
+.Xr iso 4 ,
.Sh HISTORY
The
.Fn link_addr
diff --git a/lib/libc/net/rcmd.3 b/lib/libc/net/rcmd.3
index 6849dac0a4ca..ba0f9cc58206 100644
--- a/lib/libc/net/rcmd.3
+++ b/lib/libc/net/rcmd.3
@@ -163,7 +163,7 @@ and
.Fn ruserok
return \-1.
If the local domain (as obtained from
-.Xr gethostname 3 )
+.Xr gethostname 2 )
is the same as the remote domain, only the machine name need be specified.
.Pp
The
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index fbe5e95b28a6..58b26deada88 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -95,7 +95,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
/*
* fetch next label in domain name
*/
- while (n = *cp++) {
+ while ((n = *cp++)) {
/*
* Check for indirection
*/
@@ -110,14 +110,14 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
return (-1);
checked += n + 1;
while (--n >= 0) {
- if (((c = *cp++) == '.') || (c == '\\')) {
+ if ((c = *cp++) == '.') {
if (dn + n + 2 >= eom)
return (-1);
*dn++ = '\\';
}
*dn++ = c;
if (cp >= eomorig) /* out of range */
- return (-1);
+ return(-1);
}
break;
@@ -126,7 +126,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
len = cp - comp_dn + 1;
cp = msg + (((n & 0x3f) << 8) | (*cp & 0xff));
if (cp < msg || cp >= eomorig) /* out of range */
- return (-1);
+ return(-1);
checked += 2;
/*
* Check for loops in the compressed name;
@@ -262,12 +262,12 @@ __dn_skipname(comp_dn, eom)
cp++;
break;
default: /* illegal type */
- return (-1);
+ return -1;
}
break;
}
if (cp > eom)
- return (-1);
+ return -1;
return (cp - comp_dn);
}
@@ -298,7 +298,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = exp_dn;
sp = cp = *cpp;
- while (n = *cp++) {
+ while ((n = *cp++)) {
/*
* check for indirection
*/
@@ -318,12 +318,11 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
continue;
goto next;
- case INDIR_MASK: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
default: /* illegal type */
return (-1);
+
+ case INDIR_MASK: /* indirection */
+ cp = msg + (((n & 0x3f) << 8) | *cp);
}
}
if (*dn == '\0')
@@ -334,7 +333,11 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
}
/*
- * Routines to insert/extract short/long's.
+ * Routines to insert/extract short/long's. Must account for byte
+ * order and non-alignment problems. This code at least has the
+ * advantage of being portable.
+ *
+ * used by sendmail.
*/
u_int16_t
diff --git a/lib/libc/net/res_config.h b/lib/libc/net/res_config.h
index 7d5566427320..a1339d9652a1 100644
--- a/lib/libc/net/res_config.h
+++ b/lib/libc/net/res_config.h
@@ -1,8 +1,7 @@
#define DEBUG 1 /* enable debugging code (needed for dig) */
#undef ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena */
#define RESOLVSORT /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
+#undef RFC1535 /* comply with RFC1535 */
#undef ALLOW_UPDATES /* destroy your system security */
#undef USELOOPBACK /* res_init() bind to localhost */
#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
-#define MULTI_PTRS_ARE_ALIASES /* fold multiple PTR records into aliases */
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c
index 9f4d6569e6d2..74aef85b538f 100644
--- a/lib/libc/net/res_debug.c
+++ b/lib/libc/net/res_debug.c
@@ -58,22 +58,54 @@ static char rcsid[] = "$Id: res_debug.c,v 1.3.4.1 1995/08/30 04:06:48 davidg Exp
#include <sys/param.h>
#include <netinet/in.h>
-#ifdef ISO
#include <netiso/iso.h>
-#endif
-
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <stdio.h>
-#include <netdb.h>
#include <resolv.h>
#include <string.h>
+#include <netdb.h>
#include "res_config.h"
-extern const char *_res_opcodes[];
-extern const char *_res_resultcodes[];
+const char *_res_opcodes[] = {
+ "QUERY",
+ "IQUERY",
+ "CQUERYM",
+ "CQUERYU", /* experimental */
+ "NOTIFY", /* experimental */
+ "5",
+ "6",
+ "7",
+ "8",
+ "UPDATEA",
+ "UPDATED",
+ "UPDATEDA",
+ "UPDATEM",
+ "UPDATEMA",
+ "ZONEINIT",
+ "ZONEREF",
+};
+
+const char *_res_resultcodes[] = {
+ "NOERROR",
+ "FORMERR",
+ "SERVFAIL",
+ "NXDOMAIN",
+ "NOTIMP",
+ "REFUSED",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12",
+ "13",
+ "14",
+ "NOCHANGE",
+};
/* XXX: we should use getservbyport() instead. */
static const char *
@@ -171,13 +203,13 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
* Print answer records.
*/
sflag = (_res.pfcode & pflag);
- if (n = ntohs(cnt)) {
+ if ((n = ntohs(cnt))) {
if ((!_res.pfcode) ||
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
fprintf(file, hs);
while (--n >= 0) {
if ((!_res.pfcode) || sflag) {
- cp = p_rr(cp, msg, file);
+ cp = p_rr(cp, msg, file);
} else {
unsigned int dlen;
cp += __dn_skipname(cp, cp + MAXCDNAME);
@@ -258,10 +290,9 @@ __fp_nquery(msg, len, file)
ntohs(hp->id));
putc('\n', file);
}
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX))
- putc(';', file);
+ putc(';', file);
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file, "; flags:");
+ fprintf(file,"; flags:");
if (hp->qr)
fprintf(file, " qr");
if (hp->aa)
@@ -279,7 +310,7 @@ __fp_nquery(msg, len, file)
fprintf(file, ", Auth: %d", ntohs(hp->nscount));
fprintf(file, ", Addit: %d", ntohs(hp->arcount));
}
- if ((!_res.pfcode) || (_res.pfcode &
+ if ((!_res.pfcode) || (_res.pfcode &
(RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
putc('\n',file);
}
@@ -288,23 +319,11 @@ __fp_nquery(msg, len, file)
*/
if (n = ntohs(hp->qdcount)) {
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- fprintf(file, ";; QUESTIONS:\n");
+ fprintf(file,";; QUESTIONS:\n");
while (--n >= 0) {
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- fprintf(file, ";;\t");
+ fprintf(file,";;\t");
TruncTest(cp);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- cp = p_cdnname(cp, msg, len, file);
- else {
- int n;
- char name[MAXDNAME];
-
- if ((n = dn_expand(msg, msg+len, cp, name,
- sizeof name)) < 0)
- cp = NULL;
- else
- cp += n;
- }
+ cp = p_cdnname(cp, msg, len, file);
ErrorTest(cp);
TruncTest(cp);
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
@@ -316,8 +335,7 @@ __fp_nquery(msg, len, file)
fprintf(file, ", class = %s\n",
__p_class(_getshort((u_char*)cp)));
cp += INT16SZ;
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- putc('\n', file);
+ putc('\n', file);
}
}
/*
@@ -418,9 +436,7 @@ __p_rr(cp, msg, file)
{
int type, class, dlen, n, c;
struct in_addr inaddr;
-#ifdef ISO
struct iso_addr isoa;
-#endif
const u_char *cp1, *cp2;
u_int32_t tmpttl, t;
int lcnt;
@@ -455,7 +471,7 @@ __p_rr(cp, msg, file)
case C_HS:
bcopy(cp, (char *)&inaddr, INADDRSZ);
if (dlen == 4) {
- fprintf(file, "\t%s", inet_ntoa(inaddr));
+ fprintf(file,"\t%s", inet_ntoa(inaddr));
cp += dlen;
} else if (dlen == 7) {
char *address;
@@ -491,11 +507,11 @@ __p_rr(cp, msg, file)
case T_ISDN:
cp2 = cp + dlen;
if (n = *cp++) {
- fprintf(file, "\t%.*s", n, cp);
+ fprintf(file,"\t%.*s", n, cp);
cp += n;
}
if ((cp < cp2) && (n = *cp++)) {
- fprintf(file, "\t%.*s", n, cp);
+ fprintf(file,"\t%.*s", n, cp);
cp += n;
} else if (type == T_HINFO)
fprintf(file, "\n;; *** Warning *** OS-type missing");
@@ -528,7 +544,7 @@ __p_rr(cp, msg, file)
case T_MX:
case T_AFSDB:
case T_RT:
- fprintf(file, "\t%d ", _getshort((u_char*)cp));
+ fprintf(file,"\t%d ", _getshort((u_char*)cp));
cp += INT16SZ;
if ((cp = p_fqname(cp, msg, file)) == NULL)
return (NULL);
@@ -544,7 +560,7 @@ __p_rr(cp, msg, file)
return (NULL);
break;
- case T_TXT:
+ case T_TXT:
case T_X25:
(void) fputs("\t\"", file);
cp2 = cp1 + dlen;
@@ -559,9 +575,8 @@ __p_rr(cp, msg, file)
}
}
putc('"', file);
- break;
+ break;
-#ifdef ISO
case T_NSAP:
isoa.isoa_len = dlen;
if (isoa.isoa_len > sizeof(isoa.isoa_genaddr))
@@ -570,7 +585,6 @@ __p_rr(cp, msg, file)
(void) fprintf(file, "\t%s", iso_ntoa(&isoa));
cp += dlen;
break;
-#endif
case T_MINFO:
case T_RP:
@@ -591,7 +605,7 @@ __p_rr(cp, msg, file)
case T_UID:
case T_GID:
if (dlen == 4) {
- fprintf(file, "\t%u", _getlong((u_char*)cp));
+ fprintf(file,"\t%u", _getlong((u_char*)cp));
cp += INT32SZ;
}
break;
@@ -610,7 +624,7 @@ __p_rr(cp, msg, file)
while (cp < cp1 + dlen) {
c = *cp++;
do {
- if (c & 0200) {
+ if (c & 0200) {
if (lcnt == 0) {
fputs("\n\t\t\t", file);
lcnt = 5;
@@ -619,7 +633,7 @@ __p_rr(cp, msg, file)
putc(' ', file);
lcnt--;
}
- c <<= 1;
+ c <<= 1;
} while (++n & 07);
}
putc(')', file);
@@ -643,7 +657,7 @@ __p_rr(cp, msg, file)
#endif /* ALLOW_T_UNSPEC */
default:
- fprintf(file, "\t?%d?", type);
+ fprintf(file,"\t?%d?", type);
cp += dlen;
}
#if 0
@@ -652,7 +666,7 @@ __p_rr(cp, msg, file)
putc('\n', file);
#endif
if (cp - cp1 != dlen) {
- fprintf(file, ";; packet size error (found %d, dlen was %d)\n",
+ fprintf(file,";; packet size error (found %d, dlen was %d)\n",
cp - cp1, dlen);
cp = NULL;
}
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c
index 583572195bb2..2e5e396aab74 100644
--- a/lib/libc/net/res_init.c
+++ b/lib/libc/net/res_init.c
@@ -96,7 +96,7 @@ struct __res_state _res;
* since it was noted that INADDR_ANY actually meant ``the first interface
* you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
* it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
+ * was later decided that since the recommended practice is to always
* install local static routes through 127.0.0.1 for all your network
* interfaces, that we could solve this problem without a code change.
*
@@ -223,7 +223,8 @@ res_init()
cp++;
if ((*cp == '\0') || (*cp == '\n'))
continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
+ (void)strncpy(_res.defdname, cp,
+ sizeof(_res.defdname) - 1);
if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
*cp = '\0';
havesearch = 0;
@@ -238,7 +239,8 @@ res_init()
cp++;
if ((*cp == '\0') || (*cp == '\n'))
continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
+ (void)strncpy(_res.defdname, cp,
+ sizeof(_res.defdname) - 1);
if ((cp = strchr(_res.defdname, '\n')) != NULL)
*cp = '\0';
/*
@@ -267,7 +269,7 @@ res_init()
}
/* read nameservers to query */
if (MATCH(buf, "nameserver") && nserv < MAXNS) {
- struct in_addr a;
+ struct in_addr a;
cp = buf + sizeof("nameserver") - 1;
while (*cp == ' ' || *cp == '\t')
@@ -293,7 +295,7 @@ res_init()
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii(*cp) && !isspace(*cp))
cp++;
n = *cp;
*cp = 0;
@@ -310,11 +312,11 @@ res_init()
if (inet_aton(net, &a)) {
_res.sort_list[nsort].mask = a.s_addr;
} else {
- _res.sort_list[nsort].mask =
+ _res.sort_list[nsort].mask =
net_mask(_res.sort_list[nsort].addr);
}
} else {
- _res.sort_list[nsort].mask =
+ _res.sort_list[nsort].mask =
net_mask(_res.sort_list[nsort].addr);
}
nsort++;
@@ -329,7 +331,7 @@ res_init()
continue;
}
}
- if (nserv > 1)
+ if (nserv > 1)
_res.nscount = nserv;
#ifdef RESOLVSORT
_res.nsort = nsort;
@@ -349,7 +351,7 @@ res_init()
#ifndef RFC1535
dots = 0;
- for (cp = _res.defdname; *cp; cp++)
+ for (cp = _res.defdname; *cp; cp++)
dots += (*cp == '.');
cp = _res.defdname;
@@ -369,7 +371,7 @@ res_init()
printf(";;\t..END..\n");
}
#endif /* DEBUG */
-#endif /* !RFC1535 */
+#endif /*!RFC1535*/
}
if ((cp = getenv("RES_OPTIONS")) != NULL)
@@ -395,7 +397,7 @@ res_setoptions(options, source)
while (*cp == ' ' || *cp == '\t')
cp++;
/* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
+ if (!strncmp(cp, "ndots:", sizeof("ndots:")-1)) {
i = atoi(cp + sizeof("ndots:") - 1);
if (i <= RES_MAXNDOTS)
_res.ndots = i;
@@ -405,7 +407,7 @@ res_setoptions(options, source)
if (_res.options & RES_DEBUG)
printf(";;\tndots=%d\n", _res.ndots);
#endif
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
+ } else if (!strncmp(cp, "debug", sizeof("debug")-1)) {
#ifdef DEBUG
if (!(_res.options & RES_DEBUG)) {
printf(";; res_setoptions(\"%s\", \"%s\")..\n",
@@ -429,12 +431,12 @@ static u_int32_t
net_mask(in) /* XXX - should really use system's version of this */
struct in_addr in;
{
- register u_int32_t i = ntohl(in.s_addr);
+ register u_int32_t i = ntohl(in.s_addr);
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
+ if (IN_CLASSA(i))
+ return (htonl(IN_CLASSA_NET));
+ else if (IN_CLASSB(i))
+ return (htonl(IN_CLASSB_NET));
return (htonl(IN_CLASSC_NET));
}
#endif
diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c
index dd46311814e0..c942a2e3a62e 100644
--- a/lib/libc/net/res_mkquery.c
+++ b/lib/libc/net/res_mkquery.c
@@ -61,9 +61,9 @@ static char rcsid[] = "$Id: res_mkquery.c,v 1.4.4.1 1995/08/30 04:06:54 davidg E
#include <arpa/nameser.h>
#include <stdio.h>
-#include <netdb.h>
#include <resolv.h>
#include <string.h>
+#include <netdb.h>
#include "res_config.h"
@@ -103,7 +103,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
* Initialize header fields.
*/
if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
+ return(-1);
bzero(buf, HFIXEDSZ);
hp = (HEADER *) buf;
hp->id = htons(++_res.id);
@@ -123,7 +123,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
case QUERY: /*FALLTHROUGH*/
case NS_NOTIFY_OP:
if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
+ return(-1);
if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
return (-1);
cp += n;
@@ -197,13 +197,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
return (-1);
cp += n;
__putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
+ __putshort(class, cp);
+ cp += INT16SZ;
__putlong(0, cp);
cp += INT32SZ;
__putshort(datalen, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
if (datalen) {
bcopy(data, cp, datalen);
cp += datalen;
@@ -220,13 +220,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
return (-1);
cp += n;
__putshort(newrr->r_type, cp);
- cp += INT16SZ;
- __putshort(newrr->r_class, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
+ __putshort(newrr->r_class, cp);
+ cp += INT16SZ;
__putlong(0, cp);
cp += INT32SZ;
__putshort(newrr->r_size, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
if (newrr->r_size) {
bcopy(newrr->r_data, cp, newrr->r_size);
cp += newrr->r_size;
diff --git a/lib/libc/net/res_query.c b/lib/libc/net/res_query.c
index 18d49a30f07c..2a1ce53a1329 100644
--- a/lib/libc/net/res_query.c
+++ b/lib/libc/net/res_query.c
@@ -139,21 +139,21 @@ res_query(name, class, type, answer, anslen)
ntohs(hp->ancount));
#endif
switch (hp->rcode) {
- case NXDOMAIN:
- h_errno = HOST_NOT_FOUND;
- break;
- case SERVFAIL:
- h_errno = TRY_AGAIN;
- break;
- case NOERROR:
- h_errno = NO_DATA;
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- h_errno = NO_RECOVERY;
- break;
+ case NXDOMAIN:
+ h_errno = HOST_NOT_FOUND;
+ break;
+ case SERVFAIL:
+ h_errno = TRY_AGAIN;
+ break;
+ case NOERROR:
+ h_errno = NO_DATA;
+ break;
+ case FORMERR:
+ case NOTIMP:
+ case REFUSED:
+ default:
+ h_errno = NO_RECOVERY;
+ break;
}
return (-1);
}
@@ -186,7 +186,7 @@ res_search(name, class, type, answer, anslen)
errno = 0;
h_errno = HOST_NOT_FOUND; /* default, if we never query */
dots = 0;
- for (cp = name; *cp; cp++)
+ for (cp = name; *cp; cp++)
dots += (*cp == '.');
trailing_dot = 0;
if (cp > name && *--cp == '.')
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index 55465d0e7d9d..b3ea98c4b390 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -102,38 +102,38 @@ static int vc = 0; /* is the socket a virtual ciruit? */
fprintf args;\
__fp_nquery(query, size, stdout);\
} else {}
- static void
- Aerror(file, string, error, address)
- FILE *file;
- char *string;
- int error;
- struct sockaddr_in address;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
+static void
+Aerror(file, string, error, address)
+ FILE *file;
+ char *string;
+ int error;
+ struct sockaddr_in address;
+{
+ int save = errno;
+
+ if (_res.options & RES_DEBUG) {
fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntoa(address.sin_addr),
+ string,
+ inet_ntoa(address.sin_addr),
ntohs(address.sin_port),
- strerror(error));
- }
- errno = save;
+ strerror(error));
}
- static void
- Perror(file, string, error)
- FILE *file;
- char *string;
- int error;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- }
- errno = save;
+ errno = save;
+}
+static void
+Perror(file, string, error)
+ FILE *file;
+ char *string;
+ int error;
+{
+ int save = errno;
+
+ if (_res.options & RES_DEBUG) {
+ fprintf(file, "res_send: %s: %s\n",
+ string, strerror(error));
}
+ errno = save;
+}
#endif
static res_send_qhook Qhook = NULL;
@@ -214,7 +214,7 @@ res_nameinquery(name, type, class, buf, eom)
if (n < 0)
return (-1);
cp += n;
- ttype = _getshort(cp); cp += INT16SZ;
+ ttype = _getshort(cp); cp += INT16SZ;
tclass = _getshort(cp); cp += INT16SZ;
if (ttype == type &&
tclass == class &&
@@ -263,20 +263,20 @@ res_queriesmatch(buf1, eom1, buf2, eom2)
int
res_send(buf, buflen, ans, anssiz)
- const u_char *buf;
- int buflen;
- u_char *ans;
- int anssiz;
+ const u_char *buf;
+ int buflen;
+ u_char *ans;
+ int anssiz;
{
- HEADER *hp = (HEADER *) buf;
- HEADER *anhp = (HEADER *) ans;
+ HEADER *hp = (HEADER *) buf;
+ HEADER *anhp = (HEADER *) ans;
int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns;
- register int n;
- u_int badns; /* XXX NSMAX can't exceed #/bits in this var */
+ register int n;
+ u_int badns; /* XXX NSMAX can't exceed #/bits in this var */
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
/* errno should have been set by res_init() in this case. */
- return (-1);
+ return (-1);
}
DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
(stdout, ";; res_send()\n"), buf, buflen);
@@ -293,7 +293,7 @@ res_send(buf, buflen, ans, anssiz)
for (ns = 0; ns < _res.nscount; ns++) {
struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
same_ns:
- if (badns & (1 << ns)) {
+ if (badns & (1<<ns)) {
_res_close();
goto next_ns;
}
@@ -330,13 +330,13 @@ res_send(buf, buflen, ans, anssiz)
Dprint(_res.options & RES_DEBUG,
(stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntoa(nsap->sin_addr)));
+ ns+1, inet_ntoa(nsap->sin_addr)));
if (v_circuit) {
- int truncated;
- struct iovec iov[2];
- u_short len;
- u_char *cp;
+ int truncated;
+ struct iovec iov[2];
+ u_short len;
+ u_char *cp;
/*
* Use virtual circuit;
@@ -360,7 +360,7 @@ res_send(buf, buflen, ans, anssiz)
terrno = errno;
Aerror(stderr, "connect/vc",
errno, *nsap);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
goto next_ns;
}
@@ -377,7 +377,7 @@ res_send(buf, buflen, ans, anssiz)
if (writev(s, iov, 2) != (INT16SZ + buflen)) {
terrno = errno;
Perror(stderr, "write failed", errno);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
goto next_ns;
}
@@ -456,10 +456,10 @@ res_send(buf, buflen, ans, anssiz)
/*
* Use datagrams.
*/
- struct timeval timeout;
- fd_set dsmask;
+ struct timeval timeout;
+ fd_set dsmask;
struct sockaddr_in from;
- int fromlen;
+ int fromlen;
if ((s < 0) || vc) {
if (vc)
@@ -499,7 +499,7 @@ res_send(buf, buflen, ans, anssiz)
Aerror(stderr,
"connect(dg)",
errno, *nsap);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
goto next_ns;
}
@@ -507,7 +507,7 @@ res_send(buf, buflen, ans, anssiz)
}
if (send(s, (char*)buf, buflen, 0) != buflen) {
Perror(stderr, "send", errno);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
goto next_ns;
}
@@ -534,7 +534,7 @@ res_send(buf, buflen, ans, anssiz)
sizeof(struct sockaddr))
!= buflen) {
Aerror(stderr, "sendto", errno, *nsap);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
goto next_ns;
}
@@ -608,7 +608,7 @@ res_send(buf, buflen, ans, anssiz)
#endif
if (!(_res.options & RES_INSECURE2) &&
!res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
+ ans, ans + anssiz)) {
/*
* response contains wrong query? ignore it.
* XXX - potential security hazard could
@@ -626,11 +626,11 @@ res_send(buf, buflen, ans, anssiz)
DprintQ(_res.options & RES_DEBUG,
(stdout, "server rejected query:\n"),
ans, resplen);
- badns |= (1 << ns);
+ badns |= (1<<ns);
_res_close();
/* don't retry if called from dig */
if (!_res.pfcode)
- goto next_ns;
+ goto next_ns;
}
if (!(_res.options & RES_IGNTC) && anhp->tc) {
/*
@@ -644,13 +644,9 @@ res_send(buf, buflen, ans, anssiz)
goto same_ns;
}
} /*if vc/dg*/
- Dprint((_res.options & RES_DEBUG) ||
- ((_res.pfcode & RES_PRF_REPLY) &&
- (_res.pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
DprintQ((_res.options & RES_DEBUG) ||
(_res.pfcode & RES_PRF_REPLY),
- (stdout, ""),
+ (stdout, ";; got answer:\n"),
ans, resplen);
/*
* If using virtual circuits, we assume that the first server
diff --git a/lib/libc/nls/catgets.3 b/lib/libc/nls/catgets.3
index 186ea00599ff..f644130f343a 100644
--- a/lib/libc/nls/catgets.3
+++ b/lib/libc/nls/catgets.3
@@ -63,4 +63,5 @@ otherwise it returns
.Sh STANDARDS
The
.Fn catgets
-function conforms to \fBxpg3\fR.
+function conforms to
+.St -xpg3 .
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 681ff28f651b..5bf3947ddd5f 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -260,7 +260,8 @@ nl_catd catd;
{
MCCatT *cat = (MCCatT *) catd;
MCSetT *set;
- int i;
+ MCMsgT *msg;
+ int i, j;
if (!cat) return -1;
@@ -294,7 +295,8 @@ int type;
MCHeaderT header;
MCCatT *cat;
MCSetT *set;
- long i;
+ MCMsgT *msg;
+ long i, j;
off_t nextSet;
cat = (MCCatT *) malloc(sizeof(MCCatT));
diff --git a/lib/libc/quad/Makefile.inc b/lib/libc/quad/Makefile.inc
index 617aae3bff27..627357428d17 100644
--- a/lib/libc/quad/Makefile.inc
+++ b/lib/libc/quad/Makefile.inc
@@ -1,19 +1,10 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
-# Quad support, if needed
-
-.if ${MACHINE} == "i386"
-
-SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c
-
-.else
-
+# Quad support
SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c fixdfdi.c \
fixsfdi.c fixunsdfdi.c fixunssfdi.c floatdidf.c floatdisf.c \
floatunsdidf.c iordi3.c lshldi3.c lshrdi3.c moddi3.c muldi3.c \
negdi2.c notdi2.c qdivrem.c subdi3.c ucmpdi2.c udivdi3.c umoddi3.c \
xordi3.c
-.endif
-
.PATH: ${.CURDIR}/${MACHINE}/quad ${.CURDIR}/quad
diff --git a/lib/libc/quad/quad.h b/lib/libc/quad/quad.h
index 873a1f6bde0a..bc6a2f836327 100644
--- a/lib/libc/quad/quad.h
+++ b/lib/libc/quad/quad.h
@@ -35,7 +35,6 @@
* SUCH DAMAGE.
*
* @(#)quad.h 8.1 (Berkeley) 6/4/93
- * $Id$
*/
/*
@@ -96,11 +95,7 @@ union uu {
#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1))
#define LHUP(x) ((x) << HALF_BITS)
-quad_t __divdi3 __P((quad_t a, quad_t b));
-quad_t __moddi3 __P((quad_t a, quad_t b));
-u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem));
-u_quad_t __udivdi3 __P((u_quad_t a, u_quad_t b));
-u_quad_t __umoddi3 __P((u_quad_t a, u_quad_t b));
+extern u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem));
/*
* XXX
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 8b54837c7316..6d982f889c51 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -686,7 +686,6 @@ sopno lev; /* PLUS nesting level */
/* "can't happen" */
assert(nope);
/* NOTREACHED */
- return "shut up gcc";
}
/*
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 10412aada61d..feb24ecced33 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -673,6 +673,7 @@ static void
p_bracket(p)
register struct parse *p;
{
+ register char c;
register cset *cs = allocset(p);
register int invert = 0;
@@ -820,7 +821,7 @@ register cset *cs;
register char *u;
register char c;
- while (MORE() && isalpha((unsigned char)PEEK()))
+ while (MORE() && isalpha(PEEK()))
NEXT();
len = p->next - sp;
for (cp = cclasses; cp->name != NULL; cp++)
@@ -888,6 +889,7 @@ int endc; /* name ended by endc,']' */
register char *sp = p->next;
register struct cname *cp;
register int len;
+ register char c;
while (MORE() && !SEETWO(endc, ']'))
NEXT();
@@ -913,7 +915,6 @@ static char /* if no counterpart, return ch */
othercase(ch)
int ch;
{
- ch = (unsigned char)ch;
assert(isalpha(ch));
if (isupper(ch))
return(tolower(ch));
@@ -938,7 +939,6 @@ int ch;
register char *oldend = p->end;
char bracket[3];
- ch = (unsigned char)ch;
assert(othercase(ch) != ch); /* p_bracket() would recurse */
p->next = bracket;
p->end = bracket+2;
@@ -962,7 +962,7 @@ register int ch;
{
register cat_t *cap = p->g->categories;
- if ((p->g->cflags&REG_ICASE) && isalpha((unsigned char)ch) && othercase(ch) != ch)
+ if ((p->g->cflags&REG_ICASE) && isalpha(ch) && othercase(ch) != ch)
bothcases(p, ch);
else {
EMIT(OCHAR, (unsigned char)ch);
@@ -1213,7 +1213,7 @@ register cset *cs;
for (i = 0; i < css; i++)
if (CHIN(cs, i))
- return((unsigned char)i);
+ return((char)i);
assert(never);
return(0); /* arbitrary */
}
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c
index 212f709cf73f..2d2160ac1126 100644
--- a/lib/libc/regex/regerror.c
+++ b/lib/libc/regex/regerror.c
@@ -166,6 +166,8 @@ const regex_t *preg;
char *localbuf;
{
register struct rerr *r;
+ register size_t siz;
+ register char *p;
for (r = rerrs; r->code != 0; r++)
if (strcmp(r->name, preg->re_endp) == 0)
diff --git a/lib/libc/rpc/Makefile.inc b/lib/libc/rpc/Makefile.inc
index 00d86b9acab7..43f0f3939532 100644
--- a/lib/libc/rpc/Makefile.inc
+++ b/lib/libc/rpc/Makefile.inc
@@ -21,4 +21,3 @@ MAN3+= rpc/bindresvport.3 rpc/getrpcent.3 rpc/getrpcport.3 rpc/rpc.3
MAN5+= rpc/rpc.5
MAN8+= rpc/rstat_svc.8
-MLINKS+=getrpcent.3 getrpcbyname.3 getrpcent.3 getrpcbynumber.3
diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c
index b04d5e66707a..9993392bdff6 100644
--- a/lib/libc/rpc/auth_none.c
+++ b/lib/libc/rpc/auth_none.c
@@ -41,7 +41,6 @@ static char *rcsid = "$Id: auth_none.c,v 1.2 1995/05/30 05:41:11 rgrimes Exp $";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#include <stdlib.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c
index b63b95954c52..777f42182371 100644
--- a/lib/libc/rpc/auth_unix.c
+++ b/lib/libc/rpc/auth_unix.c
@@ -47,8 +47,6 @@ static char *rcsid = "$Id: auth_unix.c,v 1.4 1995/05/30 05:41:12 rgrimes Exp $";
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
#include <sys/param.h>
#include <rpc/types.h>
@@ -85,7 +83,7 @@ struct audata {
};
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-static void marshal_new_auth();
+static bool_t marshal_new_auth();
/*
* This goop is here because some servers refuse to accept a
@@ -94,7 +92,7 @@ static void marshal_new_auth();
*/
static int authunix_maxgrouplist = 0;
-void
+int
set_rpc_maxgrouplist(int num)
{
authunix_maxgrouplist = num;
@@ -330,7 +328,7 @@ authunix_destroy(auth)
* Marshals (pre-serializes) an auth struct.
* sets private data, au_marshed and au_mpos
*/
-static void
+static bool_t
marshal_new_auth(auth)
register AUTH *auth;
{
diff --git a/lib/libc/rpc/bindresvport.3 b/lib/libc/rpc/bindresvport.3
index 5d1648751c08..1fb1f9a30600 100644
--- a/lib/libc/rpc/bindresvport.3
+++ b/lib/libc/rpc/bindresvport.3
@@ -1,5 +1,5 @@
.\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI
-.TH BINDRESVPORT 3 "22 november 1987"
+.TH BINDRESVPORT 3N "22 november 1987"
.SH NAME
bindresvport \- bind a socket to a privileged IP port
.SH SYNOPSIS
diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c
index c7f93b205270..e7cfe8bc91b9 100644
--- a/lib/libc/rpc/bindresvport.c
+++ b/lib/libc/rpc/bindresvport.c
@@ -41,8 +41,6 @@ static char *rcsid = "$Id: bindresvport.c,v 1.2 1995/05/30 05:41:13 rgrimes Exp
#include <sys/errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <unistd.h>
-#include <string.h>
/*
* Bind a socket to a privileged IP port
diff --git a/lib/libc/rpc/clnt_generic.c b/lib/libc/rpc/clnt_generic.c
index a529336dc447..96f4c3de726a 100644
--- a/lib/libc/rpc/clnt_generic.c
+++ b/lib/libc/rpc/clnt_generic.c
@@ -40,7 +40,6 @@ static char *rcsid = "$Id: clnt_generic.c,v 1.2 1995/05/30 05:41:14 rgrimes Exp
#include <sys/socket.h>
#include <sys/errno.h>
#include <netdb.h>
-#include <string.h>
/*
* Generic client creation: takes (hostname, program-number, protocol) and
diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c
index 3c73c448d7ec..f7ef47fbde09 100644
--- a/lib/libc/rpc/clnt_perror.c
+++ b/lib/libc/rpc/clnt_perror.c
@@ -40,7 +40,6 @@ static char *rcsid = "$Id: clnt_perror.c,v 1.2 1995/05/30 05:41:15 rgrimes Exp $
*
*/
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include <rpc/types.h>
@@ -151,7 +150,7 @@ clnt_perror(rpch, s)
CLIENT *rpch;
char *s;
{
- (void) fprintf(stderr,"%s\n",clnt_sperror(rpch,s));
+ (void) fprintf(stderr,"%s",clnt_sperror(rpch,s));
}
@@ -221,7 +220,7 @@ void
clnt_perrno(num)
enum clnt_stat num;
{
- (void) fprintf(stderr,"%s\n",clnt_sperrno(num));
+ (void) fprintf(stderr,"%s",clnt_sperrno(num));
}
@@ -262,7 +261,7 @@ void
clnt_pcreateerror(s)
char *s;
{
- (void) fprintf(stderr,"%s\n",clnt_spcreateerror(s));
+ (void) fprintf(stderr,"%s",clnt_spcreateerror(s));
}
struct auth_errtab {
diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c
index 56c15ef0cf02..8f8a3d8d5f9a 100644
--- a/lib/libc/rpc/clnt_raw.c
+++ b/lib/libc/rpc/clnt_raw.c
@@ -45,7 +45,6 @@ static char *rcsid = "$Id: clnt_raw.c,v 1.2 1995/05/30 05:41:16 rgrimes Exp $";
*/
#include <rpc/rpc.h>
-#include <stdlib.h>
#define MCALL_MSG_SIZE 24
@@ -98,7 +97,7 @@ clntraw_create(prog, vers)
clntraw_private = clp;
}
/*
- * pre-serialize the static part of the call msg and stash it away
+ * pre-serialize the staic part of the call msg and stash it away
*/
call_msg.rm_direction = CALL;
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index 2678287f9fca..df7fbf8df241 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -42,7 +42,6 @@ static char *rcsid = "$Id: clnt_simple.c,v 1.2 1995/05/30 05:41:17 rgrimes Exp $
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index 261ca44a9057..b7c649777a22 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -53,9 +53,6 @@ static char *rcsid = "$Id: clnt_tcp.c,v 1.2 1995/05/30 05:41:18 rgrimes Exp $";
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <netdb.h>
@@ -191,7 +188,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
call_msg.rm_call.cb_vers = vers;
/*
- * pre-serialize the static part of the call msg and stash it away
+ * pre-serialize the staic part of the call msg and stash it away
*/
xdrmem_create(&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
XDR_ENCODE);
@@ -420,8 +417,8 @@ readtcp(ct, buf, len)
#endif /* def FD_SETSIZE */
while (TRUE) {
readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &(ct->ct_wait))) {
+ switch (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
+ &(ct->ct_wait))) {
case 0:
ct->ct_error.re_status = RPC_TIMEDOUT;
return (-1);
diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c
index cb8140179ea3..1e2b450e2ec6 100644
--- a/lib/libc/rpc/clnt_udp.c
+++ b/lib/libc/rpc/clnt_udp.c
@@ -40,9 +40,6 @@ static char *rcsid = "$Id: clnt_udp.c,v 1.3.4.1 1995/08/04 19:37:31 davidg Exp $
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
@@ -291,8 +288,8 @@ send_again:
#endif /* def FD_SETSIZE */
for (;;) {
readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &(cu->cu_wait))) {
+ switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
+ (int *)NULL, &(cu->cu_wait))) {
case 0:
time_waited.tv_sec += cu->cu_wait.tv_sec;
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index 1565531f22bd..04399c4c57d3 100644
--- a/lib/libc/rpc/get_myaddress.c
+++ b/lib/libc/rpc/get_myaddress.c
@@ -45,7 +45,6 @@ static char *rcsid = "$Id: get_myaddress.c,v 1.2 1995/05/30 05:41:20 rgrimes Exp
#include <rpc/pmap_prot.h>
#include <sys/socket.h>
#include <stdio.h>
-#include <unistd.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
diff --git a/lib/libc/rpc/getrpcent.3 b/lib/libc/rpc/getrpcent.3
index 2bac189b451c..edf64e4f6b72 100644
--- a/lib/libc/rpc/getrpcent.3
+++ b/lib/libc/rpc/getrpcent.3
@@ -1,5 +1,5 @@
.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
-.TH GETRPCENT 3 "14 December 1987"
+.TH GETRPCENT 3N "14 December 1987"
.SH NAME
getrpcent, getrpcbyname, getrpcbynumber \- get RPC entry
.SH SYNOPSIS
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index e9b919c89222..824a81eb39e0 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -38,7 +38,6 @@ static char *rcsid = "$Id: getrpcent.c,v 1.2 1995/05/30 05:41:21 rgrimes Exp $";
*/
#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <rpc/rpc.h>
@@ -206,8 +205,8 @@ getrpcent()
int reason;
register struct rpcdata *d = _rpcdata();
#ifdef YP
- char *val = NULL;
- int vallen;
+ char *key = NULL, *val = NULL;
+ int keylen, vallen;
#endif
if (d == 0)
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c
index b28049332769..a081dd8771b8 100644
--- a/lib/libc/rpc/getrpcport.c
+++ b/lib/libc/rpc/getrpcport.c
@@ -38,7 +38,6 @@ static char *rcsid = "$Id: getrpcport.c,v 1.2 1995/05/30 05:41:22 rgrimes Exp $"
*/
#include <stdio.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <netdb.h>
#include <sys/socket.h>
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c
index c91682fb1b78..8048e9bcd663 100644
--- a/lib/libc/rpc/pmap_clnt.c
+++ b/lib/libc/rpc/pmap_clnt.c
@@ -40,7 +40,6 @@ static char *rcsid = "$Id: pmap_clnt.c,v 1.2 1995/05/30 05:41:22 rgrimes Exp $";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#include <unistd.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c
index cbb1a4318b5f..a5379c521182 100644
--- a/lib/libc/rpc/pmap_getmaps.c
+++ b/lib/libc/rpc/pmap_getmaps.c
@@ -47,7 +47,6 @@ static char *rcsid = "$Id: pmap_getmaps.c,v 1.2 1995/05/30 05:41:23 rgrimes Exp
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
#include <net/if.h>
#include <sys/ioctl.h>
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c
index dd63a3757f40..c1cc9c6f24e9 100644
--- a/lib/libc/rpc/pmap_getport.c
+++ b/lib/libc/rpc/pmap_getport.c
@@ -45,7 +45,6 @@ static char *rcsid = "$Id: pmap_getport.c,v 1.2 1995/05/30 05:41:24 rgrimes Exp
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <net/if.h>
-#include <unistd.h>
static struct timeval timeout = { 5, 0 };
static struct timeval tottimeout = { 60, 0 };
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c
index 4b9cba89b2ab..2a467bd56dae 100644
--- a/lib/libc/rpc/pmap_rmt.c
+++ b/lib/libc/rpc/pmap_rmt.c
@@ -47,9 +47,7 @@ static char *rcsid = "$Id: pmap_rmt.c,v 1.2 1995/05/30 05:41:27 rgrimes Exp $";
#include <rpc/pmap_rmt.h>
#include <sys/socket.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
-#include <string.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
@@ -171,7 +169,6 @@ getbroadcastnets(addrs, sock, buf)
struct ifconf ifc;
struct ifreq ifreq, *ifr;
struct sockaddr_in *sin;
- struct in_addr addr;
char *cp, *cplim;
int n, i = 0;
@@ -199,24 +196,17 @@ getbroadcastnets(addrs, sock, buf)
sin = (struct sockaddr_in *)&ifr->ifr_addr;
#ifdef SIOCGIFBRDADDR /* 4.3BSD */
if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
- addr =
+ addrs[i++] =
inet_makeaddr(inet_netof(sin->sin_addr),
INADDR_ANY);
} else {
- addr = ((struct sockaddr_in*)
+ addrs[i++] = ((struct sockaddr_in*)
&ifreq.ifr_addr)->sin_addr;
}
#else /* 4.2 BSD */
- addr = inet_makeaddr(inet_netof(sin->sin_addr),
+ addrs[i++] = inet_makeaddr(inet_netof(sin->sin_addr),
INADDR_ANY);
#endif
- for (n=i-1; n>=0; n--) {
- if (addr.s_addr == addrs[n].s_addr)
- break;
- }
- if (n<0) {
- addrs[i++] = addr;
- }
}
}
return (i);
@@ -338,8 +328,8 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
msg.acpted_rply.ar_results.where = (caddr_t)&r;
msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &t)) {
+ switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
+ (int *)NULL, &t)) {
case 0: /* timed out */
stat = RPC_TIMEDOUT;
diff --git a/lib/libc/rpc/rpc.3 b/lib/libc/rpc/rpc.3
index 3d9d6b218a23..ff00dc333029 100644
--- a/lib/libc/rpc/rpc.3
+++ b/lib/libc/rpc/rpc.3
@@ -13,7 +13,7 @@ reply.
Finally, the procedure call returns to the client.
.LP
Routines that are used for Secure RPC (DES authentication) are described in
-.BR rpc_secure (3).
+.BR rpc_secure (3N).
Secure RPC can be used only if DES encryption is available.
.LP
.ft B
@@ -646,7 +646,7 @@ client for the remote program
.IR prognum ,
version
.IR versnum ;
-the client uses
+the client uses use
.SM UDP/IP
as a transport. The remote program is located at Internet
address
@@ -700,7 +700,7 @@ client for the remote program
.IR prognum ,
on
.IR versnum ;
-the client uses
+the client uses use
.SM UDP/IP
as a transport. The remote program is located at Internet
address
@@ -725,7 +725,7 @@ out.
The total time for the call to time out is specified by
.BR clnt_call(\|) .
.IP
-This allows the user to specify the maximum packet size for sending and receiving
+This allows the user to specify the maximun packet size for sending and receiving
.SM UDP\s0-based
.SM RPC
messages.
@@ -1709,7 +1709,7 @@ This routine modifies the global variable
.BR svc_fds(\|) .
Service implementors usually do not need this routine.
.SH SEE ALSO
-.BR rpc_secure (3),
+.BR rpc_secure (3N),
.BR xdr (3)
.br
The following manuals:
diff --git a/lib/libc/rpc/rpc.5 b/lib/libc/rpc/rpc.5
index 794197b65387..324ecb153a83 100644
--- a/lib/libc/rpc/rpc.5
+++ b/lib/libc/rpc/rpc.5
@@ -68,4 +68,4 @@ nsemntd 100039
.SH FILES
/etc/rpc
.SH "SEE ALSO"
-getrpcent(3)
+getrpcent(3N)
diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c
index 54f103b5b753..7077ea40fd0b 100644
--- a/lib/libc/rpc/rpc_callmsg.c
+++ b/lib/libc/rpc/rpc_callmsg.c
@@ -41,8 +41,7 @@ static char *rcsid = "$Id: rpc_callmsg.c,v 1.2 1995/05/30 05:41:28 rgrimes Exp $
*/
#include <sys/param.h>
-#include <stdlib.h>
-#include <string.h>
+
#include <rpc/rpc.h>
/*
diff --git a/lib/libc/rpc/rstat.1 b/lib/libc/rpc/rstat.1
index 03c3a063b301..52eaa31c924e 100644
--- a/lib/libc/rpc/rstat.1
+++ b/lib/libc/rpc/rstat.1
@@ -17,7 +17,7 @@ The load average numbers give the number of jobs in the run queue
averaged over 1, 5 and 15 minutes.
.PP
The
-.B rstat_svc(8)
+.B rstat_svc(8c)
daemon must be running on the remote host for this command to
work.
.B rstat
@@ -50,8 +50,8 @@ daemon has terminated on the remote host.
rstat: RPC: Port mapper failure - RPC: Timed out
.IP
The remote host is not running the portmapper (see
-.BR portmap(8) ),
+.BR portmap(8c) ),
and cannot accommodate any RPC-based services. The host may be down.
.SH "SEE ALSO"
-.BR portmap (8),
-.BR rstat_svc (8)
+.BR portmap (8c),
+.BR rstat_svc (8c)
diff --git a/lib/libc/rpc/rstat_svc.8 b/lib/libc/rpc/rstat_svc.8
index b7b438681ba9..a10b71dbacad 100644
--- a/lib/libc/rpc/rstat_svc.8
+++ b/lib/libc/rpc/rstat_svc.8
@@ -1,5 +1,5 @@
.\" @(#)rstat_svc.8c 2.2 88/08/03 4.0 RPCSRC; from 1.10 87/09/09 SMI
-.TH RSTAT_SVC 8 "24 November 1987"
+.TH RSTAT_SVC 8C "24 November 1987"
.SH NAME
rstat_svc \- kernel statistics server
.SH SYNOPSIS
@@ -17,5 +17,5 @@ daemon is normally invoked at boot time through /etc/rc.local.
.PP
.B rstat_svc
uses an RPC protocol defined in /usr/include/rpcsvc/rstat.x.
-.\" .SH "SEE ALSO"
-.\" .BR rstat (1),
+.SH "SEE ALSO"
+.BR rstat (1),
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index 809cbfb596e7..8c8354b19c0e 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -43,8 +43,6 @@ static char *rcsid = "$Id: svc.c,v 1.2 1995/05/30 05:41:31 rgrimes Exp $";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#include <string.h>
-#include <stdlib.h>
#include <sys/errno.h>
#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c
index 27ced54634e1..7a5d24be0d4f 100644
--- a/lib/libc/rpc/svc_auth_unix.c
+++ b/lib/libc/rpc/svc_auth_unix.c
@@ -45,7 +45,6 @@ static char *rcsid = "$Id: svc_auth_unix.c,v 1.2 1995/05/30 05:41:33 rgrimes Exp
*/
#include <stdio.h>
-#include <string.h>
#include <rpc/rpc.h>
/*
diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c
index f72a5f4cb1ef..80aa9a126f93 100644
--- a/lib/libc/rpc/svc_raw.c
+++ b/lib/libc/rpc/svc_raw.c
@@ -43,7 +43,7 @@ static char *rcsid = "$Id: svc_raw.c,v 1.2 1995/05/30 05:41:34 rgrimes Exp $";
*/
#include <rpc/rpc.h>
-#include <stdlib.h>
+
/*
* This is the "network" that we will be moving data over
diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c
index 8bcc3061e8c5..4b93a331dc82 100644
--- a/lib/libc/rpc/svc_simple.c
+++ b/lib/libc/rpc/svc_simple.c
@@ -41,8 +41,6 @@ static char *rcsid = "$Id: svc_simple.c,v 1.2 1995/05/30 05:41:37 rgrimes Exp $"
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <netdb.h>
diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c
index b71fc6b8ed0d..94b5ea1dcb38 100644
--- a/lib/libc/rpc/svc_tcp.c
+++ b/lib/libc/rpc/svc_tcp.c
@@ -44,12 +44,11 @@ static char *rcsid = "$Id: svc_tcp.c,v 1.2 1995/05/30 05:41:38 rgrimes Exp $";
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
+extern bool_t abort();
+extern errno;
/*
* Ops vector for TCP/IP based rpc service handle
@@ -307,8 +306,8 @@ readtcp(xprt, buf, len)
#endif /* def FD_SETSIZE */
do {
readfds = mask;
- if (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &wait_per_try) <= 0) {
+ if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
+ &wait_per_try) <= 0) {
if (errno == EINTR) {
continue;
}
diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c
index b071355feff4..1491a582aa4f 100644
--- a/lib/libc/rpc/svc_udp.c
+++ b/lib/libc/rpc/svc_udp.c
@@ -43,8 +43,6 @@ static char *rcsid = "$Id: svc_udp.c,v 1.3 1995/05/30 05:41:39 rgrimes Exp $";
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
diff --git a/lib/libc/stdio/Makefile.inc b/lib/libc/stdio/Makefile.inc
index a549be2c1050..5ca501621a49 100644
--- a/lib/libc/stdio/Makefile.inc
+++ b/lib/libc/stdio/Makefile.inc
@@ -1,19 +1,18 @@
# @(#)Makefile.inc 8.3 (Berkeley) 4/17/94
-# $Id$
# stdio sources
.PATH: ${.CURDIR}/stdio
-SRCS+= asprintf.c clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c \
- fgetc.c fgetln.c fgetpos.c fgets.c fileno.c findfp.c flags.c fopen.c \
+SRCS+= clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c fgetc.c \
+ fgetln.c fgetpos.c fgets.c fileno.c findfp.c flags.c fopen.c \
fprintf.c fpurge.c fputc.c fputs.c fread.c freopen.c fscanf.c \
fseek.c fsetpos.c ftell.c funopen.c fvwrite.c fwalk.c fwrite.c \
getc.c getchar.c gets.c getw.c makebuf.c mktemp.c perror.c \
printf.c putc.c putchar.c puts.c putw.c refill.c remove.c rewind.c \
rget.c scanf.c setbuf.c setbuffer.c setvbuf.c snprintf.c sprintf.c \
- sscanf.c stdio.c tempnam.c tmpfile.c tmpnam.c ungetc.c vasprintf.c \
- vfprintf.c vfscanf.c vprintf.c vscanf.c vsnprintf.c vsprintf.c \
- vsscanf.c wbuf.c wsetup.c
+ sscanf.c stdio.c tempnam.c tmpfile.c tmpnam.c ungetc.c vfprintf.c \
+ vfscanf.c vprintf.c vscanf.c vsnprintf.c vsprintf.c vsscanf.c \
+ wbuf.c wsetup.c
MAN3+= stdio/fclose.3 stdio/ferror.3 stdio/fflush.3 stdio/fgetln.3 \
stdio/fgets.3 stdio/fopen.3 stdio/fputs.3 stdio/fread.3 stdio/fseek.3 \
@@ -33,7 +32,7 @@ MLINKS+=getc.3 fgetc.3 getc.3 getchar.3 getc.3 getw.3
MLINKS+=mktemp.3 mkstemp.3
MLINKS+=printf.3 fprintf.3 printf.3 snprintf.3 printf.3 sprintf.3 \
printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \
- printf.3 vsprintf.3 printf.3 asprintf.3 printf.3 vasprintf.3
+ printf.3 vsprintf.3
MLINKS+=putc.3 fputc.3 putc.3 putchar.3 putc.3 putw.3
MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \
scanf.3 vsscanf.3
diff --git a/lib/libc/stdio/clrerr.c b/lib/libc/stdio/clrerr.c
index a597b7b0baf3..de4526e0a7dc 100644
--- a/lib/libc/stdio/clrerr.c
+++ b/lib/libc/stdio/clrerr.c
@@ -40,20 +40,10 @@ static char sccsid[] = "@(#)clrerr.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#undef clearerr
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
void
clearerr(fp)
FILE *fp;
{
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
__sclearerr(fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
}
diff --git a/lib/libc/stdio/fclose.c b/lib/libc/stdio/fclose.c
index be9210801b50..8315c3cf41ea 100644
--- a/lib/libc/stdio/fclose.c
+++ b/lib/libc/stdio/fclose.c
@@ -42,12 +42,7 @@ static char sccsid[] = "@(#)fclose.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
fclose(fp)
register FILE *fp;
{
@@ -57,9 +52,6 @@ fclose(fp)
errno = EBADF;
return (EOF);
}
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
r = fp->_flags & __SWR ? __sflush(fp) : 0;
if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
r = EOF;
@@ -69,11 +61,7 @@ fclose(fp)
FREEUB(fp);
if (HASLB(fp))
FREELB(fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
fp->_flags = 0; /* Release this FILE for reuse. */
- fp->_file = -1;
fp->_r = fp->_w = 0; /* Mess up if reaccessed. */
return (r);
}
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index fce893292e60..4a5cf0f43084 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -41,36 +41,21 @@ static char sccsid[] = "@(#)fflush.c 8.1 (Berkeley) 6/4/93";
#include <errno.h>
#include <stdio.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/* Flush a single file, or (if fp is NULL) all files. */
-int
fflush(fp)
register FILE *fp;
{
- int retval;
if (fp == NULL)
return (_fwalk(__sflush));
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
if ((fp->_flags & (__SWR | __SRW)) == 0) {
errno = EBADF;
- retval = EOF;
- } else {
- retval = __sflush(fp);
+ return (EOF);
}
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sflush(fp));
}
-int
__sflush(fp)
register FILE *fp;
{
diff --git a/lib/libc/stdio/fgetc.c b/lib/libc/stdio/fgetc.c
index 7e2738f6c48f..800846cda974 100644
--- a/lib/libc/stdio/fgetc.c
+++ b/lib/libc/stdio/fgetc.c
@@ -39,22 +39,9 @@ static char sccsid[] = "@(#)fgetc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
fgetc(fp)
FILE *fp;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = __sgetc(fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sgetc(fp));
}
diff --git a/lib/libc/stdio/fgetpos.c b/lib/libc/stdio/fgetpos.c
index 4ac0be4ed3e2..1f4ec1de23d6 100644
--- a/lib/libc/stdio/fgetpos.c
+++ b/lib/libc/stdio/fgetpos.c
@@ -39,23 +39,10 @@ static char sccsid[] = "@(#)fgetpos.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
fgetpos(fp, pos)
FILE *fp;
fpos_t *pos;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = (*pos = ftell(fp)) == (fpos_t)-1;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return(retval);
+ return((*pos = ftell(fp)) == (fpos_t)-1);
}
diff --git a/lib/libc/stdio/fgets.c b/lib/libc/stdio/fgets.c
index 186a1a1136ad..09f68772818d 100644
--- a/lib/libc/stdio/fgets.c
+++ b/lib/libc/stdio/fgets.c
@@ -40,11 +40,6 @@ static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
#include <stdio.h>
#include <string.h>
-#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Read at most n-1 characters from the given file.
@@ -54,19 +49,16 @@ static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
char *
fgets(buf, n, fp)
char *buf;
- register int n;
+ register size_t n;
register FILE *fp;
{
register size_t len;
register char *s;
register unsigned char *p, *t;
- if (n <= 0) /* sanity check */
+ if (n == 0) /* sanity check */
return (NULL);
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
s = buf;
n--; /* leave space for NUL */
while (n != 0) {
@@ -76,12 +68,8 @@ fgets(buf, n, fp)
if ((len = fp->_r) <= 0) {
if (__srefill(fp)) {
/* EOF/error: stop with partial or no line */
- if (s == buf) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (s == buf)
return (NULL);
- }
break;
}
len = fp->_r;
@@ -103,9 +91,6 @@ fgets(buf, n, fp)
fp->_p = t;
(void)memcpy((void *)s, (void *)p, len);
s[len] = 0;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (buf);
}
fp->_r -= len;
@@ -115,8 +100,5 @@ fgets(buf, n, fp)
n -= len;
}
*s = 0;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (buf);
}
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c
index 2986a2ccbbd8..64548db20b3f 100644
--- a/lib/libc/stdio/findfp.c
+++ b/lib/libc/stdio/findfp.c
@@ -127,10 +127,6 @@ found:
* XXX. Force immediate allocation of internal memory. Not used by stdio,
* but documented historically for certain applications. Bad applications.
*/
-__warn_references(f_prealloc,
- "warning: this program uses f_prealloc(), which is stupid.");
-
-void
f_prealloc()
{
register struct glue *g;
diff --git a/lib/libc/stdio/fpurge.c b/lib/libc/stdio/fpurge.c
index 7cf54ffb2e38..3bee5132aa57 100644
--- a/lib/libc/stdio/fpurge.c
+++ b/lib/libc/stdio/fpurge.c
@@ -42,10 +42,6 @@ static char sccsid[] = "@(#)fpurge.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* fpurge: like fflush, but without writing anything: leave the
@@ -55,23 +51,15 @@ int
fpurge(fp)
register FILE *fp;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
if (!fp->_flags) {
errno = EBADF;
- retval = EOF;
- } else {
- if (HASUB(fp))
- FREEUB(fp);
- fp->_p = fp->_bf._base;
- fp->_r = 0;
- fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
- retval = 0;
+ return(EOF);
}
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+
+ if (HASUB(fp))
+ FREEUB(fp);
+ fp->_p = fp->_bf._base;
+ fp->_r = 0;
+ fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
+ return (0);
}
diff --git a/lib/libc/stdio/fputc.c b/lib/libc/stdio/fputc.c
index 09b55d59a58e..c86f71161fc4 100644
--- a/lib/libc/stdio/fputc.c
+++ b/lib/libc/stdio/fputc.c
@@ -39,23 +39,10 @@ static char sccsid[] = "@(#)fputc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
fputc(c, fp)
int c;
register FILE *fp;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = putc(c, fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (putc(c, fp));
}
diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c
index 92fcc303a690..9f9be2e2feee 100644
--- a/lib/libc/stdio/fputs.c
+++ b/lib/libc/stdio/fputs.c
@@ -41,20 +41,14 @@ static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <string.h>
#include "fvwrite.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Write the given string to the given file.
*/
-int
fputs(s, fp)
const char *s;
FILE *fp;
{
- int retval;
struct __suio uio;
struct __siov iov;
@@ -62,12 +56,5 @@ fputs(s, fp)
iov.iov_len = uio.uio_resid = strlen(s);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = __sfvwrite(fp, &uio);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sfvwrite(fp, &uio));
}
diff --git a/lib/libc/stdio/fread.3 b/lib/libc/stdio/fread.3
index c3e591af9ddd..03a91412bc88 100644
--- a/lib/libc/stdio/fread.3
+++ b/lib/libc/stdio/fread.3
@@ -44,9 +44,9 @@
.Nd binary stream input/output
.Sh SYNOPSIS
.Fd #include <stdio.h>
-.Ft size_t
+.Ft int
.Fn fread "void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
-.Ft size_t
+.Ft int
.Fn fwrite "const void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
.Sh DESCRIPTION
The function
diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
index 7132e8544c01..22436ec8dcc1 100644
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -40,11 +40,6 @@ static char sccsid[] = "@(#)fread.c 8.2 (Berkeley) 12/11/93";
#include <stdio.h>
#include <string.h>
-#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
size_t
fread(buf, size, count, fp)
@@ -64,9 +59,6 @@ fread(buf, size, count, fp)
*/
if ((resid = count * size) == 0)
return (0);
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
if (fp->_r < 0)
fp->_r = 0;
total = resid;
@@ -85,8 +77,5 @@ fread(buf, size, count, fp)
(void)memcpy((void *)p, (void *)fp->_p, resid);
fp->_r -= resid;
fp->_p += resid;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (count);
}
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index bbb3155f94ad..f0e726af8490 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -44,20 +44,14 @@ static char sccsid[] = "@(#)fscanf.c 8.1 (Berkeley) 6/4/93";
#else
#include <varargs.h>
#endif
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
#if __STDC__
-int
fscanf(FILE *fp, char const *fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
#else
-int
fscanf(fp, fmt, va_alist)
FILE *fp;
char *fmt;
@@ -68,13 +62,7 @@ fscanf(fp, fmt, va_alist)
va_start(ap);
#endif
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
ret = __svfscanf(fp, fmt, ap);
va_end(ap);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (ret);
}
diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c
index 1e99de9db2cc..9cb04ad03787 100644
--- a/lib/libc/stdio/fseek.c
+++ b/lib/libc/stdio/fseek.c
@@ -45,10 +45,6 @@ static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94";
#include <stdlib.h>
#include <errno.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
#define POS_ERR (-(fpos_t)1)
@@ -72,9 +68,6 @@ fseek(fp, offset, whence)
if (!__sdidinit)
__sinit();
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
/*
* Have to be able to seek.
*/
@@ -99,12 +92,8 @@ fseek(fp, offset, whence)
curoff = fp->_offset;
else {
curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR);
- if (curoff == -1L) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (curoff == -1L)
return (EOF);
- }
}
if (fp->_flags & __SRD) {
curoff -= fp->_r;
@@ -126,9 +115,6 @@ fseek(fp, offset, whence)
default:
errno = EINVAL;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (EOF);
}
@@ -212,9 +198,6 @@ fseek(fp, offset, whence)
if (HASUB(fp))
FREEUB(fp);
fp->_flags &= ~__SEOF;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (0);
}
@@ -241,9 +224,6 @@ fseek(fp, offset, whence)
fp->_p += n;
fp->_r -= n;
}
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (0);
/*
@@ -253,9 +233,6 @@ fseek(fp, offset, whence)
dumb:
if (__sflush(fp) ||
(*seekfn)(fp->_cookie, (fpos_t)offset, whence) == POS_ERR) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (EOF);
}
/* success: clear EOF indicator and discard ungetc() data */
@@ -265,8 +242,5 @@ dumb:
fp->_r = 0;
/* fp->_w = 0; */ /* unnecessary (I think...) */
fp->_flags &= ~__SEOF;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (0);
}
diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c
index abffc3e8daa1..724e5437812b 100644
--- a/lib/libc/stdio/ftell.c
+++ b/lib/libc/stdio/ftell.c
@@ -41,17 +41,13 @@ static char sccsid[] = "@(#)ftell.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <errno.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* ftell: return current offset.
*/
long
ftell(fp)
- register FILE *fp;
+ register const FILE *fp;
{
register fpos_t pos;
@@ -60,9 +56,6 @@ ftell(fp)
return (-1L);
}
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp, __FILE__, __LINE__);
-#endif
/*
* Find offset of underlying I/O object, then
* adjust for buffered bytes.
@@ -71,12 +64,8 @@ ftell(fp)
pos = fp->_offset;
else {
pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR);
- if (pos == -1) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (pos == -1L)
return (pos);
- }
}
if (fp->_flags & __SRD) {
/*
@@ -95,8 +84,5 @@ ftell(fp)
*/
pos += fp->_p - fp->_bf._base;
}
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (pos);
}
diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c
index 7efb0ac4e277..dbc2e978d7d0 100644
--- a/lib/libc/stdio/fwrite.c
+++ b/lib/libc/stdio/fwrite.c
@@ -41,10 +41,6 @@ static char sccsid[] = "@(#)fwrite.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include "local.h"
#include "fvwrite.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Write `count' objects (each size `size') from memory to the given file.
@@ -65,18 +61,12 @@ fwrite(buf, size, count, fp)
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
/*
* The usual case is success (__sfvwrite returns 0);
* skip the divide if this happens, since divides are
* generally slow and since this occurs whenever size==0.
*/
- if (__sfvwrite(fp, &uio) != 0)
- count = (n - uio.uio_resid) / size;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (count);
+ if (__sfvwrite(fp, &uio) == 0)
+ return (count);
+ return ((n - uio.uio_resid) / size);
}
diff --git a/lib/libc/stdio/getc.c b/lib/libc/stdio/getc.c
index c0726ee2db64..1e900cd6e64a 100644
--- a/lib/libc/stdio/getc.c
+++ b/lib/libc/stdio/getc.c
@@ -39,27 +39,14 @@ static char sccsid[] = "@(#)getc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* A subroutine version of the macro getc.
*/
#undef getc
-int
getc(fp)
register FILE *fp;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = __sgetc(fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sgetc(fp));
}
diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c
index 7aeef8af645f..20e52b79193e 100644
--- a/lib/libc/stdio/getchar.c
+++ b/lib/libc/stdio/getchar.c
@@ -42,23 +42,10 @@ static char sccsid[] = "@(#)getchar.c 8.1 (Berkeley) 6/4/93";
* A subroutine version of the macro getchar.
*/
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
#undef getchar
-int
getchar()
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(stdin,__FILE__,__LINE__);
-#endif
- retval = getc(stdin);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(stdin);
-#endif
- return (retval);
+ return (getc(stdin));
}
diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c
index d31aeeef9148..0517930bbcb1 100644
--- a/lib/libc/stdio/gets.c
+++ b/lib/libc/stdio/gets.c
@@ -40,9 +40,6 @@ static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93";
#include <unistd.h>
#include <stdio.h>
-#include <sys/cdefs.h>
-
-__warn_references(gets, "warning: this program uses gets(), which is unsafe.");
char *
gets(buf)
@@ -52,7 +49,7 @@ gets(buf)
register char *s;
static int warned;
static char w[] =
- "warning: this program uses gets(), which is unsafe.\n";
+ "warning: this program uses gets(), which is unsafe.\r\n";
if (!warned) {
(void) write(STDERR_FILENO, w, sizeof(w) - 1);
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index 3f5966e1f424..6cedd6a6be43 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -40,7 +40,6 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
#include <ctype.h>
static int _gettemp();
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3
index e675b3eda99b..4238a90a889e 100644
--- a/lib/libc/stdio/printf.3
+++ b/lib/libc/stdio/printf.3
@@ -43,12 +43,10 @@
.Nm fprintf ,
.Nm sprintf ,
.Nm snprintf ,
-.Nm asprintf ,
.Nm vprintf ,
.Nm vfprintf,
.Nm vsprintf ,
-.Nm vsnprintf ,
-.Nm vasprintf
+.Nm vsnprintf
.Nd formatted output conversion
.Sh SYNOPSIS
.Fd #include <stdio.h>
@@ -60,8 +58,8 @@
.Fn sprintf "char *str" "const char *format" ...
.Ft int
.Fn snprintf "char *str" "size_t size" "const char *format" ...
-.Ft int
-.Fn asprintf "char **ret" "const char *format" ...
+.\" .Ft int
+.\" .Fn smprintf "const char *format" ...
.Fd #include <stdarg.h>
.Ft int
.Fn vprintf "const char *format" "va_list ap"
@@ -71,8 +69,8 @@
.Fn vsprintf "char *str" "char *format" "va_list ap"
.Ft int
.Fn vsnprintf "char *str" "size_t size" "const char *format" "va_list ap"
-.Ft int
-.Fn vasprintf "char **ret" "const char *format" "va_list ap"
+.\" .Ft int
+.\" .Fn vsmprintf "const char *format" "va_list ap"
.Sh DESCRIPTION
The
.Fn printf
@@ -96,47 +94,45 @@ write output to the given output
and
.Fn vsnprintf
write to the character string
-.Fa str ;
-and
-.Fn asprintf
-and
-.Fn vasprintf
-dynamically allocate a new string with
-.Xr malloc 3
-/
-.Xr realloc 3 .
-.Pp
+.Fa str .
+.\" .IR str ;
+.\" and
+.\" .I smprintf
+.\" and
+.\" .I vsmprintf
+.\" dynamically allocate a new string with
+.\" .IR malloc .
These functions write the output under the control of a
.Fa format
string that specifies how subsequent arguments
(or arguments accessed via the variable-length argument facilities of
.Xr stdarg 3 )
are converted for output.
-.Pp
+.\" Except for
+.\" .I smprintf
+.\" and
+.\" .IR vsmprintf ,
+.\" all of these functions return
These functions return
the number of characters printed
(not including the trailing
.Ql \e0
used to end output to strings).
-.Pp
-.Fn Asprintf
-and
-.Fn vasprintf
-return a pointer to a buffer sufficiently large to hold the
-string in the
-.Fa ret
-argument;
-This pointer should be passed to
-.Xr free 3
-to release the allocated storage when it is no longer needed.
-If sufficient space cannot be allocated,
-.Fn asprintf
-and
-.Fn vasprintf
-will return -1 and set
-.Fa ret
-to be a NULL pointer.
-.Pp
+.\" .I Smprintf
+.\" and
+.\" .I vsmprintf
+.\" return a pointer to a string of an appropriate length;
+.\" this pointer should be passed to
+.\" .I free
+.\" to release the associated storage
+.\" when it is no longer needed.
+.\" If sufficient space is not avaliable,
+.\" .I smprintf
+.\" and
+.\" .I vsmprintf
+.\" will return
+.\" .SM
+.\" .BR
.Fn Snprintf
and
.Fn vsnprintf
@@ -151,7 +147,6 @@ if the return value is greater than or equal to the
.Fa size
argument, the string was too short
and some of the printed characters were discarded.
-.Pp
.Fn Sprintf
and
.Fn vsprintf
@@ -605,15 +600,6 @@ The functions
and
.Fn vsnprintf
are new to this release.
-.Pp
-The functions
-.Fn asprintf
-and
-.Fn vasprintf
-first appeared in the GNU C library. This implementation is thought
-to be compatable but is not derived from the GNU code. This implementation
-was written by Peter Wemm <peter@FreeBSD.org> and first appeared in
-FreeBSD-2.2.
.Sh BUGS
The conversion formats
.Cm \&%D ,
diff --git a/lib/libc/stdio/putc.c b/lib/libc/stdio/putc.c
index f1d42b11454b..c18353b7044a 100644
--- a/lib/libc/stdio/putc.c
+++ b/lib/libc/stdio/putc.c
@@ -39,28 +39,15 @@ static char sccsid[] = "@(#)putc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* A subroutine version of the macro putc.
*/
#undef putc
-int
putc(c, fp)
int c;
register FILE *fp;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = __sputc(c, fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sputc(c, fp));
}
diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c
index 5e04a6c72f2c..036b8970772c 100644
--- a/lib/libc/stdio/putchar.c
+++ b/lib/libc/stdio/putchar.c
@@ -39,29 +39,16 @@ static char sccsid[] = "@(#)putchar.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
#undef putchar
/*
* A subroutine version of the macro putchar
*/
-int
putchar(c)
int c;
{
- int retval;
register FILE *so = stdout;
-#ifdef _THREAD_SAFE
- _thread_flockfile(so,__FILE__,__LINE__);
-#endif
- retval = __sputc(c, so);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(so);
-#endif
- return (retval);
+ return (__sputc(c, so));
}
diff --git a/lib/libc/stdio/puts.c b/lib/libc/stdio/puts.c
index e8a35c533a51..96a81842b86f 100644
--- a/lib/libc/stdio/puts.c
+++ b/lib/libc/stdio/puts.c
@@ -41,19 +41,13 @@ static char sccsid[] = "@(#)puts.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <string.h>
#include "fvwrite.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Write the given string to stdout, appending a newline.
*/
-int
puts(s)
char const *s;
{
- int retval;
size_t c = strlen(s);
struct __suio uio;
struct __siov iov[2];
@@ -65,12 +59,5 @@ puts(s)
uio.uio_resid = c + 1;
uio.uio_iov = &iov[0];
uio.uio_iovcnt = 2;
-#ifdef _THREAD_SAFE
- _thread_flockfile(stdout,__FILE__,__LINE__);
-#endif
- retval = __sfvwrite(stdout, &uio) ? EOF : '\n';
-#ifdef _THREAD_SAFE
- _thread_funlockfile(stdout);
-#endif
- return (retval);
+ return (__sfvwrite(stdout, &uio) ? EOF : '\n');
}
diff --git a/lib/libc/stdio/putw.c b/lib/libc/stdio/putw.c
index 604bed0b7925..4ba898207f1e 100644
--- a/lib/libc/stdio/putw.c
+++ b/lib/libc/stdio/putw.c
@@ -40,17 +40,11 @@ static char sccsid[] = "@(#)putw.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include "fvwrite.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
putw(w, fp)
int w;
FILE *fp;
{
- int retval;
struct __suio uio;
struct __siov iov;
@@ -58,12 +52,5 @@ putw(w, fp)
iov.iov_len = uio.uio_resid = sizeof(w);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
- retval = __sfvwrite(fp, &uio);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (retval);
+ return (__sfvwrite(fp, &uio));
}
diff --git a/lib/libc/stdio/rewind.c b/lib/libc/stdio/rewind.c
index f20f6197f977..4f8391b5030f 100644
--- a/lib/libc/stdio/rewind.c
+++ b/lib/libc/stdio/rewind.c
@@ -40,22 +40,12 @@ static char sccsid[] = "@(#)rewind.c 8.1 (Berkeley) 6/4/93";
#include <errno.h>
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
void
rewind(fp)
register FILE *fp;
{
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
(void) fseek(fp, 0L, SEEK_SET);
clearerr(fp);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
errno = 0; /* not required, but seems reasonable */
}
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index 5faf018711d3..d36b13a9ed55 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -44,16 +44,10 @@ static char sccsid[] = "@(#)scanf.c 8.1 (Berkeley) 6/4/93";
#else
#include <varargs.h>
#endif
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
#if __STDC__
-int
scanf(char const *fmt, ...)
#else
-int
scanf(fmt, va_alist)
char *fmt;
va_dcl
@@ -67,13 +61,7 @@ scanf(fmt, va_alist)
#else
va_start(ap);
#endif
-#ifdef _THREAD_SAFE
- _thread_flockfile(stdin,__FILE__,__LINE__);
-#endif
ret = __svfscanf(stdin, fmt, ap);
va_end(ap);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(stdin);
-#endif
return (ret);
}
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c
index c6c037d7e293..867f9b4951f6 100644
--- a/lib/libc/stdio/setvbuf.c
+++ b/lib/libc/stdio/setvbuf.c
@@ -41,16 +41,11 @@ static char sccsid[] = "@(#)setvbuf.c 8.2 (Berkeley) 11/16/93";
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Set one of the three kinds of buffering, optionally including
* a buffer.
*/
-int
setvbuf(fp, buf, mode, size)
register FILE *fp;
char *buf;
@@ -70,9 +65,6 @@ setvbuf(fp, buf, mode, size)
if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0)
return (EOF);
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
/*
* Write current buffer, if any. Discard unread input (including
* ungetc data), cancel line buffering, and free old buffer if
@@ -124,9 +116,6 @@ nbf:
fp->_w = 0;
fp->_bf._base = fp->_p = fp->_nbuf;
fp->_bf._size = 1;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (ret);
}
flags |= __SMBF;
@@ -167,8 +156,5 @@ nbf:
}
__cleanup = _cleanup;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (ret);
}
diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c
index 82fad1a75904..3c3cf7d8169b 100644
--- a/lib/libc/stdio/snprintf.c
+++ b/lib/libc/stdio/snprintf.c
@@ -46,10 +46,8 @@ static char sccsid[] = "@(#)snprintf.c 8.1 (Berkeley) 6/4/93";
#endif
#if __STDC__
-int
snprintf(char *str, size_t n, char const *fmt, ...)
#else
-int
snprintf(str, n, fmt, va_alist)
char *str;
size_t n;
@@ -68,7 +66,6 @@ snprintf(str, n, fmt, va_alist)
#else
va_start(ap);
#endif
- f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = n - 1;
diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c
index e71f7d091bc2..254064fabd54 100644
--- a/lib/libc/stdio/sprintf.c
+++ b/lib/libc/stdio/sprintf.c
@@ -48,10 +48,8 @@ static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93";
#include "local.h"
#if __STDC__
-int
sprintf(char *str, char const *fmt, ...)
#else
-int
sprintf(str, fmt, va_alist)
char *str;
char *fmt;
@@ -62,7 +60,6 @@ sprintf(str, fmt, va_alist)
va_list ap;
FILE f;
- f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = INT_MAX;
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index dc96312a5635..bb7274437802 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -59,10 +59,8 @@ eofread(cookie, buf, len)
}
#if __STDC__
-int
sscanf(const char *str, char const *fmt, ...)
#else
-int
sscanf(str, fmt, va_alist)
char *str;
char *fmt;
@@ -73,7 +71,6 @@ sscanf(str, fmt, va_alist)
va_list ap;
FILE f;
- f._file = -1;
f._flags = __SRD;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._r = strlen(str);
diff --git a/lib/libc/stdio/stdio.3 b/lib/libc/stdio/stdio.3
index 3bde13c391a7..7ebc782d06e3 100644
--- a/lib/libc/stdio/stdio.3
+++ b/lib/libc/stdio/stdio.3
@@ -63,7 +63,7 @@ If a file can support positioning requests (such as a disk file, as opposed
to a terminal) then a
.Em file position indicator
associated with the stream is positioned at the start of the file (byte
-zero), unless the file is opened with append mode. If append mode
+zero), unless the file is opened with appended mode. If append mode
is used, the position indicator will be placed the end-of-file.
The position indicator is maintained by subsequent reads, writes
and positioning requests. All input occurs as if the characters
@@ -111,7 +111,7 @@ opened explicitly:
(for reading conventional input),
.It
.Em standard output
-(for writing conventional output), and
+(for writing conventional input), and
.It
.Em standard error
(for writing diagnostic output).
@@ -229,7 +229,7 @@ feof check and reset stream status
ferror check and reset stream status
fflush flush a stream
fgetc get next character or word from input stream
-fgetln get a line from a stream
+fgetline get a line from a stream
fgetpos reposition a stream
fgets get a line from a stream
fileno check and reset stream status
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index 25f59d7420fb..deaed759992f 100644
--- a/lib/libc/stdio/ungetc.c
+++ b/lib/libc/stdio/ungetc.c
@@ -42,10 +42,6 @@ static char sccsid[] = "@(#)ungetc.c 8.2 (Berkeley) 11/3/93";
#include <stdlib.h>
#include <string.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* Expand the ungetc buffer `in place'. That is, adjust fp->_p when
@@ -53,7 +49,7 @@ static char sccsid[] = "@(#)ungetc.c 8.2 (Berkeley) 11/3/93";
* and move the bytes in the buffer around as necessary so that they
* are all at the end (stack-style).
*/
-static int
+static
__submore(fp)
register FILE *fp;
{
@@ -86,7 +82,6 @@ __submore(fp)
return (0);
}
-int
ungetc(c, fp)
int c;
register FILE *fp;
@@ -95,27 +90,16 @@ ungetc(c, fp)
return (EOF);
if (!__sdidinit)
__sinit();
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
if ((fp->_flags & __SRD) == 0) {
/*
* Not already reading: no good unless reading-and-writing.
* Otherwise, flush any current write stuff.
*/
- if ((fp->_flags & __SRW) == 0) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if ((fp->_flags & __SRW) == 0)
return (EOF);
- }
if (fp->_flags & __SWR) {
- if (__sflush(fp)) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (__sflush(fp))
return (EOF);
- }
fp->_flags &= ~__SWR;
fp->_w = 0;
fp->_lbfsize = 0;
@@ -129,17 +113,10 @@ ungetc(c, fp)
* This may require expanding the current ungetc buffer.
*/
if (HASUB(fp)) {
- if (fp->_r >= fp->_ub._size && __submore(fp)) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (fp->_r >= fp->_ub._size && __submore(fp))
return (EOF);
- }
*--fp->_p = c;
fp->_r++;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (c);
}
fp->_flags &= ~__SEOF;
@@ -153,9 +130,6 @@ ungetc(c, fp)
fp->_p[-1] == c) {
fp->_p--;
fp->_r++;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (c);
}
@@ -170,8 +144,5 @@ ungetc(c, fp)
fp->_ubuf[sizeof(fp->_ubuf) - 1] = c;
fp->_p = &fp->_ubuf[sizeof(fp->_ubuf) - 1];
fp->_r = 1;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
return (c);
}
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 0f241deebe10..f53db612ff60 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -59,10 +59,6 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
#include "local.h"
#include "fvwrite.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/* Define FLOATING_POINT to get floating point. */
#define FLOATING_POINT
@@ -306,7 +302,8 @@ vfprintf(fp, fmt0, ap)
u_quad_t uqval; /* %q integers */
int base; /* base for [diouxX] conversion */
int dprec; /* a copy of prec if [diouxX], 0 otherwise */
- int realsz; /* field size expanded by dprec, sign, etc */
+ int fieldsz; /* field size expanded by sign, etc */
+ int realsz; /* field size expanded by dprec */
int size; /* size of converted field or string */
char *xdigs; /* digits for [xX] conversion */
#define NIOV 8
@@ -369,25 +366,14 @@ vfprintf(fp, fmt0, ap)
flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \
(u_long)va_arg(ap, u_int))
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
- if (cantwrite(fp)) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ if (cantwrite(fp))
return (EOF);
- }
/* optimise fprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
- fp->_file >= 0) {
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ fp->_file >= 0)
return (__sbprintf(fp, fmt0, ap));
- }
fmt = (char *)fmt0;
uio.uio_iov = iovp = iov;
@@ -707,13 +693,14 @@ number: if ((dprec = prec) >= 0)
* floating precision; finally, if LADJUST, pad with blanks.
*
* Compute actual size, so we know how much to pad.
- * size excludes decimal prec; realsz includes it.
+ * fieldsz excludes decimal prec; realsz includes it.
*/
- realsz = dprec > size ? dprec : size;
+ fieldsz = size;
if (sign)
- realsz++;
+ fieldsz++;
else if (flags & HEXPREFIX)
- realsz += 2;
+ fieldsz += 2;
+ realsz = dprec > fieldsz ? dprec : fieldsz;
/* right-adjusting blank padding */
if ((flags & (LADJUST|ZEROPAD)) == 0)
@@ -733,7 +720,7 @@ number: if ((dprec = prec) >= 0)
PAD(width - realsz, zeroes);
/* leading zeroes from decimal precision */
- PAD(dprec - size, zeroes);
+ PAD(dprec - fieldsz, zeroes);
/* the string or number proper */
#ifdef FLOATING_POINT
@@ -795,12 +782,7 @@ number: if ((dprec = prec) >= 0)
done:
FLUSH();
error:
- if (__sferror(fp))
- ret = EOF;
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
- return (ret);
+ return (__sferror(fp) ? EOF : ret);
/* NOTREACHED */
}
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 677039ecc8e4..5d128650b54b 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -39,24 +39,11 @@ static char sccsid[] = "@(#)vscanf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
-int
vscanf(fmt, ap)
const char *fmt;
_BSD_VA_LIST_ ap;
{
- int retval;
-#ifdef _THREAD_SAFE
- _thread_flockfile(stdin,__FILE__,__LINE__);
-#endif
- retval = __svfscanf(stdin, fmt, ap);
-#ifdef _THREAD_SAFE
- _thread_funlockfile(stdin);
-#endif
- return (retval);
+ return (__svfscanf(stdin, fmt, ap));
}
diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c
index 1bff18bb8d3d..ccc8af63f355 100644
--- a/lib/libc/stdio/vsnprintf.c
+++ b/lib/libc/stdio/vsnprintf.c
@@ -40,7 +40,6 @@ static char sccsid[] = "@(#)vsnprintf.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
-int
vsnprintf(str, n, fmt, ap)
char *str;
size_t n;
@@ -52,7 +51,6 @@ vsnprintf(str, n, fmt, ap)
if ((int)n < 1)
return (EOF);
- f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = n - 1;
diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c
index cdfb9ebb91f5..c6e192ae07c6 100644
--- a/lib/libc/stdio/vsprintf.c
+++ b/lib/libc/stdio/vsprintf.c
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)vsprintf.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <limits.h>
-int
vsprintf(str, fmt, ap)
char *str;
const char *fmt;
@@ -50,7 +49,6 @@ vsprintf(str, fmt, ap)
int ret;
FILE f;
- f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = INT_MAX;
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index 0d4d05a10a4f..540f2906b89b 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -52,15 +52,14 @@ eofread(cookie, buf, len)
return (0);
}
-int
vsscanf(str, fmt, ap)
const char *str;
const char *fmt;
_BSD_VA_LIST_ ap;
{
+ int ret;
FILE f;
- f._file = -1;
f._flags = __SRD;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._r = strlen(str);
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 81e8ed030903..de3d864b36ea 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -14,10 +14,10 @@ SRCS+= abort.c atexit.c atof.c atoi.c atol.c bsearch.c calloc.c div.c \
MAN3+= stdlib/abort.3 stdlib/abs.3 stdlib/alloca.3 stdlib/atexit.3 \
stdlib/atof.3 stdlib/atoi.3 stdlib/atol.3 stdlib/bsearch.3 \
- stdlib/calloc.3 stdlib/div.3 stdlib/exit.3 \
+ stdlib/calloc.3 stdlib/div.3 stdlib/exit.3 stdlib/free.3 \
stdlib/getenv.3 stdlib/getopt.3 stdlib/getsubopt.3 stdlib/labs.3 \
stdlib/ldiv.3 stdlib/malloc.3 stdlib/memory.3 stdlib/qsort.3 \
- stdlib/radixsort.3 stdlib/rand.3 stdlib/random.3 \
+ stdlib/radixsort.3 stdlib/rand.3 stdlib/random.3 stdlib/realloc.3 \
stdlib/realpath.3 stdlib/strtod.3 stdlib/strtol.3 stdlib/strtoul.3 \
stdlib/system.3
@@ -27,4 +27,3 @@ MLINKS+=rand.3 srand.3
MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3
MLINKS+=strtol.3 strtoq.3
MLINKS+=strtoul.3 strtouq.3
-MLINKS+=malloc.3 free.3 malloc.3 realloc.3
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index f41500739fec..e56e7e97d6b1 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -35,14 +35,10 @@
static char sccsid[] = "@(#)abort.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-#include <signal.h>
+#include <sys/signal.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
void
abort()
@@ -55,24 +51,15 @@ abort()
* any errors -- X311J doesn't allow abort to return anyway.
*/
sigdelset(&mask, SIGABRT);
-#ifdef _THREAD_SAFE
- (void) _thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#else
(void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#endif
(void)kill(getpid(), SIGABRT);
/*
* if SIGABRT ignored, or caught and the handler returns, do
* it again, only harder.
*/
-#ifdef _THREAD_SAFE
- (void) _thread_sys_signal(SIGABRT, SIG_DFL);
- (void) _thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#else
(void)signal(SIGABRT, SIG_DFL);
(void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#endif
(void)kill(getpid(), SIGABRT);
exit(1);
}
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index a6bbd355d93f..7407e0b81749 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -39,7 +39,20 @@ static char sccsid[] = "@(#)getenv.c 8.1 (Berkeley) 6/4/93";
#include <stddef.h>
#include <string.h>
-inline char *__findenv __P((const char *, int *));
+char *__findenv __P((const char *, int *));
+
+/*
+ * getenv --
+ * Returns ptr to value associated with name, if any, else NULL.
+ */
+char *
+getenv(name)
+ const char *name;
+{
+ int offset;
+
+ return (__findenv(name, &offset));
+}
/*
* __findenv --
@@ -50,42 +63,25 @@ inline char *__findenv __P((const char *, int *));
*
* This routine *should* be a static; don't use it.
*/
-inline char *
+char *
__findenv(name, offset)
register const char *name;
int *offset;
{
extern char **environ;
- register int len, i;
+ register int len;
register const char *np;
- register char **p, *cp;
+ register char **p, *c;
if (name == NULL || environ == NULL)
return (NULL);
for (np = name; *np && *np != '='; ++np)
continue;
len = np - name;
- for (p = environ; (cp = *p) != NULL; ++p) {
- for (np = name, i = len; i && *cp; i--)
- if (*cp++ != *np++)
- break;
- if (i == 0 && *cp++ == '=') {
+ for (p = environ; (c = *p) != NULL; ++p)
+ if (strncmp(c, name, len) == 0 && c[len] == '=') {
*offset = p - environ;
- return (cp);
+ return (c + len + 1);
}
- }
return (NULL);
}
-
-/*
- * getenv --
- * Returns ptr to value associated with name, if any, else NULL.
- */
-char *
-getenv(name)
- const char *name;
-{
- int offset;
-
- return (__findenv(name, &offset));
-}
diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c
index 964955381ea2..d800064f648a 100644
--- a/lib/libc/stdlib/heapsort.c
+++ b/lib/libc/stdlib/heapsort.c
@@ -38,9 +38,10 @@
static char sccsid[] = "@(#)heapsort.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/types.h>
#include <errno.h>
-#include <stddef.h>
#include <stdlib.h>
+#include <stddef.h>
/*
* Swap two areas of size number of bytes. Although qsort(3) permits random
diff --git a/lib/libc/stdlib/ldiv.3 b/lib/libc/stdlib/ldiv.3
index 2b61499e4ecd..a68952f94b26 100644
--- a/lib/libc/stdlib/ldiv.3
+++ b/lib/libc/stdlib/ldiv.3
@@ -44,7 +44,7 @@
.Sh SYNOPSIS
.Fd #include <stdlib.h>
.Ft ldiv_t
-.Fn ldiv "long num" "long denom"
+.Fn ldiv "int num" "int denom"
.Sh DESCRIPTION
The
.Fn ldiv
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 7c3d2133a064..49f53495a10a 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -32,17 +32,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93";
-#endif
-static const char rcsid[] =
- "$Id$";
#endif /* LIBC_SCCS and not lint */
+#include <sys/types.h>
#include <stdlib.h>
-typedef int cmp_t __P((const void *, const void *));
-static inline char *med3 __P((char *, char *, char *, cmp_t *));
+static inline char *med3 __P((char *, char *, char *, int (*)()));
static inline void swapfunc __P((char *, char *, int, int));
#define min(a, b) (a) < (b) ? a : b
@@ -88,7 +84,7 @@ swapfunc(a, b, n, swaptype)
static inline char *
med3(a, b, c, cmp)
char *a, *b, *c;
- cmp_t *cmp;
+ int (*cmp)();
{
return cmp(a, b) < 0 ?
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
@@ -99,7 +95,7 @@ void
qsort(a, n, es, cmp)
void *a;
size_t n, es;
- cmp_t *cmp;
+ int (*cmp)();
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
int d, r, swaptype, swap_cnt;
diff --git a/lib/libc/stdlib/strhash.c b/lib/libc/stdlib/strhash.c
index 1ccda325d447..860d52a5212e 100644
--- a/lib/libc/stdlib/strhash.c
+++ b/lib/libc/stdlib/strhash.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.4.4.1 1996/02/11 09:05:56 jkh Exp $";
+static char *rcsid = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libc/stdlib/strhash.c,v 1.4.4.1 1996/02/11 09:05:56 jkh Exp $";
#endif
/*
diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc
index c67bf9735a93..4d93c365ada8 100644
--- a/lib/libc/stdtime/Makefile.inc
+++ b/lib/libc/stdtime/Makefile.inc
@@ -8,4 +8,3 @@ MAN3+= stdtime/ctime.3 stdtime/strftime.3 stdtime/time2posix.3
MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
ctime.3 localtime.3 ctime.3 mktime.3
-MLINKS+=time2posix.3 posix2time.3
diff --git a/lib/libc/stdtime/asctime.c b/lib/libc/stdtime/asctime.c
index 1655f6a26576..107b44c4b5cd 100644
--- a/lib/libc/stdtime/asctime.c
+++ b/lib/libc/stdtime/asctime.c
@@ -1,4 +1,5 @@
+
#ifndef lint
#ifndef NOID
static char elsieid[] = "@(#)asctime.c 7.5";
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index c4cfc8899be9..c6fae73d9a10 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -17,10 +17,6 @@ static char elsieid[] = "@(#)localtime.c 7.44";
#include "private.h"
#include "tzfile.h"
#include "fcntl.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
** SunOS 4.1.1 headers lack O_BINARY.
@@ -164,10 +160,6 @@ static struct state gmtmem;
static char lcl_TZname[TZ_STRLEN_MAX + 1];
static int lcl_is_set;
static int gmt_is_set;
-#ifdef _THREAD_SAFE
-static pthread_mutex_t lcl_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif
char * tzname[2] = {
wildabbr,
@@ -916,13 +908,8 @@ struct state * const sp;
*/
static
#endif /* !defined STD_INSPIRED */
-#ifdef _THREAD_SAFE
-void
-tzsetwall_basic P((void))
-#else
void
tzsetwall P((void))
-#endif
{
if (lcl_is_set < 0)
return;
@@ -942,23 +929,8 @@ tzsetwall P((void))
settzname();
}
-#ifdef _THREAD_SAFE
-void
-tzsetwall P((void))
-{
- pthread_mutex_lock(&lcl_mutex);
- tzsetwall_basic();
- pthread_mutex_unlock(&lcl_mutex);
-}
-#endif
-
-#ifdef _THREAD_SAFE
-static void
-tzset_basic P((void))
-#else
void
tzset P((void))
-#endif
{
register const char * name;
@@ -998,16 +970,6 @@ tzset P((void))
settzname();
}
-#ifdef _THREAD_SAFE
-void
-tzset P((void))
-{
- pthread_mutex_lock(&lcl_mutex);
- tzset_basic();
- pthread_mutex_unlock(&lcl_mutex);
-}
-#endif
-
/*
** The easy way to behave "as if no library function calls" localtime
** is to not call it--so we drop its guts into "localsub", which can be
@@ -1064,55 +1026,13 @@ struct tm * const tmp;
#endif /* defined TM_ZONE */
}
-#ifdef _THREAD_SAFE
-int
-localtime_r(timep, p_tm)
-const time_t * const timep;
-struct tm *p_tm;
-{
- pthread_mutex_lock(&lcl_mutex);
- tzset();
- localsub(timep, 0L, p_tm);
- pthread_mutex_unlock(&lcl_mutex);
- return(0);
-}
-#endif
-
struct tm *
localtime(timep)
const time_t * const timep;
{
-#ifdef _THREAD_SAFE
- static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t localtime_key = -1;
- struct tm *p_tm;
-
- pthread_mutex_lock(&localtime_mutex);
- if (localtime_key < 0) {
- if (pthread_keycreate(&localtime_key, free) < 0) {
- pthread_mutex_unlock(&localtime_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&localtime_mutex);
- if (pthread_getspecific(localtime_key,(void **) &p_tm) != 0) {
- return(NULL);
- } else if (p_tm == NULL) {
- if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
- return(NULL);
- }
- pthread_setspecific(localtime_key, p_tm);
- }
- pthread_mutex_lock(&lcl_mutex);
- tzset();
- localsub(timep, 0L, p_tm);
- pthread_mutex_unlock(&lcl_mutex);
- return p_tm;
-#else
tzset();
localsub(timep, 0L, &tm);
return &tm;
-#endif
}
/*
@@ -1125,9 +1045,6 @@ const time_t * const timep;
const long offset;
struct tm * const tmp;
{
-#ifdef _THREAD_SAFE
- pthread_mutex_lock(&gmt_mutex);
-#endif
if (!gmt_is_set) {
gmt_is_set = TRUE;
#ifdef ALL_STATE
@@ -1136,9 +1053,6 @@ struct tm * const tmp;
#endif /* defined ALL_STATE */
gmtload(gmtptr);
}
-#ifdef _THREAD_SAFE
- pthread_mutex_unlock(&gmt_mutex);
-#endif
timesub(timep, offset, gmtptr, tmp);
#ifdef TM_ZONE
/*
@@ -1165,43 +1079,9 @@ struct tm *
gmtime(timep)
const time_t * const timep;
{
-#ifdef _THREAD_SAFE
- static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t gmtime_key = -1;
- struct tm *p_tm;
-
- pthread_mutex_lock(&gmtime_mutex);
- if (gmtime_key < 0) {
- if (pthread_keycreate(&gmtime_key, free) < 0) {
- pthread_mutex_unlock(&gmtime_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&gmtime_mutex);
- if (pthread_getspecific(gmtime_key,(void **) &p_tm) != 0) {
- return(NULL);
- } else if (p_tm == NULL) {
- if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
- return(NULL);
- }
- pthread_setspecific(gmtime_key, p_tm);
- }
- gmtsub(timep, 0L, p_tm);
- return(p_tm);
-#else
gmtsub(timep, 0L, &tm);
return &tm;
-#endif
-}
-
-#ifdef _THREAD_SAFE
-int
-gmtime_r(const time_t * timep, struct tm * tm)
-{
- gmtsub(timep, 0L, tm);
- return(0);
}
-#endif
#ifdef STD_INSPIRED
@@ -1604,16 +1484,8 @@ time_t
mktime(tmp)
struct tm * const tmp;
{
- time_t mktime_return_value;
-#ifdef _THREAD_SAFE
- pthread_mutex_lock(&lcl_mutex);
-#endif
tzset();
- mktime_return_value = time1(tmp, localsub, 0L);
-#ifdef _THREAD_SAFE
- pthread_mutex_unlock(&lcl_mutex);
-#endif
- return(mktime_return_value);
+ return time1(tmp, localsub, 0L);
}
#ifdef STD_INSPIRED
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 653d6ba74c58..b0e82a7d639e 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -483,17 +483,15 @@ __time_load_locale(const char *name)
struct stat st;
size_t namesize;
size_t bufsize;
- int save_using_locale;
- save_using_locale = using_locale;
using_locale = 0;
- if (name == NULL)
- goto no_locale;
-
- if (!*name || !strcmp(name, "C") || !strcmp(name, "POSIX"))
+ if (!strcmp(name, "C") || !strcmp(name, "POSIX"))
return 0;
+ if (name == NULL || *name == '\0') {
+ goto no_locale;
+ }
/*
** If the locale name is the same as our cache, use the cache.
*/
@@ -516,8 +514,9 @@ __time_load_locale(const char *name)
"%s/%s/%s",
_PathLocale, name, lc_time);
fd = open(filename, O_RDONLY);
- if (fd < 0)
+ if (fd < 0) {
goto no_locale;
+ }
if (fstat(fd, &st) != 0)
goto bad_locale;
if (st.st_size <= 0)
@@ -544,7 +543,7 @@ __time_load_locale(const char *name)
ap < (const char **) (&localebuf + 1);
++ap) {
if (p == plim)
- goto reset_locale;
+ goto bad_lbuf;
*ap = p;
while (*p != '\n')
++p;
@@ -558,19 +557,16 @@ __time_load_locale(const char *name)
using_locale = 1;
return 0;
-reset_locale:
+bad_lbuf:
+ free(lbuf);
+bad_locale:
+ (void) close(fd);
+no_locale:
/*
* XXX - This may not be the correct thing to do in this case.
* setlocale() assumes that we left the old locale alone.
*/
locale_buf = locale_buf_C;
localebuf = C_time_locale;
- save_using_locale = 0;
-bad_lbuf:
- free(lbuf);
-bad_locale:
- (void) close(fd);
-no_locale:
- using_locale = save_using_locale;
return -1;
}
diff --git a/lib/libc/stdtime/tzfile.5 b/lib/libc/stdtime/tzfile.5
index f894390cc1cd..4bff7de04d12 100644
--- a/lib/libc/stdtime/tzfile.5
+++ b/lib/libc/stdtime/tzfile.5
@@ -3,7 +3,7 @@
.Os FreeBSD 2.0
.Sh NAME
.Nm tzfile
-.Nd timezone information
+.Nd time zone information
.Sh SYNOPSIS
.Fd #include <tzfile.h>
.Sh DESCRIPTION
@@ -40,7 +40,7 @@ four-byte values of type
sorted in ascending order.
These values are written in ``standard'' byte order.
Each is used as a transition time (as returned by
-.Xr time 3 )
+.Xr time 2 )
at which the rules for computing local time change.
Next come
.Li tzh_timecnt
@@ -89,7 +89,7 @@ Then there are
pairs of four-byte values, written in standard byte order;
the first value of each pair gives the time
(as returned by
-.Xr time 3 )
+.Xr time 2 )
at which a leap second occurs;
the second gives the
.Em total
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index c88832cf5be2..336476aa7938 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -1,5 +1,4 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
-# $Id$
.PATH: ${.CURDIR}/${MACHINE}/string ${.CURDIR}/string
@@ -17,12 +16,12 @@ OBJS+= bzero.o
bzero.o: memset.c
${CC} -DBZERO ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
bzero.po: memset.c
${CC} -DBZERO ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
@${LD} -X -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.endif
# If no machine specific memmove(3), build one out of bcopy(3).
@@ -31,12 +30,12 @@ OBJS+= memmove.o
memmove.o: bcopy.c
${CC} -DMEMMOVE ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
memmove.po: bcopy.c
${CC} -DMEMMOVE ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
@${LD} -X -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.endif
# If no machine specific memcpy(3), build one out of bcopy(3).
@@ -45,12 +44,12 @@ OBJS+= memcpy.o
memcpy.o: bcopy.c
${CC} -DMEMCOPY ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
memcpy.po: bcopy.c
${CC} -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
@${LD} -X -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.endif
# If no machine specific strchr(3), build one out of index(3).
@@ -59,12 +58,12 @@ OBJS+= strchr.o
strchr.o: index.c
${CC} -DSTRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
strchr.po: index.c
${CC} -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
@${LD} -X -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.endif
# If no machine specific strrchr(3), build one out of rindex(3).
@@ -73,12 +72,12 @@ OBJS+= strrchr.o
strrchr.o: rindex.c
${CC} -DSTRRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
strrchr.po: rindex.c
${CC} -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
@${LD} -X -r ${.TARGET}
- @mv -f a.out ${.TARGET}
+ @mv a.out ${.TARGET}
.endif
#
MAN3+= string/bcmp.3 string/bcopy.3 string/bstring.3 string/bzero.3 \
@@ -95,4 +94,4 @@ MLINKS+=strcasecmp.3 strncasecmp.3
MLINKS+=strcat.3 strncat.3
MLINKS+=strcmp.3 strncmp.3
MLINKS+=strcpy.3 strncpy.3
-MLINKS+=strerror.3 perror.3 strerror.3 sys_errlist.3 strerror.3 sys_nerr.3
+MLINKS+=strerror.3 perror.3
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 431aa04ce782..dc65844af2ca 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,5 +1,4 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
-# $Id$
# sys sources
.PATH: ${.CURDIR}/${MACHINE}/sys ${.CURDIR}/sys
@@ -22,13 +21,11 @@ ASM= accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o chmod.o \
getrlimit.o getrusage.o getsockname.o getsockopt.o gettimeofday.o \
getuid.o ioctl.o kill.o ktrace.o lfs_bmapv.o lfs_markv.o \
lfs_segclean.o lfs_segwait.o link.o listen.o lstat.o \
- madvise.o mincore.o minherit.o mkdir.o mkfifo.o mknod.o mlock.o \
- mount.o \
+ madvise.o mincore.o mkdir.o mkfifo.o mknod.o mlock.o mount.o \
mprotect.o msgsys.o msync.o munlock.o munmap.o nfssvc.o \
ntp_adjtime.o open.o pathconf.o profil.o quotactl.o read.o \
readlink.o readv.o recvfrom.o recvmsg.o rename.o revoke.o rmdir.o \
- rtprio.o select.o semsys.o sendmsg.o sendto.o setegid.o seteuid.o \
- setgid.o \
+ rtprio.o select.o semsys.o sendmsg.o sendto.o setegid.o seteuid.o setgid.o \
setgroups.o setitimer.o setpgid.o setpriority.o \
setregid.o setreuid.o setrlimit.o \
setsid.o setsockopt.o settimeofday.o setuid.o shmsys.o shutdown.o \
@@ -92,13 +89,11 @@ MAN2+= sys/accept.2 sys/access.2 sys/acct.2 sys/adjtime.2 sys/bind.2 \
sys/getrlimit.2 sys/getrusage.2 sys/getsockname.2 sys/getsockopt.2 \
sys/gettimeofday.2 sys/getuid.2 sys/intro.2 sys/ioctl.2 sys/kill.2 \
sys/ktrace.2 sys/link.2 sys/listen.2 sys/lseek.2 sys/mkdir.2 \
- sys/mkfifo.2 sys/mknod.2 sys/madvise.2 sys/mincore.2 sys/minherit.2 \
- sys/mlock.2 \
+ sys/mkfifo.2 sys/mknod.2 sys/madvise.2 sys/mincore.2 sys/mlock.2 \
sys/mmap.2 sys/mount.2 sys/mprotect.2 sys/msync.2 sys/munmap.2 \
- sys/ptrace.2 sys/nfssvc.2 sys/open.2 sys/pathconf.2 sys/pipe.2 \
- sys/profil.2 sys/quotactl.2 sys/read.2 sys/readlink.2 sys/reboot.2 \
- sys/recv.2 sys/rename.2 sys/revoke.2 sys/rmdir.2 \
- sys/rtprio.2 sys/select.2 \
+ sys/nfssvc.2 sys/open.2 sys/pathconf.2 sys/pipe.2 sys/profil.2 \
+ sys/quotactl.2 sys/read.2 sys/readlink.2 sys/reboot.2 sys/recv.2 \
+ sys/rename.2 sys/revoke.2 sys/rmdir.2 sys/rtprio.2 sys/select.2 \
sys/semctl.2 sys/semget.2 sys/semop.2 \
sys/send.2 sys/setgroups.2 \
sys/setpgid.2 sys/setregid.2 sys/setreuid.2 \
@@ -110,6 +105,8 @@ MAN2+= sys/accept.2 sys/access.2 sys/acct.2 sys/adjtime.2 sys/bind.2 \
sys/sync.2 sys/syscall.2 sys/truncate.2 sys/umask.2 sys/unlink.2 \
sys/utimes.2 sys/vfork.2 sys/wait.2 sys/write.2
+# missing: ptrace.2
+
MLINKS+=brk.2 sbrk.2
MLINKS+=dup.2 dup2.2
MLINKS+=chdir.2 fchdir.2
diff --git a/lib/libc/sys/_exit.2 b/lib/libc/sys/_exit.2
index 12a5f7e0967d..73e60627453a 100644
--- a/lib/libc/sys/_exit.2
+++ b/lib/libc/sys/_exit.2
@@ -53,7 +53,7 @@ This may entail delays, for example, waiting for output to drain;
a process in this state may not be killed, as it is already dying.
.It
If the parent process of the calling process has an outstanding
-.Xr wait 2
+.Xr wait
call
or catches the
.Dv SIGCHLD
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index 126000a2ecb6..d475e3685b43 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -129,31 +129,6 @@ by issuing a
call with providing only the control information,
or by calling
.Xr setsockopt 2 .
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn accept
-is implemented as the
-.Va accept
-syscall.
-.Pp
-In the threaded library, the
-.Va accept
-syscall is assembled to
-.Fn _thread_sys_accept
-and
-.Fn accept
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_accept .
-If the call to
-.Fn _thread_sys_accept
-would block, a context switch is performed. Before returning,
-.Fn accept
-unlocks
-.Va s .
-.Pp
.Sh RETURN VALUES
The call returns \-1 on error. If it succeeds, it returns a non-negative
integer that is a descriptor for the accepted socket.
diff --git a/lib/libc/sys/bind.2 b/lib/libc/sys/bind.2
index f98631d7939b..18512e29e5c9 100644
--- a/lib/libc/sys/bind.2
+++ b/lib/libc/sys/bind.2
@@ -62,28 +62,6 @@ needed (using
.Pp
The rules used in name binding vary between communication domains.
Consult the manual entries in section 4 for detailed information.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn bind
-is implemented as the
-.Va bind
-syscall.
-.Pp
-In the threaded library, the
-.Va bind
-syscall is assembled to
-.Fn _thread_sys_bind
-and
-.Fn bind
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_bind .
-Before returning,
-.Fn bind
-unlocks
-.Va s .
.Sh RETURN VALUES
If the bind is successful, a 0 value is returned.
A return value of -1 indicates an error, which is
diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2
index 0e34e4f7daa9..7580f3855dbf 100644
--- a/lib/libc/sys/brk.2
+++ b/lib/libc/sys/brk.2
@@ -94,7 +94,7 @@ it will not be possible to set the break
beyond the
.Em rlim_max
value returned from a call to
-.Xr getrlimit 2 ,
+.Xr getrlimit ,
e.g.
.Dq qetext + rlp\(->rlim_max.
(see
@@ -109,12 +109,12 @@ otherwise -1 with
set to indicate why the allocation failed.
The
.Nm sbrk
-function returns a pointer to the base of the new storage if successful;
+returns a pointer to the base of the new storage if successful;
otherwise -1 with
.Va errno
set to indicate why the allocation failed.
.Sh ERRORS
-.Fn Sbrk
+.Xr Sbrk
will fail and no additional memory will be allocated if
one of the following are true:
.Bl -tag -width [ENOMEM]
@@ -139,7 +139,7 @@ Setting the break may fail due to a temporary lack of
swap space. It is not possible to distinguish this
from a failure caused by exceeding the maximum size of
the data segment without consulting
-.Xr getrlimit 2 .
+.Xr getrlimit .
.Sh HISTORY
A
.Nm
diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2
index 89656f3b2dca..11c3956898e8 100644
--- a/lib/libc/sys/chown.2
+++ b/lib/libc/sys/chown.2
@@ -66,8 +66,7 @@ capability is restricted to the super-user.
clears the set-user-id and set-group-id bits
on the file
to prevent accidental or mischievous creation of
-set-user-id and set-group-id programs if not executed
-by the super-user.
+set-user-id and set-group-id programs.
.Pp
.Fn Fchown
is particularly useful when used in conjunction
diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2
index 3a64dac01887..885ac807b693 100644
--- a/lib/libc/sys/close.2
+++ b/lib/libc/sys/close.2
@@ -78,7 +78,7 @@ of the descriptors can be rearranged with
or deleted with
.Fn close
before the
-.Xr execve 2
+.Xr execve
is attempted, but if some of these descriptors will still
be needed if the execve fails, it is necessary to arrange for them
to be closed if the execve succeeds.
@@ -90,28 +90,6 @@ execve; the call
.Dq Li fcntl(d, F_SETFD, 0)
restores the default,
which is to not close the descriptor.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn close
-is implemented as the
-.Va close
-syscall.
-.Pp
-In the threaded library, the
-.Va close
-syscall is assembled to
-.Fn _thread_sys_close
-and
-.Fn close
-is implemented as a function which locks
-.Va d
-for read and write, then calls
-.Fn _thread_sys_close .
-Before returning,
-.Fn close
-unlocks
-.Va d .
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and the global integer variable
diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2
index a6d7c7133165..eb38ab320b4b 100644
--- a/lib/libc/sys/connect.2
+++ b/lib/libc/sys/connect.2
@@ -68,30 +68,6 @@ only once; datagram sockets may use
multiple times to change their association.
Datagram sockets may dissolve the association
by connecting to an invalid address, such as a null address.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn connect
-is implemented as the
-.Va connect
-syscall.
-.Pp
-In the threaded library, the
-.Va connect
-syscall is assembled to
-.Fn _thread_sys_connect
-and
-.Fn connect
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_connect .
-If the call to
-.Fn _thread_sys_connect
-would block, a context switch is performed. Before returning,
-.Fn connect
-unlocks
-.Va s .
.Sh RETURN VALUES
If the connection or binding succeeds, 0 is returned.
Otherwise a -1 is returned, and a more specific error
@@ -103,10 +79,10 @@ The
call fails if:
.Bl -tag -width EADDRNOTAVAILABB
.It Bq Er EBADF
-.Fa s
+.Fa S
is not a valid descriptor.
.It Bq Er ENOTSOCK
-.Fa s
+.Fa S
is a descriptor for a file, not a socket.
.It Bq Er EADDRNOTAVAIL
The specified address is not available on this machine.
diff --git a/lib/libc/sys/dup.2 b/lib/libc/sys/dup.2
index 29d1ada27b77..898963923e8c 100644
--- a/lib/libc/sys/dup.2
+++ b/lib/libc/sys/dup.2
@@ -95,53 +95,6 @@ is specified. If this descriptor is already
in use, the descriptor is first deallocated as if a
.Xr close 2
call had been done first.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn dup
-is implemented as the
-.Va dup
-syscall.
-.Pp
-In the threaded library, the
-.Va dup
-syscall is assembled to
-.Fn _thread_sys_dup
-and
-.Fn dup
-is implemented as a function which locks
-.Va oldd
-for read and write, then calls
-.Fn _thread_sys_dup .
-Before returning,
-.Fn dup
-unlocks
-.Va oldd .
-.Pp
-In the non-threaded library
-.Fn dup2
-is implemented as the
-.Va dup2
-syscall.
-.Pp
-In the threaded library, the
-.Va dup2
-syscall is assembled to
-.Fn _thread_sys_dup2
-and
-.Fn dup2
-is implemented as a function which locks both
-.Va oldd
-and
-.Va newd
-for read and write, then calls
-.Fn _thread_sys_dup2 .
-Before returning,
-.Fn dup2
-unlocks
-.Va oldd .
-and
-.Va newd .
.Sh RETURN VALUES
The value -1 is returned if an error occurs in either call.
The external variable
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2
index 4db261896152..ba47e6d1833c 100644
--- a/lib/libc/sys/execve.2
+++ b/lib/libc/sys/execve.2
@@ -178,23 +178,6 @@ and
.Fa argv
points to the array of character pointers
to the arguments themselves.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn execve
-is implemented as the
-.Va execve
-syscall.
-.Pp
-In the threaded library, the
-.Va execve
-syscall is assembled to
-.Fn _thread_sys_execve
-and
-.Fn execve
-is implemented as a function which performs user-thread
-library re-initialization and then calls
-.Fn _thread_sys_execve .
.Sh RETURN VALUES
As the
.Fn execve
@@ -244,7 +227,7 @@ is larger than the system-imposed limit.
The limit in the system as released is 20480 bytes
.Pf ( Dv NCARGS
in
-.Ao Pa sys/param.h Ac ) .
+.Ao Pa sys/param.h Ac .
.It Bq Er EFAULT
The new process file is not as long as indicated by
the size values in its header.
@@ -267,10 +250,9 @@ the real
is ``root'', then the program has some of the powers
of a super-user as well.
.Sh SEE ALSO
-.Xr _exit 2 ,
+.Xr exit 2 ,
.Xr fork 2 ,
.Xr execl 3 ,
-.Xr exit 3 ,
.Xr environ 7
.Sh HISTORY
The
diff --git a/lib/libc/sys/flock.2 b/lib/libc/sys/flock.2
index 5ec080c5f5d1..bb6abb75fc5b 100644
--- a/lib/libc/sys/flock.2
+++ b/lib/libc/sys/flock.2
@@ -109,28 +109,6 @@ forks and the child explicitly unlocks the file, the parent will
lose its lock.
.Pp
Processes blocked awaiting a lock may be awakened by signals.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn flock
-is implemented as the
-.Va flock
-syscall.
-.Pp
-In the threaded library, the
-.Va flock
-syscall is assembled to
-.Fn _thread_sys_flock
-and
-.Fn flock
-is implemented as a function which locks
-.Va fd
-for read and write, then calls
-.Fn _thread_sys_flock .
-Before returning,
-.Fn flock
-unlocks
-.Va fd .
.Sh RETURN VALUES
Zero is returned if the operation was successful;
on an error a -1 is returned and an error code is left in
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2
index b8d465a0892d..0c290f69bd1c 100644
--- a/lib/libc/sys/fork.2
+++ b/lib/libc/sys/fork.2
@@ -59,9 +59,9 @@ for instance, file pointers in file objects are shared between
the child and the parent, so that an
.Xr lseek 2
on a descriptor in the child process can affect a subsequent
-.Xr read 2
+.Xr read
or
-.Xr write 2
+.Xr write
by the parent.
This descriptor copying is also used by the shell to
establish standard input and output for newly created processes
diff --git a/lib/libc/sys/fsync.2 b/lib/libc/sys/fsync.2
index 313b4c7a7116..234ea6e996ed 100644
--- a/lib/libc/sys/fsync.2
+++ b/lib/libc/sys/fsync.2
@@ -53,28 +53,6 @@ of buffers for the associated file to be written to a disk.
should be used by programs that require a file to be
in a known state, for example, in building a simple transaction
facility.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn fsync
-is implemented as the
-.Va fsync
-syscall.
-.Pp
-In the threaded library, the
-.Va fsync
-syscall is assembled to
-.Fn _thread_sys_fsync
-and
-.Fn fsync
-is implemented as a function which locks
-.Va fd
-for read and write, then calls
-.Fn _thread_sys_fsync .
-Before returning,
-.Fn fsync
-unlocks
-.Va fd .
.Sh RETURN VALUES
A 0 value is returned on success. A -1 value indicates
an error.
@@ -94,8 +72,8 @@ An I/O error occurred while reading from or writing to the file system.
.El
.Sh SEE ALSO
.Xr sync 2 ,
-.Xr update 4 ,
-.Xr sync 8
+.Xr sync 8 ,
+.Xr update 8
.Sh HISTORY
The
.Nm
diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c
index 72a6a9158153..2f3ae6d5a024 100644
--- a/lib/libc/sys/ftruncate.c
+++ b/lib/libc/sys/ftruncate.c
@@ -37,11 +37,6 @@ static char sccsid[] = "@(#)ftruncate.c 8.1 (Berkeley) 6/17/93";
#include <sys/types.h>
#include <sys/syscall.h>
-#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* This function provides 64-bit offset padding that
@@ -53,16 +48,5 @@ ftruncate(fd, length)
off_t length;
{
-#ifdef _THREAD_SAFE
- int retval;
- if (_thread_fd_lock(fd, FD_RDWR, NULL,__FILE__,__LINE__) != 0) {
- retval = -1;
- } else {
- retval = __syscall((quad_t)SYS_ftruncate, fd, 0, length);
- _thread_fd_unlock(fd, FD_RDWR);
- }
- return(retval);
-#else
return(__syscall((quad_t)SYS_ftruncate, fd, 0, length));
-#endif
}
diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2
index b0ecd92287c7..6df944420db6 100644
--- a/lib/libc/sys/getdirentries.2
+++ b/lib/libc/sys/getdirentries.2
@@ -120,28 +120,6 @@ The current position pointer should only be set to a value returned by
a value returned in the location pointed to by
.Fa basep ,
or zero.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn getdirentries
-is implemented as the
-.Va getdirentries
-syscall.
-.Pp
-In the threaded library, the
-.Va getdirentries
-syscall is assembled to
-.Fn _thread_sys_getdirentries
-and
-.Fn getdirentries
-is implemented as a function which locks
-.Va fd
-for read and write, then calls
-.Fn _thread_sys_getdirentries .
-Before returning,
-.Fn getdirentries
-unlocks
-.Va fd .
.Sh RETURN VALUES
If successful, the number of bytes actually transferred is returned.
Otherwise, -1 is returned and the global variable
@@ -151,16 +129,16 @@ is set to indicate the error.
.Fn Getdirentries
will fail if:
.Bl -tag -width [EFAULT]
-.It Bq Er EBADF
+.It EBADF
.Fa fd
is not a valid file descriptor open for reading.
-.It Bq Er EFAULT
+.It EFAULT
Either
.Fa buf
or
.Fa basep
point outside the allocated address space.
-.It Bq Er EIO
+.It EIO
An
.Tn I/O
error occurred while reading from or writing to the file system.
diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2
index e881066096b4..ab73d5a4b558 100644
--- a/lib/libc/sys/getfh.2
+++ b/lib/libc/sys/getfh.2
@@ -38,7 +38,7 @@
.Nm getfh
.Nd get file handle
.Sh SYNOPSIS
-.Fd #include <sys/param.h>
+.Fd #include <sys/types.h>
.Fd #include <sys/mount.h>
.Ft int
.Fn getfh "char *path" "fhandle_t *fhp"
diff --git a/lib/libc/sys/getgid.2 b/lib/libc/sys/getgid.2
index 574c15a11eb2..52519d767c68 100644
--- a/lib/libc/sys/getgid.2
+++ b/lib/libc/sys/getgid.2
@@ -70,7 +70,7 @@ indicate an error.
.Sh SEE ALSO
.Xr getuid 2 ,
.Xr setregid 2 ,
-.Xr setgid 2
+.Xr setgid 3
.Sh STANDARDS
.Fn Getgid
and
diff --git a/lib/libc/sys/getlogin.2 b/lib/libc/sys/getlogin.2
index b0c6f1bb1483..5b351ca0fed2 100644
--- a/lib/libc/sys/getlogin.2
+++ b/lib/libc/sys/getlogin.2
@@ -66,50 +66,6 @@ This call is restricted to the super-user, and
is normally used only when a new session is being created on behalf
of the named user
(for example, at login time, or when a remote shell is invoked).
-.Pp
-.Em NOTE:
-There is only one `login name' per `session .
-.Pp
-It is
-.Em CRITICALLY
-important to ensure that
-.Fn setlogin
-is only ever called after the process has taken adequate steps to ensure
-that it is detached from it's parent's session.
-Making a
-.Fn setsid
-system call is the
-.Em ONLY
-way to do this. The
-.Fn daemon
-library call calls
-.Fn setsid
-which is an ideal way of detaching from a controlling terminal and
-forking into the background.
-.Pp
-In particular, doing a
-.Fn "ioctl" "ttyfd" "TIOCNOTTY" "..."
-or
-.Fn "setpgrp" "..."
-is
-.Em NOT
-sufficient.
-.Pp
-Once a parent process does a
-.Fn setsid
-call, it is acceptable for some child of that process to then do a
-.Fn setlogin
-even though it is not the session leader, but beware that ALL processes
-in the session will change their login name at the same time, even the
-parent.
-.Pp
-This is not the same as the traditional UNIX behavior of inheriting privilege.
-.Pp
-Since the
-.Fn setlogin
-system call is restricted to the super-user, it is assumed that (like
-all other privileged programs) the programmer has taken adequate
-precautions to prevent security violations.
.Sh RETURN VALUES
If a call to
.Fn getlogin
@@ -145,8 +101,7 @@ characters, currently 12.
The caller tried to set the login name and was not the super-user.
.El
.Sh SEE ALSO
-.Xr setsid 2 ,
-.Xr daemon 3
+.Xr setsid 2
.Sh BUGS
Login names are limited in length by
.Fn setlogin .
diff --git a/lib/libc/sys/getpeername.2 b/lib/libc/sys/getpeername.2
index 5ca0a443c326..d89488c3aaf9 100644
--- a/lib/libc/sys/getpeername.2
+++ b/lib/libc/sys/getpeername.2
@@ -53,28 +53,6 @@ the amount of space pointed to by
On return it contains the actual size of the name
returned (in bytes).
The name is truncated if the buffer provided is too small.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn getpeername
-is implemented as the
-.Va getpeername
-syscall.
-.Pp
-In the threaded library, the
-.Va getpeername
-syscall is assembled to
-.Fn _thread_sys_getpeername
-and
-.Fn getpeername
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_getpeername .
-Before returning,
-.Fn getpeername
-unlocks
-.Va s .
.Sh DIAGNOSTICS
A 0 is returned if the call succeeds, -1 if it fails.
.Sh ERRORS
diff --git a/lib/libc/sys/getpid.2 b/lib/libc/sys/getpid.2
index 22f9257b5198..5f77706f30f9 100644
--- a/lib/libc/sys/getpid.2
+++ b/lib/libc/sys/getpid.2
@@ -63,7 +63,7 @@ and
functions are always successful, and no return value is reserved to
indicate an error.
.Sh SEE ALSO
-.Xr gethostid 3
+.Xr gethostid 2
.Sh STANDARDS
.Fn Getpid
and
diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2
index 42b9028dada9..9aa3c8edac37 100644
--- a/lib/libc/sys/getrlimit.2
+++ b/lib/libc/sys/getrlimit.2
@@ -60,7 +60,7 @@ parameter is one of the following:
.Bl -tag -width RLIMIT_FSIZEAA
.It Li RLIMIT_CORE
The largest size (in bytes)
-.Xr core 5
+.Xr core
file that may be created.
.It Li RLIMIT_CPU
The maximum amount of cpu time (in seconds) to be used by
@@ -171,11 +171,19 @@ raised the maximum limit value, and the caller is not the super-user.
.El
.Sh SEE ALSO
.Xr csh 1 ,
-.Xr quota 1 ,
-.Xr quotactl 2 ,
+.Xr quota 2 ,
.Xr sigaltstack 2 ,
.Xr sigvec 2 ,
.Xr sysctl 3
+.Sh BUGS
+There should be
+.Ic limit
+and
+.Ic unlimit
+commands in
+.Xr sh 1
+as well as in
+.Xr csh .
.Sh HISTORY
The
.Nm
diff --git a/lib/libc/sys/getsockname.2 b/lib/libc/sys/getsockname.2
index e053b4768e7b..d56e40486646 100644
--- a/lib/libc/sys/getsockname.2
+++ b/lib/libc/sys/getsockname.2
@@ -51,28 +51,6 @@ the amount of space pointed to by
.Fa name .
On return it contains the actual size of the name
returned (in bytes).
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn getsockname
-is implemented as the
-.Va getsockname
-syscall.
-.Pp
-In the threaded library, the
-.Va getsockname
-syscall is assembled to
-.Fn _thread_sys_getsockname
-and
-.Fn getsockname
-is implemented as a function which locks
-.Va fd
-for read and write, then calls
-.Fn _thread_sys_getsockname .
-Before returning,
-.Fn getsockname
-unlocks
-.Va fd .
.Sh DIAGNOSTICS
A 0 is returned if the call succeeds, -1 if it fails.
.Sh ERRORS
diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2
index 5adfdec61c33..46d3d8a53fc9 100644
--- a/lib/libc/sys/getsockopt.2
+++ b/lib/libc/sys/getsockopt.2
@@ -29,10 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94
-.\" $Id$
+.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94
.\"
-.Dd November 3, 1995
+.Dd April 19, 1994
.Dt GETSOCKOPT 2
.Os BSD 4.3r
.Sh NAME
@@ -190,7 +189,7 @@ is performed.
If the socket promises reliable delivery of data and
.Dv SO_LINGER is set,
the system will block the process on the
-.Xr close 2
+.Xr close
attempt until it is able to transmit the data or until it decides it
is unable to deliver the information (a timeout period, termed the
linger interval, is specified in the
@@ -201,7 +200,7 @@ is requested).
If
.Dv SO_LINGER
is disabled and a
-.Xr close 2
+.Xr close
is issued, the system will process the close in a manner that allows
the process to continue as quickly as possible.
.Pp
@@ -215,9 +214,9 @@ With protocols that support out-of-band data, the
option
requests that out-of-band data be placed in the normal data input queue
as received; it will then be accessible with
-.Xr recv 2
+.Xr recv
or
-.Xr read 2
+.Xr read
calls without the
.Dv MSG_OOB
flag.
@@ -229,11 +228,7 @@ are options to adjust the normal
buffer sizes allocated for output and input buffers, respectively.
The buffer size may be increased for high-volume connections,
or may be decreased to limit the possible backlog of incoming data.
-The system places an absolute maximum on these values, which is accessible
-through the
-.Xr sysctl 3
-MIB variable
-.Dq Li kern.maxsockbuf .
+The system places an absolute limit on these values.
.Pp
.Dv SO_SNDLOWAT
is an option to set the minimum count for output operations.
@@ -266,7 +261,7 @@ wait until they have received the smaller of the low water mark value
or the requested amount.
Receive calls may still return less than the low water mark if an error
occurs, a signal is caught, or the type of data next in the receive queue
-is different from that which was returned.
+is different than that returned.
.Pp
.Dv SO_SNDTIMEO
is an option to set a timeout value for output operations.
@@ -313,49 +308,6 @@ returns any pending error on the socket and clears
the error status.
It may be used to check for asynchronous errors on connected
datagram sockets or for other asynchronous errors.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn getsockopt
-is implemented as the
-.Va getsockopt
-syscall.
-.Pp
-In the threaded library, the
-.Va getsockopt
-syscall is assembled to
-.Fn _thread_sys_getsockopt
-and
-.Fn getsockopt
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_getsockopt .
-Before returning,
-.Fn getsockopt
-unlocks
-.Va s .
-.Pp
-In the non-threaded library
-.Fn setsockopt
-is implemented as the
-.Va setsockopt
-syscall.
-.Pp
-In the threaded library, the
-.Va setsockopt
-syscall is assembled to
-.Fn _thread_sys_setsockopt
-and
-.Fn setsockopt
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_setsockopt .
-Before returning,
-.Fn setsockopt
-unlocks
-.Va s .
.Sh RETURN VALUES
A 0 is returned if the call succeeds, -1 if it fails.
.Sh ERRORS
@@ -384,10 +336,8 @@ is not in a valid part of the process address space.
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr socket 2 ,
-.Xr getprotoent 3 ,
-.Xr sysctl 3 ,
-.Xr protocols 5 ,
-.Xr sysctl 8
+.Xr getprotoent 3
+.Xr protocols 5
.Sh BUGS
Several of the socket options should be handled at lower levels of the system.
.Sh HISTORY
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index 79aad8a8a6b6..bf4380917e39 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -47,49 +47,13 @@ their error returns, and other common definitions and concepts.
.\".Pp
.\"<more later...>
.Sh DIAGNOSTICS
-Nearly all of the system calls provide an error number referenced via
-the external identifier errno. This identifier is defined in
-.Aq Pa sys/errno.h
-for non-threaded programs as:
+Nearly all of the system calls provide an error number in the external
+variable
+.Va errno ,
+which is defined as:
.Pp
.Dl extern int errno
.Pp
-and for threaded programs as:
-.Pp
-.Dl extern int * __error();
-.Dl #define errno (* __error())
-.Pp
-A threaded program must be compiled with
-.Va _THREAD_SAFE
-defined so that the preprocessor will output the appropriate errno
-definition to the compiler. Failure to do so will mean that error
-variables will not be thread specific.
-.Pp
-The threaded library implementation of
-.Va __error()
-returns a pointer to a field in the thread specific structure for
-threads other than the initial thread. For the initial thread,
-.Va __error()
-returns a pointer to a global
-.Va errno
-variable that is compatible with that used by non-threaded programs.
-This allows the initial thread to call functions in libraries which have
-not been compiled with
-.Va _THREAD_SAFE .
-Programmers should ensure that threads other than the initial thread only
-call functions in libraries that have been compiled with
-.Va _THREAD_SAFE .
-.Pp
-Programmers should include
-.Aq Pa sys/errno.h to obtain the definition of
-.Va errno
-rather than coding the definition as an external reference directly. It is
-planned that the
-.Va extern int errno
-definition will eventually be replaced by the threaded definition so that
-all libraries will have a thread-aware treatment of
-.Va errno .
-.Pp
When a system call detects an error,
it returns an integer value
indicating failure (usually -1)
@@ -159,9 +123,9 @@ or a read (write) request was made to a file that was only open for
writing (reading).
.It Er 10 ECHILD Em "\&No child processes" .
A
-.Xr wait 2
+.Xr wait
or
-.Xr waitpid 2
+.Xr waitpid
function was executed by a process that had no existing or unwaited-for
child processes.
.It Er 11 EDEADLK Em "Resource deadlock avoided" .
@@ -187,7 +151,7 @@ in a manner which would have conflicted with the request.
.It Er 17 EEXIST Em "File exists" .
An existing file was mentioned in an inappropriate context,
for instance, as the new link name in a
-.Xr link 2
+.Xr link
function.
.It Er 18 EXDEV Em "Improper link" .
A hard link to a file on another file system
@@ -205,9 +169,9 @@ An attempt was made to open a directory with write mode specified.
.It Er 22 EINVAL Em "Invalid argument" .
Some invalid argument was supplied. (For example,
specifying an undefined signal to a
-.Xr signal 3
+.Xr signal
or
-.Xr kill 2
+.Xr kill
function).
.It Er 23 ENFILE Em "Too many open files in system" .
Maximum number of file descriptors allowable on the system
@@ -227,7 +191,7 @@ special device for which the operation was inappropriate.
The new process was a pure procedure (shared text) file
which was open for writing by another process, or
while the pure procedure file was being executed an
-.Xr open 2
+.Xr open
call requested write access.
.It Er 27 EFBIG Em "File too large" .
The size of a file exceeded the maximum (about
@@ -236,7 +200,7 @@ The size of a file exceeded the maximum (about
bytes).
.It Er 28 ENOSPC Em "Device out of space" .
A
-.Xr write 2
+.Xr write
to an ordinary file, the creation of a
directory or symbolic link, or the creation of a directory
entry failed because no more disk blocks were available
@@ -245,7 +209,7 @@ created file failed because no more inodes were available
on the file system.
.It Er 29 ESPIPE Em "Illegal seek" .
An
-.Xr lseek 2
+.Xr lseek
function was issued on a socket, pipe or
.Tn FIFO .
.It Er 30 EROFS Em "Read-only file system" .
@@ -344,12 +308,12 @@ An operation on a socket or pipe was not performed because
the system lacked sufficient buffer space or because a queue was full.
.It Er 56 EISCONN Em "Socket is already connected" .
A
-.Xr connect 2
+.Xr connect
request was made on an already connected socket; or,
a
-.Xr sendto 2
+.Xr sendto
or
-.Xr sendmsg 2
+.Xr sendmsg
request on a connected socket specified a destination
when already connected.
.It Er 57 ENOTCONN Em "Socket is not connected" .
@@ -363,9 +327,9 @@ had already been shut down with a previous
call.
.It Er 60 ETIMEDOUT Em "Operation timed out" .
A
-.Xr connect 2
+.Xr connect
or
-.Xr send 2
+.Xr send
request failed because the connected party did not
properly respond after a period of time. (The timeout
period is dependent on the communication protocol.)
@@ -397,7 +361,7 @@ was supplied to a remove directory or rename call.
The quota system ran out of table entries.
.It Er 69 EDQUOT Em "Disc quota exceeded" .
A
-.Xr write 2
+.Xr write
to an ordinary file, the creation of a
directory or symbolic link, or the creation of a directory
entry failed because the user's quota of disk blocks was
@@ -450,7 +414,7 @@ A new process is created by a currently active process; (see
The parent process ID of a process is initially the process ID of its creator.
If the creating process exits,
the parent process ID of each child is set to the ID of a system process,
-.Xr init 8 .
+.Xr init .
.It Process Group
Each active process is a member of a process group that is identified by
a non-negative integer called the process group ID. This is the process
@@ -497,7 +461,7 @@ as the group,
but is in a different process group.
Note that when a process exits, the parent process for its children
is changed to be
-.Nm init ,
+.Xr init ,
which is in a separate session.
Not all members of an orphaned process group are necessarily orphaned
processes (those whose creating process has exited).
@@ -701,5 +665,4 @@ of a certain format. An Address Family is the set of addresses
for a specific group of protocols. Each socket has an address
chosen from the address family in which the socket was created.
.Sh SEE ALSO
-.Xr intro 3 ,
-.Xr perror 3
+intro(3), perror(3)
diff --git a/lib/libc/sys/ioctl.2 b/lib/libc/sys/ioctl.2
index 38c58b9dcf59..36ce6ff47f65 100644
--- a/lib/libc/sys/ioctl.2
+++ b/lib/libc/sys/ioctl.2
@@ -68,28 +68,6 @@ Macros and defines used in specifying an ioctl
.Fa request
are located in the file
.Ao Pa sys/ioctl.h Ac .
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn ioctl
-is implemented as the
-.Va ioctl
-syscall.
-.Pp
-In the threaded library, the
-.Va ioctl
-syscall is assembled to
-.Fn _thread_sys_ioctl
-and
-.Fn ioctl
-is implemented as a function which locks
-.Va d
-for read and write, then calls
-.Fn _thread_sys_ioctl .
-Before returning,
-.Fn ioctl
-unlocks
-.Va d .
.Sh RETURN VALUES
If an error has occurred, a value of -1 is returned and
.Va errno
diff --git a/lib/libc/sys/ktrace.2 b/lib/libc/sys/ktrace.2
index fd4515fc6082..9fe61f89570f 100644
--- a/lib/libc/sys/ktrace.2
+++ b/lib/libc/sys/ktrace.2
@@ -38,9 +38,7 @@
.Nm ktrace
.Nd process tracing
.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Fd #include <sys/time.h>
-.Fd #include <sys/uio.h>
+.Fd #include <sys/types.h>
.Fd #include <sys/ktrace.h>
.Ft int
.Fn ktrace "const char *tracefile" "int ops" "int trpoints" "int pid"
diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2
index 4c27ab9765ac..d1607862d2c5 100644
--- a/lib/libc/sys/link.2
+++ b/lib/libc/sys/link.2
@@ -74,6 +74,7 @@ both
and
.Fa name2
must be in the same file system.
+Unless the caller is the super-user,
.Fa name1
may not be a directory.
.Sh RETURN VALUES
@@ -112,7 +113,8 @@ does exist.
.It Bq Er EPERM
The file named by
.Fa name1
-is a directory.
+is a directory and the effective
+user ID is not super-user.
.It Bq Er EXDEV
The link named by
.Fa name2
@@ -147,10 +149,3 @@ is outside the process's allocated address space.
is expected to
conform to IEEE Std 1003.1-1988
.Pq Dq Tn POSIX .
-.Sh HISTORY
-.Pp
-The
-.Nm
-system call traditionally allows the super-user to link directories which
-corrupts the filesystem coherency. This implementation no longer permits
-it.
diff --git a/lib/libc/sys/listen.2 b/lib/libc/sys/listen.2
index b3271dd2d62c..0ab28bc2bd59 100644
--- a/lib/libc/sys/listen.2
+++ b/lib/libc/sys/listen.2
@@ -29,10 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93
-.\" $Id$
+.\" @(#)listen.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd November 3, 1995
+.Dd December 11, 1993
.Dt LISTEN 2
.Os BSD 4.2
.Sh NAME
@@ -69,41 +68,6 @@ receive an error with an indication of
.Er ECONNREFUSED ,
or, if the underlying protocol supports retransmission,
the request may be ignored so that retries may succeed.
-.Pp
-The
-.Xr sysctl 3
-MIB variable
-.Dq Li kern.somaxconn
-specifies a hard limit on
-.Fa backlog ;
-if a value greater than
-.Li kern.somaxconn
-or less than zero is specified,
-.Fa backlog
-is silently forced to
-.Li kern.somaxconn .
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn listen
-is implemented as the
-.Va listen
-syscall.
-.Pp
-In the threaded library, the
-.Va listen
-syscall is assembled to
-.Fn _thread_sys_listen
-and
-.Fn listen
-is implemented as a function which locks
-.Va s
-for read and write, then calls
-.Fn _thread_sys_listen .
-Before returning,
-.Fn listen
-unlocks
-.Va s .
.Sh RETURN VALUES
A 0 return value indicates success; -1 indicates an error.
.Sh ERRORS
@@ -125,17 +89,13 @@ The socket is not of a type that supports the operation
.Sh SEE ALSO
.Xr accept 2 ,
.Xr connect 2 ,
-.Xr socket 2 ,
-.Xr sysctl 3 ,
-.Xr sysctl 8
+.Xr socket 2
+.Sh BUGS
+The
+.Fa backlog
+is currently limited (silently) to 32.
.Sh HISTORY
The
.Nm
function call appeared in
.Bx 4.2 .
-The ability to configure the maximum
-.Fa backlog
-at run-time, and to use a negative
-.Fa backlog
-to request the maximum allowable value, was introduced in
-.Fx 2.2 .
diff --git a/lib/libc/sys/lseek.c b/lib/libc/sys/lseek.c
index 8896ad8d3567..52208d137a93 100644
--- a/lib/libc/sys/lseek.c
+++ b/lib/libc/sys/lseek.c
@@ -37,11 +37,6 @@ static char sccsid[] = "@(#)lseek.c 8.1 (Berkeley) 6/17/93";
#include <sys/types.h>
#include <sys/syscall.h>
-#include <unistd.h>
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
/*
* This function provides 64-bit offset padding that
@@ -53,17 +48,7 @@ lseek(fd, offset, whence)
off_t offset;
int whence;
{
-#ifdef _THREAD_SAFE
- off_t offs;
- if (_thread_fd_lock(fd, FD_RDWR, NULL,__FILE__,__LINE__) != 0) {
- offs = -1;
- } else {
- offs = __syscall((quad_t) SYS_lseek,fd, 0, offset, whence);
- _thread_fd_unlock(fd, FD_RDWR);
- }
- return(offs);
+ extern off_t __syscall();
-#else
return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
-#endif
}
diff --git a/lib/libc/sys/madvise.2 b/lib/libc/sys/madvise.2
index 4326389b1eb1..d0676ab18fce 100644
--- a/lib/libc/sys/madvise.2
+++ b/lib/libc/sys/madvise.2
@@ -38,9 +38,7 @@
.Nm madvise
.Nd give advise about use of memory
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/mman.h>
-.Fn madvise "caddr_t addr" "size_t len" "int behav"
+.Fn madvise "caddr_t addr" "int len" "int behav"
.Sh DESCRIPTION
The
.Fn madvise
@@ -61,12 +59,7 @@ The known behaviors are given in
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr mprotect 2 ,
-.Xr mincore 2 .
-
-.Sh BUGS
-.Nm madvise
-is not yet implemented.
-
+.Xr mincore 2
.Sh HISTORY
The
.Nm madvise
diff --git a/lib/libc/sys/mincore.2 b/lib/libc/sys/mincore.2
index a51fcc9fc464..4e73c2ab90f8 100644
--- a/lib/libc/sys/mincore.2
+++ b/lib/libc/sys/mincore.2
@@ -38,9 +38,7 @@
.Nm mincore
.Nd get advise about use of memory
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/mman.h>
-.Fn mincore "caddr_t addr" "size_t len" "char *vec"
+.Fn mincore "caddr_t addr" "int len" "char *vec"
.Sh DESCRIPTION
The
.Fn mincore
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index 2b87189dc723..1c0d84a85d0c 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -124,7 +124,7 @@ Notify the kernel that the region may contain semaphores and that special
handling may be necessary.
.It Dv MAP_INHERIT
Permit regions to be inherited across
-.Xr execve 2
+.Xr exec 2
system calls.
.It Dv MAP_PRIVATE
Modifications are private.
@@ -202,27 +202,9 @@ parameter wasn't available.
.Dv MAP_ANON
was specified and insufficient memory was available.
.Sh "SEE ALSO"
+.Xr getpagesize 2 ,
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr mprotect 2 ,
.Xr madvise 2 ,
-.Xr mincore 2 ,
-.Xr mlock 2 ,
-.Xr munlock 2 ,
-.Xr getpagesize 3
-
-.Sh BUGS
-.Ar len
-is limit to 2GB. Mmapping slightly more than 2GB doesn't work, but
-mapping a window of size (filesize % 2GB) for file sizes of slightly
-less than 2G, 4GB, 6GB and 8GB.
-
-The limit is imposed for a variety of reasons. Most of them have to do
-with FreeBSD not wanting to use 64 bit offsets in the VM system due to
-the extreme performance penalty. So FreeBSD use 32bit page indexes and
-this gives FreeBSD a maximum of 8TB filesizes. It's actually bugs in
-the filesystem code that causes the limit to be further restricted to
-1TB (loss of precision when doing blockno calculations).
-
-Another reason for the 2GB limit is that filesystem metadata can
-reside at negative offsets.
+.Xr mincore 2
diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2
index 4ddd65d5e8ac..bb2b9ad21e44 100644
--- a/lib/libc/sys/mprotect.2
+++ b/lib/libc/sys/mprotect.2
@@ -38,9 +38,7 @@
.Nm mprotect
.Nd control the protection of pages
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/mman.h>
-.Fn mprotect "caddr_t addr" "size_t len" "int prot"
+.Fn mprotect "caddr_t addr" "int len" "int prot"
.Sh DESCRIPTION
The
.Fn mprotect
diff --git a/lib/libc/sys/msync.2 b/lib/libc/sys/msync.2
index 409dd08b35a2..d976e304599e 100644
--- a/lib/libc/sys/msync.2
+++ b/lib/libc/sys/msync.2
@@ -38,9 +38,7 @@
.Nm msync
.Nd synchronize a mapped region
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/mman.h>
-.Fn msync "caddr_t addr" "size_t len" "int flags"
+.Fn msync "caddr_t addr" "int len" "int flags"
.Sh DESCRIPTION
The
.Fn msync
diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2
index 5d14016e887d..b9e8a1b0841c 100644
--- a/lib/libc/sys/munmap.2
+++ b/lib/libc/sys/munmap.2
@@ -38,8 +38,6 @@
.Nm munmap
.Nd remove a mapping
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/mman.h>
.Fn munmap "caddr_t addr" "size_t len"
.Sh DESCRIPTION
The
@@ -68,12 +66,12 @@ parameter was negative, or
some part of the region being unmapped is not part of the currently
valid address space.
.Sh "SEE ALSO"
+.Xr getpagesize 2 ,
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr mprotect 2 ,
.Xr madvise 2 ,
-.Xr mincore 2 ,
-.Xr getpagesize 3
+.Xr mincore 2
.Sh HISTORY
The
.Fn munmap
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index bb7526250cb4..dea59fcce346 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -136,7 +136,7 @@ When a new file is created it is given the group of the directory
which contains it.
.Pp
The new descriptor is set to remain open across
-.Xr execve 2
+.Xr execve
system calls; see
.Xr close 2
and
@@ -146,26 +146,6 @@ The system imposes a limit on the number of file descriptors
open simultaneously by one process.
.Xr Getdtablesize 2
returns the current system limit.
-.Pp
-.Sh IMPLEMENTATION NOTES
-In the non-threaded library
-.Fn open
-is implemented as the
-.Va open
-syscall.
-.Pp
-In the threaded library, the
-.Va open
-syscall is assembled to
-.Fn _thread_sys_open
-and
-.Fn open
-is implemented as a function which disables thread rescheduling
-and calls
-.Fn _thread_sys_open .
-Before returning,
-.Fn open
-enables thread rescheduling.
.Sh ERRORS
The named file is opened unless:
.Bl -tag -width Er
diff --git a/lib/libc/sys/pipe.2 b/lib/libc/sys/pipe.2
index 763cc2fc7dfa..51b7364bf86c 100644
--- a/lib/libc/sys/pipe.2
+++ b/lib/libc/sys/pipe.2
@@ -48,13 +48,12 @@ function
creates a
.Em pipe ,
which is an object allowing
-bidirectional data flow,
+unidirectional data flow,
and allocates a pair of file descriptors.
-.Pp
-By convention, the first descriptor is normally used as the
+The first descriptor connects to the
.Em read end
of the pipe,
-and the second is normally the
+and the second connects to the
.Em write end ,
so that data written to
.Fa fildes[1]
@@ -70,7 +69,7 @@ the read end of the pipe.
The pipe itself persists until all its associated descriptors are
closed.
.Pp
-A pipe that has had an end closed is considered
+A pipe whose read or write end has been closed is considered
.Em widowed .
Writing on such a pipe causes the writing process to receive
a
@@ -80,10 +79,9 @@ Widowing a pipe is the only way to deliver end-of-file to a reader:
after the reader consumes any buffered data, reading a widowed pipe
returns a zero count.
.Pp
-The bidirectional nature of this implementation of pipes is not
-portable to older systems, so it is recommended to use the convention
-for using the endpoints in the traditional manner when using a
-pipe in one direction.
+Pipes are really a special case of the
+.Xr socketpair 2
+call and, in fact, are implemented as such in the system.
.Sh RETURN VALUES
On successful creation of the pipe, zero is returned. Otherwise,
a value of -1 is returned and the variable
@@ -115,5 +113,3 @@ space.
A
.Nm
function call appeared in Version 6 AT&T UNIX.
-.Pp
-Bidirectional pipes were first used on Unix System V release 4.
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index dc66d1d77d44..f9cf5d106206 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -75,7 +75,7 @@ and data, which is why there are two requests: conceptually,
.Dv PT_READ_I
reads from the instruction space and
.Dv PT_READ_D
-reads from the data space. In the current FreeBSD implementation, these
+reads from the data space. In the current NetBSD implementation, these
two requests are completely identical. The
.Fa addr
argument specifies the address (in the traced process' virtual address
@@ -145,61 +145,6 @@ The traced process terminates, as if
had been used with
.Dv SIGKILL
given as the signal to be delivered.
-.It Dv PT_ATTACH
-This request allows a process to gain control of an otherwise unrelated
-process and begin tracing it. It does not need any cooperation from
-the to-be-traced process. In this case,
-.Fa pid
-specifies the process ID of the to-be-traced process, and the other two
-arguments are ignored. This request requires that the target process
-must have the same real UID as the tracing process, and that it must
-not be executing a setuid or setgid executable. (If the tracing
-process is running as root, these restrictions do not apply.) The
-tracing process will see the newly-traced process stop and may then
-control it as if it had been traced all along.
-.It Dv PT_DETACH
-This request is like PT_CONTINUE, except that it does not allow
-specifying an alternate place to continue execution, and after it
-succeeds, the traced process is no longer traced and continues
-execution normally.
-.El
-.Pp
-Additionally, machine-specific requests can exist. On the i386, these
-are:
-.Bl -tag -width 12n
-.It Dv PT_GETREGS
-This request reads the traced process' machine registers into the
-.Dq Li "struct reg"
-(defined in
-.Aq Pa machine/reg.h )
-pointed to by
-.Fa addr .
-.It Dv PT_SETREGS
-This request is the converse of
-.Dv PT_GETREGS ;
-it loads the traced process' machine registers from the
-.Dq Li "struct reg"
-(defined in
-.Aq Pa machine/reg.h )
-pointed to by
-.Fa addr .
-.It Dv PT_GETFPREGS
-This request reads the traced process' floating-point registers into
-the
-.Dq Li "struct fpreg"
-(defined in
-.Aq Pa machine/reg.h )
-pointed to by
-.Fa addr .
-.It Dv PT_SETFPREGS
-This request is the converse of
-.Dv PT_GETFPREGS ;
-it loads the traced process' floating-point registers from the
-.Dq Li "struct fpreg"
-(defined in
-.Aq Pa machine/reg.h )
-pointed to by
-.Fa addr .
.El
.Sh ERRORS
Some requests can cause
@@ -219,10 +164,6 @@ No process having the specified process ID exists.
.It Bq Er EINVAL
.Bl -bullet -compact
.It
-A process attempted to use
-.Dv PT_ATTACH
-on itself.
-.It
The
.Fa request
was not one of the legal requests.
@@ -241,40 +182,12 @@ The signal number (in
to
.Dv PT_CONTINUE
was neither 0 nor a legal signal number.
-.It
-.Dv PT_GETREGS ,
-.Dv PT_SETREGS ,
-.Dv PT_GETFPREGS ,
-or
-.Dv PT_SETFPREGS
-was attempted on a process with no valid register set. (This is
-normally true only of system processes.)
-.El
-.It Bq Er EBUSY
-.Bl -bullet -compact
-.It
-.Dv PT_ATTACH
-was attempted on a process that was already being traced.
-.It
-A request attempted to manipulate a process that was being traced by
-some process other than the one making the request.
-.It
-A request (other than
-.Dv PT_ATTACH )
-specified a process that wasn't stopped.
.El
.It Bq Er EPERM
.Bl -bullet -compact
.It
-A request (other than
-.Dv PT_ATTACH )
+A request
attempted to manipulate a process that wasn't being traced at all.
-.It
-An attempt was made to use
-.Dv PT_ATTACH
-on a process in violation of the requirements listed under
-.Dv PT_ATTACH
-above.
.El
.Sh SEE ALSO
.Xr sigaction 2
diff --git a/lib/libc/sys/quotactl.2 b/lib/libc/sys/quotactl.2
index f40a0dee2d0b..047d070d2be3 100644
--- a/lib/libc/sys/quotactl.2
+++ b/lib/libc/sys/quotactl.2
@@ -41,7 +41,7 @@
.Nm quotactl
.Nd manipulate filesystem quotas
.Sh SYNOPSIS
-.Fd #include <ufs/ufs/quota.h> /* for ufs quotas */
+.Ft #include <ufs/ufs/quota.h> /* for ufs quotas */
.Ft int
.Fn quotactl "const char *path" "int cmd" "int id" "char *addr"
.Sh DESCRIPTION
diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2
index ea428fd47a12..b94341a043c0 100644
--- a/lib/libc/sys/read.2
+++ b/lib/libc/sys/read.2
@@ -107,53 +107,6 @@ The system guarantees to read the number of bytes requested if
the descriptor references a normal file that has that many bytes left
before the end-of-file, but in no other case.
.Pp
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn read
-is implemented as the
-.Va read
-syscall.
-.Pp
-In the threaded library, the
-.Va read
-syscall is assembled to
-.Fn _thread_sys_read
-and
-.Fn read
-is implemented as a function which locks
-.Va d
-for read, then calls
-.Fn _thread_sys_read .
-If the call to
-.Fn _thread_sys_read
-would block, a context switch is performed. Before returning,
-.Fn read
-unlocks
-.Va d .
-.Pp
-In the non-threaded library
-.Fn readv
-is implemented as the
-.Va readv
-syscall.
-.Pp
-In the threaded library, the
-.Va readv
-syscall is assembled to
-.Fn _thread_sys_readv
-and
-.Fn readv
-is implemented as a function which locks
-.Va d
-for read, then calls
-.Fn _thread_sys_readv .
-If the call to
-.Fn _thread_sys_readv
-would block, a context switch is performed. Before returning,
-.Fn readv
-unlocks
-.Va d .
.Sh RETURN VALUES
If successful, the
number of bytes actually read is returned. Upon reading end-of-file,
diff --git a/lib/libc/sys/reboot.2 b/lib/libc/sys/reboot.2
index ad66ee5646db..0db9ea2349cb 100644
--- a/lib/libc/sys/reboot.2
+++ b/lib/libc/sys/reboot.2
@@ -140,6 +140,7 @@ variable
The caller is not the super-user.
.El
.Sh SEE ALSO
+.Xr kadb 4 ,
.Xr crash 8 ,
.Xr halt 8 ,
.Xr init 8 ,
diff --git a/lib/libc/sys/rtprio.2 b/lib/libc/sys/rtprio.2
index 1fd18ee5f05d..8b74272999e1 100644
--- a/lib/libc/sys/rtprio.2
+++ b/lib/libc/sys/rtprio.2
@@ -35,10 +35,10 @@
.Nm rtprio
.Nd examine or modify a process realtime or idle priority
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
+.Fd #include <sys/resource.h>
.Fd #include <sys/rtprio.h>
.Ft int
-.Fn rtprio "int function" "pid_t pid" "struct rtprio *rtp"
+.Fn rtprio "function" "pid_t pid" "struct rtprio *rtp"
.Sh DESCRIPTION
.Fn rtprio
is used to lookup or change the realtime or idle priority of a process.
@@ -101,6 +101,6 @@ implementation in FreeBSD was substantially rewritten by David Greenman.
.Xr rtprio 1 ,
.Xr nice 1 ,
.Xr ps 1 ,
-.Xr setpriority 2 ,
-.Xr nice 3 ,
+.Xr nice 2 ,
.Xr renice 8
+
diff --git a/lib/libc/sys/setsid.2 b/lib/libc/sys/setsid.2
index 404b1b81a008..48ac6a071785 100644
--- a/lib/libc/sys/setsid.2
+++ b/lib/libc/sys/setsid.2
@@ -68,7 +68,7 @@ group ID of a process other than the calling process matches the process
ID of the calling process.
.El
.Sh SEE ALSO
-.Xr setpgid 2 ,
+.Xr setpgid 3 ,
.Xr tcgetpgrp 3 ,
.Xr tcsetpgrp 3
.Sh STANDARDS
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2
index b9fe5caca506..3f41266a9c81 100644
--- a/lib/libc/sys/sigaction.2
+++ b/lib/libc/sys/sigaction.2
@@ -50,7 +50,7 @@ struct sigaction {
.Sh DESCRIPTION
The system defines a set of signals that may be delivered to a process.
Signal delivery resembles the occurrence of a hardware interrupt:
-the signal is normally blocked from further occurrence, the current process
+the signal is blocked from further occurrence, the current process
context is saved, and a new one is built. A process may specify a
.Em handler
to which a signal is delivered, or specify that a signal is to be
@@ -68,7 +68,7 @@ of the process. This may be changed, on a per-handler basis,
so that signals are taken on a special
.Em "signal stack" .
.Pp
-Signal routines normally execute with the signal that caused their
+Signal routines execute with the signal that caused their
invocation
.Em blocked ,
but other signals may yet occur.
@@ -131,7 +131,7 @@ If
is non-zero, the previous handling information for the signal
is returned to the user.
.Pp
-Once a signal handler is installed, it normally remains installed
+Once a signal handler is installed, it remains installed
until another
.Fn sigaction
call is made, or an
@@ -178,16 +178,7 @@ bit is set in
the system will deliver the signal to the process on a
.Em "signal stack" ,
specified with
-.Xr sigaltstack 2 .
-If the
-.Dv SA_NODEFER
-bit is set, further occurrences of the delivered signal are not
-masked during the execution of the handler.
-If the
-.Dv SA_RESETHAND
-bit is set, the handler is reset back to
-.Dv SIG_DFL
-at the moment the signal is delivered.
+.Xr sigstack 2 .
.Pp
If a signal is caught during the system calls listed below,
the call may be forced to terminate
@@ -243,7 +234,7 @@ with names as in the include file
.It Dv SIGQUIT No " create core image" " quit program"
.It Dv SIGILL No " create core image" " illegal instruction"
.It Dv SIGTRAP No " create core image" " trace trap"
-.It Dv SIGABRT No " create core image" Xr abort 3
+.It Dv SIGABRT No " create core image" Xr abort 2
call (formerly
.Dv SIGIOT )
.It Dv SIGEMT No " create core image" " emulate instruction executed"
@@ -251,7 +242,7 @@ call (formerly
.It Dv SIGKILL No " terminate process" " kill program"
.It Dv SIGBUS No " create core image" " bus error"
.It Dv SIGSEGV No " create core image" " segmentation violation"
-.It Dv SIGSYS No " create core image" " non-existent system call invoked"
+.It Dv SIGSYS No " create core image" " system call given invalid argument"
.It Dv SIGPIPE No " terminate process" " write on a pipe with no reader"
.It Dv SIGALRM No " terminate process" " real-time timer expired"
.It Dv SIGTERM No " terminate process" " software termination signal"
@@ -361,11 +352,6 @@ and
Those signals are available on most
.Tn BSD Ns \-derived
systems.
-The
-.Dv SA_NODEFER
-and
-.Dv SA_RESETHAND
-are intended for backwards compatability with other operating systems.
.Sh SEE ALSO
.Xr kill 1 ,
.Xr ptrace 2 ,
@@ -376,7 +362,7 @@ are intended for backwards compatability with other operating systems.
.Xr sigblock 2 ,
.Xr sigsetmask 2 ,
.Xr sigpause 2 ,
-.Xr sigaltstack 2 ,
+.Xr sigstack 2 ,
.Xr sigvec 2 ,
.Xr setjmp 3 ,
.Xr siginterrupt 3 ,
diff --git a/lib/libc/sys/sigaltstack.2 b/lib/libc/sys/sigaltstack.2
index 4892a923fcbd..f1ed718eb966 100644
--- a/lib/libc/sys/sigaltstack.2
+++ b/lib/libc/sys/sigaltstack.2
@@ -71,7 +71,7 @@ the system arranges a switch to the signal stack for the
duration of the signal handler's execution.
.Pp
If
-.Dv SS_DISABLE
+.Dv SA_DISABLE
is set in
.Fa ss_flags ,
.Fa ss_sp
@@ -95,9 +95,9 @@ is non-zero, the current signal stack state is returned.
The
.Fa ss_flags
field will contain the value
-.Dv SS_ONSTACK
+.Dv SA_ONSTACK
if the process is currently on a signal stack and
-.Dv SS_DISABLE
+.Dv SA_DISABLE
if the signal stack is currently disabled.
.Sh NOTES
The value
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2
index 51a5b2e5ff4b..27bc183ddeb0 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -256,7 +256,7 @@ depend on the time stamps being contiguous (in calls to
.Xr symlink 7
.Sh BUGS
Applying
-.Fn fstat
+.Xr fstat
to a socket (and thus to a pipe)
returns a zeroed buffer,
except for the blocksize field,
diff --git a/lib/libc/sys/sync.2 b/lib/libc/sys/sync.2
index 6309c18c7261..5e79feff2d28 100644
--- a/lib/libc/sys/sync.2
+++ b/lib/libc/sys/sync.2
@@ -53,7 +53,7 @@ As information in the cache is lost after a system crash a
call is issued
frequently
by the user process
-.Xr update 4
+.Xr update 8
(about every 30 seconds).
.Pp
The function
@@ -62,8 +62,8 @@ may be used to synchronize individual file descriptor
attributes.
.Sh SEE ALSO
.Xr fsync 2 ,
-.Xr update 4 ,
-.Xr sync 8
+.Xr sync 8 ,
+.Xr update 8
.Sh BUGS
.Fn Sync
may return before the buffers are completely flushed.
diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2
index 1f469453d5ad..78221bc505fc 100644
--- a/lib/libc/sys/unlink.2
+++ b/lib/libc/sys/unlink.2
@@ -56,8 +56,6 @@ all resources associated with the file are reclaimed.
If one or more process have the file open when the last link is removed,
the link is removed, but the removal of the file is delayed until
all references to it have been closed.
-.Fa path
-may not be a directory.
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and
@@ -85,7 +83,8 @@ to be removed.
.It Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
.It Bq Er EPERM
-The named file is a directory.
+The named file is a directory and the effective user ID
+of the process is not the super-user.
.It Bq Er EPERM
The directory containing the file is marked sticky,
and neither the containing directory nor the file to be removed
@@ -111,9 +110,3 @@ points outside the process's allocated address space.
An
.Nm
function call appeared in Version 6 AT&T UNIX.
-.Pp
-The
-.Nm
-system call traditionally allows the super-user to unlink directories which
-can damage the filesystem integrity. This implementation no longer permits
-it.
diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2
index 125b6193c637..1ebeb37eecd9 100644
--- a/lib/libc/sys/utimes.2
+++ b/lib/libc/sys/utimes.2
@@ -82,7 +82,7 @@ and the effective user ID of the process does not
match the owner of the file, and is not the super-user, and write
access is denied.
.It Bq Er EFAULT
-.Fa File
+.Xr File
or
.Fa times
points outside the process's allocated address space.
diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2
index 0d0dbf02d3be..8b6e077a90ee 100644
--- a/lib/libc/sys/vfork.2
+++ b/lib/libc/sys/vfork.2
@@ -48,16 +48,16 @@ space of the old process, which is horrendously inefficient in a paged
environment. It is useful when the purpose of
.Xr fork 2
would have been to create a new system context for an
-.Xr execve 2 .
+.Xr execve .
.Fn Vfork
differs from
-.Xr fork 2
+.Xr fork
in that the child borrows the parent's memory and thread of
control until a call to
.Xr execve 2
or an exit (either by a call to
-.Xr exit 3
-or abnormally).
+.Xr exit 2
+or abnormally.)
The parent process is suspended while the child is using its resources.
.Pp
.Fn Vfork
@@ -66,7 +66,7 @@ the parent's context.
.Pp
.Fn Vfork
can normally be used just like
-.Xr fork 2 .
+.Xr fork .
It does not work, however, to return while running in the childs context
from the procedure that called
.Fn vfork
@@ -74,19 +74,19 @@ since the eventual return from
.Fn vfork
would then return to a no longer existent stack frame.
Be careful, also, to call
-.Xr _exit 2
+.Xr _exit
rather than
-.Xr exit 3
+.Xr exit
if you can't
-.Xr execve 2 ,
+.Xr execve ,
since
-.Xr exit 3
+.Xr exit
will flush and close standard I/O channels, and thereby mess up the
parent processes standard I/O data structures.
(Even with
-.Xr fork 2
+.Xr fork
it is wrong to call
-.Xr exit 3
+.Xr exit
since buffered data would then be flushed twice.)
.Sh SEE ALSO
.Xr fork 2 ,
@@ -95,15 +95,15 @@ since buffered data would then be flushed twice.)
.Xr wait 2 ,
.Sh DIAGNOSTICS
Same as for
-.Xr fork 2 .
+.Xr fork .
.Sh BUGS
This system call will be eliminated when proper system sharing
mechanisms are implemented.
Users should not depend on the memory
sharing semantics of
-.Xr vfork 2
+.Xr vfork
as it will, in that case, be made synonymous to
-.Xr fork 2 .
+.Xr fork .
.Pp
To avoid a possible deadlock situation,
processes that are children in the middle
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2
index cd9ab62750e7..c0077b150ce8 100644
--- a/lib/libc/sys/wait.2
+++ b/lib/libc/sys/wait.2
@@ -156,7 +156,7 @@ One of the first three macros will evaluate to a non-zero (true) value:
True if the process terminated normally by a call to
.Xr _exit 2
or
-.Xr exit 3 .
+.Xr exit 2 .
.It Fn WIFSIGNALED status
True if the process terminated due to receipt of a signal.
.It Fn WIFSTOPPED status
@@ -178,7 +178,7 @@ is true, evaluates to the low-order 8 bits
of the argument passed to
.Xr _exit 2
or
-.Xr exit 3
+.Xr exit 2
by the child.
.It Fn WTERMSIG status
If
@@ -287,9 +287,8 @@ and the ability to restart a pending
.Fn wait
call are extensions to the POSIX interface.
.Sh SEE ALSO
-.Xr _exit 2 ,
-.Xr sigaction 2 ,
-.Xr exit 3
+.Xr exit 2 ,
+.Xr sigaction 2
.Sh HISTORY
A
.Nm
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index a1e4a517cbe2..de2d3aef59ab 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -115,53 +115,6 @@ and
may write fewer bytes than requested;
the return value must be noted,
and the remainder of the operation should be retried when possible.
-.Sh IMPLEMENTATION NOTES
-.Pp
-In the non-threaded library
-.Fn write
-is implemented as the
-.Va write
-syscall.
-.Pp
-In the threaded library, the
-.Va write
-syscall is assembled to
-.Fn _thread_sys_write
-and
-.Fn write
-is implemented as a function which locks
-.Va d
-for read and write, then calls
-.Fn _thread_sys_write .
-If the call to
-.Fn _thread_sys_write
-would block, a context switch is performed. Before returning,
-.Fn write
-unlocks
-.Va d .
-.Pp
-In the non-threaded library
-.Fn writev
-is implemented as the
-.Va writev
-syscall.
-.Pp
-In the threaded library, the
-.Va writev
-syscall is assembled to
-.Fn _thread_sys_writev
-and
-.Fn writev
-is implemented as a function which locks
-.Va d
-for read and write, then calls
-.Fn _thread_sys_writev .
-If the call to
-.Fn _thread_sys_writev
-would block, a context switch is performed. Before returning,
-.Fn writev
-unlocks
-.Va d .
.Sh RETURN VALUES
Upon successful completion the number of bytes which were written
is returned. Otherwise a -1 is returned and the global variable
diff --git a/lib/libc/xdr/xdr.3 b/lib/libc/xdr/xdr.3
index ae1ea860518c..b656ea804da8 100644
--- a/lib/libc/xdr/xdr.3
+++ b/lib/libc/xdr/xdr.3
@@ -1,5 +1,5 @@
.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI
-.TH XDR 3 "16 February 1988"
+.TH XDR 3N "16 February 1988"
.SH NAME
xdr \- library routines for external data representation
.SH SYNOPSIS AND DESCRIPTION
@@ -808,7 +808,7 @@ routines as parameters, and
one of the most frequently used primitives, requires three.
Returns one if it succeeds, zero otherwise.
.SH SEE ALSO
-.BR rpc (3)
+.BR rpc (3N)
.LP
The following manuals:
.RS
diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c
index 87b4f7aaacf4..f4530869a709 100644
--- a/lib/libc/xdr/xdr.c
+++ b/lib/libc/xdr/xdr.c
@@ -44,7 +44,6 @@ static char *rcsid = "$Id: xdr.c,v 1.2 1995/05/30 05:42:03 rgrimes Exp $";
*/
#include <stdio.h>
-#include <stdlib.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/xdr/xdr_array.c b/lib/libc/xdr/xdr_array.c
index 35bbb2bd99e8..57b5189ba820 100644
--- a/lib/libc/xdr/xdr_array.c
+++ b/lib/libc/xdr/xdr_array.c
@@ -44,7 +44,6 @@ static char *rcsid = "$Id: xdr_array.c,v 1.2 1995/05/30 05:42:04 rgrimes Exp $";
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/xdr/xdr_mem.c b/lib/libc/xdr/xdr_mem.c
index 6f82f670f17a..05e01224e957 100644
--- a/lib/libc/xdr/xdr_mem.c
+++ b/lib/libc/xdr/xdr_mem.c
@@ -44,7 +44,7 @@ static char *rcsid = "$Id: xdr_mem.c,v 1.2 1995/05/30 05:42:06 rgrimes Exp $";
*
*/
-#include <string.h>
+
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <netinet/in.h>
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c
index 3b69f257132b..dbd7d0380360 100644
--- a/lib/libc/xdr/xdr_rec.c
+++ b/lib/libc/xdr/xdr_rec.c
@@ -51,7 +51,6 @@ static char *rcsid = "$Id: xdr_rec.c,v 1.3 1995/05/30 05:42:09 rgrimes Exp $";
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <netinet/in.h>
diff --git a/lib/libc/xdr/xdr_reference.c b/lib/libc/xdr/xdr_reference.c
index 91ccff2d79cf..b65c8497068b 100644
--- a/lib/libc/xdr/xdr_reference.c
+++ b/lib/libc/xdr/xdr_reference.c
@@ -43,8 +43,6 @@ static char *rcsid = "$Id: xdr_reference.c,v 1.2 1995/05/30 05:42:12 rgrimes Exp
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
diff --git a/lib/libcom_err/Makefile b/lib/libcom_err/Makefile
index c295a3accd4d..2fee22d86f59 100644
--- a/lib/libcom_err/Makefile
+++ b/lib/libcom_err/Makefile
@@ -9,7 +9,7 @@ SUBDIR= doc
beforeinstall:
-cd ${.CURDIR}; cmp -s com_err.h ${DESTDIR}/usr/include/com_err.h || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 com_err.h \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 com_err.h \
${DESTDIR}/usr/include
.include <bsd.lib.mk>
diff --git a/lib/libcom_err/com_err.3 b/lib/libcom_err/com_err.3
index ee4375b0262e..a002e7fa5242 100644
--- a/lib/libcom_err/com_err.3
+++ b/lib/libcom_err/com_err.3
@@ -1,7 +1,7 @@
.\" Copyright (c) 1988 Massachusetts Institute of Technology,
.\" Student Information Processing Board. All rights reserved.
.\"
-.\" $Header$
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/com_err.3,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $
.\"
.TH COM_ERR 3 "22 Nov 1988" SIPB
.SH NAME
diff --git a/lib/libcom_err/doc/com_err.texinfo b/lib/libcom_err/doc/com_err.texinfo
index 2f4b26612975..51732f473ffb 100644
--- a/lib/libcom_err/doc/com_err.texinfo
+++ b/lib/libcom_err/doc/com_err.texinfo
@@ -1,8 +1,8 @@
\input texinfo @c -*-texinfo-*-
-@c $Header$
-@c $Source$
-@c $Locker$
+@c $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/doc/com_err.texinfo,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $
+@c $Source: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/doc/com_err.texinfo,v $
+@c $Locker: $
@c Note that although this source file is in texinfo format (more
@c or less), it is not yet suitable for turning into an ``info''
diff --git a/lib/libcom_err/error_message.c b/lib/libcom_err/error_message.c
index 99dab1e582c8..5fb26e71aeb4 100644
--- a/lib/libcom_err/error_message.c
+++ b/lib/libcom_err/error_message.c
@@ -1,6 +1,6 @@
/*
- * $Header: error_message.c,v 1.2 89/01/25 09:08:57 shanzer Exp $
- * $Source: /paris/source/4.3/athena.lib/et.new/RCS/error_message.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/error_message.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/error_message.c,v $
* $Locker: $
*
* Copyright 1987 by the Student Information Processing Board
@@ -15,7 +15,7 @@
#include "internal.h"
static const char rcsid[] =
- "$Header: error_message.c,v 1.2 89/01/25 09:08:57 shanzer Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/error_message.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $";
static const char copyright[] =
"Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
diff --git a/lib/libcom_err/et_name.c b/lib/libcom_err/et_name.c
index a896bab84e18..2ddd11fa9528 100644
--- a/lib/libcom_err/et_name.c
+++ b/lib/libcom_err/et_name.c
@@ -12,7 +12,7 @@
static const char copyright[] =
"Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
static const char rcsid_et_name_c[] =
- "$Header: et_name.c,v 1.7 89/01/01 06:14:56 raeburn Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/et_name.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $";
#endif
static const char char_set[] =
diff --git a/lib/libcom_err/init_et.c b/lib/libcom_err/init_et.c
index 630c2ac4a0b3..6ee579b51a6d 100644
--- a/lib/libcom_err/init_et.c
+++ b/lib/libcom_err/init_et.c
@@ -1,6 +1,6 @@
/*
- * $Header: init_et.c,v 1.5 88/10/27 08:34:54 raeburn Exp $
- * $Source: /mit/raeburn/Work/et/src/RCS/init_et.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/init_et.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/init_et.c,v $
* $Locker: $
*
* Copyright 1986, 1987, 1988 by MIT Information Systems and
@@ -19,7 +19,7 @@
#ifndef lint
static const char rcsid_init_et_c[] =
- "$Header: init_et.c,v 1.5 88/10/27 08:34:54 raeburn Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcom_err/init_et.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $";
#endif
extern char *malloc(), *realloc();
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c
index 0b475614b358..023796e158a0 100644
--- a/lib/libcrypt/crypt.c
+++ b/lib/libcrypt/crypt.c
@@ -6,12 +6,12 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $
+ * $Id: crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $
*
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $";
+static char rcsid[] = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libcrypt/crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile
index 902e59d862d5..fd2e711b8e0a 100644
--- a/lib/libcurses/Makefile
+++ b/lib/libcurses/Makefile
@@ -16,7 +16,7 @@ MAN3= curses.3
beforeinstall:
-cd ${.CURDIR}; cmp -s curses.h ${DESTDIR}/usr/include/curses.h || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 curses.h \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 curses.h \
${DESTDIR}/usr/include
.include <bsd.lib.mk>
diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile
index 9db8d0a502a1..c4437b75fb0b 100644
--- a/lib/libdisk/Makefile
+++ b/lib/libdisk/Makefile
@@ -1,9 +1,5 @@
# $Id: Makefile,v 1.11.4.4 1996/05/28 22:51:06 jkh Exp $
-# $Id$
-
-# $Id$
-
LIB= disk
SRCS= blocks.c disklabel.c dkcksum.c chunk.c disk.c change.c \
create_chunk.c rules.c write_disk.c data.c
diff --git a/lib/libedit/term.c b/lib/libedit/term.c
index f98d02fba145..0dc0bc98bd8f 100644
--- a/lib/libedit/term.c
+++ b/lib/libedit/term.c
@@ -35,7 +35,7 @@
*/
#if !defined(lint) && !defined(SCCSID)
-static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
+static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint && not SCCSID */
/*
@@ -880,22 +880,18 @@ term_init_arrow(el)
fkey_t *arrow = el->el_term.t_fkey;
arrow[A_K_DN].name = "down";
- arrow[A_K_DN].key = T_kd;
arrow[A_K_DN].fun.cmd = ED_NEXT_HISTORY;
arrow[A_K_DN].type = XK_CMD;
arrow[A_K_UP].name = "up";
- arrow[A_K_UP].key = T_ku;
arrow[A_K_UP].fun.cmd = ED_PREV_HISTORY;
arrow[A_K_UP].type = XK_CMD;
arrow[A_K_LT].name = "left";
- arrow[A_K_LT].key = T_kl;
arrow[A_K_LT].fun.cmd = ED_PREV_CHAR;
arrow[A_K_LT].type = XK_CMD;
arrow[A_K_RT].name = "right";
- arrow[A_K_RT].key = T_kr;
arrow[A_K_RT].fun.cmd = ED_NEXT_CHAR;
arrow[A_K_RT].type = XK_CMD;
diff --git a/lib/libedit/termcap.h b/lib/libedit/termcap.h
new file mode 100644
index 000000000000..4fd2cab0ec02
--- /dev/null
+++ b/lib/libedit/termcap.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Christos Zoulas of Cornell University.
+ *
+ * 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.
+ *
+ * @(#)termcap.h 8.1 (Berkeley) 6/4/93
+ */
+
+/*
+ * termcap.h: I cannot find those in any include files...
+ */
+#ifndef _h_termcap
+#define _h_termcap
+
+int tgetent __P((char *, char *));
+char *tgetstr __P((char *, char **));
+int tgetflag __P((char *));
+int tgetnum __P((char *));
+char *tgoto __P((char *, int, int));
+char *tputs __P((char *, int, void (*)(int)));
+
+#endif /* _h_termcap */
diff --git a/lib/libf2c/Makefile b/lib/libf2c/Makefile
index 1777f5c2d500..63ad8082fe94 100644
--- a/lib/libf2c/Makefile
+++ b/lib/libf2c/Makefile
@@ -5,7 +5,7 @@ CFLAGS+= -DIEEE_drem -DNON_ANSI_RW_MODES -DNON_UNIX_STDIO
MISC = Version.c main.c s_rnge.c abort_.c getarg_.c iargc_.c getenv_.c\
signal_.c s_stop.c s_paus.c system_.c cabs.c\
- derf_.c derfc_.c erf_.c erfc_.c sig_die.c F77_aloc.c exit.c
+ derf_.c derfc_.c erf_.c erfc_.c sig_die.c
POW = pow_ci.c pow_dd.c pow_di.c pow_hh.c pow_ii.c pow_ri.c pow_zi.c pow_zz.c
CX = c_abs.c c_cos.c c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c
DCX = z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c
diff --git a/lib/libforms/Makefile b/lib/libforms/Makefile
index 36b0c4f88f83..55e06c1e2bf5 100644
--- a/lib/libforms/Makefile
+++ b/lib/libforms/Makefile
@@ -11,7 +11,7 @@ CLEANFILES+= lex.c parser.c y.tab.h
beforeinstall:
@(cd ${.CURDIR}; cmp -s forms.h ${DESTDIR}/usr/include/forms.h || \
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 forms.h \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 forms.h \
${DESTDIR}/usr/include/forms.h;)
.include <bsd.lib.mk>
diff --git a/lib/libforms/bindings.c b/lib/libforms/bindings.c
index 4ebdd8d99b73..947b5ee47bdd 100644
--- a/lib/libforms/bindings.c
+++ b/lib/libforms/bindings.c
@@ -45,12 +45,6 @@ bind_tuple(hash_table *htable, char *name,
{
struct Tuple *tuple;
- /* First check to see if we've been bound in already */
- if (hash_search(htable, tuple->name, NULL, NULL)) {
- warn("Duplicate tuple name, %s, skipping", name);
- return (ST_ERROR);
- }
-
tuple = malloc(sizeof (struct Tuple));
if (!tuple) {
warn("Couldn't allocate memory for new tuple");
@@ -61,8 +55,10 @@ bind_tuple(hash_table *htable, char *name,
tuple->type = type;
tuple->addr = fn;
- /* Insert it */
- hash_search(htable, tuple->name, tuple, NULL);
+ if (hash_search(htable, tuple->name, tuple, NULL)) {
+ warn("Duplicate tuple name, %s, skipping", name);
+ return (ST_ERROR);
+ }
#ifdef DEBUG
debug_dump_table(htable);
diff --git a/lib/libforms/examples/Makefile b/lib/libforms/examples/Makefile
index b14392f7b6a2..4389b705c043 100644
--- a/lib/libforms/examples/Makefile
+++ b/lib/libforms/examples/Makefile
@@ -11,7 +11,7 @@ FORMDIR=${.CURDIR}/../obj
FORMDIR=${.CURDIR}/..
.endif
-LDADD = -L${FORMDIR} -lforms -lncurses -lmytinfo -ll
+LDADD = -L${FORMDIR} -lforms -ldialog -lncurses -lmytinfo -ll
DPADD = ${LIBFORMS} ${LIBNCURSES}
.include <bsd.prog.mk>
diff --git a/lib/libforms/objects.c b/lib/libforms/objects.c
index 0e3c29492bf2..0a51caeda958 100644
--- a/lib/libforms/objects.c
+++ b/lib/libforms/objects.c
@@ -371,21 +371,3 @@ add_menu_option(MENU_OBJECT *menu, char *option)
return (++menu->no_options);
}
-
-
-/* Default object functions */
-
-void
-draw_box(OBJECT *object)
-{
- /* Gross hack for now */
- ncurses_draw_box(object);
-}
-
-void
-draw_shadow(OBJECT *object)
-{
- /* Gross hack for now */
- ncurses_draw_shadow(object);
-}
-
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 47773e7b4f6b..c26e680b79a0 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -599,23 +599,13 @@ kvm_doargv(kd, kp, nchr, info)
register char **ap;
u_long addr;
int cnt;
- struct ps_strings arginfo, *ps_strings;
- int mib[2];
- size_t len;
-
- ps_strings = NULL;
- mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof(ps_strings);
- if (sysctl(mib, 2, &ps_strings, &len, NULL, 0) < 0 ||
- ps_strings == NULL)
- ps_strings = PS_STRINGS;
+ struct ps_strings arginfo;
/*
* Pointers are stored at the top of the user stack.
*/
if (p->p_stat == SZOMB ||
- kvm_uread(kd, p, ps_strings, (char *)&arginfo,
+ kvm_uread(kd, p, USRSTACK - sizeof(arginfo), (char *)&arginfo,
sizeof(arginfo)) != sizeof(arginfo))
return (0);
@@ -669,11 +659,6 @@ kvm_uread(kd, p, uva, buf, len)
ssize_t amount;
int fd;
- if (!ISALIVE(kd)) {
- _kvm_err(kd, kd->program, "cannot read user space from dead kernel");
- return(0);
- }
-
cp = buf;
sprintf(procfile, "/proc/%d/mem", p->p_pid);
diff --git a/lib/libncurses/TESTS/newdemo.c b/lib/libncurses/TESTS/newdemo.c
index 5573557b08ec..2e924b61b222 100644
--- a/lib/libncurses/TESTS/newdemo.c
+++ b/lib/libncurses/TESTS/newdemo.c
@@ -1,4 +1,4 @@
-/* $Header: /home/ncvs/src/lib/libncurses/TESTS/newdemo.c,v 1.1.1.1 1994/10/07 08:58:56 ache Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libncurses/TESTS/newdemo.c,v 1.2 1995/05/30 05:47:07 rgrimes Exp $
*
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
diff --git a/lib/libpcap/bpf_filter.c b/lib/libpcap/bpf_filter.c
index e755b59eb727..3991161209ac 100644
--- a/lib/libpcap/bpf_filter.c
+++ b/lib/libpcap/bpf_filter.c
@@ -38,11 +38,11 @@
* @(#)bpf.c 7.5 (Berkeley) 7/15/91
*
* static char rcsid[] =
- * "$Header: /home/ncvs/src/lib/libpcap/bpf_filter.c,v 1.1.1.1 1995/01/20 04:13:02 jkh Exp $";
+ * "$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/bpf_filter.c,v 1.2 1995/05/30 05:47:18 rgrimes Exp $";
*/
#if !(defined(lint) || defined(KERNEL))
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/bpf_filter.c,v 1.1.1.1 1995/01/20 04:13:02 jkh Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/bpf_filter.c,v 1.2 1995/05/30 05:47:18 rgrimes Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/lib/libpcap/bpf_image.c b/lib/libpcap/bpf_image.c
index e86fa8501835..7a6598f91ed2 100644
--- a/lib/libpcap/bpf_image.c
+++ b/lib/libpcap/bpf_image.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: bpf_image.c,v 1.12 94/01/31 03:22:34 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/bpf_image.c,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/etherent.c b/lib/libpcap/etherent.c
index 7045f3dcf04b..68ce3628eef0 100644
--- a/lib/libpcap/etherent.c
+++ b/lib/libpcap/etherent.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: etherent.c,v 1.8 94/06/20 19:07:50 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/etherent.c,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/ethertype.h b/lib/libpcap/ethertype.h
index 37f6920c9601..10bee47ec0d4 100644
--- a/lib/libpcap/ethertype.h
+++ b/lib/libpcap/ethertype.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: ethertype.h,v 1.2 94/06/14 20:03:27 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/ethertype.h,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)
*/
/* Map between Ethernet protocol types and names */
diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c
index 3f237c105c9f..6675ddb6ea72 100644
--- a/lib/libpcap/gencode.c
+++ b/lib/libpcap/gencode.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/gencode.c,v 1.1.1.1 1995/01/20 04:13:04 jkh Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/gencode.c,v 1.1.1.1.4.1 1995/08/30 08:51:45 davidg Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/gencode.h b/lib/libpcap/gencode.h
index 34d4c19ef583..f3346268af66 100644
--- a/lib/libpcap/gencode.h
+++ b/lib/libpcap/gencode.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/ncvs/src/lib/libpcap/gencode.h,v 1.1.1.1 1995/01/20 04:13:06 jkh Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/gencode.h,v 1.2 1995/05/30 05:47:20 rgrimes Exp $ (LBL)
*/
/*
diff --git a/lib/libpcap/grammar.y b/lib/libpcap/grammar.y
index 4c17bdc81607..c0cacf1451a6 100644
--- a/lib/libpcap/grammar.y
+++ b/lib/libpcap/grammar.y
@@ -22,7 +22,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/grammar.y,v 1.1.1.1 1995/01/20 04:13:06 jkh Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/grammar.y,v 1.2 1995/02/21 10:46:34 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/inet.c b/lib/libpcap/inet.c
index 004e27506bfd..543df7d86c3b 100644
--- a/lib/libpcap/inet.c
+++ b/lib/libpcap/inet.c
@@ -33,7 +33,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: inet.c,v 1.4 94/06/07 01:16:50 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/inet.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/lib/libpcap/nametoaddr.c b/lib/libpcap/nametoaddr.c
index 9732f97997b7..fb70bd5e225d 100644
--- a/lib/libpcap/nametoaddr.c
+++ b/lib/libpcap/nametoaddr.c
@@ -24,7 +24,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/nametoaddr.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/nametoaddr.c,v 1.2 1995/05/30 05:47:21 rgrimes Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/lib/libpcap/optimize.c b/lib/libpcap/optimize.c
index 50eb88ef6056..f2f6de6a9c89 100644
--- a/lib/libpcap/optimize.c
+++ b/lib/libpcap/optimize.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: optimize.c,v 1.45 94/06/20 19:07:55 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/optimize.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c
index 39e61978e377..fce51c329d66 100644
--- a/lib/libpcap/pcap-bpf.c
+++ b/lib/libpcap/pcap-bpf.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-bpf.c,v 1.14 94/06/03 19:58:49 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-bpf.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <stdio.h>
diff --git a/lib/libpcap/pcap-dlpi.c b/lib/libpcap/pcap-dlpi.c
index adcffcd1ea0d..d02bd80125a0 100644
--- a/lib/libpcap/pcap-dlpi.c
+++ b/lib/libpcap/pcap-dlpi.c
@@ -23,7 +23,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-dlpi.c,v 1.22x 94/10/12 20:08:15 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-dlpi.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
/*
diff --git a/lib/libpcap/pcap-int.h b/lib/libpcap/pcap-int.h
index db3677afa180..11bc60417a1f 100644
--- a/lib/libpcap/pcap-int.h
+++ b/lib/libpcap/pcap-int.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /home/ncvs/src/lib/libpcap/pcap-int.h,v 1.1.1.1 1995/01/20 04:13:06 jkh Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-int.h,v 1.2 1995/05/30 05:47:23 rgrimes Exp $ (LBL)
*/
#ifndef pcap_int_h
diff --git a/lib/libpcap/pcap-namedb.h b/lib/libpcap/pcap-namedb.h
index 347122709df2..2a63936b6020 100644
--- a/lib/libpcap/pcap-namedb.h
+++ b/lib/libpcap/pcap-namedb.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: pcap-namedb.h,v 1.2 94/06/14 20:03:34 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-namedb.h,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)
*/
#ifndef lib_pcap_ethers_h
diff --git a/lib/libpcap/pcap-nit.c b/lib/libpcap/pcap-nit.c
index 125e14f9fa08..ee03553bec27 100644
--- a/lib/libpcap/pcap-nit.c
+++ b/lib/libpcap/pcap-nit.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-nit.c,v 1.24 94/02/10 23:02:37 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-nit.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/pcap-nit.h b/lib/libpcap/pcap-nit.h
index dc1c9e8eec07..03e2e186ff8f 100644
--- a/lib/libpcap/pcap-nit.h
+++ b/lib/libpcap/pcap-nit.h
@@ -15,5 +15,5 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: pcap-nit.h,v 1.2 94/06/14 20:06:03 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-nit.h,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)
*/
diff --git a/lib/libpcap/pcap-pf.c b/lib/libpcap/pcap-pf.c
index 483dc975ff7d..86a86a1ff3f9 100644
--- a/lib/libpcap/pcap-pf.c
+++ b/lib/libpcap/pcap-pf.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-pf.c,v 1.32 94/06/10 17:41:01 mccanne Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-pf.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
/*
diff --git a/lib/libpcap/pcap-pf.h b/lib/libpcap/pcap-pf.h
index 65ca067ef082..1ba83dce546f 100644
--- a/lib/libpcap/pcap-pf.h
+++ b/lib/libpcap/pcap-pf.h
@@ -15,5 +15,5 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: pcap-pf.h,v 1.2 94/06/14 20:06:33 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-pf.h,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)
*/
diff --git a/lib/libpcap/pcap-snit.c b/lib/libpcap/pcap-snit.c
index 562b9657a366..3b8aff529932 100644
--- a/lib/libpcap/pcap-snit.c
+++ b/lib/libpcap/pcap-snit.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-snit.c,v 1.33 94/06/23 13:51:17 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-snit.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
/*
diff --git a/lib/libpcap/pcap-snoop.c b/lib/libpcap/pcap-snoop.c
index 50f978576684..687f7f919d88 100644
--- a/lib/libpcap/pcap-snoop.c
+++ b/lib/libpcap/pcap-snoop.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-snoop.c,v 1.6 94/01/31 05:26:09 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap-snoop.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/lib/libpcap/pcap.c b/lib/libpcap/pcap.c
index 44d65aeebd00..aa90a5b65244 100644
--- a/lib/libpcap/pcap.c
+++ b/lib/libpcap/pcap.c
@@ -33,7 +33,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/pcap.c,v 1.2 1995/02/23 06:55:14 phk Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap.c,v 1.3 1995/05/30 05:47:24 rgrimes Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libpcap/pcap.h b/lib/libpcap/pcap.h
index 506b15b1e6c9..a3de75b773a1 100644
--- a/lib/libpcap/pcap.h
+++ b/lib/libpcap/pcap.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: pcap.h,v 1.15 94/06/14 20:03:34 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/pcap.h,v 1.1.1.1 1995/01/20 04:13:05 jkh Exp $ (LBL)
*/
#ifndef lib_pcap_h
diff --git a/lib/libpcap/savefile.c b/lib/libpcap/savefile.c
index 90ee7238175f..41e6a130e5c7 100644
--- a/lib/libpcap/savefile.c
+++ b/lib/libpcap/savefile.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: savefile.c,v 1.16 94/06/20 19:07:56 leres Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/savefile.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
/*
diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l
index c2ff10d98755..54d78eac840b 100644
--- a/lib/libpcap/scanner.l
+++ b/lib/libpcap/scanner.l
@@ -22,7 +22,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: scanner.l,v 1.40 94/06/10 17:21:44 mccanne Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/lib/libpcap/scanner.l,v 1.1.1.1 1995/01/20 04:13:06 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/lib/libutil/setproctitle.c b/lib/libutil/setproctitle.c
index b13409d4ba96..804b7eb991b8 100644
--- a/lib/libutil/setproctitle.c
+++ b/lib/libutil/setproctitle.c
@@ -11,16 +11,19 @@
* 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. Absolutely no warranty of function or purpose is made by the author
+ * 3. This work was done expressly for inclusion into FreeBSD. Other use
+ * is permitted provided this notation is included.
+ * 4. Absolutely no warranty of function or purpose is made by the author
* Peter Wemm.
+ * 5. Modifications may be freely made to this file providing the above
+ * conditions are met.
*
- * $Id: setproctitle.c,v 1.2 1996/02/24 14:37:29 peter Exp $
+ * $Id: setproctitle.c,v 1.1 1995/12/26 22:50:08 peter Exp $
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/exec.h>
-#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -68,12 +71,10 @@ setproctitle(fmt, va_alist)
#endif
{
char *p;
+ int len;
static char buf[SPT_BUFSIZE];
static char *ps_argv[2];
va_list ap;
- int mib[2];
- struct ps_strings *ps_strings;
- size_t len;
#if defined(__STDC__)
va_start(ap, fmt);
@@ -103,21 +104,13 @@ setproctitle(fmt, va_alist)
va_end(ap);
- ps_strings = NULL;
- mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof(ps_strings);
- if (sysctl(mib, 2, &ps_strings, &len, NULL, 0) < 0 ||
- ps_strings == NULL)
- ps_strings = PS_STRINGS;
-
/* PS_STRINGS points to zeroed memory on a style #2 kernel */
- if (ps_strings->ps_argvstr) {
+ if (PS_STRINGS->ps_argvstr) {
/* style #3 */
ps_argv[0] = buf;
ps_argv[1] = NULL;
- ps_strings->ps_nargvstr = 1;
- ps_strings->ps_argvstr = ps_argv;
+ PS_STRINGS->ps_nargvstr = 1;
+ PS_STRINGS->ps_argvstr = ps_argv;
} else {
/* style #2 */
OLD_PS_STRINGS->old_ps_nargvstr = 1;
diff --git a/lib/msun/i387/e_exp.S b/lib/msun/i387/e_exp.S
index 3ba2d439f8da..8ef3fbdf840f 100644
--- a/lib/msun/i387/e_exp.S
+++ b/lib/msun/i387/e_exp.S
@@ -50,5 +50,4 @@ ENTRY(__ieee754_exp)
fld1
faddp /* 2^(fract(x * log2(e))) */
fscale /* e^x */
- fstpl %st(1)
ret
diff --git a/libexec/bootpd/bootpd.8 b/libexec/bootpd/bootpd.8
index 359ce53d30ae..a9fb65e2f77f 100644
--- a/libexec/bootpd/bootpd.8
+++ b/libexec/bootpd/bootpd.8
@@ -1,6 +1,6 @@
.\" Copyright (c) 1988, 1989, 1991 Carnegie Mellon University
.\"
-.\" $Header: /home/ncvs/src/libexec/bootpd/bootpd.8,v 1.1.1.1 1994/09/30 05:45:04 pst Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/libexec/bootpd/bootpd.8,v 1.2 1995/04/12 00:24:48 gpalmer Exp $
.\"
.TH BOOTPD 8 "November 06, 1993" "Carnegie Mellon University"
.SH NAME
diff --git a/libexec/bootpd/bootptab.5 b/libexec/bootpd/bootptab.5
index 74953837f6e9..447ce8985687 100644
--- a/libexec/bootpd/bootptab.5
+++ b/libexec/bootpd/bootptab.5
@@ -1,6 +1,6 @@
.\" Copyright (c) 1988, 1989, 1991 Carnegie Mellon University
.\"
-.\" $Header: /home/ncvs/src/usr.sbin/bootpd/bootptab.5,v 1.1.1.1 1994/09/10 14:44:54 csgr Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/libexec/bootpd/bootptab.5,v 1.1.1.1 1994/09/30 05:45:04 pst Exp $
.\"
.TH BOOTPTAB 5 "October 31, 1991" "Carnegie Mellon University"
.UC 6
diff --git a/sbin/slattach/Makefile b/sbin/slattach/Makefile
index e6dfd0aea492..b9937390a0a0 100644
--- a/sbin/slattach/Makefile
+++ b/sbin/slattach/Makefile
@@ -1,6 +1,6 @@
# @(#)Makefile 5.4 (Berkeley) 5/11/90
#
-# $Header: /home/ncvs/src/sbin/slattach/Makefile,v 1.6 1995/09/20 12:56:23 ache Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/sbin/slattach/Makefile,v 1.4.6.1 1995/10/25 00:50:32 jkh Exp $
PROG= slattach
SRCS= slattach.c uucplock.c
diff --git a/sbin/slattach/slattach.8 b/sbin/slattach/slattach.8
index 235a27cb9c01..df9f443a2828 100644
--- a/sbin/slattach/slattach.8
+++ b/sbin/slattach/slattach.8
@@ -31,7 +31,7 @@
.\"
.\" @(#)slattach.8 6.4 (Berkeley) 3/16/91
.\"
-.\" $Header: /home/ncvs/src/sbin/slattach/slattach.8,v 1.4.4.3 1996/01/06 07:09:54 nate Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/sbin/slattach/slattach.8,v 1.4.4.4 1996/01/30 14:03:07 mpp Exp $
.\"
.Dd April 4, 1993
.Dt SLATTACH 8
diff --git a/share/doc/iso/ucb/program.nr b/share/doc/iso/ucb/program.nr
index a43166176bc6..a4fe690f8187 100644
--- a/share/doc/iso/ucb/program.nr
+++ b/share/doc/iso/ucb/program.nr
@@ -1,5 +1,5 @@
-.\"$Header: program.nr,v 1.1 88/12/05 18:10:57 nhall Exp $
-.\"$Source: /usr/argo/doc/kernel/RCS/program.nr,v $
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/ucb/program.nr,v 1.1.1.1 1994/05/30 19:08:12 rgrimes Exp $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/ucb/program.nr,v $
.\"
.\"
.\" FONT CONVENTIONS
diff --git a/share/doc/iso/wisc/appendix_a.nr b/share/doc/iso/wisc/appendix_a.nr
index 25228542e66d..7f26a82d8ae5 100644
--- a/share/doc/iso/wisc/appendix_a.nr
+++ b/share/doc/iso/wisc/appendix_a.nr
@@ -1,4 +1,4 @@
-.\" $Header: appendix_a.nr,v 1.3 88/12/07 10:42:12 nhall Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/appendix_a.nr,v 1.1.1.1 1994/05/30 19:08:06 rgrimes Exp $
.(x
Appendix A
.)x
diff --git a/share/doc/iso/wisc/appendix_b.nr b/share/doc/iso/wisc/appendix_b.nr
index 01ade558e652..2350d8c59b37 100644
--- a/share/doc/iso/wisc/appendix_b.nr
+++ b/share/doc/iso/wisc/appendix_b.nr
@@ -1,4 +1,4 @@
-.\" $Header: appendix_b.nr,v 1.1 88/12/05 18:08:02 nhall Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/appendix_b.nr,v 1.1.1.1 1994/05/30 19:08:06 rgrimes Exp $
.(x
Appendix B
.)x
diff --git a/share/doc/iso/wisc/debug.nr b/share/doc/iso/wisc/debug.nr
index 352eeee05e7f..61776f65ad7e 100644
--- a/share/doc/iso/wisc/debug.nr
+++ b/share/doc/iso/wisc/debug.nr
@@ -1,5 +1,5 @@
-.\"$Header: debug.nr,v 1.4 88/12/06 16:05:36 nhall Exp $
-.\"$Source: /usr/argo/doc/kernel/RCS/debug.nr,v $
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/debug.nr,v 1.1.1.1 1994/05/30 19:08:05 rgrimes Exp $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/debug.nr,v $
.\"
.\" Program names should be in italics
.\"
diff --git a/share/doc/iso/wisc/errors.nr b/share/doc/iso/wisc/errors.nr
index 51b5eb5ff4be..5955760222cb 100644
--- a/share/doc/iso/wisc/errors.nr
+++ b/share/doc/iso/wisc/errors.nr
@@ -1,5 +1,5 @@
-.\"$Header: errors.nr,v 1.2 88/12/06 16:06:07 nhall Exp $
-.\"$Source: /usr/argo/doc/kernel/RCS/errors.nr,v $
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/errors.nr,v 1.1.1.1 1994/05/30 19:08:05 rgrimes Exp $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/errors.nr,v $
.NC "Error Handling"
This section describes the various ways that the ARGO kernel
handles errors.
diff --git a/share/doc/iso/wisc/parts.nr b/share/doc/iso/wisc/parts.nr
index 1cd70b12003e..fda5c4ce86b6 100644
--- a/share/doc/iso/wisc/parts.nr
+++ b/share/doc/iso/wisc/parts.nr
@@ -1,5 +1,5 @@
-.\"$Header: parts.nr,v 1.1 88/12/05 18:10:50 nhall Exp $
-.\"$Source: /usr/argo/doc/kernel/RCS/parts.nr,v $
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/parts.nr,v 1.1.1.1 1994/05/30 19:08:06 rgrimes Exp $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/parts.nr,v $
.\"
.\"
.\" LOOK FOR ALL CASES OF 'writing' (as in, "at this writing")
diff --git a/share/doc/iso/wisc/program.nr b/share/doc/iso/wisc/program.nr
index dfb33055260a..6e2966823363 100644
--- a/share/doc/iso/wisc/program.nr
+++ b/share/doc/iso/wisc/program.nr
@@ -1,5 +1,5 @@
-.\"$Header: program.nr,v 1.1 88/12/05 18:10:57 nhall Exp $
-.\"$Source: /usr/argo/doc/kernel/RCS/program.nr,v $
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/program.nr,v 1.1.1.1 1994/05/30 19:08:06 rgrimes Exp $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wisc/program.nr,v $
.\"
.\"
.\" FONT CONVENTIONS
diff --git a/share/doc/iso/wiscman/cons.4 b/share/doc/iso/wiscman/cons.4
index 73bd3fc60b9c..39f50e3ea339 100644
--- a/share/doc/iso/wiscman/cons.4
+++ b/share/doc/iso/wiscman/cons.4
@@ -3,9 +3,9 @@
.\" LICENSED MATERIALS - PROPERTY OF IBM
.\" REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
.\"
-.\"$Header:cons.4_ca 11.3$
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/cons.4,v 1.1.1.1 1994/05/30 19:08:11 rgrimes Exp $
.\"$ACIS:cons.4_ca 11.3$
-.\"$Source: /ibm/acis/usr/man/man4/RCS/cons.4_ca,v $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/cons.4,v $
.\" This file uses -man macros.
.TH CONS 4 "Sept 1988" "Space overwritten by .AC macro" " "
.AC 1 0
diff --git a/share/doc/iso/wiscman/if.4n b/share/doc/iso/wiscman/if.4n
index ca6884c75ac4..21286060b074 100644
--- a/share/doc/iso/wiscman/if.4n
+++ b/share/doc/iso/wiscman/if.4n
@@ -3,9 +3,9 @@
# LICENSED MATERIALS - PROPERTY OF IBM
# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
#
-.\"# $Header:if.4n_ca 1.5$
+.\"# $Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/if.4n,v 1.1.1.1 1994/05/30 19:08:12 rgrimes Exp $
.\"# $ACIS:if.4n_ca 1.5$
-.\"# $Source: /ibm/acis/usr/man/man4/RCS/if.4n_ca,v $
+.\"# $Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/if.4n,v $
.\" @(#)if.4n 1.2 87/08/23 3.2/4.3NFSSRC
.\" @(#)if.4n 1.2 87/02/10 NFSSRC
.\" @(#)if.4n 1.1 86/09/25 SMI;
diff --git a/share/doc/iso/wiscman/rvd.4p b/share/doc/iso/wiscman/rvd.4p
index 44d7e8499af6..13cff8ded7e5 100644
--- a/share/doc/iso/wiscman/rvd.4p
+++ b/share/doc/iso/wiscman/rvd.4p
@@ -3,9 +3,9 @@
.\" LICENSED MATERIALS - PROPERTY OF IBM
.\" REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
.\"
-.\"$Header:rvd.4p_ca 11.0$
+.\"$Header: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/rvd.4p,v 1.1.1.1 1994/05/30 19:08:12 rgrimes Exp $
.\"$ACIS:rvd.4p_ca 11.0$
-.\"$Source: /ibm/acis/usr/man/man4/RCS/rvd.4p_ca,v $
+.\"$Source: /pub/FreeBSD/FreeBSD-CVS/src/share/doc/iso/wiscman/rvd.4p,v $
.\"This file contains -man macros.
.TH RVD 4P "July 1987" "Space overwritten by .AC macro" " "
.AC 1 0
diff --git a/share/man/man4/snp.4 b/share/man/man4/snp.4
index 2f77db171794..48d00a541a60 100644
--- a/share/man/man4/snp.4
+++ b/share/man/man4/snp.4
@@ -1,6 +1,6 @@
.\"
-.\" $Id: snp.4,v 1.6 1995/02/28 00:24:47 pst Exp $
-.\" $Source: /home/ncvs/src/share/man/man4/snp.4,v $
+.\" $Id: snp.4,v 1.6.4.1 1996/01/30 14:02:11 mpp Exp $
+.\" $Source: /pub/FreeBSD/FreeBSD-CVS/src/share/man/man4/snp.4,v $
.\"
.Dd February 24, 1995
.Dt SNP 4
diff --git a/share/mk/Makefile b/share/mk/Makefile
index b2f831ed643a..44d820473dc6 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -2,7 +2,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/8/93
FILES= bsd.README
-FILES+= bsd.dep.mk bsd.doc.mk bsd.info.mk bsd.kmod.mk bsd.obj.mk
+FILES+= bsd.dep.mk bsd.doc.mk bsd.info.mk bsd.kmod.mk
FILES+= bsd.lib.mk bsd.man.mk bsd.own.mk bsd.port.mk
FILES+= bsd.port.subdir.mk bsd.prog.mk bsd.sgml.mk bsd.subdir.mk
FILES+= sys.mk
diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index a64229aed262..534b6149de0f 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -205,19 +205,39 @@ DPADD Additional dependencies for the program. Usually used for
SRCLIB=${LIBCOMPAT} ${LIBUTIL}
- There is a predefined identifier for each (non-profiled,
- non-shared) library and object. Library file names are
- transformed to identifiers by removing the extension and
- converting to upper case.
-
- There are no special identifiers for profiled or shared
- libraries or objects. The identifiers for the standard
- libraries are used in DPADD. This works correctly iff all
- the libraries are built at the same time. Unfortunately,
- it causes unnecessary relinks to shared libraries when
- only the static libraries have changed. Dependencies on
- shared libraries should be only on the library version
- numbers.
+ The following libraries are predefined for DPADD:
+
+ LIBCRT0 /usr/lib/crt0.o (sic)
+ LIBC /usr/lib/libc.a
+ LIBCOMPAT /usr/lib/libcompat.a
+ LIBCRYPT /usr/lib/libcrypt.a
+ LIBCURSES /usr/lib/libcurses.a
+ LIBDES /usr/lib/libdes.a
+ LIBDIALOG /usr/lib/libdialog.a
+ LIBEDIT /usr/lib/libedit.a
+ LIBGCC /usr/lib/libgcc.a
+ LIBGNUMALLOC /usr/lib/libgnumalloc.a
+ LIBGNUREGEX /usr/lib/libgnuregex.a
+ LIBKDB /usr/lib/libkdb.a
+ LIBKRB /usr/lib/libkrb.a
+ LIBKVM /usr/lib/libkvm.a
+ LIBL /usr/lib/libl.a
+ LIBM /usr/lib/libm.a
+ LIBMD /usr/lib/libmd.a
+ LIBMP /usr/lib/libmp.a
+ LIBMYTINFO /usr/lib/libmytinfo.a
+ LIBNCURSES /usr/lib/libncurses.a
+ LIBPC /usr/lib/libpc.a
+ LIBPLOT /usr/lib/libplot.a
+ LIBREADLINE /usr/lib/libreadline.a
+ LIBRESOLV /usr/lib/libresolv.a
+ LIBRPCSVC /usr/lib/librpcsvc.a
+ LIBSCRYPT /usr/lib/libscrypt.a
+ LIBSKEY /usr/lib/libskey.a
+ LIBTELNET /usr/lib/libtelnet.a
+ LIBTERMCAP /usr/lib/libtermcap.a
+ LIBUTIL /usr/lib/libutil.a
+ LIBY /usr/lib/liby.a
STRIP The flag passed to the install program to cause the binary
to be stripped.
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 8977d0622807..f07ea048c54a 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -1,64 +1,25 @@
# $Id: bsd.dep.mk,v 1.2 1995/02/08 21:35:24 bde Exp $
-#
-# The include file <bsd.dep.mk> handles Makefile dependencies.
-#
-#
-# +++ variables +++
-#
-# DEPENDFILE dependencies file [.depend]
-#
-# MKDEP Options for ${MKDEPCMD} [not set]
-#
-# MKDEPCMD Makefile dependency list program [mkdep]
-#
-# SRCS List of source files (c, c++, assembler)
-#
-#
-# +++ targets +++
-#
-# cleandepend:
-# Remove depend and tags file
-#
-# depend:
-# Make the dependencies for the source files, and store
-# them in the file ${DEPENDFILE}.
-#
-# tags:
-# Create a tags file for the source files.
-#
-
-
-MKDEPCMD?= mkdep
-DEPENDFILE?= .depend
# some of the rules involve .h sources, so remove them from mkdep line
.if !target(depend)
-depend: beforedepend ${DEPENDFILE} afterdepend ${_DEPSUBDIR}
+depend: beforedepend .depend afterdepend ${_DEPSUBDIR}
.if defined(SRCS)
-
-# .if defined ${SRCS:M*.[sS]} does not work
-__depend_s= ${SRCS:M*.[sS]}
-__depend_c= ${SRCS:M*.c}
-__depend_cc= ${SRCS:M*.cc} ${SRCS:M*.C} ${SRCS:M*.cxx}
-
-${DEPENDFILE}: ${SRCS}
- rm -f ${DEPENDFILE}
-.if defined(__depend_s) && !empty(__depend_s)
- ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} \
- ${.ALLSRC:M*.[sS]}
-.endif
-.if defined(__depend_c) && !empty(__depend_c)
- ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[ID]*} \
- ${.ALLSRC:M*.c}
-.endif
-.if defined(__depend_cc) && !empty(__depend_cc)
- ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \
- ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} \
- ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}
-.endif
-
+.depend: ${SRCS}
+ rm -f .depend
+ files="${.ALLSRC:M*.[sS]}"; \
+ if [ "$$files" != "" ]; then \
+ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} $$files; \
+ fi
+ files="${.ALLSRC:M*.c}"; \
+ if [ "$$files" != "" ]; then \
+ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
+ fi
+ files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
+ if [ "$$files" != " " ]; then \
+ mkdep -a ${MKDEP} ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} $$files; \
+ fi
.else
-${DEPENDFILE}: ${_DEPSUBDIR}
+.depend: ${_DEPSUBDIR}
.endif
.if !target(beforedepend)
beforedepend:
@@ -82,5 +43,5 @@ tags:
clean:
cleandir: cleandepend
cleandepend:
- rm -f ${DEPENDFILE} ${.CURDIR}/tags
+ rm -f .depend ${.CURDIR}/tags
.endif
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index 6fb27f423f78..c8eb75ca5352 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -16,11 +16,6 @@ ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES}
.endif
SOELIM?= soelim
-SOELIMPP= sed ${SOELIMPPARGS}
-SOELIMPPARGS0= ${SRCS} ${EXTRA}
-SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/}
-SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
-SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g}
TBL?= tbl
DOC?= paper
@@ -88,7 +83,7 @@ obj:
clean:
rm -f ${DOC}.${PRINTER} ${DOC}.ps ${DOC}.ascii \
- ${DOC}.ps.gz ${DOC}.ascii.gz Errs errs mklog ${CLEANFILES}
+ ${DOC}.ps.gz ${DOC}.ascii.gz [eE]rrs mklog ${CLEANFILES}
cleandir: clean
cd ${.CURDIR}; rm -rf obj
@@ -117,7 +112,7 @@ afterinstall:
.endif
-DISTRIBUTION?= doc
+DISTRIBUTION?= bin
.if !target(distribute)
distribute:
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies
@@ -133,15 +128,8 @@ BINMODE= 444
SRCDIR?= ${.CURDIR}
.if !target(${DFILE})
-${DFILE}:: ${SRCS} ${EXTRA} ${OBJS}
-# XXX ${.ALLSRC} doesn't work unless there are a lot of .PATH.foo statements.
-ALLSRCS= ${SRCS:S;^;${SRCDIR}/;}
-${DFILE}:: ${SRCS}
-.if defined(USE_SOELIMPP)
- ${SOELIMPP} ${ALLSRCS} | ${ROFF} | ${GZIPCMD} > ${.TARGET}
-.else
+${DFILE}: ${SRCS}
(cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) | ${GZIPCMD} > ${.TARGET}
-.endif
.else
.if !defined(NODOCCOMPRESS)
${DFILE}: ${DOC}.${PRINTER}
diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk
index 0300c7df1890..5d3e6deecbf4 100644
--- a/share/mk/bsd.info.mk
+++ b/share/mk/bsd.info.mk
@@ -3,7 +3,7 @@
BINMODE= 444
BINDIR?= /usr/share/info
MAKEINFO?= makeinfo
-MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression
+MAKEINFOFLAGS?= --no-split # simplify some things, e.g., compression
.MAIN: all
@@ -66,7 +66,7 @@ obj:
.endif
clean:
- rm -f ${INFO:S/$/.info*/g} Errs errs mklog ${CLEANFILES}
+ rm -f ${INFO:S/$/.info*/g} [eE]rrs mklog ${CLEANFILES}
cleandir: clean
cd ${.CURDIR}; rm -rf obj
diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk
index 4591d0a3a156..80771b9b1783 100644
--- a/share/mk/bsd.kmod.mk
+++ b/share/mk/bsd.kmod.mk
@@ -1,84 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
# $Id: bsd.kmod.mk,v 1.11.4.1 1996/04/03 12:10:28 phk Exp $
-#
-# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
-# <bsd.kmod.mk> includes the file named "../Makefile.inc" if it exists,
-# as well as the include file <bsd.obj.mk>, <bsd.dep.mk>, and
-# may be <bsd.man.mk>
-#
-#
-# +++ variables +++
-#
-# CLEANFILES Additional files to remove for the clean and cleandir targets.
-#
-# DISTRIBUTION Name of distribution. [bin]
-#
-# EXPORT_SYMS ???
-#
-# KERN Main Kernel source directory. [${.CURDIR}/../../sys/kern]
-#
-# KMOD The name of the loadable kernel module to build.
-#
-# KMODDIR Base path for loadable kernel modules
-# (see lkm(4)). [/lkm]
-#
-# KMODOWN LKM owner. [${BINOWN}]
-#
-# KMODGRP LKM group. [${BINGRP}]
-#
-# KMODMODE LKM mode. [${BINMODE}]
-#
-# LINKS The list of LKM links; should be full pathnames, the
-# linked-to file coming first, followed by the linked
-# file. The files are hard-linked. For example, to link
-# /lkm/master and /lkm/meister, use:
-#
-# LINKS= /lkm/master /lkm/meister
-#
-# LN_FLAGS Flags for ln(1) (see variable LINKS)
-#
-# NOMAN LKM does not have a manual page if set.
-#
-# PROG The name of the loadable kernel module to build.
-# If not supplied, ${KMOD} is used.
-#
-# PSEUDO_LKM ???
-#
-# SRCS List of source files
-#
-# SUBDIR A list of subdirectories that should be built as well.
-# Each of the targets will execute the same target in the
-# subdirectories.
-#
-# DESTDIR, DISTDIR are set by other Makefiles (e.g. bsd.own.mk)
-#
-#
-# +++ targets +++
-#
-# distribute:
-# This is a variant of install, which will
-# put the stuff into the right "distribution".
-#
-# install:
-# install the program and its manual pages; if the Makefile
-# does not itself define the target install, the targets
-# beforeinstall and afterinstall may also be used to cause
-# actions immediately before and after the install target
-# is executed.
-#
-# load:
-# Load LKM.
-#
-# tags:
-# Create a tags file for the source files.
-#
-# unload:
-# Unload LKM.
-#
-# bsd.obj.mk: clean, cleandir and obj
-# bsd.dep.mk: depend
-# bsd.man.mk: maninstall
-#
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
@@ -91,14 +12,12 @@
# ${.CURDIR}/../../sys. We don't bother adding a .PATH since nothing
# actually lives in /sys directly.
#
-CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
- -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
- -Winline
+CWARNFLAGS?= -W -Wcomment -Wredundant-decls
+CFLAGS+=${COPTS} -DKERNEL -I${.CURDIR}/../../sys ${CWARNFLAGS}
-CFLAGS+=${COPTS} -DKERNEL -DACTUALLY_LKM_NOT_KERNEL -I${.CURDIR}/../../sys \
- ${CWARNFLAGS}
-
-EXPORT_SYMS?= _${KMOD}
+KMODGRP?= bin
+KMODOWN?= bin
+KMODMODE?= 555
.if defined(VFS_LKM)
CFLAGS+= -DVFS_LKM -DMODVNOPS=${KMOD}vnops -I.
@@ -118,26 +37,14 @@ PROG= ${KMOD}.o
.endif
${PROG}: ${DPSRCS} ${OBJS} ${DPADD}
- ${LD} -r ${LDFLAGS} -o tmp.o ${OBJS}
-.if defined(EXPORT_SYMS)
- @rm -f symb.tmp
- @for i in ${EXPORT_SYMS} ; do echo $$i >> symb.tmp ; done
- symorder -c symb.tmp tmp.o
- @rm -f symb.tmp
-.endif
- mv tmp.o ${.TARGET}
+ ${LD} -r ${LDFLAGS} -o ${.TARGET} ${OBJS}
-.if !defined(NOMAN)
-.include <bsd.man.mk>
-.if !defined(_MANPAGES) || empty(_MANPAGES)
+.if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
+ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
+ !defined(MAN7) && !defined(MAN8) && !defined(NOMAN)
MAN1= ${KMOD}.4
.endif
-.elif !target(maninstall)
-maninstall:
-all-man:
-.endif
-
_PROGSUBDIR: .USE
.if defined(SUBDIR) && !empty(SUBDIR)
@for entry in ${SUBDIR}; do \
@@ -152,9 +59,19 @@ _PROGSUBDIR: .USE
.endif
.MAIN: all
-all: ${PROG} all-man _PROGSUBDIR
+all: ${PROG} _PROGSUBDIR
-CLEANFILES+=${PROG} ${OBJS}
+.if !target(clean)
+clean: _PROGSUBDIR
+ rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES}
+.endif
+
+.if !target(cleandir)
+cleandir: _PROGSUBDIR
+ rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES}
+ rm -f ${.CURDIR}/tags .depend
+ cd ${.CURDIR}; rm -rf obj;
+.endif
.if !target(install)
.if !target(beforeinstall)
@@ -165,8 +82,8 @@ afterinstall:
.endif
realinstall: _PROGSUBDIR
- ${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
- ${INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
@@ -195,6 +112,22 @@ distribute:
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies
.endif
+.if !target(obj)
+.if defined(NOOBJ)
+obj: _PROGSUBDIR
+.else
+obj: _PROGSUBDIR
+ @cd ${.CURDIR}; rm -rf obj; \
+ here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
+ ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \
+ if test -d /usr/obj -a ! -d $$dest; then \
+ mkdir -p $$dest; \
+ else \
+ true; \
+ fi;
+.endif
+.endif
+
.if !target(tags)
tags: ${SRCS} _PROGSUBDIR
.if defined(PROG)
@@ -203,6 +136,11 @@ tags: ${SRCS} _PROGSUBDIR
.endif
.endif
+.if !defined(NOMAN)
+.include <bsd.man.mk>
+.elif !target(maninstall)
+maninstall:
+.endif
.if !target(load)
load: ${PROG}
@@ -222,7 +160,4 @@ vnode_if.h: ${KERN}/vnode_if.sh ${KERN}/vnode_if.src
./vnode_if.h: vnode_if.h
_DEPSUBDIR= _PROGSUBDIR
-_SUBDIRUSE: _PROGSUBDIR
-.include <bsd.obj.mk>
.include <bsd.dep.mk>
-
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index c0f4c9f23fed..e5c17202bb97 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
-# $Id: bsd.lib.mk,v 1.24.4.2 1996/05/29 22:38:30 jkh Exp $
+# $Id: bsd.lib.mk,v 1.24.4.1 1995/08/27 03:12:58 davidg Exp $
#
.if exists(${.CURDIR}/../Makefile.inc)
@@ -20,10 +20,23 @@ CXXINCLUDES+= -I${DESTDIR}/usr/include/${CXX}
CFLAGS+= ${DEBUG_FLAGS}
.endif
+RANTOUCH?= ${RANLIB} -t
+
+LIBDIR?= /usr/lib
+LINTLIBDIR?= /usr/libdata/lint
+LIBGRP?= bin
+LIBOWN?= bin
+LIBMODE?= 444
+SHLIBDIR?= ${LIBDIR}
+
.if !defined(DEBUG_FLAGS)
STRIP?= -s
.endif
+BINGRP?= bin
+BINOWN?= bin
+BINMODE?= 555
+
.MAIN: all
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
@@ -33,66 +46,66 @@ STRIP?= -s
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.c.po:
${CC} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
.c.so:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
-.cc.o .C.o .cxx.o:
+.cc.o .cxx.o .C.o:
${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
-.cc.po .C.po .cxx.po:
+.cc.po .C.po .cxx.o:
${CXX} -p ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
-.cc.so .C.so .cxx.so:
+.cc.so .C.so:
${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.f.o:
${FC} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.f.po:
${FC} -p ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
.f.so:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.s.o:
${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
${AS} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.s.po:
${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
${AS} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
.s.so:
${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
${AS} -k -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.S.o:
${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
@@ -105,18 +118,18 @@ STRIP?= -s
.S.so:
${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
${AS} -k -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
.m.po:
${CC} ${CFLAGS} -p -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
.m.o:
${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
.if !defined(INTERNALLIB) || defined(INTERNALSTATICLIB)
.if !defined(NOPROFILE) && !defined(INTERNALLIB)
@@ -152,7 +165,7 @@ _LIBSUBDIR: .USE
done
.endif
-all: ${_LIBS} all-man _LIBSUBDIR # llib-l${LIB}.ln
+all: ${_LIBS} _LIBSUBDIR # llib-l${LIB}.ln
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
@@ -184,7 +197,7 @@ SOBJS+= ${OBJS:.o=.so}
lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS}
@${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
@rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
- @${LD} -Bshareable -x \
+ @${LD} -Bshareable \
-o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
`lorder ${SOBJS} | tsort` ${LDDESTDIR} ${LDADD}
@@ -238,9 +251,11 @@ realinstall: beforeinstall
.if !defined(INTERNALLIB)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR}
+ ${RANTOUCH} ${DESTDIR}${LIBDIR}/lib${LIB}.a
.if !defined(NOPROFILE)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
+ ${RANTOUCH} ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.endif
.endif
.if !defined(NOPIC)
@@ -253,6 +268,7 @@ realinstall: beforeinstall
.if defined(INSTALL_PIC_ARCHIVE)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
+ ${RANTOUCH} ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.endif
.endif
.if defined(LINKS) && !empty(LINKS)
@@ -296,7 +312,6 @@ tags: ${SRCS}
.include <bsd.man.mk>
.elif !target(maninstall)
maninstall:
-all-man:
.endif
.if !target(obj)
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index e48afa95e3c3..78a070408de6 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -1,123 +1,101 @@
-# $Id: bsd.man.mk,v 1.12 1996/05/25 23:09:48 wosch Exp $
-#
-# The include file <bsd.man.mk> handles installing manual pages and
-# their links. <bsd.man.mk> includes the file named "../Makefile.inc"
-# if it exists.
-#
-#
-# +++ variables +++
-#
-# DESTDIR Change the tree where the man pages gets installed. [not set]
-#
-# MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
-#
-# MANOWN Manual owner. [${SHAREOWN}]
-#
-# MANGRP Manual group. [${SHAREGRP}]
-#
-# MANMODE Manual mode. [${NOBINMODE}]
-#
-# MANSUBDIR Subdirectory under the manual page section, i.e. "/i386"
-# or "/tahoe" for machine specific manual pages.
-#
-# MAN${sect} The manual pages to be installed. For sections see
-# variable ${SECTIONS}
-#
-# _MANPAGES List of all man pages to be installed.
-# (``_MANPAGES=$MAN1 $MAN2 ... $MANn'')
-#
-# MCOMPRESS Program to compress man pages. Output is to
-# stdout. [gzip -c]
-#
-# MLINKS List of manual page links (using a suffix). The
-# linked-to file must come first, the linked file
-# second, and there may be multiple pairs. The files
-# are hard-linked.
-#
-# NOMANCOMPRESS If you do not want unformatted manual pages to be
-# compressed when they are installed. [not set]
-#
-#
-# +++ targets +++
-#
-# maninstall:
-# Install the manual pages and their links.
-#
-
+# from: @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+# $Id: bsd.man.mk,v 1.4 1994/12/28 03:50:51 ache Exp $
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
+MANGRP?= bin
+MANOWN?= bin
+MANMODE?= 444
+
+MANDIR?= /usr/share/man/man
MANSRC?= ${.CURDIR}
-MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
-MCOMPRESS= gzip -c
+MCOMPRESS= gzip -f
+BASENAME= basename
ZEXTENSION= .gz
-
-SECTIONS= 1 2 3 3f 4 5 6 7 8 9
-
-.undef _MANPAGES
-.for sect in ${SECTIONS}
-.if defined(MAN${sect}) && !empty(MAN${sect})
-.SUFFIXES: .${sect}
-.PATH.${sect}: ${MANSRC}
-_MANPAGES+= ${MAN${sect}}
-.endif
-.endfor
-
-all-man: ${MANDEPEND}
-
-.if defined(NOMANCOMPRESS)
-
-COPY= -c
-ZEXT=
-
+.if !defined(NOMANCOMPRESS)
+ZEXT= ${ZEXTENSION}
.else
+ZEXT=
+.endif
-ZEXT= ${ZEXTENSION}
+MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN3F} ${MAN4} ${MAN5} \
+ ${MAN6} ${MAN7} ${MAN8}
-.for sect in ${SECTIONS}
-.if defined(MAN${sect}) && !empty(MAN${sect})
-CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g}
-.for page in ${MAN${sect}}
-.for target in ${page:T:S/$/${ZEXTENSION}/}
-all-man: ${target}
-${target}: ${page}
- ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
-.endfor
-.endfor
+maninstall: ${MANDEPEND}
+.if defined(MAN1) && !empty(MAN1)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN1} ${DESTDIR}${MANDIR}1${MANSUBDIR})
.endif
-.endfor
-
+.if defined(MAN2) && !empty(MAN2)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN2} ${DESTDIR}${MANDIR}2${MANSUBDIR})
+.endif
+.if defined(MAN3) && !empty(MAN3)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN3} ${DESTDIR}${MANDIR}3${MANSUBDIR})
+.endif
+.if defined(MAN3F) && !empty(MAN3F)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN3F} ${DESTDIR}${MANDIR}3f${MANSUBDIR})
+.endif
+.if defined(MAN4) && !empty(MAN4)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN4} ${DESTDIR}${MANDIR}4${MANSUBDIR})
+.endif
+.if defined(MAN5) && !empty(MAN5)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN5} ${DESTDIR}${MANDIR}5${MANSUBDIR})
+.endif
+.if defined(MAN6) && !empty(MAN6)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN6} ${DESTDIR}${MANDIR}6${MANSUBDIR})
+.endif
+.if defined(MAN7) && !empty(MAN7)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN7} ${DESTDIR}${MANDIR}7${MANSUBDIR})
+.endif
+.if defined(MAN8) && !empty(MAN8)
+ (cd ${MANSRC}; ${MINSTALL} ${MAN8} ${DESTDIR}${MANDIR}8${MANSUBDIR})
.endif
-maninstall::
-.for sect in ${SECTIONS}
-.if defined(MAN${sect}) && !empty(MAN${sect})
-maninstall:: ${MAN${sect}}
-.if defined(NOMANCOMPRESS)
- ${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
+# by default all pages are compressed
+# we don't handle .so's yet
+.if !empty(MANALL:S/ //g)
+.if !defined(NOMANCOMPRESS)
+ @set ${MANALL} ; \
+ while test $$# -ge 1; do \
+ name=`${BASENAME} $$1`; \
+ sect=`expr $$name : '.*\.\([^.]*\)'`; \
+ ${ECHO} "compressing in" \
+ "${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}:" \
+ "$$name -> $${name}${ZEXT}"; \
+ ${MCOMPRESS} ${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name ; \
+ shift ; \
+ done ; true
.else
- ${MINSTALL} ${.ALLSRC:T:S/$/${ZEXTENSION}/g} \
- ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
+# we are installing uncompressed pages, so nuke any compressed pages
+ @set ${MANALL} ; \
+ while test $$# -ge 1; do \
+ name=`${BASENAME} $$1`; \
+ sect=`expr $$name : '.*\.\([^.]*\)'`; \
+ rm -f ${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name${ZEXTENSION};\
+ shift ; \
+ done ; true
.endif
.endif
-.endfor
.if defined(MLINKS) && !empty(MLINKS)
- @set `echo ${MLINKS} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \
- while : ; do \
- case $$# in \
- 0) break;; \
- [123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
- esac; \
- name=$$1; shift; sect=$$1; shift; \
- l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
- name=$$1; shift; sect=$$1; shift; \
- t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ sect=`expr $$name : '.*\.\([^.]*\)'`; \
+ dir=${DESTDIR}${MANDIR}$$sect; \
+ l=$${dir}${MANSUBDIR}/$$name; \
+ name=$$1; \
+ shift; \
+ sect=`expr $$name : '.*\.\([^.]*\)'`; \
+ dir=${DESTDIR}${MANDIR}$$sect; \
+ t=$${dir}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
- rm -f $${t} $${t}${ZEXTENSION}; \
+ rm -f $${t}${ZEXTENSION}; \
+ rm -f $${t}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
- done
+ done; true
.endif
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index d8ba4ba17207..69a0f4be2318 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,174 +1,16 @@
# $Id: bsd.own.mk,v 1.2 1994/09/16 14:30:21 jkh Exp $
-#
-# The include file <bsd.own.mk> set common variables for owner,
-# group, mode, and directories. Defaults are in brackets.
-#
-#
-# +++ variables +++
-#
-# where the system object and source trees are kept; can be configurable
-# by the user in case they want them in ~/foosrc and ~/fooobj, for example
-# where the system object and source trees are kept; can be configurable
-# by the user in case they want them in ~/foosrc and ~/fooobj, for example
-# BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
-# will work correctly. [/usr/obj]
-#
-# BSDSRCDIR The real path to the system sources, so that 'make obj'
-# will work correctly. [/usr/src]
-#
-# DESTDIR Change the tree where the file gets installed. [not set]
-#
-# DISTDIR Change the tree where the file for a distribution
-# gets installed (see /usr/src/release/Makefile). [not set]
-#
-#
-# COPY The flag passed to the install program to cause the binary
-# to be copied rather than moved. This is to be used when
-# building our own install script so that the entire system
-# can either be installed with copies, or with moves using
-# a single knob. [-c]
-#
-# STRIP The flag passed to the install program to cause the binary
-# to be stripped. This is to be used when building your
-# own install script so that the entire system can be made
-# stripped/not-stripped using a single knob. [-s]
-#
-#
-#
-# BINOWN Binary owner. [bin]
-#
-# BINGRP Binary group. [bin]
-#
-# BINMODE Binary mode. [555]
-#
-# NOBINMODE Mode for non-executable files. [444]
-#
-#
-# LIBDIR Base path for libraries. [/usr/lib]
-#
-# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint]
-#
-# SHLIBDIR Base path for shared libraries. [${LIBDIR}]
-#
-# LIBOWN Library mode. [${BINOWN}]
-#
-# LIBGRP Library group. [${BINGRP}]
-#
-# LIBMODE Library mode. [${NOBINMODE}]
-#
-#
-# KMODDIR Base path for loadable kernel modules
-# (see lkm(4)). [/lkm]
-#
-# KMODOWN LKM owner. [${BINOWN}]
-#
-# KMODGRP LKM group. [${BINGRP}]
-#
-# KMODMODE LKM mode. [${BINMODE}]
-#
-#
-# SHAREDIR Base path for architecture-independent ascii
-# text files. [/usr/share]
-#
-# SHAREOWN ASCII text file owner. [bin]
-#
-# SHAREGRP ASCII text file group. [bin]
-#
-# SHAREMODE ASCII text file mode. [${NOBINMODE}]
-#
-#
-# DOCDIR Base path for system documentation (e.g. PSD, USD,
-# handbook, FAQ etc.). [${SHAREDIR}/doc]
-#
-# DOCOWN Documentation owner. [${SHAREOWN}]
-#
-# DOCGRP Documentation group. [${SHAREGRP}]
-#
-# DOCMODE Documentation mode. [${NOBINMODE}]
-#
-#
-# INFODIR Base path for GNU's hypertext system
-# called Info (see info(1)). [${SHAREDIR}/info]
-#
-# INFOOWN Info owner. [${SHAREOWN}]
-#
-# INFOGRP Info group. [${SHAREGRP}]
-#
-# INFOMODE Info mode. [${NOBINMODE}]
-#
-#
-# MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
-#
-# MANOWN Manual owner. [${SHAREOWN}]
-#
-# MANGRP Manual group. [${SHAREGRP}]
-#
-# MANMODE Manual mode. [${NOBINMODE}]
-#
-#
-# NLSDIR Base path for National Language Support files
-# installation (see mklocale(1)). [${SHAREDIR}/nls]
-#
-# NLSGRP National Language Support files group. [${SHAREOWN}]
-#
-# NLSOWN National Language Support files owner. [${SHAREGRP}]
-#
-# NLSMODE National Language Support files mode. [${NONBINMODE}]
-#
-
-BSDSRCDIR?= /usr/src
-BSDOBJDIR?= /usr/obj
-
-
-# Binaries
-BINOWN?= bin
BINGRP?= bin
+BINOWN?= bin
BINMODE?= 555
-NOBINMODE?= 444
-
-LIBDIR?= /usr/lib
-LINTLIBDIR?= /usr/libdata/lint
-SHLIBDIR?= ${LIBDIR}
-LIBOWN?= ${BINOWN}
-LIBGRP?= ${BINGRP}
-LIBMODE?= ${NOBINMODE}
-
-KMODDIR?= /lkm
-KMODOWN?= ${BINOWN}
-KMODGRP?= ${BINGRP}
-KMODMODE?= ${BINMODE}
-
-# Share files
-SHAREDIR?= /usr/share
-SHAREOWN?= bin
-SHAREGRP?= bin
-SHAREMODE?= ${NOBINMODE}
-
-MANDIR?= ${SHAREDIR}/man/man
-MANOWN?= ${SHAREOWN}
-MANGRP?= ${SHAREGRP}
-MANMODE?= ${NOBINMODE}
-
-DOCDIR?= ${SHAREDIR}/doc
-DOCOWN?= ${SHAREOWN}
-DOCGRP?= ${SHAREGRP}
-DOCMODE?= ${NOBINMODE}
-
-INFODIR?= ${SHAREDIR}/info
-INFOOWN?= ${SHAREOWN}
-INFOGRP?= ${SHAREGRP}
-INFOMODE?= ${NOBINMODE}
-
-NLSDIR?= ${SHAREDIR}/nls
-NLSGRP?= ${SHAREOWN}
-NLSOWN?= ${SHAREGRP}
-NLSMODE?= ${NONBINMODE}
-
-# Common variables
.if !defined(DEBUG_FLAGS)
STRIP?= -s
.endif
COPY?= -c
+
+MANDIR?= /usr/share/man/man
+MANGRP?= bin
+MANOWN?= bin
+MANMODE?= 444
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index 84cae1629f26..58f2339d21d4 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -14,14 +14,14 @@
#
# PORTSDIR - The root of the ports tree (default: /usr/ports).
# DISTDIR - Where to get gzip'd, tarballed copies of original sources
-# (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}).
+# (default: ${PORTSDIR}/distfiles).
# PREFIX - Where to install things in general (default: /usr/local).
# MASTER_SITES - Primary location(s) for distribution files if not found
# locally (default:
-# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/)
-# PATCH_SITES - Primary location(s) for distribution patch files
+# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles)
+# PATCH_SITES - Primary location(s) for distributed patch files
# (see PATCHFILES below) if not found locally (default:
-# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/)
+# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles)
#
# MASTER_SITE_OVERRIDE - If set, override the MASTER_SITES setting with this
# value.
@@ -35,6 +35,8 @@
# (default: ports@FreeBSD.ORG).
# CATEGORIES - A list of descriptive categories into which this port falls
# (default: orphans).
+# KEYWORDS - A list of descriptive keywords that might index well for this
+# port (default: orphans).
#
# Variables that typically apply to an individual port. Non-Boolean
# variables without defaults are *mandatory*.
@@ -47,16 +49,14 @@
# NO_WRKSUBDIR is set, in which case simply ${WRKDIR}).
# DISTNAME - Name of port or distribution.
# DISTFILES - Name(s) of archive file(s) containing distribution
-# (default: ${DISTNAME}${EXTRACT_SUFX}).
-# PATCHFILES - Name(s) of additional files that contain distribution
+# (default: ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}).
+# PATCHFILES - Name(s) of additional files that contain distributed
# patches (default: none). make will look for them at
# PATCH_SITES (see above). They will automatically be
# uncompressed before patching if the names end with
# ".gz" or ".Z".
-# DIST_SUBDIR - Suffix to ${DISTDIR} (see above). If set, all ${DISTFILES}
-# and ${PATCHFILES} will be put in this subdirectory of
-# ${DISTDIR}. Also they will be fetched in this subdirectory
-# from FreeBSD mirror sites.
+# PATCH_PRFX - Filename prefix for distribution patches (default: none)
+# typically ${DISTNAME}/ or foo-
# PKGNAME - Name of the package file to create if the DISTNAME
# isn't really relevant for the port/package
# (default: ${DISTNAME}).
@@ -83,13 +83,10 @@
# NO_BUILD - Use a dummy (do-nothing) build target.
# NO_PACKAGE - Use a dummy (do-nothing) package target.
# NO_INSTALL - Use a dummy (do-nothing) install target.
-# NO_CDROM - Use dummy (do-nothing) targets if FOR_CDROM is set.
# NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
# NO_WRKDIR - There's no work directory at all; port does this someplace
# else.
# NO_DEPENDS - Don't verify build of dependencies.
-# BROKEN - Port is broken.
-# RESTRICTED - Port is restricted. Set this string to the reason why.
# USE_GMAKE - Says that the port uses gmake.
# USE_IMAKE - Says that the port uses imake.
# USE_X11 - Says that the port uses X11.
@@ -98,9 +95,8 @@
# HAS_CONFIGURE - Says that the port has its own configure script.
# GNU_CONFIGURE - Set if you are using GNU configure (optional).
# CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'.
-# CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set.
-# CONFIGURE_ENV - Pass these env (shell-like) to configure if
-# ${HAS_CONFIGURE} is set.
+# CONFIGURE_ARGS - Pass these args to configure, if ${HAS_CONFIGURE} set.
+# CONFIGURE_ENV - Pass these env (shell-like) to configure, if ${HAS_CONFIGURE} set.
# IS_INTERACTIVE - Set this if your port needs to interact with the user
# during a build. User can then decide to skip this port by
# setting ${BATCH}, or compiling only the interactive ports
@@ -144,14 +140,6 @@
# NCFTP - Full path to ncftp command if not in $PATH (default: ncftp).
# NCFTPFLAGS - Arguments to ${NCFTP} (default: -N).
#
-# Motif support:
-#
-# REQUIRES_MOTIF - Set this in your port if it requires Motif. It will be
-# built only if HAVE_MOTIF is set.
-# HAVE_MOTIF - If set, means system has Motif. Typically set in
-# /etc/make.conf.
-# MOTIF_STATIC - If set, link libXm statically; otherwise, link it
-# dynamically.
#
# Variables to change if you want a special behavior:
#
@@ -184,8 +172,8 @@
# checkpatch - Do a "patch -C" instead of a "patch". Note that it may
# give incorrect results if multiple patches deal with
# the same file.
-# checksum - Use files/md5 to ensure that your distfiles are valid.
-# makesum - Generate files/md5 (only do this for your own ports!).
+# checksum - Use files/md5 to ensure that your distfiles are valid
+# makesum - Generate files/md5 (only do this for your own ports!)
#
# Default sequence for "all" is: fetch checksum extract patch configure build
#
@@ -205,11 +193,9 @@
# tree we are and thus can't go relative. They can, of course, be overridden
# by individual Makefiles.
PORTSDIR?= ${DESTDIR}/usr/ports
-LOCALBASE?= /usr/local
X11BASE?= /usr/X11R6
-DISTDIR?= ${PORTSDIR}/distfiles/${DIST_SUBDIR}
+DISTDIR?= ${PORTSDIR}/distfiles
PACKAGES?= ${PORTSDIR}/packages
-TEMPLATES?= ${PORTSDIR}/templates
.if !defined(NO_WRKDIR)
WRKDIR?= ${.CURDIR}/work
.else
@@ -227,7 +213,7 @@ PKGDIR?= ${.CURDIR}/pkg
.if defined(USE_IMAKE) || defined(USE_X11)
PREFIX?= ${X11BASE}
.else
-PREFIX?= ${LOCALBASE}
+PREFIX?= /usr/local
.endif
# The following 4 lines should go away as soon as the ports are all updated
.if defined(EXEC_DEPENDS)
@@ -260,10 +246,8 @@ GMAKE?= gmake
XMKMF?= xmkmf -a
MD5?= /sbin/md5
MD5_FILE?= ${FILESDIR}/md5
-
MAKE_FLAGS?= -f
MAKEFILE?= Makefile
-MAKE_ENV?= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"
NCFTP?= /usr/bin/ncftp
NCFTPFLAGS?= -N
@@ -281,10 +265,6 @@ PATCH_DIST_ARGS?= -d ${WRKSRC} -E ${PATCH_DIST_STRIP}
PATCH_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP}
PATCH_DIST_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
.endif
-.if defined(BATCH)
-PATCH_ARGS+= --batch
-PATCH_DIST_ARGS+= --batch
-.endif
.if defined(PATCH_CHECK_ONLY)
PATCH_ARGS+= -C
@@ -328,7 +308,7 @@ PKG_ARGS+= -k ${PKGDIR}/DEINSTALL
.if exists(${PKGDIR}/REQ)
PKG_ARGS+= -r ${PKGDIR}/REQ
.endif
-.if !defined(NO_MTREE) && defined(MTREE_LOCAL)
+.if !defined(USE_X11) && !defined(USE_IMAKE) && defined(MTREE_LOCAL)
PKG_ARGS+= -m ${MTREE_LOCAL}
.endif
.endif
@@ -336,47 +316,32 @@ PKG_SUFX?= .tgz
# where pkg_add records its dirty deeds.
PKG_DBDIR?= /var/db/pkg
-# shared/dynamic motif libs
-.if defined(HAVE_MOTIF)
-.if defined(MOTIF_STATIC)
-MOTIFLIB?= ${X11BASE}/lib/libXm.a
-.else
-MOTIFLIB?= -L${X11BASE}/lib -lXm
-.endif
-.endif
-
-ECHO?= /bin/echo
-CAT+= /bin/cat
-CP?= /bin/cp
-SETENV?= /usr/bin/env
-RM?= /bin/rm
-MKDIR?= /bin/mkdir
-GZCAT?= /usr/bin/gzcat
-BASENAME?= /usr/bin/basename
-SED?= /usr/bin/sed
-CAT?= /bin/cat
-GREP?= /usr/bin/grep
-AWK?= /usr/bin/awk
-
# Used to print all the '===>' style prompts - override this to turn them off.
-ECHO_MSG?= ${ECHO}
+ECHO_MSG?= /bin/echo
ALL_TARGET?= all
INSTALL_TARGET?= install
# If the user has this set, go to the FreeBSD respository for everything.
.if defined(MASTER_SITE_FREEBSD)
-MASTER_SITE_OVERRIDE= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
+MASTER_SITE_OVERRIDE= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/
.endif
# I guess we're in the master distribution business! :) As we gain mirror
# sites for distfiles, add them to this list.
.if !defined(MASTER_SITE_OVERRIDE)
-MASTER_SITES+= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
-PATCH_SITES+= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
+MASTER_SITES+= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/
+PATCH_SITES+= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${PATCH_PRFX}
.else
MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES}
-PATCH_SITES:= ${MASTER_SITE_OVERRIDE} ${PATCH_SITES}
+PATCH_SITES:= ${MASTER_SITE_OVERRIDE}${PATCH_PRFX} ${PATCH_SITES}
+.endif
+
+.if defined(PATCH_PRFX)
+PATCHDIST!= /bin/echo ${PATCH_PRFX} | sed 's|^\(.*\)/$$|/\1|'
+PATCHDIST:= ${DISTDIR}${PATCHDIST}
+.else
+PATCHDIST:= ${DISTDIR}
.endif
# Derived names so that they're easily overridable.
@@ -390,6 +355,7 @@ EXTRACT_ONLY?= ${DISTFILES}
# Documentation
MAINTAINER?= ports@FreeBSD.ORG
CATEGORIES?= orphans
+KEYWORDS+= ${CATEGORIES}
# Note this has to start with a capital letter (or more accurately, it
# shouldn't match "[a-z]*"), see the target "delete-package-links" below.
@@ -411,8 +377,6 @@ HAS_CONFIGURE= yes
.MAIN: all
################################################################
-# Many ways to disable a port.
-#
# If we're in BATCH mode and the port is interactive, or we're
# in interactive mode and the port is non-interactive, skip all
# the important targets. The reason we have two modes is that
@@ -420,27 +384,10 @@ HAS_CONFIGURE= yes
# overnight, then come back in the morning and do _only_ the
# interactive ones that required your intervention.
#
-# Don't attempt to build ports that require Motif if you don't
-# have Motif.
-#
-# Ignore ports that can't be resold if building for a CDROM.
-#
-# Don't build a port if it's restricted and we don't want to get
-# into that.
-#
-# Don't build a port if it's broken.
+# This allows you to do both.
################################################################
-.if (defined(IS_INTERACTIVE) && defined(BATCH)) || \
- (!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) || \
- (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)) || \
- (defined(NO_CDROM) && defined(FOR_CDROM)) || \
- (defined(RESTRICTED) && defined(NO_RESTRICTED)) || \
- defined(BROKEN)
-IGNORE= yes
-.endif
-
-.if defined(IGNORE)
+.if (defined(IS_INTERACTIVE) && defined(BATCH)) || (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
all:
@${DO_NADA}
build:
@@ -455,18 +402,6 @@ package:
@${DO_NADA}
.endif
-.if defined(ALL_HOOK)
-all:
- @${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
- DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
- PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
- FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
- DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \
- RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \
- ${ALL_HOOK}
-
-.endif
-
.if !target(all)
all: build
.endif
@@ -533,11 +468,11 @@ patch: extract
.if !target(do-fetch)
do-fetch:
- @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi
+ @if [ ! -d ${DISTDIR} ]; then /bin/mkdir -p ${DISTDIR}; fi
@(cd ${DISTDIR}; \
for file in ${DISTFILES}; do \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
- if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
+ if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
+ if [ -h $$file -o -h `/usr/bin/basename $$file` ]; then \
${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \
${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
${ECHO_MSG} ">> Please correct this problem and try again."; \
@@ -546,8 +481,8 @@ do-fetch:
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
for site in ${MASTER_SITES}; do \
${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
- (${NCFTP} ${NCFTPFLAGS} $${site}$${file} ${NCFTPTAIL} || true); \
- if [ -f $$file -o -f `${BASENAME} $$file` ]; then \
+ (${NCFTP} ${NCFTPFLAGS} $${site}$${file} || true); \
+ if [ -f $$file -o -f `/usr/bin/basename $$file` ]; then \
continue 2; \
fi \
done; \
@@ -557,12 +492,12 @@ do-fetch:
fi \
done)
.if defined(PATCHFILES)
- @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi
- @(cd ${DISTDIR}; \
+ @if [ ! -d ${PATCHDIST} ]; then /bin/mkdir -p ${PATCHDIST}; fi
+ @(cd ${PATCHDIST}; \
for file in ${PATCHFILES}; do \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
- if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
- ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \
+ if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
+ if [ -h $$file -o -h `/usr/bin/basename $$file` ]; then \
+ ${ECHO_MSG} ">> ${PATCHDIST}/$$file is a broken symlink."; \
${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
${ECHO_MSG} ">> Please correct this problem and try again."; \
exit 1; \
@@ -570,13 +505,13 @@ do-fetch:
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
for site in ${PATCH_SITES}; do \
${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
- (${NCFTP} ${NCFTPFLAGS} $${site}$${file} ${NCFTPTAIL} || true); \
- if [ -f $$file -o -f `${BASENAME} $$file` ]; then \
+ (${NCFTP} ${NCFTPFLAGS} $${site}$${file} || true); \
+ if [ -f $$file -o -f `/usr/bin/basename $$file` ]; then \
continue 2; \
fi \
done; \
${ECHO_MSG} ">> Couldn't fetch it - please try to retreive this";\
- ${ECHO_MSG} ">> port manually into ${DISTDIR} and try again."; \
+ ${ECHO_MSG} ">> port manually into ${PATCHDIST} and try again."; \
exit 1; \
fi \
done)
@@ -587,8 +522,8 @@ do-fetch:
.if !target(do-extract)
do-extract:
- @${RM} -rf ${WRKDIR}
- @${MKDIR} -p ${WRKDIR}
+ @/bin/rm -rf ${WRKDIR}
+ @/bin/mkdir -p ${WRKDIR}
@for file in ${EXTRACT_ONLY}; do \
if ! (cd ${WRKDIR};${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
then \
@@ -602,14 +537,14 @@ do-extract:
.if !target(do-patch)
do-patch:
.if defined(PATCHFILES)
- @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
+ @${ECHO_MSG} "===> Applying distributed patches for ${PKGNAME}"
.if defined(PATCH_DEBUG)
- @(cd ${DISTDIR}; \
+ @(cd ${PATCHDIST}; \
for i in ${PATCHFILES}; do \
- ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
+ ${ECHO_MSG} "===> Applying distributed patch $$i" ; \
case $$i in \
*.Z|*.gz) \
- ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
+ /usr/bin/gzcat $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
;; \
*) \
${PATCH} ${PATCH_DIST_ARGS} < $$i; \
@@ -617,11 +552,11 @@ do-patch:
esac; \
done)
.else
- @(cd ${DISTDIR}; \
+ @(cd ${PATCHDIST}; \
for i in ${PATCHFILES}; do \
case $$i in \
*.Z|*.gz) \
- ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
+ /usr/bin/gzcat $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
;; \
*) \
${PATCH} ${PATCH_DIST_ARGS} < $$i; \
@@ -667,7 +602,7 @@ do-patch:
.if !target(do-configure)
do-configure:
@if [ -f ${SCRIPTDIR}/configure ]; then \
- ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
+ /usr/bin/env CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \
@@ -689,9 +624,9 @@ do-configure:
.if !target(do-build)
do-build:
.if defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
+ @(cd ${WRKSRC}; ${GMAKE} PREFIX=${PREFIX} X11BASE=${X11BASE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
.else defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
+ @(cd ${WRKSRC}; ${MAKE} PREFIX=${PREFIX} X11BASE=${X11BASE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
.endif
.endif
@@ -700,14 +635,14 @@ do-build:
.if !target(do-install)
do-install:
.if defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
+ @(cd ${WRKSRC}; ${GMAKE} PREFIX=${PREFIX} X11BASE=${X11BASE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
+ @(cd ${WRKSRC}; ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
.endif
.else defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
+ @(cd ${WRKSRC}; ${MAKE} PREFIX=${PREFIX} X11BASE=${X11BASE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
+ @(cd ${WRKSRC}; ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
.endif
.endif
.endif
@@ -720,7 +655,7 @@ do-package:
${ECHO_MSG} "===> Building package for ${PKGNAME}"; \
if [ -d ${PACKAGES} ]; then \
if [ ! -d ${PKGREPOSITORY} ]; then \
- if ! ${MKDIR} -p ${PKGREPOSITORY}; then \
+ if ! /bin/mkdir -p ${PKGREPOSITORY}; then \
${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \
exit 1; \
fi; \
@@ -744,7 +679,7 @@ package-links:
@${MAKE} ${.MAKEFLAGS} delete-package-links
@for cat in ${CATEGORIES}; do \
if [ ! -d ${PACKAGES}/$$cat ]; then \
- if ! ${MKDIR} -p ${PACKAGES}/$$cat; then \
+ if ! /bin/mkdir -p ${PACKAGES}/$$cat; then \
${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \
exit 1; \
fi; \
@@ -755,13 +690,13 @@ package-links:
.if !target(delete-package-links)
delete-package-links:
- @${RM} -f ${PACKAGES}/[a-z]*/${PKGNAME}${PKG_SUFX};
+ @/bin/rm -f ${PACKAGES}/[a-z]*/${PKGNAME}${PKG_SUFX};
.endif
.if !target(delete-package)
delete-package:
@${MAKE} ${.MAKEFLAGS} delete-package-links
- @${RM} -f ${PKGFILE}
+ @/bin/rm -f ${PKGFILE}
.endif
################################################################
@@ -791,7 +726,7 @@ _PORT_USE: .USE
.endif
@${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
- ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
+ /usr/bin/env CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \
@@ -800,7 +735,7 @@ _PORT_USE: .USE
@${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
@${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
- ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
+ /usr/bin/env CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \
@@ -915,8 +850,8 @@ checkpatch:
reinstall: pre-reinstall install
pre-reinstall:
- @${RM} -f ${INSTALL_COOKIE}
- @${RM} -f ${PACKAGE_COOKIE}
+ @/bin/rm -f ${INSTALL_COOKIE}
+ @/bin/rm -f ${PACKAGE_COOKIE}
.endif
################################################################
@@ -933,12 +868,12 @@ pre-clean:
.if !target(clean)
clean: pre-clean
@${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
- @${RM} -f ${EXTRACT_COOKIE} ${CONFIGURE_COOKIE} ${INSTALL_COOKIE} \
+ @/bin/rm -f ${EXTRACT_COOKIE} ${CONFIGURE_COOKIE} ${INSTALL_COOKIE} \
${BUILD_COOKIE} ${PATCH_COOKIE}
.if defined(NO_WRKDIR)
- @${RM} -f ${WRKDIR}/.*_done
+ @/bin/rm -f ${WRKDIR}/.*_done
.else
- @${RM} -rf ${WRKDIR}
+ @/bin/rm -rf ${WRKDIR}
.endif
.endif
@@ -946,26 +881,26 @@ clean: pre-clean
.if !target(fetch-list)
fetch-list:
- @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi
+ @if [ ! -d ${DISTDIR} ]; then /bin/mkdir -p ${DISTDIR}; fi
@(cd ${DISTDIR}; \
for file in ${DISTFILES}; do \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+ if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
for site in ${MASTER_SITES}; do \
- ${ECHO} -n ${NCFTP} ${NCFTPFLAGS} $${site}$${file} "${NCFTPTAIL}" '||' ; \
+ /bin/echo -n ${NCFTP} ${NCFTPFLAGS} $${site}$${file} '||' ; \
break; \
done; \
- ${ECHO} "echo $${file} not fetched" ; \
+ /bin/echo "echo $${file} not fetched" ; \
fi \
done)
.if defined(PATCHFILES)
@(cd ${DISTDIR}; \
for file in ${PATCHFILES}; do \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+ if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
for site in ${PATCH_SITES}; do \
- ${ECHO} -n ${NCFTP} ${NCFTPFLAGS} $${site}$${file} "${NCFTPTAIL}" '||' ; \
+ /bin/echo -n ${NCFTP} ${NCFTPFLAGS} $${site}$${file} ${PATCH_PRFX}$${file} '||' ; \
break; \
done; \
- ${ECHO} "echo $${file} not fetched" ; \
+ /bin/echo "echo $${file} not fetched" ; \
fi \
done)
.endif
@@ -975,10 +910,10 @@ fetch-list:
.if !target(makesum)
makesum: fetch
- @if [ ! -d ${FILESDIR} ]; then ${MKDIR} -p ${FILESDIR}; fi
- @if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi
+ @if [ ! -d ${FILESDIR} ]; then /bin/mkdir -p ${FILESDIR}; fi
+ @if [ -f ${MD5_FILE} ]; then /bin/rm -f ${MD5_FILE}; fi
@(cd ${DISTDIR}; \
- for file in ${DISTFILES} ${PATCHFILES}; do \
+ for file in ${DISTFILES} ${PATCHFILES:S|^|${PATCH_PRFX}|}; do \
${MD5} $$file >> ${MD5_FILE}; \
done)
.endif
@@ -989,9 +924,9 @@ checksum: fetch
${ECHO_MSG} ">> No MD5 checksum file."; \
else \
(cd ${DISTDIR}; OK=""; \
- for file in ${DISTFILES} ${PATCHFILES}; do \
- CKSUM=`${MD5} $$file | ${AWK} '{print $$4}'`; \
- CKSUM2=`${GREP} "($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
+ for file in ${DISTFILES} ${PATCHFILES:S|^|${PATCH_PRFX}|}; do \
+ CKSUM=`${MD5} $$file | awk '{print $$4}'`; \
+ CKSUM2=`grep "($$file)" ${MD5_FILE} | awk '{print $$4}'`; \
if [ "$$CKSUM2" = "" ]; then \
${ECHO_MSG} ">> No checksum recorded for $$file"; \
OK="false"; \
@@ -1017,7 +952,9 @@ checksum: fetch
.if !target(package-name)
package-name:
- @${ECHO} ${PKGNAME}
+.if !defined(NO_PACKAGE)
+ @/bin/echo ${PKGNAME}
+.endif
.endif
# Show (recursively) all the packages this package depends on.
@@ -1025,7 +962,7 @@ package-name:
.if !target(package-depends)
package-depends:
@for i in ${RUN_DEPENDS} ${LIB_DEPENDS} ${DEPENDS}; do \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
+ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
(cd $$dir ; ${MAKE} package-name package-depends); \
done
.endif
@@ -1036,7 +973,7 @@ package-depends:
repackage: pre-repackage package
pre-repackage:
- @${RM} -f ${PACKAGE_COOKIE}
+ @/bin/rm -f ${PACKAGE_COOKIE}
.endif
# Build a package but don't check the cookie for installation, also don't
@@ -1074,36 +1011,18 @@ _DEPENDS_USE: .USE
.if defined(NO_DEPENDS)
# Just print out messages
@for i in ${DEPENDS_TMP}; do \
- prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
- if expr "$$prog" : \\/ >/dev/null; then \
- ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog ($$dir)"; \
- else \
- ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog ($$dir)"; \
- fi; \
+ prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
+ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
+ ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog ($$dir)"; \
done
.else
@for i in ${DEPENDS_TMP}; do \
- prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
- if expr "$$prog" : \\/ >/dev/null; then \
- if [ -e "$$prog" ]; then \
- ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
- notfound=0; \
- else \
- ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
- notfound=1; \
- fi; \
+ prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
+ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
+ if which -s "$$prog"; then \
+ ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
else \
- if which -s "$$prog"; then \
- ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
- notfound=0; \
- else \
- ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
- notfound=1; \
- fi; \
- fi; \
- if [ $$notfound != 0 ]; then \
+ ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
${ECHO_MSG} "===> Verifying build for $$prog in $$dir"; \
if [ ! -d "$$dir" ]; then \
${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \
@@ -1127,15 +1046,15 @@ lib-depends:
.if defined(NO_DEPENDS)
# Just print out messages
@for i in ${LIB_DEPENDS}; do \
- lib=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
+ lib=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
+ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib ($$dir)"; \
done
.else
@for i in ${LIB_DEPENDS}; do \
- lib=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
- if /sbin/ldconfig -r | ${GREP} -q -e "-l$$lib"; then \
+ lib=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
+ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
+ if /sbin/ldconfig -r | grep -q -e "-l$$lib"; then \
${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - found"; \
else \
${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - not found"; \
@@ -1173,14 +1092,6 @@ misc-depends:
.endif
-.if !target(depends-list)
-depends-list:
- @for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${DEPENDS}; do \
- dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
- (cd $$dir ; ${MAKE} package-name depends-list); \
- done
-.endif
-
################################################################
# Everything after here are internal targets and really
# shouldn't be touched by anybody but the release engineers.
@@ -1190,67 +1101,24 @@ depends-list:
# a large index. Format is:
#
# distribution-name|port-path|installation-prefix|comment| \
-# description-file|maintainer|categories|build deps|run deps
+# description-file|maintainer|categories|keywords
#
.if !target(describe)
describe:
- @${ECHO} -n "${PKGNAME}|${.CURDIR}/${PKGNAME}|"
- @${ECHO} -n "${PREFIX}|"
+ @/bin/echo -n "${PKGNAME}|${.CURDIR}/${PKGNAME}|"
+ @/bin/echo -n "${PREFIX}|"
@if [ -f ${PKGDIR}/COMMENT ]; then \
- ${ECHO} -n "`${CAT} ${PKGDIR}/COMMENT`"; \
+ /bin/echo -n "`/bin/cat ${PKGDIR}/COMMENT`"; \
else \
- ${ECHO} -n "** No Description"; \
+ /bin/echo -n "** No Description"; \
fi
@if [ -f ${PKGDIR}/DESCR ]; then \
- ${ECHO} -n "|${PKGDIR}/DESCR"; \
+ /bin/echo -n "|${PKGDIR}/DESCR"; \
else \
- ${ECHO} -n "|/dev/null"; \
+ /bin/echo -n "|/dev/null"; \
fi
- @${ECHO} -n "|${MAINTAINER}|${CATEGORIES}|"
- @${ECHO} -n `make depends-list|sort|uniq`
- @${ECHO} -n "|"
- @${ECHO} -n `make package-depends|sort|uniq`
- @${ECHO} ""
-.endif
-
-.if !target(readmes)
-readmes: readme
-.endif
-
-.if !target(readme)
-readme:
- @rm -f README.html
- @make README.html
-.endif
-
-README.html:
- @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
- @${CAT} ${TEMPLATES}/README.port | \
- ${SED} -e 's%%PORT%%'`${ECHO} ${.CURDIR} | ${SED} -e 's.*/\([^/]*/[^/]*\)$$\1'`'g' \
- -e 's%%PKG%%${PKGNAME}g' \
- -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
- -e '/%%COMMENT%%/d' \
- -e 's%%BUILD_DEPENDS%%'"`${MAKE} print-depends-list`"'' \
- -e 's%%RUN_DEPENDS%%'"`${MAKE} print-package-depends`"'' \
- >> $@
-
-.if !target(print-depends-list)
-print-depends-list:
-.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
- defined(LIB_DEPENDS) || defined(DEPENDS)
- @${ECHO} -n 'This port requires package(s) "'
- @${ECHO} -n `make depends-list | sort | uniq`
- @${ECHO} '" to build.'
-.endif
-.endif
-
-.if !target(print-package-depends)
-print-package-depends:
-.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
- @${ECHO} -n 'This port requires package(s) "'
- @${ECHO} -n `make package-depends | sort | uniq`
- @${ECHO} '" to run.'
-.endif
+ @/bin/echo -n "|${MAINTAINER}|${CATEGORIES}|${KEYWORDS}"
+ @/bin/echo ""
.endif
# Fake installation of package so that user can pkg_delete it later.
@@ -1259,30 +1127,30 @@ print-package-depends:
.if !target(fake-pkg)
fake-pkg:
- @if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi
- @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} -p ${PKG_DBDIR}; fi
+ @if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then /bin/echo "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi
+ @if [ ! -d ${PKG_DBDIR} ]; then /bin/rm -f ${PKG_DBDIR}; /bin/mkdir -p ${PKG_DBDIR}; fi
.if defined(FORCE_PKG_REGISTER)
- @${RM} -rf ${PKG_DBDIR}/${PKGNAME}
+ @/bin/rm -rf ${PKG_DBDIR}/${PKGNAME}
.endif
@if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
- ${MKDIR} -p ${PKG_DBDIR}/${PKGNAME}; \
+ /bin/mkdir -p ${PKG_DBDIR}/${PKGNAME}; \
${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
- ${CP} ${PKGDIR}/DESCR ${PKG_DBDIR}/${PKGNAME}/+DESC; \
- ${CP} ${PKGDIR}/COMMENT ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
+ /bin/cp ${PKGDIR}/DESCR ${PKG_DBDIR}/${PKGNAME}/+DESC; \
+ /bin/cp ${PKGDIR}/COMMENT ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
if [ -f ${PKGDIR}/INSTALL ]; then \
- ${CP} ${PKGDIR}/INSTALL ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
+ /bin/cp ${PKGDIR}/INSTALL ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
fi; \
if [ -f ${PKGDIR}/DEINSTALL ]; then \
- ${CP} ${PKGDIR}/DEINSTALL ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
+ /bin/cp ${PKGDIR}/DEINSTALL ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
fi; \
if [ -f ${PKGDIR}/REQ ]; then \
- ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \
+ /bin/cp ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \
fi; \
else \
${ECHO_MSG} "===> ${PKGNAME} is already installed - perhaps an older version?"; \
${ECHO_MSG} " If so, you may wish to \`\`pkg_delete ${PKGNAME}'' and install"; \
- ${ECHO_MSG} " this port again by \`\`make reinstall'' to upgrade it properly."; \
+ ${ECHO_MSG} " this port again to upgrade it properly."; \
fi
.endif
diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk
index ab920b063f56..486f2da95429 100644
--- a/share/mk/bsd.port.subdir.mk
+++ b/share/mk/bsd.port.subdir.mk
@@ -7,6 +7,9 @@
STRIP?= -s
.endif
+BINGRP?= bin
+BINOWN?= bin
+BINMODE?= 555
ECHO_MSG?= echo
@@ -42,12 +45,49 @@ ${SUBDIR}::
fi; \
${MAKE} all
-.for __target in all fetch fetch-list package extract configure \
- build clean depend describe reinstall tags checksum
-.if !target(__target)
-${__target}: _SUBDIRUSE
+.if !target(all)
+all: _SUBDIRUSE
+.endif
+
+.if !target(fetch)
+fetch: _SUBDIRUSE
+.endif
+
+.if !target(fetch-list)
+fetch-list: _SUBDIRUSE
+.endif
+
+.if !target(package)
+package: _SUBDIRUSE
+.endif
+
+.if !target(extract)
+extract: _SUBDIRUSE
+.endif
+
+.if !target(configure)
+configure: _SUBDIRUSE
+.endif
+
+.if !target(build)
+build: _SUBDIRUSE
+.endif
+
+.if !target(clean)
+clean: _SUBDIRUSE
+.endif
+
+.if !target(depend)
+depend: _SUBDIRUSE
+.endif
+
+.if !target(describe)
+describe: _SUBDIRUSE
+.endif
+
+.if !target(reinstall)
+reinstall: _SUBDIRUSE
.endif
-.endfor
.if !target(install)
.if !target(beforeinstall)
@@ -61,45 +101,10 @@ afterinstall: realinstall
realinstall: beforeinstall _SUBDIRUSE
.endif
-.if !target(readmes)
-readmes: readme _SUBDIRUSE
-.endif
-
-.if !target(readme)
-readme:
- @rm -f README.html
- @make README.html
-.endif
-
-PORTSDIR ?= /usr/ports
-TEMPLATES ?= ${PORTSDIR}/templates
-.if defined(PORTSTOP)
-README= ${TEMPLATES}/README.top
-.else
-README= ${TEMPLATES}/README.category
-.endif
-
-README.html:
- @echo "===> Creating README.html"
- @> $@.tmp
-.for entry in ${SUBDIR}
-.if defined(PORTSTOP)
- @echo -n '<a href="'${entry}/README.html'">${entry}</a>: ' >> $@.tmp
-.else
- @echo -n '<a href="'${entry}/README.html'">'"`cd ${entry}; make package-name`</a>: " >> $@.tmp
-.endif
-.if exists(${entry}/pkg/COMMENT)
- @cat ${entry}/pkg/COMMENT >> $@.tmp
-.else
- @echo "(no description)" >> $@.tmp
-.endif
-.endfor
- @sort -t '>' +1 -2 $@.tmp > $@.tmp2
- @cat ${README} | \
- sed -e 's%%CATEGORY%%'`echo ${.CURDIR} | sed -e 's.*/\([^/]*\)$$\1'`'g' \
- -e '/%%DESCR%%/r${.CURDIR}/pkg/DESCR' \
- -e '/%%DESCR%%/d' \
- -e '/%%SUBDIR%%/r$@.tmp2' \
- -e '/%%SUBDIR%%/d' \
- > $@
- @rm -f $@.tmp $@.tmp2
+.if !target(tags)
+tags: _SUBDIRUSE
+.endif
+
+.if !target(checksum)
+checksum: _SUBDIRUSE
+.endif
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index c85bd1a662e1..657d53aef5a4 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -17,39 +17,30 @@ CXXINCLUDES+= -I${DESTDIR}/usr/include/${CXX}
STRIP?= -s
.endif
+BINGRP?= bin
+BINOWN?= bin
+BINMODE?= 555
LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
-LIBKZHEAD?= ${DESTDIR}/usr/lib/kzhead.o
-LIBKZTAIL?= ${DESTDIR}/usr/lib/kztail.o
-
LIBC?= ${DESTDIR}/usr/lib/libc.a
-LIBC_PIC= ${DESTDIR}/usr/lib/libc_pic.a
-LIBCOM_ERR= ${DESTDIR}/usr/lib/libcom_err.a
LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
LIBDES?= ${DESTDIR}/usr/lib/libdes.a # XXX doesn't exist
LIBDIALOG?= ${DESTDIR}/usr/lib/libdialog.a
-LIBDISK?= ${DESTDIR}/usr/lib/libdisk.a
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
-LIBF2C?= ${DESTDIR}/usr/lib/libf2c.a
-LIBFL?= "don't use LIBFL, use LIBL"
LIBFORMS?= ${DESTDIR}/usr/lib/libforms.a
-LIBGPLUSPLUS?= ${DESTDIR}/usr/lib/libg++.a
+LIBFTP?= ${DESTDIR}/usr/lib/libftp.a
LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
-LIBGCC_PIC?= ${DESTDIR}/usr/lib/libgcc_pic.a
-LIBGMP?= ${DESTDIR}/usr/lib/libgmp.a
+LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
LIBGNUREGEX?= ${DESTDIR}/usr/lib/libgnuregex.a
-LIBIPX?= ${DESTDIR}/usr/lib/libipx.a
LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a # XXX doesn't exist
LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a # XXX doesn't exist
-LIBKEYCAP?= ${DESTDIR}/usr/lib/libkeycap.a
LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
LIBL?= ${DESTDIR}/usr/lib/libl.a
-LIBLN?= "don't use, LIBLN, use LIBL"
LIBM?= ${DESTDIR}/usr/lib/libm.a
LIBMD?= ${DESTDIR}/usr/lib/libmd.a
-LIBMP?= ${DESTDIR}/usr/lib/libmp.a
+LIBMP?= ${DESTDIR}/usr/lib/libmp.a # XXX doesn't exist
LIBMYTINFO?= ${DESTDIR}/usr/lib/libmytinfo.a
LIBNCURSES?= ${DESTDIR}/usr/lib/libncurses.a
LIBPC?= ${DESTDIR}/usr/lib/libpc.a # XXX doesn't exist
@@ -58,15 +49,12 @@ LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a # XXX doesn't exist
LIBREADLINE?= ${DESTDIR}/usr/lib/libreadline.a
LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
-LIBSCRYPT?= "don't use LIBSCRYPT, use LIBCRYPT"
+LIBSCRYPT?= ${DESTDIR}/usr/lib/libscrypt.a # XXX don't use, use LIBCRYPT
LIBSCSI?= ${DESTDIR}/usr/lib/libscsi.a
LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
-LIBSS?= ${DESTDIR}/usr/lib/libss.a
LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
-LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP"
LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
-LIBXPG4?= ${DESTDIR}/usr/lib/libxpg4.a
LIBY?= ${DESTDIR}/usr/lib/liby.a
.if defined(NOSHARED)
@@ -146,16 +134,16 @@ _PROGSUBDIR: .USE
# here (or does maninstall always work when nothing is made?),
.MAIN: all
-all: ${PROG} all-man _PROGSUBDIR
+all: ${PROG} ${MANDEPEND} _PROGSUBDIR
.if !target(clean)
clean: _PROGSUBDIR
- rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES}
+ rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES}
.endif
.if !target(cleandir)
cleandir: _PROGSUBDIR
- rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES}
+ rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES}
rm -f ${.CURDIR}/tags .depend
cd ${.CURDIR}; rm -rf obj;
.endif
@@ -240,7 +228,6 @@ tags: ${SRCS} _PROGSUBDIR
.include <bsd.man.mk>
.elif !target(maninstall)
maninstall:
-all-man:
.endif
_DEPSUBDIR= _PROGSUBDIR
diff --git a/share/mk/bsd.sgml.mk b/share/mk/bsd.sgml.mk
index 0c12fd3b0f10..41ddf94accfb 100644
--- a/share/mk/bsd.sgml.mk
+++ b/share/mk/bsd.sgml.mk
@@ -19,7 +19,7 @@ VOLUME?= ${.CURDIR:T}
DOC?= ${.CURDIR:T}
BINDIR?= /usr/share/doc
SRCDIR?= ${.CURDIR}
-DISTRIBUTION?= doc
+DISTRIBUTION?= bin
SGMLFMT?= sgmlfmt
LPR?= lpr
@@ -50,7 +50,7 @@ obj:
.endif
clean: ${FORMATS:S/^/clean-/g}
- rm -f Errs errs mklog
+ rm -f [eE]rrs mklog
cleandir: clean
cd ${.CURDIR}; rm -rf obj
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index c7d7cf964124..9da0febb156d 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -3,6 +3,14 @@
.MAIN: all
+.if !defined(DEBUG_FLAGS)
+STRIP?= -s
+.endif
+
+BINGRP?= bin
+BINOWN?= bin
+BINMODE?= 555
+
_SUBDIRUSE: .USE
@for entry in ${SUBDIR}; do \
(if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
@@ -25,12 +33,34 @@ ${SUBDIR}::
fi; \
${MAKE} all
+.if !target(all)
+all: _SUBDIRUSE
+.endif
+
+.if !target(clean)
+clean: _SUBDIRUSE
+.endif
+
+.if !target(cleandir)
+cleandir: _SUBDIRUSE
+.endif
+
+.if !target(depend)
+depend: _SUBDIRUSE
+.endif
-.for __target in all clean cleandir obj depend maninstall lint tags
-.if !target(__target)
-${__target}: _SUBDIRUSE
+.if !target (maninstall)
+maninstall: _SUBDIRUSE
+.endif
+
+DISTRIBUTION?= bin
+.if !target(afterdistribute)
+afterdistribute:
+.endif
+.if !target(distribute)
+distribute: _SUBDIRUSE
+ cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${DISTRIBUTION}
.endif
-.endfor
.if !target(install)
.if !target(beforeinstall)
@@ -44,11 +74,14 @@ afterinstall: realinstall
realinstall: beforeinstall _SUBDIRUSE
.endif
-DISTRIBUTION?= bin
-.if !target(afterdistribute)
-afterdistribute:
+.if !target(lint)
+lint: _SUBDIRUSE
.endif
-.if !target(distribute)
-distribute: _SUBDIRUSE
- cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${DISTRIBUTION}
+
+.if !target(obj)
+obj: _SUBDIRUSE
+.endif
+
+.if !target(tags)
+tags: _SUBDIRUSE
.endif
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 371aa1a9c7c2..f80913665496 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -3,7 +3,7 @@
unix ?= We run FreeBSD, not UNIX.
-.SUFFIXES: .out .a .ln .o .c .cc .cxx .C .F .f .e .r .y .l .S .s .cl .p .h .sh
+.SUFFIXES: .out .a .ln .o .c .cc .cxx .C .F .f .e .r .y .l .S .s .cl .p .h
.LIBS: .a
@@ -17,7 +17,12 @@ AS ?= as
AFLAGS ?=
CC ?= cc
+
+.if ${MACHINE} == "sparc"
+CFLAGS ?= -O4
+.else
CFLAGS ?= -O
+.endif
CXX ?= c++
CXXFLAGS ?= ${CXXINCLUDES} ${CFLAGS}
@@ -64,12 +69,10 @@ SHELL ?= sh
YACC ?= yacc
YFLAGS ?= -d
-.c:
- ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-
-.sh:
- cp -p ${.IMPSRC} ${.TARGET}
- chmod a+x ${.TARGET}
+# This rule currently causes both make from 1.x and 2.x to have problems,
+# and is not being used so disable it for now.
+#.c:
+# ${CC} ${CFLAGS} ${.IMPSRC} -o ${.TARGET}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
@@ -89,46 +92,40 @@ YFLAGS ?= -d
.s.o:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-# XXX not -j safe
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
rm -f y.tab.c
-# XXX not -j safe
.l.o:
${LEX} ${LFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c lex.yy.c -o ${.TARGET}
rm -f lex.yy.c
-# XXX not -j safe
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
mv y.tab.c ${.TARGET}
-# XXX not -j safe
.l.c:
${LEX} ${LFLAGS} ${.IMPSRC}
mv lex.yy.c ${.TARGET}
.s.out .c.out .o.out:
- ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
+ ${CC} ${CFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
.f.out .F.out .r.out .e.out:
- ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
+ ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${.IMPSRC} \
${LDLIBS} -o ${.TARGET}
rm -f ${.PREFIX}.o
-# XXX not -j safe
.y.out:
${YACC} ${YFLAGS} ${.IMPSRC}
- ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
+ ${CC} ${CFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
rm -f y.tab.c
-# XXX not -j safe
.l.out:
${LEX} ${LFLAGS} ${.IMPSRC}
- ${CC} ${CFLAGS} ${LDFLAGS} lex.yy.c ${LDLIBS} -ll -o ${.TARGET}
+ ${CC} ${CFLAGS} lex.yy.c ${LDLIBS} -ll -o ${.TARGET}
rm -f lex.yy.c
.include <bsd.own.mk>
diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c
index c58f89fd4cc3..887ab2b6c49f 100644
--- a/sys/i386/boot/biosboot/boot.c
+++ b/sys/i386/boot/biosboot/boot.c
@@ -104,7 +104,7 @@ boot(int drive)
/***************************************************************\
* As a default set it to the first partition of the boot *
* floppy or hard drive *
- * Define BOOT_HD to boot sd0 when wd0 is also installed *
+ * Define BOOT_HT to boot sd0 when wd0 is also installed *
\***************************************************************/
part = 0;
unit = drive & 0x7f;
diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c
index daea8855b5b7..f59c6003151a 100644
--- a/sys/i386/i386/autoconf.c
+++ b/sys/i386/i386/autoconf.c
@@ -54,7 +54,6 @@
#include <sys/reboot.h>
#include <sys/kernel.h>
-#include <machine/cpu.h>
#include <machine/md_var.h>
#include <machine/pte.h>
#include <i386/isa/icu.h> /* For interrupts */
@@ -184,29 +183,18 @@ configure()
mfs_initminiroot(mfs_root);
#endif /* MFS_ROOT */
- if (bootverbose)
- printf("Device configuration finished.\n");
-
#ifdef CD9660
- if ((boothowto & RB_CDROM) && !mountroot) {
- if (bootverbose)
- printf("Considering CD-ROM root f/s.\n");
+ if ((boothowto & RB_CDROM) && !mountroot)
mountroot = find_cdrom_root;
- }
#endif
#ifdef NFS
- if (!mountroot && nfs_diskless_valid) {
- if (bootverbose)
- printf("Considering NFS root f/s.\n");
+ if (!mountroot && nfs_diskless_valid)
mountroot = nfs_mountroot;
- }
#endif /* NFS */
#ifdef FFS
if (!mountroot) {
- if (bootverbose)
- printf("Considering FFS root f/s.\n");
mountroot = ffs_mountroot;
/*
* Ignore the -a flag if this kernel isn't compiled
@@ -227,12 +215,8 @@ configure()
* Configure swap area and related system
* parameter based on device(s) used.
*/
- if (bootverbose)
- printf("Configuring root and swap devs.\n");
setconf();
cold = 0;
- if (bootverbose)
- printf("configure() finished.\n");
}
int
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index 2d71f774de2c..a902d997fda4 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
- * $Id: ansi.h,v 1.10 1996/05/01 00:47:05 bde Exp $
+ * $Id: ansi.h,v 1.7.4.1 1995/10/01 06:29:18 davidg Exp $
*/
#ifndef _MACHINE_ANSI_H_
@@ -48,11 +48,9 @@
*/
#define _BSD_CLOCK_T_ unsigned long /* clock() */
#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
#define _BSD_SIZE_T_ unsigned int /* sizeof() */
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_TIME_T_ long /* time() */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
/*
* Types which are fundamental to the implementation and must be used
@@ -60,22 +58,26 @@
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ long long /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
+#define _BSD_PID_T_ long /* process [group] */
#define _BSD_VA_LIST_ char * /* va_list */
/*
- * The rune type is declared to be an ``int'' instead of the more natural
+ * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
+ * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
+ * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
+ * defined for ctype.h.
*/
+#define _BSD_WCHAR_T_ int /* wchar_t */
+#define _BSD_RUNE_T_ int /* rune_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
@@ -90,4 +92,4 @@
#define _BSD_CLK_TCK_ 128
#define _BSD_CLOCKS_PER_SEC_ 128
-#endif /* !_MACHINE_ANSI_H_ */
+#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index e6617a24de55..878a8ccca451 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/mse.c
@@ -57,7 +57,6 @@
#include <sys/devconf.h>
#include <machine/clock.h>
-#include <machine/cpu.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
@@ -442,8 +441,7 @@ mse_probelogi(idp)
outb(idp->id_iobase + MSE_PORTC, MSE_DISINTR);
return(1);
} else {
- if (bootverbose)
- printf("mse%d: wrong signature %x\n",idp->id_unit,sig);
+ printf("mse%d: wrong signature %x\n",idp->id_unit,sig);
return(0);
}
}
diff --git a/sys/i386/isa/qcam.c b/sys/i386/isa/qcam.c
index 8c58d49cb934..3f3a59d78452 100644
--- a/sys/i386/isa/qcam.c
+++ b/sys/i386/isa/qcam.c
@@ -230,10 +230,10 @@ qcam_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
switch (cmd) {
case QC_GET:
- return qcam_ioctl_get(qs, info) ? EINVAL : 0;
+ return qcam_ioctl_get(qs, info) ? 0 : EINVAL;
case QC_SET:
- return qcam_ioctl_set(qs, info) ? EINVAL : 0;
+ return qcam_ioctl_set(qs, info) ? 0 : EINVAL;
default:
return(ENOTTY);
diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c
index ed54c6b80111..52c1aba45c3d 100644
--- a/sys/i386/scsi/aic7xxx.c
+++ b/sys/i386/scsi/aic7xxx.c
@@ -1560,8 +1560,6 @@ clear:
((long)xs->sc_link->fordriver & SELBUSB)
? 'B' : 'A',
iobase);
- /* Stop the selection */
- outb(SCSISEQ + iobase, 0);
outb(SCB_CONTROL + iobase, 0);
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index d268499bf8ac..379585084a8f 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -191,8 +191,7 @@ lkmcioctl(dev, cmd, data, flag, p)
switch(cmd) {
case LMRESERV: /* reserve pages for a module */
- if ((flag & FWRITE) == 0 || securelevel > 0)
- /* only allow this if writing */
+ if ((flag & FWRITE) == 0) /* only allow this if writing */
return EPERM;
resrvp = (struct lmc_resrv *)data;
@@ -232,8 +231,7 @@ lkmcioctl(dev, cmd, data, flag, p)
break;
case LMLOADBUF: /* Copy in; stateful, follows LMRESERV */
- if ((flag & FWRITE) == 0 || securelevel > 0)
- /* only allow this if writing */
+ if ((flag & FWRITE) == 0) /* only allow this if writing */
return EPERM;
loadbufp = (struct lmc_loadbuf *)data;
@@ -268,8 +266,7 @@ lkmcioctl(dev, cmd, data, flag, p)
break;
case LMUNRESRV: /* discard reserved pages for a module */
- if ((flag & FWRITE) == 0 || securelevel > 0)
- /* only allow this if writing */
+ if ((flag & FWRITE) == 0) /* only allow this if writing */
return EPERM;
lkmunreserve(); /* coerce state to LKM_IDLE */
@@ -279,8 +276,7 @@ lkmcioctl(dev, cmd, data, flag, p)
break;
case LMREADY: /* module loaded: call entry */
- if ((flag & FWRITE) == 0 || securelevel > 0)
- /* only allow this if writing */
+ if ((flag & FWRITE) == 0) /* only allow this if writing */
return EPERM;
switch (lkm_state) {
@@ -342,8 +338,7 @@ lkmcioctl(dev, cmd, data, flag, p)
break;
case LMUNLOAD: /* unload a module */
- if ((flag & FWRITE) == 0 || securelevel > 0)
- /* only allow this if writing */
+ if ((flag & FWRITE) == 0) /* only allow this if writing */
return EPERM;
unloadp = (struct lmc_unload *)data;
@@ -829,6 +824,7 @@ _lkm_exec(lkmtp, cmd)
const struct execsw **execsw =
(const struct execsw **)&execsw_set.ls_items[0];
+#if 1
switch(cmd) {
case LKM_E_LOAD:
/* don't load twice! */
@@ -874,6 +870,9 @@ _lkm_exec(lkmtp, cmd)
case LKM_E_STAT: /* no special handling... */
break;
}
+#else
+ err = EINVAL;
+#endif
return(err);
}
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 1c87d645306f..6ef522360256 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -229,7 +229,7 @@ setpgid(curp, uap, retval)
if (uap->pid != 0 && uap->pid != curp->p_pid) {
if ((targp = pfind(uap->pid)) == 0 || !inferior(targp))
return (ESRCH);
- if (targp->p_pgrp == NULL || targp->p_session != curp->p_session)
+ if (targp->p_session != curp->p_session)
return (EPERM);
if (targp->p_flag & P_EXEC)
return (EACCES);
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 297f816eb256..762eb2b3815f 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -49,11 +49,6 @@
#include <sys/signalvar.h>
/*
- * Exported to userland via sysctl
- */
-int somaxconn = SOMAXCONN;
-
-/*
* Socket operation routines.
* These routines are called by the routines in
* sys_socket.c or from a system process, and
@@ -130,9 +125,9 @@ solisten(so, backlog)
}
if (so->so_q == 0)
so->so_options |= SO_ACCEPTCONN;
- if (backlog < 0 || backlog > somaxconn)
- backlog = somaxconn;
- so->so_qlimit = backlog;
+ if (backlog < 0)
+ backlog = 0;
+ so->so_qlimit = min(backlog, SOMAXCONN);
splx(s);
return (0);
}
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 614fe78c009f..589815d7de23 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -56,10 +56,9 @@ char netio[] = "netio";
char netcon[] = "netcon";
char netcls[] = "netcls";
-/* these two are sysctl visible */
u_long sb_max = SB_MAX; /* patchable */
-u_long sb_efficiency = 8; /* parameter for sbreserve() */
+static u_long sb_efficiency = 8; /* parameter for sbreserve() */
/*
* Procedures to manipulate state flags of socket
diff --git a/sys/miscfs/devfs/devfs_back.c b/sys/miscfs/devfs/devfs_back.c
index 5e615cb7b228..1cdb663a1948 100644
--- a/sys/miscfs/devfs/devfs_back.c
+++ b/sys/miscfs/devfs/devfs_back.c
@@ -2,7 +2,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_back.c,v 1.2 1995/04/20 07:34:51 julian Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/miscfs/devfs/Attic/devfs_back.c,v 1.3 1995/05/30 08:06:49 rgrimes Exp $
*/
#include "param.h"
diff --git a/sys/miscfs/devfs/devfs_front.c b/sys/miscfs/devfs/devfs_front.c
index a3d02554ccc7..0c9de3b95092 100644
--- a/sys/miscfs/devfs/devfs_front.c
+++ b/sys/miscfs/devfs/devfs_front.c
@@ -1,7 +1,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_front.c,v 1.3 1995/04/20 07:42:41 julian Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/miscfs/devfs/Attic/devfs_front.c,v 1.4 1995/05/30 08:06:50 rgrimes Exp $
*
*/
diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c
index 5781df7058c6..ffdcbf2636ba 100644
--- a/sys/miscfs/devfs/devfs_vfsops.c
+++ b/sys/miscfs/devfs/devfs_vfsops.c
@@ -1,7 +1,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.2 1995/04/20 07:34:53 julian Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.3 1995/05/30 08:06:52 rgrimes Exp $
*
*
*/
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index 5deda3e88d45..3ae6be5eb43d 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -1,7 +1,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.4 1995/05/03 23:04:26 julian Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/miscfs/devfs/devfs_vnops.c,v 1.5 1995/05/30 08:06:53 rgrimes Exp $
*
* symlinks can wait 'til later.
*/
diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h
index c6216e208d5c..0e27d457f96a 100644
--- a/sys/miscfs/devfs/devfsdefs.h
+++ b/sys/miscfs/devfs/devfsdefs.h
@@ -7,7 +7,7 @@
/*
* Written by Julian Elischer (julian@DIALIX.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfsdefs.h,v 1.3 1995/05/03 23:06:31 julian Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/miscfs/devfs/devfsdefs.h,v 1.4 1995/05/30 08:06:55 rgrimes Exp $
*/
/* first a couple of defines for compatibility with inodes */
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index 81f37617f86c..1af11f2a7db3 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
- * $Id: procfs_status.c,v 1.5 1996/02/02 05:19:20 wosch Exp $
+ * $Id: procfs_status.c,v 1.4 1995/05/30 08:07:10 rgrimes Exp $
*/
#include <sys/param.h>
@@ -78,9 +78,8 @@ procfs_dostatus(curp, p, pfs, uio)
sess = p->p_pgrp->pg_session;
sid = sess->s_leader ? sess->s_leader->p_pid : 0;
-/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg
- euid ruid rgid,egid,groups[1 .. NGROUPS]
-*/
+/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg uid groups ... */
+
ps = psbuf;
bcopy(p->p_comm, ps, MAXCOMLEN);
ps[MAXCOMLEN] = '\0';
@@ -127,14 +126,7 @@ procfs_dostatus(curp, p, pfs, uio)
cr = p->p_ucred;
- ps += sprintf(ps, " %ld %ld %ld",
- cr->cr_uid, /* euid */
- p->p_cred->p_ruid, /* ruid */
- p->p_cred->p_rgid); /* rgid */
-
- /* egid (p->p_cred->p_svgid) is equal to cr_ngroups[0]
- see also getegid(2) in /sys/kern/kern_prot.c */
-
+ ps += sprintf(ps, " %ld %ld", cr->cr_uid, cr->cr_gid);
for (i = 0; i < cr->cr_ngroups; i++)
ps += sprintf(ps, ",%ld", cr->cr_groups[i]);
ps += sprintf(ps, "\n");
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 6cc162ec2972..5dce597bdf50 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -497,8 +497,6 @@ ether_ifattach(ifp)
ifp->if_addrlen = 6;
ifp->if_hdrlen = 14;
ifp->if_mtu = ETHERMTU;
- if (ifp->if_baudrate == 0)
- ifp->if_baudrate = 10000000;
for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
sdl->sdl_family == AF_LINK) {
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 7e7deb96339b..9c6825a813b4 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -554,7 +554,6 @@ fddi_ifattach(ifp)
ifp->if_addrlen = 6;
ifp->if_hdrlen = 21;
ifp->if_mtu = FDDIMTU;
- ifp->if_baudrate = 100000000;
for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
sdl->sdl_family == AF_LINK) {
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index 56635fb48f9d..7ac35561f48f 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -48,7 +48,7 @@ struct ip_fw {
#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
- u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
+ u_char fw_tcpf,fw_tcpnf; /* TCP flags sen/unset */
};
struct ip_fw_chain {
diff --git a/sys/netiso/argo_debug.h b/sys/netiso/argo_debug.h
index e87da1cd89f8..a0dd5f12dee6 100644
--- a/sys/netiso/argo_debug.h
+++ b/sys/netiso/argo_debug.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)argo_debug.h 8.1 (Berkeley) 6/10/93
- * $Id: argo_debug.h,v 1.3 1994/08/21 06:14:11 paul Exp $
+ * $Id: argo_debug.h,v 1.4 1995/05/30 08:10:09 rgrimes Exp $
*/
#ifndef _NETISO_ARGO_DEBUG_H_
@@ -64,8 +64,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/argo_debug.h,v 1.3 1994/08/21 06:14:11 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/argo_debug.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/argo_debug.h,v 1.4 1995/05/30 08:10:09 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/argo_debug.h,v $
*/
diff --git a/sys/netiso/clnp.h b/sys/netiso/clnp.h
index 646b6b8fc6f2..230ec471bccb 100644
--- a/sys/netiso/clnp.h
+++ b/sys/netiso/clnp.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp.h 8.2 (Berkeley) 4/16/94
- * $Id: clnp.h,v 1.3 1994/08/21 06:14:13 paul Exp $
+ * $Id: clnp.h,v 1.4 1995/05/30 08:10:12 rgrimes Exp $
*/
#ifndef _NETISO_CLNP_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp.h,v 1.4 1995/05/30 08:10:12 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp.h,v $ */
/* should be config option but cpp breaks with too many #defines */
#define DECBIT
diff --git a/sys/netiso/clnp_debug.c b/sys/netiso/clnp_debug.c
index 52d6f040dfa6..6511b02503e5 100644
--- a/sys/netiso/clnp_debug.c
+++ b/sys/netiso/clnp_debug.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_debug.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_debug.c,v 1.2 1994/08/02 07:49:35 davidg Exp $
+ * $Id: clnp_debug.c,v 1.3 1995/05/30 08:10:14 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_debug.c,v 1.2 1994/08/02 07:49:35 davidg Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_debug.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_debug.c,v 1.3 1995/05/30 08:10:14 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_debug.c,v $ */
#include <sys/param.h>
#include <sys/mbuf.h>
diff --git a/sys/netiso/clnp_er.c b/sys/netiso/clnp_er.c
index ca12308dde17..cbbdc0bcce22 100644
--- a/sys/netiso/clnp_er.c
+++ b/sys/netiso/clnp_er.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_er.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_er.c,v 1.3 1994/11/15 14:26:10 bde Exp $
+ * $Id: clnp_er.c,v 1.4 1995/05/30 08:10:15 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_er.c,v 1.3 1994/11/15 14:26:10 bde Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_er.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_er.c,v 1.4 1995/05/30 08:10:15 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_er.c,v $ */
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/netiso/clnp_frag.c b/sys/netiso/clnp_frag.c
index 69c92a5b8c1a..89ec430314f9 100644
--- a/sys/netiso/clnp_frag.c
+++ b/sys/netiso/clnp_frag.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_frag.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_frag.c,v 1.2 1994/08/02 07:49:37 davidg Exp $
+ * $Id: clnp_frag.c,v 1.3 1995/05/30 08:10:17 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_frag.c,v 1.2 1994/08/02 07:49:37 davidg Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_frag.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_frag.c,v 1.3 1995/05/30 08:10:17 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_frag.c,v $ */
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/netiso/clnp_input.c b/sys/netiso/clnp_input.c
index c67df925bb3f..ca13a3088159 100644
--- a/sys/netiso/clnp_input.c
+++ b/sys/netiso/clnp_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_input.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_input.c,v 1.5 1995/05/11 00:13:20 wollman Exp $
+ * $Id: clnp_input.c,v 1.6 1995/05/30 08:10:19 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_input.c,v 1.5 1995/05/11 00:13:20 wollman Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_input.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_input.c,v 1.6 1995/05/30 08:10:19 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_input.c,v $ */
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/netiso/clnp_options.c b/sys/netiso/clnp_options.c
index bac8b5b8da67..efc51b9c5201 100644
--- a/sys/netiso/clnp_options.c
+++ b/sys/netiso/clnp_options.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_options.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_options.c,v 1.2 1994/08/02 07:49:40 davidg Exp $
+ * $Id: clnp_options.c,v 1.3 1995/05/30 08:10:20 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_options.c,v 1.2 1994/08/02 07:49:40 davidg Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_options.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_options.c,v 1.3 1995/05/30 08:10:20 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_options.c,v $ */
#ifdef ISO
diff --git a/sys/netiso/clnp_output.c b/sys/netiso/clnp_output.c
index 579d923724c0..71c5db6ebe23 100644
--- a/sys/netiso/clnp_output.c
+++ b/sys/netiso/clnp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_output.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_output.c,v 1.3 1994/11/15 14:26:12 bde Exp $
+ * $Id: clnp_output.c,v 1.4 1995/05/30 08:10:22 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_output.c,v 1.3 1994/11/15 14:26:12 bde Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_output.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_output.c,v 1.4 1995/05/30 08:10:22 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_output.c,v $ */
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/netiso/clnp_raw.c b/sys/netiso/clnp_raw.c
index ade1ba24cf7e..9a0c687f19b0 100644
--- a/sys/netiso/clnp_raw.c
+++ b/sys/netiso/clnp_raw.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_raw.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_raw.c,v 1.2 1994/08/02 07:49:44 davidg Exp $
+ * $Id: clnp_raw.c,v 1.3 1995/05/30 08:10:23 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_raw.c,v 1.2 1994/08/02 07:49:44 davidg Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_raw.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_raw.c,v 1.3 1995/05/30 08:10:23 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_raw.c,v $ */
#include <sys/param.h>
#include <sys/mbuf.h>
diff --git a/sys/netiso/clnp_stat.h b/sys/netiso/clnp_stat.h
index a6cdd0478f11..d02ea1724694 100644
--- a/sys/netiso/clnp_stat.h
+++ b/sys/netiso/clnp_stat.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_stat.h 8.1 (Berkeley) 6/10/93
- * $Id: clnp_stat.h,v 1.3 1994/08/21 06:14:13 paul Exp $
+ * $Id: clnp_stat.h,v 1.4 1995/05/30 08:10:24 rgrimes Exp $
*/
#ifndef _NETISO_CLNP_STAT_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_stat.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_stat.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_stat.h,v 1.4 1995/05/30 08:10:24 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_stat.h,v $ */
struct clnp_stat {
int cns_total; /* total pkts received */
diff --git a/sys/netiso/clnp_subr.c b/sys/netiso/clnp_subr.c
index 138871ef625d..478cc0d04462 100644
--- a/sys/netiso/clnp_subr.c
+++ b/sys/netiso/clnp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_subr.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_subr.c,v 1.2 1994/08/02 07:49:50 davidg Exp $
+ * $Id: clnp_subr.c,v 1.3 1995/05/30 08:10:26 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_subr.c,v 1.2 1994/08/02 07:49:50 davidg Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_subr.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_subr.c,v 1.3 1995/05/30 08:10:26 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_subr.c,v $ */
#ifdef ISO
diff --git a/sys/netiso/clnp_timer.c b/sys/netiso/clnp_timer.c
index 401d35866cf8..d08909b10d24 100644
--- a/sys/netiso/clnp_timer.c
+++ b/sys/netiso/clnp_timer.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)clnp_timer.c 8.1 (Berkeley) 6/10/93
- * $Id: clnp_timer.c,v 1.3 1994/11/15 14:26:13 bde Exp $
+ * $Id: clnp_timer.c,v 1.4 1995/05/30 08:10:27 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/clnp_timer.c,v 1.3 1994/11/15 14:26:13 bde Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/clnp_timer.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_timer.c,v 1.4 1995/05/30 08:10:27 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/clnp_timer.c,v $ */
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/netiso/cons.h b/sys/netiso/cons.h
index ecaa3741b5d9..016cf9044d83 100644
--- a/sys/netiso/cons.h
+++ b/sys/netiso/cons.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)cons.h 8.1 (Berkeley) 6/10/93
- * $Id: cons.h,v 1.3 1994/08/21 06:14:15 paul Exp $
+ * $Id: cons.h,v 1.4 1995/05/30 08:10:30 rgrimes Exp $
*/
#ifndef _NETISO_CONS_H_
@@ -64,8 +64,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/cons.h,v 1.3 1994/08/21 06:14:15 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/cons.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/cons.h,v 1.4 1995/05/30 08:10:30 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/cons.h,v $
*
* interface between TP and CONS
*/
diff --git a/sys/netiso/cons_pcb.h b/sys/netiso/cons_pcb.h
index 7a3b52f416d9..f84c0679be6d 100644
--- a/sys/netiso/cons_pcb.h
+++ b/sys/netiso/cons_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)cons_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id: cons_pcb.h,v 1.3 1994/08/21 06:14:16 paul Exp $
+ * $Id: cons_pcb.h,v 1.4 1995/05/30 08:10:31 rgrimes Exp $
*/
#ifndef _NETISO_CONS_PCB_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/cons_pcb.h,v 1.3 1994/08/21 06:14:16 paul Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/cons_pcb.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/cons_pcb.h,v 1.4 1995/05/30 08:10:31 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/cons_pcb.h,v $ */
/*
* protocol control block for the connection oriented network service
diff --git a/sys/netiso/esis.h b/sys/netiso/esis.h
index 400d120387d6..4cd6fd422ad3 100644
--- a/sys/netiso/esis.h
+++ b/sys/netiso/esis.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)esis.h 8.1 (Berkeley) 6/10/93
- * $Id: esis.h,v 1.3 1994/08/21 06:14:18 paul Exp $
+ * $Id: esis.h,v 1.4 1995/05/30 08:10:36 rgrimes Exp $
*/
#ifndef _NETISO_ESIS_H_
@@ -64,8 +64,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/esis.h,v 1.3 1994/08/21 06:14:18 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/esis.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/esis.h,v 1.4 1995/05/30 08:10:36 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/esis.h,v $
*/
#ifndef BYTE_ORDER
diff --git a/sys/netiso/if_cons.c b/sys/netiso/if_cons.c
index 28559b7bd1e5..fae7538e9099 100644
--- a/sys/netiso/if_cons.c
+++ b/sys/netiso/if_cons.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_cons.c 8.1 (Berkeley) 6/10/93
- * $Id: if_cons.c,v 1.3 1994/12/13 22:33:04 wollman Exp $
+ * $Id: if_cons.c,v 1.4 1995/05/30 08:10:39 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/if_cons.c,v 1.3 1994/12/13 22:33:04 wollman Exp $
- * $Source: /home/ncvs/src/sys/netiso/if_cons.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/if_cons.c,v 1.4 1995/05/30 08:10:39 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/if_cons.c,v $
*
* cons.c - Connection Oriented Network Service:
* including support for a) user transport-level service,
diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c
index c8ac5997be30..188b366a70cc 100644
--- a/sys/netiso/if_eon.c
+++ b/sys/netiso/if_eon.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_eon.c 8.1 (Berkeley) 6/10/93
- * $Id: if_eon.c,v 1.3 1995/04/26 18:10:57 pst Exp $
+ * $Id: if_eon.c,v 1.4 1995/05/30 08:10:45 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/if_eon.c,v 1.3 1995/04/26 18:10:57 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/if_eon.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/if_eon.c,v 1.4 1995/05/30 08:10:45 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/if_eon.c,v $
*
* EON rfc
* Layer between IP and CLNL
diff --git a/sys/netiso/iso.c b/sys/netiso/iso.c
index 447fb2127988..a790c4538b60 100644
--- a/sys/netiso/iso.c
+++ b/sys/netiso/iso.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso.c 8.2 (Berkeley) 11/15/93
- * $Id: iso.c,v 1.3 1995/04/26 18:10:58 pst Exp $
+ * $Id: iso.c,v 1.4 1995/05/30 08:10:46 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/iso.c,v 1.3 1995/04/26 18:10:58 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/iso.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso.c,v 1.4 1995/05/30 08:10:46 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso.c,v $
*
* iso.c: miscellaneous routines to support the iso address family
*/
diff --git a/sys/netiso/iso.h b/sys/netiso/iso.h
index 1ac1f1353b36..0569f368214e 100644
--- a/sys/netiso/iso.h
+++ b/sys/netiso/iso.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso.h 8.1 (Berkeley) 6/10/93
- * $Id: iso.h,v 1.3 1994/08/21 06:14:19 paul Exp $
+ * $Id: iso.h,v 1.4 1995/05/30 08:10:49 rgrimes Exp $
*/
#ifndef _NETISO_ISO_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/iso.h,v 1.3 1994/08/21 06:14:19 paul Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/iso.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso.h,v 1.4 1995/05/30 08:10:49 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso.h,v $ */
/*
* Return true if this is a multicast address
diff --git a/sys/netiso/iso_chksum.c b/sys/netiso/iso_chksum.c
index 19a3b65af687..28548a845f11 100644
--- a/sys/netiso/iso_chksum.c
+++ b/sys/netiso/iso_chksum.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_chksum.c 8.1 (Berkeley) 6/10/93
- * $Id: iso_chksum.c,v 1.2 1994/08/02 07:50:31 davidg Exp $
+ * $Id: iso_chksum.c,v 1.3 1995/05/30 08:10:50 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/iso_chksum.c,v 1.2 1994/08/02 07:50:31 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/iso_chksum.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_chksum.c,v 1.3 1995/05/30 08:10:50 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_chksum.c,v $
*
* ISO CHECKSUM
*
diff --git a/sys/netiso/iso_pcb.c b/sys/netiso/iso_pcb.c
index 613f2c4e0d0b..d9604c8f3123 100644
--- a/sys/netiso/iso_pcb.c
+++ b/sys/netiso/iso_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_pcb.c 8.1 (Berkeley) 6/10/93
- * $Id: iso_pcb.c,v 1.2 1994/08/02 07:50:37 davidg Exp $
+ * $Id: iso_pcb.c,v 1.3 1995/05/30 08:10:53 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/iso_pcb.c,v 1.2 1994/08/02 07:50:37 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/iso_pcb.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_pcb.c,v 1.3 1995/05/30 08:10:53 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_pcb.c,v $
*
* Iso address family net-layer(s) pcb stuff. NEH 1/29/87
*/
diff --git a/sys/netiso/iso_pcb.h b/sys/netiso/iso_pcb.h
index 80fc29a193a0..3d567edf32a0 100644
--- a/sys/netiso/iso_pcb.h
+++ b/sys/netiso/iso_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id: iso_pcb.h,v 1.3 1994/08/21 06:14:20 paul Exp $
+ * $Id: iso_pcb.h,v 1.4 1995/05/30 08:10:55 rgrimes Exp $
*/
#ifndef _NETISO_ISO_PCB_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/iso_pcb.h,v 1.3 1994/08/21 06:14:20 paul Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/iso_pcb.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_pcb.h,v 1.4 1995/05/30 08:10:55 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_pcb.h,v $ */
#define MAXX25CRUDLEN 16 /* 16 bytes of call request user data */
diff --git a/sys/netiso/iso_proto.c b/sys/netiso/iso_proto.c
index 86d6cf26089f..51b7ed4d689c 100644
--- a/sys/netiso/iso_proto.c
+++ b/sys/netiso/iso_proto.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_proto.c 8.1 (Berkeley) 6/10/93
- * $Id: iso_proto.c,v 1.3 1995/05/11 00:13:20 wollman Exp $
+ * $Id: iso_proto.c,v 1.4 1995/05/30 08:10:56 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/iso_proto.c,v 1.3 1995/05/11 00:13:20 wollman Exp $
- * $Source: /home/ncvs/src/sys/netiso/iso_proto.c,v $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_proto.c,v 1.4 1995/05/30 08:10:56 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_proto.c,v $
*
* iso_proto.c : protocol switch tables in the ISO domain
*
diff --git a/sys/netiso/iso_snpac.c b/sys/netiso/iso_snpac.c
index 3650231162d3..164787307379 100644
--- a/sys/netiso/iso_snpac.c
+++ b/sys/netiso/iso_snpac.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_snpac.c 8.1 (Berkeley) 6/10/93
- * $Id: iso_snpac.c,v 1.3 1994/12/13 22:33:05 wollman Exp $
+ * $Id: iso_snpac.c,v 1.4 1995/05/30 08:10:58 rgrimes Exp $
*/
/***********************************************************
@@ -60,8 +60,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/iso_snpac.c,v 1.3 1994/12/13 22:33:05 wollman Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/iso_snpac.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_snpac.c,v 1.4 1995/05/30 08:10:58 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_snpac.c,v $ */
#ifdef ISO
diff --git a/sys/netiso/iso_var.h b/sys/netiso/iso_var.h
index b87499509ce5..290f7b575bb9 100644
--- a/sys/netiso/iso_var.h
+++ b/sys/netiso/iso_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)iso_var.h 8.1 (Berkeley) 6/10/93
- * $Id: iso_var.h,v 1.4 1995/03/16 18:15:21 bde Exp $
+ * $Id: iso_var.h,v 1.5 1995/05/30 08:11:01 rgrimes Exp $
*/
#ifndef _NETISO_ISO_VAR_H_
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: /home/ncvs/src/sys/netiso/iso_var.h,v 1.4 1995/03/16 18:15:21 bde Exp $
- * $Source: /home/ncvs/src/sys/netiso/iso_var.h,v $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_var.h,v 1.5 1995/05/30 08:11:01 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/iso_var.h,v $
*/
/*
diff --git a/sys/netiso/tp.trans b/sys/netiso/tp.trans
index edefc769b816..8e1832b1fa85 100644
--- a/sys/netiso/tp.trans
+++ b/sys/netiso/tp.trans
@@ -60,7 +60,7 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-/* $Header: tp.trans,v 5.1 88/10/12 12:22:07 root Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp.trans,v 1.1.1.1 1994/05/24 10:07:31 rgrimes Exp $
*
* Transition file for TP.
*
diff --git a/sys/netiso/tp_clnp.h b/sys/netiso/tp_clnp.h
index 7e54a6739731..30fd5497baa3 100644
--- a/sys/netiso/tp_clnp.h
+++ b/sys/netiso/tp_clnp.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_clnp.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_clnp.h,v 1.3 1994/08/21 06:14:23 paul Exp $
+ * $Id: tp_clnp.h,v 1.4 1995/05/30 08:11:02 rgrimes Exp $
*/
#ifndef _NETISO_TP_CLNP_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_clnp.h,v 1.3 1994/08/21 06:14:23 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_clnp.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_clnp.h,v 1.4 1995/05/30 08:11:02 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_clnp.h,v $
*
* AF_ISO net-dependent structures and include files
*
diff --git a/sys/netiso/tp_cons.c b/sys/netiso/tp_cons.c
index ca2dc328a3c3..b68adea12b9c 100644
--- a/sys/netiso/tp_cons.c
+++ b/sys/netiso/tp_cons.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_cons.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_cons.c,v 1.3 1994/11/15 14:26:15 bde Exp $
+ * $Id: tp_cons.c,v 1.4 1995/05/30 08:11:04 rgrimes Exp $
*/
/***********************************************************
@@ -62,8 +62,8 @@ SOFTWARE.
*/
/*
* ARGO TP
- * $Header: /home/ncvs/src/sys/netiso/tp_cons.c,v 1.3 1994/11/15 14:26:15 bde Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_cons.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_cons.c,v 1.4 1995/05/30 08:11:04 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_cons.c,v $
*
* Here is where you find the iso- and cons-dependent code. We've tried
* keep all net-level and (primarily) address-family-dependent stuff
diff --git a/sys/netiso/tp_emit.c b/sys/netiso/tp_emit.c
index d26cea088097..8376c13fac0c 100644
--- a/sys/netiso/tp_emit.c
+++ b/sys/netiso/tp_emit.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_emit.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_emit.c,v 1.2 1994/08/02 07:51:02 davidg Exp $
+ * $Id: tp_emit.c,v 1.3 1995/05/30 08:11:07 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_emit.c,v 1.2 1994/08/02 07:51:02 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_emit.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_emit.c,v 1.3 1995/05/30 08:11:07 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_emit.c,v $
*
* This file contains tp_emit() and tp_error_emit(), which
* form TPDUs and hand them to ip.
diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c
index d8a9a4284aaa..c70d8ebb63c5 100644
--- a/sys/netiso/tp_inet.c
+++ b/sys/netiso/tp_inet.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_inet.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_inet.c,v 1.4 1995/04/26 21:32:36 pst Exp $
+ * $Id: tp_inet.c,v 1.5 1995/05/30 08:11:10 rgrimes Exp $
*/
/***********************************************************
@@ -62,8 +62,8 @@ SOFTWARE.
*/
/*
* ARGO TP
- * $Header: /home/ncvs/src/sys/netiso/tp_inet.c,v 1.4 1995/04/26 21:32:36 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_inet.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_inet.c,v 1.5 1995/05/30 08:11:10 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_inet.c,v $
*
* Here is where you find the inet-dependent code. We've tried
* keep all net-level and (primarily) address-family-dependent stuff
diff --git a/sys/netiso/tp_input.c b/sys/netiso/tp_input.c
index 2caa2bf036e3..a10ae76f323b 100644
--- a/sys/netiso/tp_input.c
+++ b/sys/netiso/tp_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_input.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_input.c,v 1.2 1994/08/02 07:51:11 davidg Exp $
+ * $Id: tp_input.c,v 1.3 1995/05/30 08:11:12 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_input.c,v 1.2 1994/08/02 07:51:11 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_input.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_input.c,v 1.3 1995/05/30 08:11:12 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_input.c,v $
*
* tp_input() gets an mbuf chain from ip. Actually, not directly
* from ip, because ip calls a net-level routine that strips off
diff --git a/sys/netiso/tp_ip.h b/sys/netiso/tp_ip.h
index 865e2fde69de..b16ed04a6b29 100644
--- a/sys/netiso/tp_ip.h
+++ b/sys/netiso/tp_ip.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_ip.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_ip.h,v 1.3 1994/08/21 06:14:24 paul Exp $
+ * $Id: tp_ip.h,v 1.4 1995/05/30 08:11:13 rgrimes Exp $
*/
#ifndef _NETISO_TP_IP_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_ip.h,v 1.3 1994/08/21 06:14:24 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_ip.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_ip.h,v 1.4 1995/05/30 08:11:13 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_ip.h,v $
*
* internet IP-dependent structures and include files
*
diff --git a/sys/netiso/tp_iso.c b/sys/netiso/tp_iso.c
index b62debedf2f0..5114417ee164 100644
--- a/sys/netiso/tp_iso.c
+++ b/sys/netiso/tp_iso.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_iso.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_iso.c,v 1.2 1994/08/02 07:51:14 davidg Exp $
+ * $Id: tp_iso.c,v 1.3 1995/05/30 08:11:18 rgrimes Exp $
*/
/***********************************************************
@@ -62,8 +62,8 @@ SOFTWARE.
*/
/*
* ARGO TP
- * $Header: /home/ncvs/src/sys/netiso/tp_iso.c,v 1.2 1994/08/02 07:51:14 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_iso.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_iso.c,v 1.3 1995/05/30 08:11:18 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_iso.c,v $
*
* Here is where you find the iso-dependent code. We've tried
* keep all net-level and (primarily) address-family-dependent stuff
diff --git a/sys/netiso/tp_meas.c b/sys/netiso/tp_meas.c
index f7bbecb7d017..d6a7f5ea5f12 100644
--- a/sys/netiso/tp_meas.c
+++ b/sys/netiso/tp_meas.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_meas.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_meas.c,v 1.2 1994/08/02 07:51:15 davidg Exp $
+ * $Id: tp_meas.c,v 1.3 1995/05/30 08:11:20 rgrimes Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
/*
- * $Header: /home/ncvs/src/sys/netiso/tp_meas.c,v 1.2 1994/08/02 07:51:15 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_meas.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_meas.c,v 1.3 1995/05/30 08:11:20 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_meas.c,v $
*
* tp_meas.c : create a performance measurement event
* in the circular buffer tp_Meas[]
diff --git a/sys/netiso/tp_output.c b/sys/netiso/tp_output.c
index bfa938b13012..bbc4ad16c411 100644
--- a/sys/netiso/tp_output.c
+++ b/sys/netiso/tp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_output.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_output.c,v 1.3 1995/04/26 21:32:37 pst Exp $
+ * $Id: tp_output.c,v 1.4 1995/05/30 08:11:23 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_output.c,v 1.3 1995/04/26 21:32:37 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_output.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_output.c,v 1.4 1995/05/30 08:11:23 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_output.c,v $
*
* In here is tp_ctloutput(), the guy called by [sg]etsockopt(),
*/
diff --git a/sys/netiso/tp_param.h b/sys/netiso/tp_param.h
index 6b0195314b9c..ce27f77706ae 100644
--- a/sys/netiso/tp_param.h
+++ b/sys/netiso/tp_param.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_param.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_param.h,v 1.3 1994/08/21 06:14:26 paul Exp $
+ * $Id: tp_param.h,v 1.4 1995/05/30 08:11:24 rgrimes Exp $
*/
#ifndef _NETISO_TP_PARAM_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_param.h,v 1.3 1994/08/21 06:14:26 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_param.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_param.h,v 1.4 1995/05/30 08:11:24 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_param.h,v $
*
*/
diff --git a/sys/netiso/tp_pcb.c b/sys/netiso/tp_pcb.c
index da34f3fa2402..0082972dec44 100644
--- a/sys/netiso/tp_pcb.c
+++ b/sys/netiso/tp_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_pcb.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_pcb.c,v 1.4 1995/04/26 21:32:38 pst Exp $
+ * $Id: tp_pcb.c,v 1.5 1995/05/30 08:11:26 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_pcb.c,v 1.4 1995/04/26 21:32:38 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_pcb.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_pcb.c,v 1.5 1995/05/30 08:11:26 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_pcb.c,v $
*
*
* This is the initialization and cleanup stuff -
diff --git a/sys/netiso/tp_pcb.h b/sys/netiso/tp_pcb.h
index 6322835dd379..e0de63d4f4d1 100644
--- a/sys/netiso/tp_pcb.h
+++ b/sys/netiso/tp_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_pcb.h,v 1.4 1995/04/26 21:32:39 pst Exp $
+ * $Id: tp_pcb.h,v 1.5 1995/05/30 08:11:27 rgrimes Exp $
*/
#ifndef _NETISO_TP_PCB_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_pcb.h,v 1.4 1995/04/26 21:32:39 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_pcb.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_pcb.h,v 1.5 1995/05/30 08:11:27 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_pcb.h,v $
*
*
* This file defines the transport protocol control block (tpcb).
diff --git a/sys/netiso/tp_seq.h b/sys/netiso/tp_seq.h
index 7b8fcd3394ae..a4a312258cf9 100644
--- a/sys/netiso/tp_seq.h
+++ b/sys/netiso/tp_seq.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_seq.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_seq.h,v 1.3 1994/08/21 06:14:28 paul Exp $
+ * $Id: tp_seq.h,v 1.4 1995/05/30 08:11:29 rgrimes Exp $
*/
#ifndef _NETISO_TP_SEQ_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_seq.h,v 1.3 1994/08/21 06:14:28 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_seq.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_seq.h,v 1.4 1995/05/30 08:11:29 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_seq.h,v $
*
* These macros perform sequence number arithmetic modulo (2**7 or 2**31).
* The relevant fields in the tpcb are:
diff --git a/sys/netiso/tp_stat.h b/sys/netiso/tp_stat.h
index e7c80fd22baa..b6db8960e558 100644
--- a/sys/netiso/tp_stat.h
+++ b/sys/netiso/tp_stat.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_stat.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_stat.h,v 1.3 1994/08/21 06:14:28 paul Exp $
+ * $Id: tp_stat.h,v 1.4 1995/05/30 08:11:30 rgrimes Exp $
*/
#ifndef _NETISO_TP_STAT_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_stat.h,v 1.3 1994/08/21 06:14:28 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_stat.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_stat.h,v 1.4 1995/05/30 08:11:30 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_stat.h,v $
*
* Here are the data structures in which the global
* statistics(counters) are gathered.
diff --git a/sys/netiso/tp_states.init b/sys/netiso/tp_states.init
index 89e53453866a..d2333c07996d 100644
--- a/sys/netiso/tp_states.init
+++ b/sys/netiso/tp_states.init
@@ -1,5 +1,5 @@
-/* $Header$ */
-/* $Source$ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_states.init,v 1.1.1.1 1994/05/24 10:07:29 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_states.init,v $ */
{0x3,0x0},
{0x6,0x1},
{0x6,0x2},
diff --git a/sys/netiso/tp_subr.c b/sys/netiso/tp_subr.c
index 6125a0a60747..359b3c91f24f 100644
--- a/sys/netiso/tp_subr.c
+++ b/sys/netiso/tp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_subr.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_subr.c,v 1.3 1995/04/26 21:32:40 pst Exp $
+ * $Id: tp_subr.c,v 1.4 1995/05/30 08:11:32 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_subr.c,v 1.3 1995/04/26 21:32:40 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_subr.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_subr.c,v 1.4 1995/05/30 08:11:32 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_subr.c,v $
*
* The main work of data transfer is done here.
* These routines are called from tp.trans.
diff --git a/sys/netiso/tp_subr2.c b/sys/netiso/tp_subr2.c
index 943d11bcff73..1414df1a4deb 100644
--- a/sys/netiso/tp_subr2.c
+++ b/sys/netiso/tp_subr2.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_subr2.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_subr2.c,v 1.3 1995/04/26 21:32:41 pst Exp $
+ * $Id: tp_subr2.c,v 1.4 1995/05/30 08:11:34 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_subr2.c,v 1.3 1995/04/26 21:32:41 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_subr2.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_subr2.c,v 1.4 1995/05/30 08:11:34 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_subr2.c,v $
*
* Some auxiliary routines:
* tp_protocol_error: required by xebec- called when a combo of state,
diff --git a/sys/netiso/tp_timer.c b/sys/netiso/tp_timer.c
index 6ccc615ff8a3..63ca48d4d7d9 100644
--- a/sys/netiso/tp_timer.c
+++ b/sys/netiso/tp_timer.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_timer.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_timer.c,v 1.2 1994/08/02 07:51:27 davidg Exp $
+ * $Id: tp_timer.c,v 1.3 1995/05/30 08:11:35 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_timer.c,v 1.2 1994/08/02 07:51:27 davidg Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_timer.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_timer.c,v 1.3 1995/05/30 08:11:35 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_timer.c,v $
*
*/
diff --git a/sys/netiso/tp_timer.h b/sys/netiso/tp_timer.h
index 0894480546bb..c0ab2d5663d1 100644
--- a/sys/netiso/tp_timer.h
+++ b/sys/netiso/tp_timer.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_timer.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_timer.h,v 1.3 1994/08/21 06:14:30 paul Exp $
+ * $Id: tp_timer.h,v 1.4 1995/05/30 08:11:37 rgrimes Exp $
*/
#ifndef _NETISO_TP_TIMER_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_timer.h,v 1.3 1994/08/21 06:14:30 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_timer.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_timer.h,v 1.4 1995/05/30 08:11:37 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_timer.h,v $
*
* ARGO TP
* The callout structures used by the tp timers.
diff --git a/sys/netiso/tp_tpdu.h b/sys/netiso/tp_tpdu.h
index c9a36795323e..d2bbf608363a 100644
--- a/sys/netiso/tp_tpdu.h
+++ b/sys/netiso/tp_tpdu.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_tpdu.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_tpdu.h,v 1.3 1994/08/21 06:14:31 paul Exp $
+ * $Id: tp_tpdu.h,v 1.4 1995/05/30 08:11:38 rgrimes Exp $
*/
#ifndef _NETISO_TP_TPDU_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_tpdu.h,v 1.3 1994/08/21 06:14:31 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_tpdu.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_tpdu.h,v 1.4 1995/05/30 08:11:38 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_tpdu.h,v $
*
* This ghastly set of macros makes it possible to
* refer to tpdu structures without going mad.
diff --git a/sys/netiso/tp_trace.c b/sys/netiso/tp_trace.c
index a6f64ef06b34..8e4050e245e7 100644
--- a/sys/netiso/tp_trace.c
+++ b/sys/netiso/tp_trace.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_trace.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_trace.c,v 1.3 1995/04/26 21:32:41 pst Exp $
+ * $Id: tp_trace.c,v 1.4 1995/05/30 08:11:40 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_trace.c,v 1.3 1995/04/26 21:32:41 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_trace.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_trace.c,v 1.4 1995/05/30 08:11:40 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_trace.c,v $
*
* The whole protocol trace module.
* We keep a circular buffer of trace structures, which are big
diff --git a/sys/netiso/tp_trace.h b/sys/netiso/tp_trace.h
index b2dd01cb9740..b0bb47ba2c3f 100644
--- a/sys/netiso/tp_trace.h
+++ b/sys/netiso/tp_trace.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_trace.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_trace.h,v 1.3 1994/08/21 06:14:32 paul Exp $
+ * $Id: tp_trace.h,v 1.4 1995/05/30 08:11:41 rgrimes Exp $
*/
#ifndef _NETISO_TP_TRACE_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_trace.h,v 1.3 1994/08/21 06:14:32 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_trace.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_trace.h,v 1.4 1995/05/30 08:11:41 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_trace.h,v $
*
*
* Definitions needed for the protocol trace mechanism.
diff --git a/sys/netiso/tp_user.h b/sys/netiso/tp_user.h
index bc86c2e2bd0d..79a7415eda92 100644
--- a/sys/netiso/tp_user.h
+++ b/sys/netiso/tp_user.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_user.h 8.1 (Berkeley) 6/10/93
- * $Id: tp_user.h,v 1.3 1994/08/21 06:14:32 paul Exp $
+ * $Id: tp_user.h,v 1.4 1995/05/30 08:11:43 rgrimes Exp $
*/
#ifndef _NETISO_TP_USER_H_
@@ -66,8 +66,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_user.h,v 1.3 1994/08/21 06:14:32 paul Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_user.h,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_user.h,v 1.4 1995/05/30 08:11:43 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_user.h,v $
*
* These are the values a real-live user ;-) needs.
*/
diff --git a/sys/netiso/tp_usrreq.c b/sys/netiso/tp_usrreq.c
index 13948e8f9541..8f6a5cd05dd9 100644
--- a/sys/netiso/tp_usrreq.c
+++ b/sys/netiso/tp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id: tp_usrreq.c,v 1.3 1995/04/26 21:32:42 pst Exp $
+ * $Id: tp_usrreq.c,v 1.4 1995/05/30 08:11:44 rgrimes Exp $
*/
/***********************************************************
@@ -63,8 +63,8 @@ SOFTWARE.
/*
* ARGO TP
*
- * $Header: /home/ncvs/src/sys/netiso/tp_usrreq.c,v 1.3 1995/04/26 21:32:42 pst Exp $
- * $Source: /home/ncvs/src/sys/netiso/tp_usrreq.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_usrreq.c,v 1.4 1995/05/30 08:11:44 rgrimes Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/Attic/tp_usrreq.c,v $
*
* tp_usrreq(), the fellow that gets called from most of the socket code.
* Pretty straighforward.
diff --git a/sys/netiso/xebec/debug.h b/sys/netiso/xebec/debug.h
index c5b3622ce13c..aa0c6564c189 100644
--- a/sys/netiso/xebec/debug.h
+++ b/sys/netiso/xebec/debug.h
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/debug.h,v 1.1.1.1 1994/05/24 10:07:51 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/debug.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/debug.h,v 1.2 1995/05/30 08:11:55 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/debug.h,v $ */
#define OUT stdout
diff --git a/sys/netiso/xebec/llparse.c b/sys/netiso/xebec/llparse.c
index 68b511ea7861..cbca4830aa60 100644
--- a/sys/netiso/xebec/llparse.c
+++ b/sys/netiso/xebec/llparse.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/llparse.c,v 1.1.1.1 1994/05/24 10:07:51 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/llparse.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llparse.c,v 1.2 1995/05/30 08:11:57 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llparse.c,v $ */
/*
* ************************* NOTICE *******************************
* This code is in the public domain. It cannot be copyrighted.
diff --git a/sys/netiso/xebec/llparse.h b/sys/netiso/xebec/llparse.h
index 718c3608dbe0..01f70a94da8e 100644
--- a/sys/netiso/xebec/llparse.h
+++ b/sys/netiso/xebec/llparse.h
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/llparse.h,v 1.1.1.1 1994/05/24 10:07:50 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/llparse.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llparse.h,v 1.2 1995/05/30 08:11:59 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llparse.h,v $ */
/************************************************************
attributes stack garbage
diff --git a/sys/netiso/xebec/llscan.c b/sys/netiso/xebec/llscan.c
index 8f1f1a033c59..4163e9425034 100644
--- a/sys/netiso/xebec/llscan.c
+++ b/sys/netiso/xebec/llscan.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/llscan.c,v 1.1.1.1 1994/05/24 10:07:50 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/llscan.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llscan.c,v 1.2 1995/05/30 08:12:01 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/llscan.c,v $ */
/*
* ************************* NOTICE *******************************
* This code is in the public domain. It cannot be copyrighted.
diff --git a/sys/netiso/xebec/main.c b/sys/netiso/xebec/main.c
index b46a930f5cc3..566114dae5da 100644
--- a/sys/netiso/xebec/main.c
+++ b/sys/netiso/xebec/main.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/main.c,v 1.1.1.1 1994/05/24 10:07:49 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/main.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/main.c,v 1.2 1995/05/30 08:12:03 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/main.c,v $ */
/*
* TODO:
* rewrite the command line stuff altogether - it's kludged beyond
diff --git a/sys/netiso/xebec/main.h b/sys/netiso/xebec/main.h
index 236058d68036..c64a27f15609 100644
--- a/sys/netiso/xebec/main.h
+++ b/sys/netiso/xebec/main.h
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/main.h,v 1.1.1.1 1994/05/24 10:07:49 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/main.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/main.h,v 1.2 1995/05/30 08:12:05 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/main.h,v $ */
#define TRUE 1
#define FALSE 0
diff --git a/sys/netiso/xebec/malloc.c b/sys/netiso/xebec/malloc.c
index d09af2987cdb..5abe2d43183f 100644
--- a/sys/netiso/xebec/malloc.c
+++ b/sys/netiso/xebec/malloc.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/malloc.c,v 1.1.1.1 1994/05/24 10:07:48 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/malloc.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/malloc.c,v 1.2 1995/05/30 08:12:07 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/malloc.c,v $ */
/*
* This code is such a kludge that I don't want to put my name on it.
* It was a ridiculously fast hack and needs rewriting.
diff --git a/sys/netiso/xebec/malloc.h b/sys/netiso/xebec/malloc.h
index 53d865bf47b5..4de16e123886 100644
--- a/sys/netiso/xebec/malloc.h
+++ b/sys/netiso/xebec/malloc.h
@@ -1,4 +1,4 @@
-/* $Header: malloc.h,v 2.1 88/09/19 12:56:27 nhall Exp $ */
-/* $Source: /var/home/tadl/src/argo/xebec/RCS/malloc.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/malloc.h,v 1.1.1.1 1994/05/24 10:07:47 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/malloc.h,v $ */
char *Malloc();
diff --git a/sys/netiso/xebec/procs.c b/sys/netiso/xebec/procs.c
index 8134a82f65a8..f6b7744d29b8 100644
--- a/sys/netiso/xebec/procs.c
+++ b/sys/netiso/xebec/procs.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/procs.c,v 1.1.1.1 1994/05/24 10:07:46 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/procs.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/procs.c,v 1.2 1995/05/30 08:12:08 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/procs.c,v $ */
/*
* This code is such a kludge that I don't want to put my name on it.
* It was a ridiculously fast hack and needs rewriting.
diff --git a/sys/netiso/xebec/procs.h b/sys/netiso/xebec/procs.h
index e41ae75995ce..e886434334b1 100644
--- a/sys/netiso/xebec/procs.h
+++ b/sys/netiso/xebec/procs.h
@@ -1,5 +1,5 @@
-/* $Header: procs.h,v 2.1 88/09/19 12:56:30 nhall Exp $ */
-/* $Source: /var/home/tadl/src/argo/xebec/RCS/procs.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/procs.h,v 1.1.1.1 1994/05/24 10:07:46 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/procs.h,v $ */
extern char *stash();
extern struct Object *SameState;
diff --git a/sys/netiso/xebec/putdriver.c b/sys/netiso/xebec/putdriver.c
index 85fcd501fccf..6543c3abf362 100644
--- a/sys/netiso/xebec/putdriver.c
+++ b/sys/netiso/xebec/putdriver.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/putdriver.c,v 1.1.1.1 1994/05/24 10:07:46 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/putdriver.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/putdriver.c,v 1.2 1995/05/30 08:12:10 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/putdriver.c,v $ */
/*
* This code is such a kludge that I don't want to put my name on it.
diff --git a/sys/netiso/xebec/sets.c b/sys/netiso/xebec/sets.c
index 6022a894434d..7cbfaaa2656f 100644
--- a/sys/netiso/xebec/sets.c
+++ b/sys/netiso/xebec/sets.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/sets.c,v 1.1.1.1 1994/05/24 10:07:45 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/sets.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/sets.c,v 1.2 1995/05/30 08:12:12 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/sets.c,v $ */
/*
* This code is such a kludge that I don't want to put my name on it.
* It was a ridiculously fast hack and needs rewriting.
diff --git a/sys/netiso/xebec/sets.h b/sys/netiso/xebec/sets.h
index 15168ef26b0d..b1ef98d651cb 100644
--- a/sys/netiso/xebec/sets.h
+++ b/sys/netiso/xebec/sets.h
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/sets.h,v 1.1.1.1 1994/05/24 10:07:44 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/sets.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/sets.h,v 1.2 1995/05/30 08:12:14 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/sets.h,v $ */
#define MAXEVENTS 200
#define MAXSTATES 200
diff --git a/sys/netiso/xebec/test.trans b/sys/netiso/xebec/test.trans
index 49db36109943..9cacba95c0a8 100644
--- a/sys/netiso/xebec/test.trans
+++ b/sys/netiso/xebec/test.trans
@@ -1,4 +1,4 @@
-/* $Header: test.trans,v 0.2 88/09/19 12:58:29 nhall Exp $
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/test.trans,v 1.1.1.1 1994/05/24 10:07:51 rgrimes Exp $
*/
*PROTOCOL test
diff --git a/sys/netiso/xebec/xebec.c b/sys/netiso/xebec/xebec.c
index 40f862fe10a3..485f8a2f2bc4 100644
--- a/sys/netiso/xebec/xebec.c
+++ b/sys/netiso/xebec/xebec.c
@@ -1,5 +1,5 @@
-/* $Header: /home/ncvs/src/sys/netiso/xebec/xebec.c,v 1.1.1.1 1994/05/24 10:07:43 rgrimes Exp $ */
-/* $Source: /home/ncvs/src/sys/netiso/xebec/xebec.c,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/xebec.c,v 1.2 1995/05/30 08:12:16 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/xebec.c,v $ */
#include "xebec.h"
#include "llparse.h"
diff --git a/sys/netiso/xebec/xebec.h b/sys/netiso/xebec/xebec.h
index 168bb77b249d..cf5a443467dd 100644
--- a/sys/netiso/xebec/xebec.h
+++ b/sys/netiso/xebec/xebec.h
@@ -1,5 +1,5 @@
-/* $Header: xebec.h,v 2.1 88/09/19 12:56:35 nhall Exp $ */
-/* $Source: /var/home/tadl/src/argo/xebec/RCS/xebec.h,v $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/xebec.h,v 1.1.1.1 1994/05/24 10:07:40 rgrimes Exp $ */
+/* $Source: /pub/FreeBSD/FreeBSD-CVS/src/sys/netiso/xebec/Attic/xebec.h,v $ */
union llattrib {
struct {
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 9fa5b9c2cc5d..38e1141cd6f8 100644
--- a/sys/pci/if_fxp.c
+++ b/sys/pci/if_fxp.c
@@ -283,7 +283,6 @@ fxp_attach(config_id, unit)
ifp->if_output = ether_output;
ifp->if_start = fxp_start;
ifp->if_watchdog = fxp_watchdog;
- ifp->if_baudrate = 100000000;
fxp_get_macaddr(sc);
printf("fxp%d: Ethernet address %s\n", unit,
diff --git a/sys/sys/ipc.h b/sys/sys/ipc.h
index 683682b63df8..314758ebe96a 100644
--- a/sys/sys/ipc.h
+++ b/sys/sys/ipc.h
@@ -40,8 +40,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)ipc.h 8.4 (Berkeley) 2/19/95
- * $Id: ipc.h,v 1.5.4.1 1996/06/03 05:12:07 jkh Exp $
+ * @(#)ipc.h 8.3 (Berkeley) 1/21/94
+ * $Id: ipc.h,v 1.5 1994/12/30 05:38:14 davidg Exp $
*/
/*
@@ -50,6 +50,8 @@
#ifndef _SYS_IPC_H_
#define _SYS_IPC_H_
+typedef long key_t; /* XXX should be in types.h */
+
struct ipc_perm {
ushort cuid; /* creator user id */
ushort cgid; /* creator group id */
@@ -83,18 +85,6 @@ struct ipc_perm {
#define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff))
int ipcperm __P((struct ucred *,struct ipc_perm *,int));
-#else /* ! KERNEL */
-
-/* XXX doesn't really belong here, but has been historical practice in SysV. */
-
-#ifndef _POSIX_SOURCE
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-key_t ftok __P((const char *, int));
-__END_DECLS
-#endif /* ! POSIX */
-
#endif /* KERNEL */
#endif /* !_SYS_IPC_H_ */
diff --git a/sys/sys/link_aout.h b/sys/sys/link_aout.h
index e527ab3d6c45..c71a1fcbd539 100644
--- a/sys/sys/link_aout.h
+++ b/sys/sys/link_aout.h
@@ -14,7 +14,7 @@
* must display the following acknowledgement:
* This product includes software developed by Paul Kranenburg.
* 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
+ * derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -27,7 +27,7 @@
* (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: link.h,v 1.6 1996/01/30 23:30:20 mpp Exp $
+ * $Id: link.h,v 1.4.4.1 1995/08/25 07:08:07 davidg Exp $
*/
/*
@@ -42,7 +42,7 @@
#define _LINK_H_
/*
- * A `Shared Object Descriptor' describes a shared object that is needed
+ * A `Shared Object Descriptor' descibes a shared object that is needed
* to complete the link edit process of the object containing it.
* A list of such objects (chained through `sod_next') is pointed at
* by `sdt_sods' in the section_dispatch_table structure.
@@ -237,7 +237,7 @@ struct _dynamic {
*/
struct crt_ldso {
int crt_ba; /* Base address of ld.so */
- int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */
+ int crt_dzfd; /* "/dev/zero" file decriptor (SunOS) */
int crt_ldfd; /* ld.so file descriptor */
struct _dynamic *crt_dp; /* Main's __DYNAMIC */
char **crt_ep; /* environment strings */
diff --git a/sys/sys/link_elf.h b/sys/sys/link_elf.h
index e527ab3d6c45..c71a1fcbd539 100644
--- a/sys/sys/link_elf.h
+++ b/sys/sys/link_elf.h
@@ -14,7 +14,7 @@
* must display the following acknowledgement:
* This product includes software developed by Paul Kranenburg.
* 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
+ * derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -27,7 +27,7 @@
* (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: link.h,v 1.6 1996/01/30 23:30:20 mpp Exp $
+ * $Id: link.h,v 1.4.4.1 1995/08/25 07:08:07 davidg Exp $
*/
/*
@@ -42,7 +42,7 @@
#define _LINK_H_
/*
- * A `Shared Object Descriptor' describes a shared object that is needed
+ * A `Shared Object Descriptor' descibes a shared object that is needed
* to complete the link edit process of the object containing it.
* A list of such objects (chained through `sod_next') is pointed at
* by `sdt_sods' in the section_dispatch_table structure.
@@ -237,7 +237,7 @@ struct _dynamic {
*/
struct crt_ldso {
int crt_ba; /* Base address of ld.so */
- int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */
+ int crt_dzfd; /* "/dev/zero" file decriptor (SunOS) */
int crt_ldfd; /* ld.so file descriptor */
struct _dynamic *crt_dp; /* Main's __DYNAMIC */
char **crt_ep; /* environment strings */
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 30ce65200138..9a6d2d1316ce 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -136,12 +136,7 @@ struct ctlname {
#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_SOMAXCONN 30 /* int: max connections in listen q */
-#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_SOCKBUF_WASTE 34 /* int: reserved sockbuf space */
-#define KERN_MAXID 35 /* number of valid kern ids */
+#define KERN_MAXID 30 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
@@ -173,12 +168,7 @@ struct ctlname {
{ "bootfile", CTLTYPE_STRING }, \
{ "maxfilesperproc", CTLTYPE_INT }, \
{ "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "somaxconn", CTLTYPE_INT }, \
- { "maxsockbuf", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
- { "sockbuf_waste_factor", CTLTYPE_INT }, \
+ { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
}
/*
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 3e4f0726043c..81e8f452b516 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1982, 1986, 1991, 1993, 1994
+ * 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
@@ -35,16 +35,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)types.h 8.6 (Berkeley) 2/19/95
- * $Id: types.h,v 1.4.8.1 1996/06/03 05:12:07 jkh Exp $
+ * @(#)types.h 8.4 (Berkeley) 1/21/94
+ * $Id: types.h,v 1.4 1994/09/25 15:56:25 davidg Exp $
*/
#ifndef _SYS_TYPES_H_
#define _SYS_TYPES_H_
+#include <sys/cdefs.h>
+
/* Machine type dependent parameters. */
-#include <machine/ansi.h>
-#include <machine/types.h>
+#include <machine/endian.h>
#ifndef _POSIX_SOURCE
typedef unsigned char u_char;
@@ -55,24 +56,23 @@ typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
-typedef u_int64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
+typedef unsigned long long u_quad_t; /* quads */
+typedef long long quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
-typedef int32_t daddr_t; /* disk address */
-typedef u_int32_t dev_t; /* device number */
-typedef u_int32_t fixpt_t; /* fixed point number */
-typedef u_int32_t gid_t; /* group id */
-typedef u_int32_t ino_t; /* inode number */
-typedef long key_t; /* IPC key (for Sys V IPC) */
-typedef u_int16_t mode_t; /* permissions */
-typedef u_int16_t nlink_t; /* link count */
-typedef _BSD_OFF_T_ off_t; /* file offset */
-typedef _BSD_PID_T_ pid_t; /* process id */
-typedef int32_t segsz_t; /* segment size */
-typedef int32_t swblk_t; /* swap offset */
-typedef u_int32_t uid_t; /* user id */
+typedef long daddr_t; /* disk address */
+typedef unsigned long dev_t; /* device number */
+typedef unsigned long fixpt_t; /* fixed point number */
+typedef unsigned long gid_t; /* group id */
+typedef unsigned long ino_t; /* inode number */
+typedef unsigned short mode_t; /* permissions */
+typedef unsigned short nlink_t; /* link count */
+typedef quad_t off_t; /* file offset */
+typedef long pid_t; /* process id */
+typedef long segsz_t; /* segment size */
+typedef long swblk_t; /* swap offset */
+typedef unsigned long uid_t; /* user id */
/*
* This belongs in unistd.h, but is placed here to ensure that programs
@@ -80,7 +80,6 @@ typedef u_int32_t uid_t; /* user id */
* version of lseek.
*/
#ifndef KERNEL
-#include <sys/cdefs.h>
__BEGIN_DECLS
off_t lseek __P((int, off_t, int));
__END_DECLS
@@ -94,10 +93,11 @@ __END_DECLS
*/
#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
+#define makedev(x,y) ((dev_t)(((x)<<8) | (y))) /* create dev_t */
#endif
-#include <machine/endian.h>
+#include <machine/ansi.h>
+#include <machine/types.h>
#ifdef _BSD_CLOCK_T_
typedef _BSD_CLOCK_T_ clock_t;
@@ -136,7 +136,7 @@ typedef long fd_mask;
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
#ifndef howmany
-#define howmany(x, y) (((x) + ((y) - 1)) / (y))
+#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
typedef struct fd_set {
diff --git a/usr.bin/compile_et/compile_et.1 b/usr.bin/compile_et/compile_et.1
index f17a278bdc71..df664bdacf7d 100644
--- a/usr.bin/compile_et/compile_et.1
+++ b/usr.bin/compile_et/compile_et.1
@@ -1,7 +1,7 @@
.\" Copyright (c) 1988 Massachusetts Institute of Technology,
.\" Student Information Processing Board. All rights reserved.
.\"
-.\" $Header$
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compile_et/compile_et.1,v 1.1 1995/01/14 22:29:30 wollman Exp $
.\"
.TH COMPILE_ET 1 "22 Nov 1988" SIPB
.SH NAME
diff --git a/usr.bin/compile_et/compile_et.c b/usr.bin/compile_et/compile_et.c
index 8e3f492140ff..5635df928cab 100644
--- a/usr.bin/compile_et/compile_et.c
+++ b/usr.bin/compile_et/compile_et.c
@@ -23,7 +23,7 @@ static const char copyright[] =
"Copyright 1987,1988 by MIT Student Information Processing Board";
static const char rcsid_compile_et_c[] =
- "$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/athena.lib/et/RCS/compile_et.c,v 1.3 91/02/28 15:15:23 epeisach Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compile_et/compile_et.c,v 1.2 1995/01/14 22:29:31 wollman Exp $";
#endif
extern char *gensym();
diff --git a/usr.bin/compile_et/error_table.y b/usr.bin/compile_et/error_table.y
index cb3c0dabc7cf..f584ef15d87a 100644
--- a/usr.bin/compile_et/error_table.y
+++ b/usr.bin/compile_et/error_table.y
@@ -74,7 +74,7 @@ description : QUOTED_STRING
#ifndef lint
static char const rcsid_error_table_y[] =
- "$Header: /home/ncvs/src/usr.bin/compile_et/error_table.y,v 1.2 1995/01/14 22:29:33 wollman Exp $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compile_et/error_table.y,v 1.3 1995/03/15 19:05:28 wpaul Exp $";
#endif
void *malloc(), *realloc();
diff --git a/usr.bin/compile_et/et_lex.lex.l b/usr.bin/compile_et/et_lex.lex.l
index 0c848de295c4..bffe0d4855f5 100644
--- a/usr.bin/compile_et/et_lex.lex.l
+++ b/usr.bin/compile_et/et_lex.lex.l
@@ -22,5 +22,5 @@ end return END;
. { return (*yytext); }
%%
#ifndef lint
-static char rcsid_et_lex_lex_l[] = "$Header: et_lex.lex.l,v 1.3 87/10/31 06:28:05 raeburn Exp $";
+static char rcsid_et_lex_lex_l[] = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compile_et/et_lex.lex.l,v 1.2 1995/01/14 22:29:33 wollman Exp $";
#endif
diff --git a/usr.bin/compress/doc/revision.log b/usr.bin/compress/doc/revision.log
index b1d8b24cc4f0..efddfbd716e3 100644
--- a/usr.bin/compress/doc/revision.log
+++ b/usr.bin/compress/doc/revision.log
@@ -1,6 +1,9 @@
/*
- * $Header: compress.c,v 4.0 85/07/30 12:50:00 joe Release $
- * $Log: compress.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compress/doc/revision.log,v 1.1.1.1 1994/05/27 12:30:59 rgrimes Exp $
+ * $Log: revision.log,v $
+# Revision 1.1.1.1 1994/05/27 12:30:59 rgrimes
+# BSD 4.4 Lite Usr.bin Sources
+#
* Revision 4.0 85/07/30 12:50:00 joe
* Removed ferror() calls in output routine on every output except first.
* Prepared for release to the world.
@@ -113,4 +116,4 @@
*/
static char rcs_ident[] =
- "$Header: compress.c,v 4.0 85/07/30 12:50:00 joe Release $";
+ "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/compress/doc/revision.log,v 1.1.1.1 1994/05/27 12:30:59 rgrimes Exp $";
diff --git a/usr.bin/ee/doc/new_curse.c b/usr.bin/ee/doc/new_curse.c
index 0e6cd54831cf..9d57038e19a6 100644
--- a/usr.bin/ee/doc/new_curse.c
+++ b/usr.bin/ee/doc/new_curse.c
@@ -37,14 +37,14 @@
| Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon
| All are rights reserved.
|
- | $Header: /home/hugh/sources/old_ae/RCS/new_curse.c,v 1.37 1995/08/28 23:49:26 hugh Exp $
+ | $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/ee/doc/new_curse.c,v 1.1.1.1 1995/08/30 07:28:06 jkh Exp $
|
*/
char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon",
"All rights are reserved."};
-char * new_curse_name= "@(#) new_curse.c $Revision: 1.37 $";
+char * new_curse_name= "@(#) new_curse.c $Revision: 1.1.1.1 $";
#include "new_curse.h"
#include <signal.h>
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c
index 1552db1fed1a..0556fd7322f4 100644
--- a/usr.bin/ee/ee.c
+++ b/usr.bin/ee/ee.c
@@ -49,7 +49,7 @@
| proprietary information which is protected by
| copyright. All rights are reserved.
|
- | $Header: /home/ncvs/src/usr.bin/ee/ee.c,v 1.3.2.1 1995/10/22 14:14:25 jkh Exp $
+ | $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/ee/ee.c,v 1.3.2.2 1996/05/27 21:07:11 joerg Exp $
|
*/
@@ -62,7 +62,7 @@ char *ee_long_notice[] = {
"copyright. All rights are reserved."
};
-char *version = "@(#) ee, version 1.2.4 $Revision: 1.3.2.1 $";
+char *version = "@(#) ee, version 1.2.4 $Revision: 1.3.2.2 $";
#ifdef NCURSE
#include "new_curse.h"
diff --git a/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg b/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg
index 9f62c500881e..042bc7fd9490 100644
--- a/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg
+++ b/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg
@@ -3,7 +3,7 @@ $ ee.i18n.guide for more information
$
$ For ee patchlevel 3
$
-$ $Header: /home/ncvs/src/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg,v 1.1 1995/10/21 23:47:40 joerg Exp $
+$ $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/ee/nls/de_DE.ISO_8859-1/ee.msg,v 1.1.2.1 1996/05/27 21:07:59 joerg Exp $
$
$set 1
$quote "
diff --git a/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg b/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg
index 1d4fe8c0e03f..e5cc9c770583 100644
--- a/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg
+++ b/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg
@@ -3,7 +3,7 @@ $ ee.i18n.guide for more information
$
$ For ee patchlevel 3
$
-$ $Header: /home/ncvs/src/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg,v 1.1 1995/08/30 13:25:55 jkh Exp $
+$ $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/ee/nls/en_US.ISO_8859-1/ee.msg,v 1.1.2.1 1996/05/27 21:08:02 joerg Exp $
$
$set 1
$quote "
diff --git a/usr.bin/getopt/Makefile b/usr.bin/getopt/Makefile
index 21dde959afa2..2b373ee386ac 100644
--- a/usr.bin/getopt/Makefile
+++ b/usr.bin/getopt/Makefile
@@ -1,4 +1,4 @@
-# $Header: /b/source/CVS/src/usr.bin/getopt/Makefile,v 1.1 1993/06/21 12:43:58 brezak Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/getopt/Makefile,v 1.1 1993/07/26 22:22:35 nate Exp $
#
PROG = getopt
diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c
index 3ab77ac63ed8..27888cae97b7 100644
--- a/usr.bin/ipcs/ipcs.c
+++ b/usr.bin/ipcs/ipcs.c
@@ -182,14 +182,6 @@ main(argc, argv)
default:
usage();
}
-
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
- if (namelist != NULL || core != NULL)
- setgid(getgid());
-
if ((kd = kvm_open(namelist, core, NULL, O_RDONLY, "ipcs")) == NULL)
exit(1);
diff --git a/usr.bin/lex/FlexLexer.h b/usr.bin/lex/FlexLexer.h
index feb40b66265d..48d1369d5913 100644
--- a/usr.bin/lex/FlexLexer.h
+++ b/usr.bin/lex/FlexLexer.h
@@ -1,4 +1,4 @@
-// $Header: FlexLexer.h,v 1.2 94/01/04 14:57:26 vern Exp $
+// $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/FlexLexer.h,v 1.1.1.1 1994/08/24 13:10:33 csgr Exp $
// FlexLexer.h -- define classes for lexical analyzers generated by flex
diff --git a/usr.bin/lex/ccl.c b/usr.bin/lex/ccl.c
index 5f613b4eddee..8a1e2784655c 100644
--- a/usr.bin/lex/ccl.c
+++ b/usr.bin/lex/ccl.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/ccl.c,v 1.1.1.1 1994/08/24 13:10:33 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/ccl.c,v 1.2 1995/05/30 06:31:06 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/dfa.c b/usr.bin/lex/dfa.c
index 83eb4547227d..62ffa0c7f6b2 100644
--- a/usr.bin/lex/dfa.c
+++ b/usr.bin/lex/dfa.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/dfa.c,v 1.1.1.1 1994/08/24 13:10:33 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/dfa.c,v 1.2 1995/05/30 06:31:08 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/ecs.c b/usr.bin/lex/ecs.c
index 7aed68f193c2..e186b2794f44 100644
--- a/usr.bin/lex/ecs.c
+++ b/usr.bin/lex/ecs.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/ecs.c,v 1.1.1.1 1994/08/24 13:10:33 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/ecs.c,v 1.2 1995/05/30 06:31:09 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl
index 01ff7a1262b4..92f909981a7f 100644
--- a/usr.bin/lex/flex.skl
+++ b/usr.bin/lex/flex.skl
@@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/flex-2.4.7/RCS/flex.skl,v 1.2 94/08/03 11:13:24 vern Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/flex.skl,v 1.1.1.1 1994/08/24 13:10:33 csgr Exp $
*/
#define FLEX_SCANNER
diff --git a/usr.bin/lex/flexdef.h b/usr.bin/lex/flexdef.h
index bf5c10d25a15..d2fc16bb5c3b 100644
--- a/usr.bin/lex/flexdef.h
+++ b/usr.bin/lex/flexdef.h
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* @(#) $Header: /home/ncvs/src/usr.bin/lex/flexdef.h,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ (LBL) */
+/* @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/flexdef.h,v 1.2 1995/05/30 06:31:12 rgrimes Exp $ (LBL) */
#include <stdio.h>
#include <ctype.h>
diff --git a/usr.bin/lex/gen.c b/usr.bin/lex/gen.c
index 9115a7c58bad..7d06703ed8a0 100644
--- a/usr.bin/lex/gen.c
+++ b/usr.bin/lex/gen.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/gen.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/gen.c,v 1.2 1995/05/30 06:31:13 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c
index f608d4c7720b..70a1237238d3 100644
--- a/usr.bin/lex/initscan.c
+++ b/usr.bin/lex/initscan.c
@@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /home/ncvs/src/usr.bin/lex/initscan.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/initscan.c,v 1.2 1995/05/30 06:31:14 rgrimes Exp $
*/
#define FLEX_SCANNER
@@ -894,7 +894,7 @@ char *yytext;
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/initscan.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/initscan.c,v 1.2 1995/05/30 06:31:14 rgrimes Exp $ */
#include "flexdef.h"
#include "parse.h"
diff --git a/usr.bin/lex/lib/libmain.c b/usr.bin/lex/lib/libmain.c
index a893c7abd3d2..a7efd3abdcc3 100644
--- a/usr.bin/lex/lib/libmain.c
+++ b/usr.bin/lex/lib/libmain.c
@@ -1,6 +1,6 @@
/* libmain - flex run-time support library "main" function */
-/* $Header: /home/daffy/u0/vern/flex/RCS/libmain.c,v 1.3 93/04/14 22:41:55 vern Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/lib/libmain.c,v 1.1.1.1 1994/08/24 13:10:34 csgr Exp $ */
extern int yylex();
diff --git a/usr.bin/lex/lib/libyywrap.c b/usr.bin/lex/lib/libyywrap.c
index b18f54e6e8f9..c14876b47fb0 100644
--- a/usr.bin/lex/lib/libyywrap.c
+++ b/usr.bin/lex/lib/libyywrap.c
@@ -1,6 +1,6 @@
/* libyywrap - flex run-time support library "yywrap" function */
-/* $Header: /home/daffy/u0/vern/flex/RCS/libyywrap.c,v 1.1 93/10/02 15:23:09 vern Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/lib/libyywrap.c,v 1.1.1.1 1994/08/24 13:10:34 csgr Exp $ */
int yywrap()
{
diff --git a/usr.bin/lex/main.c b/usr.bin/lex/main.c
index 2139daace22a..116901b91018 100644
--- a/usr.bin/lex/main.c
+++ b/usr.bin/lex/main.c
@@ -32,7 +32,7 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
-/* $Header: /home/ncvs/src/usr.bin/lex/main.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/main.c,v 1.2 1995/05/30 06:31:15 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/misc.c b/usr.bin/lex/misc.c
index 1cbdbd6fb8cb..37889e50438a 100644
--- a/usr.bin/lex/misc.c
+++ b/usr.bin/lex/misc.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/misc.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/misc.c,v 1.2 1995/05/30 06:31:16 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/nfa.c b/usr.bin/lex/nfa.c
index 7820ce9a6f81..5007b8ca9f08 100644
--- a/usr.bin/lex/nfa.c
+++ b/usr.bin/lex/nfa.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/nfa.c,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/nfa.c,v 1.2 1995/05/30 06:31:17 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/parse.y b/usr.bin/lex/parse.y
index c14f2452ca4a..4cd4db9dc3d8 100644
--- a/usr.bin/lex/parse.y
+++ b/usr.bin/lex/parse.y
@@ -29,7 +29,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/daffy/u0/vern/flex/RCS/parse.y,v 2.15 93/12/09 13:57:23 vern Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/parse.y,v 1.1.1.1 1994/08/24 13:10:32 csgr Exp $ */
/* Some versions of bison are broken in that they use alloca() but don't
diff --git a/usr.bin/lex/scan.l b/usr.bin/lex/scan.l
index 74b589c771ce..59742c56c615 100644
--- a/usr.bin/lex/scan.l
+++ b/usr.bin/lex/scan.l
@@ -27,7 +27,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: scan.l,v 1.2 94/01/04 14:33:09 vern Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/scan.l,v 1.1.1.1 1994/08/24 13:10:31 csgr Exp $ */
#include "flexdef.h"
#include "parse.h"
diff --git a/usr.bin/lex/skel.c b/usr.bin/lex/skel.c
index 4ab49d1085cd..f7030209758d 100644
--- a/usr.bin/lex/skel.c
+++ b/usr.bin/lex/skel.c
@@ -6,7 +6,7 @@ char *skel[] = {
"/* A lexical scanner generated by flex */",
"",
"/* Scanner skeleton version:",
- " * $Header: /home/daffy/u0/vern/flex/flex-2.4.7/RCS/flex.skl,v 1.2 94/08/03 11:13:24 vern Exp $",
+ " * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/skel.c,v 1.1.1.1 1994/08/24 13:10:31 csgr Exp $",
" */",
"",
"#define FLEX_SCANNER",
diff --git a/usr.bin/lex/sym.c b/usr.bin/lex/sym.c
index 3a55b6836e37..fde1ef4236c4 100644
--- a/usr.bin/lex/sym.c
+++ b/usr.bin/lex/sym.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/sym.c,v 1.1.1.1 1994/08/24 13:10:31 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/sym.c,v 1.2 1995/05/30 06:31:18 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/tblcmp.c b/usr.bin/lex/tblcmp.c
index 655717ba2662..d5185ebea4be 100644
--- a/usr.bin/lex/tblcmp.c
+++ b/usr.bin/lex/tblcmp.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/tblcmp.c,v 1.1.1.1 1994/08/24 13:10:31 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/tblcmp.c,v 1.2 1995/05/30 06:31:19 rgrimes Exp $ */
#include "flexdef.h"
diff --git a/usr.bin/lex/yylex.c b/usr.bin/lex/yylex.c
index 6edb13049f56..0c915447512b 100644
--- a/usr.bin/lex/yylex.c
+++ b/usr.bin/lex/yylex.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/yylex.c,v 1.1.1.1 1994/08/24 13:10:34 csgr Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/lex/yylex.c,v 1.2 1995/05/30 06:31:20 rgrimes Exp $ */
#include <ctype.h>
#include "flexdef.h"
diff --git a/usr.bin/modstat/Makefile b/usr.bin/modstat/Makefile
index c7f18f1cbf4a..22ba7a6b7198 100644
--- a/usr.bin/modstat/Makefile
+++ b/usr.bin/modstat/Makefile
@@ -38,5 +38,7 @@
PROG= modstat
MAN8= modstat.8
+BINGRP= kmem
+BINMODE=2555
.include <bsd.prog.mk>
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index ade41449ce7c..72fbf3266601 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -36,8 +36,8 @@ static char sccsid[] = "@(#)iso.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
- * $Header: /home/ncvs/src/usr.bin/netstat/iso.c,v 1.1.1.1 1994/05/27 12:32:25 rgrimes Exp $
- * $Source: /home/ncvs/src/usr.bin/netstat/iso.c,v $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/netstat/iso.c,v 1.2 1995/04/09 05:33:17 davidg Exp $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/netstat/iso.c,v $
*/
/*******************************************************************************
Copyright IBM Corporation 1987
diff --git a/usr.bin/rlogin/krcmd.c b/usr.bin/rlogin/krcmd.c
index c5eee4f0720b..35e31b68cf92 100644
--- a/usr.bin/rlogin/krcmd.c
+++ b/usr.bin/rlogin/krcmd.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)krcmd.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
- * $Source: /home/ncvs/src/usr.bin/rlogin/krcmd.c,v $
+ * $Source: /pub/FreeBSD/FreeBSD-CVS/src/usr.bin/rlogin/krcmd.c,v $
* $Header: /mit/kerberos/ucb/mit/kcmd/RCS/krcmd.c,v 5.1
* 89/07/25 15:38:44 kfall Exp Locker: kfall $
* static char *rcsid_kcmd_c =
diff --git a/usr.bin/symorder/symorder.1 b/usr.bin/symorder/symorder.1
index a609799688e3..1ed08884ae77 100644
--- a/usr.bin/symorder/symorder.1
+++ b/usr.bin/symorder/symorder.1
@@ -39,7 +39,6 @@
.Nd rearrange name list
.Sh SYNOPSIS
.Nm symorder
-.Fl c
.Fl m
.Fl t
.Fl x
@@ -59,10 +58,6 @@ symbols read from
.Ar symlist
are relocated to the beginning of the table and in the order given.
.Bl -tag -width flag
-.It Fl c
-Makes all any symbols not in
-.Ar symlist
-local to this file.
.It Fl t
Restrict the symbol table to the symbols listed in
.Ar symlist .
@@ -86,9 +81,9 @@ listed in the
file was not found in the symbol
table, and >1 if an error occurs.
.Sh SEE ALSO
-.Xr nm 1 ,
-.Xr strip 1 ,
-.Xr nlist 3
+.Xr nm 3 ,
+.Xr nlist 3 ,
+.Xr strip 3
.Sh HISTORY
The
.Nm
diff --git a/usr.bin/symorder/symorder.c b/usr.bin/symorder/symorder.c
index 2cac53c2e745..c7fbe4cb4d9b 100644
--- a/usr.bin/symorder/symorder.c
+++ b/usr.bin/symorder/symorder.c
@@ -68,7 +68,7 @@ struct exec exec;
struct stat stb;
struct nlist *newtab, *symtab;
off_t sa;
-int nexclude, nsym, strtabsize, symfound, symkept, small, missing, clean;
+int nexclude, nsym, strtabsize, symfound, symkept, small, missing;
char *kfile, *newstrings, *strings, asym[BUFSIZ];
main(argc, argv)
@@ -84,11 +84,8 @@ main(argc, argv)
int ch, n, o;
xfilename = NULL;
- while ((ch = getopt(argc, argv, "cmtx:")) != EOF)
+ while ((ch = getopt(argc, argv, "mtx:")) != EOF)
switch(ch) {
- case 'c':
- clean = 1;
- break;
case 'm':
missing = 1;
break;
@@ -185,19 +182,15 @@ main(argc, argv)
strtabsize - sizeof(int))
badfmt("corrupted string table");
+ newtab = (struct nlist *)malloc(n);
+ if (newtab == (struct nlist *)NULL)
+ error(NULL);
+ memset(newtab, 0, n);
+
i = n / sizeof(struct nlist);
- if (!clean) {
- newtab = (struct nlist *)malloc(n);
- if (newtab == (struct nlist *)NULL)
- error(NULL);
- memset(newtab, 0, n);
-
- reorder(symtab, newtab, i);
- free((void *)symtab);
- symtab = newtab;
- } else {
- symkept = i;
- }
+ reorder(symtab, newtab, i);
+ free((void *)symtab);
+ symtab = newtab;
newstrings = malloc(strtabsize);
if (newstrings == NULL)
@@ -206,13 +199,8 @@ main(argc, argv)
for (symp = symtab; --i >= 0; symp++) {
if (symp->n_un.n_strx == 0)
continue;
- if (inlist(symp) < 0) {
- if (small)
- continue;
- if (clean && !savesymb(symp))
- symp->n_type &= ~N_EXT;
- } else if (clean)
- symfound++;
+ if (small && inlist(symp) < 0)
+ continue;
symp->n_un.n_strx -= sizeof(int);
(void)strcpy(t, &strings[symp->n_un.n_strx]);
symp->n_un.n_strx = (t - newstrings) + sizeof(int);
@@ -252,20 +240,6 @@ main(argc, argv)
exit(OKEXIT);
}
-savesymb(s)
- register struct nlist *s;
-{
- if ((s->n_type & N_EXT) != N_EXT)
- return 0;
- switch (s->n_type & N_TYPE) {
- case N_TEXT:
- case N_DATA:
- return 0;
- default:
- return 1;
- }
-}
-
reorder(st1, st2, entries)
register struct nlist *st1, *st2;
int entries;
@@ -349,6 +323,6 @@ error(n)
usage()
{
(void)fprintf(stderr,
- "usage: symorder [-c] [-m] [-t] [-x excludelist] symlist file\n");
+ "usage: symorder [-m] [-t] [-x excludelist] symlist file\n");
exit(ERREXIT);
}
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index b6337d8b84f6..664d56f8f640 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -176,13 +176,6 @@ main(argc, argv)
_res.retrans = 2; /* resolver timeout to 2 seconds per try */
_res.retry = 1; /* only try once.. */
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
- if (nlistf != NULL || memf != NULL)
- setgid(getgid());
-
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL)
errx(1, "%s", errbuf);
diff --git a/usr.sbin/ncrcontrol/ncrcontrol.c b/usr.sbin/ncrcontrol/ncrcontrol.c
index 7b8ff6cbd303..f1ffbe1783ad 100644
--- a/usr.sbin/ncrcontrol/ncrcontrol.c
+++ b/usr.sbin/ncrcontrol/ncrcontrol.c
@@ -188,13 +188,6 @@ void open_kvm(int flags)
vmunix = _PATH_UNIX;
}
#if defined(__NetBSD__) || (__FreeBSD__ >= 2)
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
- if (vmunix != NULL || kmemf != NULL)
- setgid(getgid());
-
kvm = kvm_openfiles(vmunix, kmemf, NULL, flags, errbuf);
if (kvm == NULL) {
fprintf(stderr, "%s: kvm_openfiles: %s\n", prog, errbuf);
diff --git a/usr.sbin/pcvt/kbdio/kbdio.y b/usr.sbin/pcvt/kbdio/kbdio.y
index 5a8115768694..e5261c5e63c3 100644
--- a/usr.sbin/pcvt/kbdio/kbdio.y
+++ b/usr.sbin/pcvt/kbdio/kbdio.y
@@ -34,10 +34,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/kbdio.y,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
+#ident "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/kbdio/kbdio.y,v 1.2 1995/04/01 17:16:26 joerg Exp $"
/*
* $Log: kbdio.y,v $
+ * Revision 1.2 1995/04/01 17:16:26 joerg
+ * Update pcvt to 3.20b23
+ *
+ * Submitted by: Hellmuth Michaelis <hm@altona.hamburg.com>
+ *
* Revision 1.1.1.1 1995/02/05 13:49:24 jkh
* PCVT userland utilities.
* Submitted by: hm
diff --git a/usr.sbin/pcvt/kbdio/lex.l b/usr.sbin/pcvt/kbdio/lex.l
index a829dd2dd96b..361ba277ce03 100644
--- a/usr.sbin/pcvt/kbdio/lex.l
+++ b/usr.sbin/pcvt/kbdio/lex.l
@@ -33,10 +33,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/lex.l,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
+#ident "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/kbdio/lex.l,v 1.2 1995/04/01 17:16:27 joerg Exp $"
/*
* $Log: lex.l,v $
+ * Revision 1.2 1995/04/01 17:16:27 joerg
+ * Update pcvt to 3.20b23
+ *
+ * Submitted by: Hellmuth Michaelis <hm@altona.hamburg.com>
+ *
* Revision 1.1.1.1 1995/02/05 13:49:24 jkh
* PCVT userland utilities.
* Submitted by: hm
diff --git a/usr.sbin/pcvt/set2061/compiler.h b/usr.sbin/pcvt/set2061/compiler.h
index 9fbdb56c9159..0f55d729d087 100644
--- a/usr.sbin/pcvt/set2061/compiler.h
+++ b/usr.sbin/pcvt/set2061/compiler.h
@@ -20,7 +20,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * $Header: /home/ncvs/src/usr.sbin/pcvt/set2061/compiler.h,v 1.1.1.1 1995/02/05 13:49:25 jkh Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/set2061/compiler.h,v 1.2 1995/05/30 03:49:45 rgrimes Exp $
*/
diff --git a/usr.sbin/pcvt/vgaio/lex.l b/usr.sbin/pcvt/vgaio/lex.l
index 5ff8622df236..77fa100f3f8f 100644
--- a/usr.sbin/pcvt/vgaio/lex.l
+++ b/usr.sbin/pcvt/vgaio/lex.l
@@ -33,10 +33,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /b/source/CVS/src/sys/arch/i386/isa/pcvt/Util/vgaio/lex.l,v 1.1 1994/03/29 02:47:20 mycroft Exp $"
+#ident "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/vgaio/lex.l,v 1.1.1.1 1995/02/05 13:49:23 jkh Exp $"
/*
* $Log: lex.l,v $
+ * Revision 1.1.1.1 1995/02/05 13:49:23 jkh
+ * PCVT userland utilities.
+ * Submitted by: hm
+ *
* Revision 1.1 1994/03/29 02:47:20 mycroft
* pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
*
diff --git a/usr.sbin/pcvt/vgaio/vgaio.8 b/usr.sbin/pcvt/vgaio/vgaio.8
index aa0c93c2b192..6a577d8907b2 100644
--- a/usr.sbin/pcvt/vgaio/vgaio.8
+++ b/usr.sbin/pcvt/vgaio/vgaio.8
@@ -31,7 +31,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Header: /b/source/CVS/src/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.8,v 1.1 1994/03/29 02:47:23 mycroft Exp $
+.\" $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/vgaio/vgaio.8,v 1.1.1.1 1995/02/05 13:49:23 jkh Exp $
.\" -hm updated 31.12.94
.\"
.Dd December 31, 1994
diff --git a/usr.sbin/pcvt/vgaio/vgaio.y b/usr.sbin/pcvt/vgaio/vgaio.y
index 0e7dd7924b4a..87aa8486dd13 100644
--- a/usr.sbin/pcvt/vgaio/vgaio.y
+++ b/usr.sbin/pcvt/vgaio/vgaio.y
@@ -33,10 +33,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /b/source/CVS/src/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.y,v 1.1 1994/03/29 02:47:27 mycroft Exp $"
+#ident "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/pcvt/vgaio/vgaio.y,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
/*
* $Log: vgaio.y,v $
+ * Revision 1.1.1.1 1995/02/05 13:49:24 jkh
+ * PCVT userland utilities.
+ * Submitted by: hm
+ *
* Revision 1.1 1994/03/29 02:47:27 mycroft
* pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
*
diff --git a/usr.sbin/ppp/slcompress.h b/usr.sbin/ppp/slcompress.h
index 4e0b8badc1d6..ea9b20b18fdc 100644
--- a/usr.sbin/ppp/slcompress.h
+++ b/usr.sbin/ppp/slcompress.h
@@ -1,7 +1,7 @@
/*
* Definitions for tcp compression routines.
*
- * $Header: /home/ncvs/src/usr.sbin/ppp/slcompress.h,v 1.2 1995/02/26 12:17:58 amurai Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/ppp/slcompress.h,v 1.3 1995/05/30 03:50:58 rgrimes Exp $
*
* Copyright (c) 1989 Regents of the University of California.
* All rights reserved.
@@ -18,7 +18,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: slcompress.h,v 1.2 1995/02/26 12:17:58 amurai Exp $
+ * $Id: slcompress.h,v 1.3 1995/05/30 03:50:58 rgrimes Exp $
*
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
* - Initial distribution.
diff --git a/usr.sbin/rarpd/rarpd.8 b/usr.sbin/rarpd/rarpd.8
index 9db18c460dee..44ca6043ab9c 100644
--- a/usr.sbin/rarpd/rarpd.8
+++ b/usr.sbin/rarpd/rarpd.8
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.8,v 1.2 1995/03/05 22:04:05 wpaul Exp $ (LBL)
+.\" @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/rarpd/rarpd.8,v 1.2.4.1 1996/01/30 14:01:05 mpp Exp $ (LBL)
.\"
.\" Copyright (c) 1988-1990 The Regents of the University of California.
.\" All rights reserved.
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index ea649dbe839f..ccff2c906846 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -26,7 +26,7 @@ char copyright[] =
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.c,v 1.4 1995/05/30 03:51:25 rgrimes Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/rarpd/rarpd.c,v 1.4.4.1 1995/08/05 08:04:30 davidg Exp $ (LBL)";
#endif
diff --git a/usr.sbin/sendmail/cf/README b/usr.sbin/sendmail/cf/README
index 73a4d4822c32..e6e9ce975366 100644
--- a/usr.sbin/sendmail/cf/README
+++ b/usr.sbin/sendmail/cf/README
@@ -1148,7 +1148,7 @@ Sam Leffler's FlexFAX software is still in beta test -- but he expects a
public version out "later this week" [as of 3/1/93]. The following
blurb is direct from Sam:
- $Header: /home/ncvs/src/usr.sbin/sendmail/cf/README,v 1.1.1.3 1995/12/03 17:45:24 peter Exp $
+ $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/sendmail/cf/README,v 1.1.1.1.6.1 1996/03/25 06:52:39 peter Exp $
How To Obtain This Software (in case all you get is this file)
--------------------------------------------------------------
diff --git a/usr.sbin/sendmail/contrib/expn.pl b/usr.sbin/sendmail/contrib/expn.pl
index 243729853866..4920b86f9447 100755
--- a/usr.sbin/sendmail/contrib/expn.pl
+++ b/usr.sbin/sendmail/contrib/expn.pl
@@ -13,7 +13,7 @@ $sockaddr = 'S n a4 x8';
# system requirements:
# must have 'nslookup' and 'hostname' programs.
-# $Header: /home/ncvs/src/usr.sbin/sendmail/contrib/expn.pl,v 1.1.1.2 1995/12/02 17:30:09 peter Exp $
+# $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/sendmail/contrib/expn.pl,v 1.1.1.1.6.1 1996/03/25 06:53:28 peter Exp $
# TODO:
# less magic should apply to command-line addresses
diff --git a/usr.sbin/slstat/slstat.c b/usr.sbin/slstat/slstat.c
index fb1b80cd334a..409c123eec52 100644
--- a/usr.sbin/slstat/slstat.c
+++ b/usr.sbin/slstat/slstat.c
@@ -132,13 +132,6 @@ main(argc, argv)
kflag++;
}
}
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
- if (system != NULL || kmemf != NULL)
- setgid(getgid());
-
kvm_h = kvm_openfiles(system, kmemf, NULL, O_RDONLY, errbuf);
if (kvm_h == 0) {
(void)fprintf(stderr,
diff --git a/usr.sbin/tcpdump/tcpdump/addrtoname.c b/usr.sbin/tcpdump/tcpdump/addrtoname.c
index 11a1098a3d84..bdfd0b067753 100644
--- a/usr.sbin/tcpdump/tcpdump/addrtoname.c
+++ b/usr.sbin/tcpdump/tcpdump/addrtoname.c
@@ -23,7 +23,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: addrtoname.c,v 1.37 94/06/16 00:42:28 mccanne Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/addrtoname.c,v 1.2 1995/03/08 12:52:07 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/tcpdump/addrtoname.h b/usr.sbin/tcpdump/tcpdump/addrtoname.h
index f52825b3eace..e2fca54a6ccc 100644
--- a/usr.sbin/tcpdump/tcpdump/addrtoname.h
+++ b/usr.sbin/tcpdump/tcpdump/addrtoname.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: addrtoname.h,v 1.11 94/06/14 20:11:41 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/addrtoname.h,v 1.2 1995/03/08 12:52:08 olah Exp $ (LBL)
*/
/* Name to address translation routines. */
diff --git a/usr.sbin/tcpdump/tcpdump/appletalk.h b/usr.sbin/tcpdump/tcpdump/appletalk.h
index 6a21f1dfe2d1..291049543d3d 100644
--- a/usr.sbin/tcpdump/tcpdump/appletalk.h
+++ b/usr.sbin/tcpdump/tcpdump/appletalk.h
@@ -20,7 +20,7 @@
*
* AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
*
- * @(#) $Header: appletalk.h,v 1.10 94/06/14 20:11:44 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/appletalk.h,v 1.2 1995/03/08 12:52:09 olah Exp $ (LBL)
*/
struct LAP {
diff --git a/usr.sbin/tcpdump/tcpdump/bootp.h b/usr.sbin/tcpdump/tcpdump/bootp.h
index 19844cafefff..7e33c4f6ef68 100644
--- a/usr.sbin/tcpdump/tcpdump/bootp.h
+++ b/usr.sbin/tcpdump/tcpdump/bootp.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: bootp.h,v 1.6 94/01/13 19:06:29 leres Exp $ (LBL) */
+/* @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/bootp.h,v 1.2 1995/03/08 12:52:09 olah Exp $ (LBL) */
/*
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
*
diff --git a/usr.sbin/tcpdump/tcpdump/bpf_dump.c b/usr.sbin/tcpdump/tcpdump/bpf_dump.c
index 547041a045a3..b281a54d0ce1 100644
--- a/usr.sbin/tcpdump/tcpdump/bpf_dump.c
+++ b/usr.sbin/tcpdump/tcpdump/bpf_dump.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: bpf_dump.c,v 1.6 94/06/06 14:31:21 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/bpf_dump.c,v 1.2 1995/03/08 12:52:10 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/tcpdump/decnet.h b/usr.sbin/tcpdump/tcpdump/decnet.h
index 83e7e0e57510..8c952c778adf 100644
--- a/usr.sbin/tcpdump/tcpdump/decnet.h
+++ b/usr.sbin/tcpdump/tcpdump/decnet.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: decnet.h,v 1.3 94/06/14 20:11:44 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/decnet.h,v 1.1 1995/03/08 12:52:11 olah Exp $ (LBL)
*/
typedef unsigned char byte[1]; /* single byte field */
diff --git a/usr.sbin/tcpdump/tcpdump/ethertype.h b/usr.sbin/tcpdump/tcpdump/ethertype.h
index 6fa6e40ad1ed..daeac60b5229 100644
--- a/usr.sbin/tcpdump/tcpdump/ethertype.h
+++ b/usr.sbin/tcpdump/tcpdump/ethertype.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: ethertype.h,v 1.4 94/06/14 20:11:45 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/ethertype.h,v 1.1 1995/03/08 12:52:12 olah Exp $ (LBL)
*/
/* Map between Ethernet protocol types and names */
diff --git a/usr.sbin/tcpdump/tcpdump/extract.h b/usr.sbin/tcpdump/tcpdump/extract.h
index 4e10275471ab..01353879993a 100644
--- a/usr.sbin/tcpdump/tcpdump/extract.h
+++ b/usr.sbin/tcpdump/tcpdump/extract.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: extract.h,v 1.7 94/06/14 20:11:45 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/extract.h,v 1.2 1995/03/08 12:52:13 olah Exp $ (LBL)
*/
#ifdef TCPDUMP_ALIGN
diff --git a/usr.sbin/tcpdump/tcpdump/fddi.h b/usr.sbin/tcpdump/tcpdump/fddi.h
index a6c271195640..81fcda1feee2 100644
--- a/usr.sbin/tcpdump/tcpdump/fddi.h
+++ b/usr.sbin/tcpdump/tcpdump/fddi.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: fddi.h,v 1.6 94/06/14 20:12:35 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/fddi.h,v 1.1 1995/03/08 12:52:14 olah Exp $ (LBL)
*/
/*
diff --git a/usr.sbin/tcpdump/tcpdump/interface.h b/usr.sbin/tcpdump/tcpdump/interface.h
index 146ca6a122b8..bf65f82a6dca 100644
--- a/usr.sbin/tcpdump/tcpdump/interface.h
+++ b/usr.sbin/tcpdump/tcpdump/interface.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: interface.h,v 1.66 94/06/14 20:21:37 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/interface.h,v 1.3 1995/03/08 12:52:14 olah Exp $ (LBL)
*/
#ifdef __GNUC__
diff --git a/usr.sbin/tcpdump/tcpdump/ipx.h b/usr.sbin/tcpdump/tcpdump/ipx.h
index 075d727322b0..16b3a730362f 100644
--- a/usr.sbin/tcpdump/tcpdump/ipx.h
+++ b/usr.sbin/tcpdump/tcpdump/ipx.h
@@ -1,7 +1,7 @@
/*
* IPX protocol formats
*
- * @(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/ipx.h,v 1.1 1995/03/08 12:52:15 olah Exp $
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/ipx.h,v 1.2 1995/05/30 03:52:37 rgrimes Exp $
*/
/* well-known sockets */
diff --git a/usr.sbin/tcpdump/tcpdump/llc.h b/usr.sbin/tcpdump/tcpdump/llc.h
index 89c10d52bdaa..39ec63526556 100644
--- a/usr.sbin/tcpdump/tcpdump/llc.h
+++ b/usr.sbin/tcpdump/tcpdump/llc.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: llc.h,v 1.4 94/06/14 20:11:46 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/llc.h,v 1.1 1995/03/08 12:52:16 olah Exp $ (LBL)
*/
/*
diff --git a/usr.sbin/tcpdump/tcpdump/md.h b/usr.sbin/tcpdump/tcpdump/md.h
index 9df5e9bece28..efad733474a4 100644
--- a/usr.sbin/tcpdump/tcpdump/md.h
+++ b/usr.sbin/tcpdump/tcpdump/md.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: md-i386.h,v 1.5 94/06/14 20:14:40 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/md.h,v 1.2 1995/03/08 12:52:17 olah Exp $ (LBL)
*/
#define TCPDUMP_ALIGN
diff --git a/usr.sbin/tcpdump/tcpdump/nfsfh.h b/usr.sbin/tcpdump/tcpdump/nfsfh.h
index 36296c33c914..281da091c6cd 100644
--- a/usr.sbin/tcpdump/tcpdump/nfsfh.h
+++ b/usr.sbin/tcpdump/tcpdump/nfsfh.h
@@ -1,5 +1,5 @@
/*
- * $Header: nfsfh.h,v 1.3 94/06/12 14:32:58 leres Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/nfsfh.h,v 1.1 1995/03/08 12:52:19 olah Exp $
*
* nfsfh.h - NFS file handle definitions (for portable use)
*
diff --git a/usr.sbin/tcpdump/tcpdump/ntp.h b/usr.sbin/tcpdump/tcpdump/ntp.h
index 2a626fd0f98a..277b4927ca3d 100644
--- a/usr.sbin/tcpdump/tcpdump/ntp.h
+++ b/usr.sbin/tcpdump/tcpdump/ntp.h
@@ -1,4 +1,4 @@
-/* $Header: ntp.h,v 1.2 93/11/12 21:43:36 mccanne Exp $ */
+/* $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/ntp.h,v 1.2 1995/03/08 12:52:20 olah Exp $ */
/*
* Based on ntp.h from the U of MD implementation
diff --git a/usr.sbin/tcpdump/tcpdump/os.h b/usr.sbin/tcpdump/tcpdump/os.h
index 1bd9d5cc2360..d59e48318a25 100644
--- a/usr.sbin/tcpdump/tcpdump/os.h
+++ b/usr.sbin/tcpdump/tcpdump/os.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: os-bsd.h,v 1.18 94/06/14 20:15:17 leres Exp $ (LBL)
+ * @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/os.h,v 1.2 1995/03/08 12:52:21 olah Exp $ (LBL)
*/
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/parsenfsfh.c b/usr.sbin/tcpdump/tcpdump/parsenfsfh.c
index 4acb82be9790..4cb3dd46ce05 100644
--- a/usr.sbin/tcpdump/tcpdump/parsenfsfh.c
+++ b/usr.sbin/tcpdump/tcpdump/parsenfsfh.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char *RCSid = "$Header: parsenfsfh.c,v 1.5 94/01/13 19:06:41 leres Exp $";
+static char *RCSid = "$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/parsenfsfh.c,v 1.1 1995/03/08 12:52:23 olah Exp $";
#endif
/*
diff --git a/usr.sbin/tcpdump/tcpdump/print-arp.c b/usr.sbin/tcpdump/tcpdump/print-arp.c
index 92fce668d08c..dff475412c17 100644
--- a/usr.sbin/tcpdump/tcpdump/print-arp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-arp.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-arp.c,v 1.28 94/06/14 20:17:36 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-arp.c,v 1.2 1995/03/08 12:52:23 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-atalk.c b/usr.sbin/tcpdump/tcpdump/print-atalk.c
index 65514375e33f..437e27ed23ae 100644
--- a/usr.sbin/tcpdump/tcpdump/print-atalk.c
+++ b/usr.sbin/tcpdump/tcpdump/print-atalk.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/print-atalk.c,v 1.3 1995/09/22 17:24:50 wollman Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-atalk.c,v 1.2.4.1 1995/10/06 11:53:42 davidg Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-bootp.c b/usr.sbin/tcpdump/tcpdump/print-bootp.c
index 9e3f8ca58760..955024860652 100644
--- a/usr.sbin/tcpdump/tcpdump/print-bootp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-bootp.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-bootp.c,v 1.30 94/06/14 20:17:37 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-bootp.c,v 1.2 1995/03/08 12:52:27 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-decnet.c b/usr.sbin/tcpdump/tcpdump/print-decnet.c
index 91794d8254cd..f37081d4ca95 100644
--- a/usr.sbin/tcpdump/tcpdump/print-decnet.c
+++ b/usr.sbin/tcpdump/tcpdump/print-decnet.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-decnet.c,v 1.15 94/06/20 19:44:38 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-decnet.c,v 1.1 1995/03/08 12:52:28 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-domain.c b/usr.sbin/tcpdump/tcpdump/print-domain.c
index 2ed1edf6fd91..45a93894a7ef 100644
--- a/usr.sbin/tcpdump/tcpdump/print-domain.c
+++ b/usr.sbin/tcpdump/tcpdump/print-domain.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-domain.c,v 1.23 94/06/14 20:17:38 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-domain.c,v 1.2 1995/03/08 12:52:29 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-egp.c b/usr.sbin/tcpdump/tcpdump/print-egp.c
index 876118d2ea21..89dc1fcb3643 100644
--- a/usr.sbin/tcpdump/tcpdump/print-egp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-egp.c
@@ -20,7 +20,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-egp.c,v 1.14 94/06/20 19:44:38 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-egp.c,v 1.2 1995/03/08 12:52:30 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-ether.c b/usr.sbin/tcpdump/tcpdump/print-ether.c
index 713fc0973248..0de0fc46e91c 100644
--- a/usr.sbin/tcpdump/tcpdump/print-ether.c
+++ b/usr.sbin/tcpdump/tcpdump/print-ether.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-ether.c,v 1.37 94/06/10 17:01:29 mccanne Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-ether.c,v 1.3 1995/03/08 12:52:30 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-fddi.c b/usr.sbin/tcpdump/tcpdump/print-fddi.c
index 80528256a111..afe40df5e764 100644
--- a/usr.sbin/tcpdump/tcpdump/print-fddi.c
+++ b/usr.sbin/tcpdump/tcpdump/print-fddi.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-fddi.c,v 1.21 94/06/10 17:01:29 mccanne Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-fddi.c,v 1.2 1995/03/08 12:52:32 olah Exp $ (LBL)";
#endif
#ifdef FDDI
diff --git a/usr.sbin/tcpdump/tcpdump/print-icmp.c b/usr.sbin/tcpdump/tcpdump/print-icmp.c
index ccd3156099d6..4c130c321038 100644
--- a/usr.sbin/tcpdump/tcpdump/print-icmp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-icmp.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-icmp.c,v 1.20 94/06/14 20:17:39 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-icmp.c,v 1.2 1995/03/08 12:52:32 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-ipx.c b/usr.sbin/tcpdump/tcpdump/print-ipx.c
index 5040068d27d0..b253c1e58bbf 100644
--- a/usr.sbin/tcpdump/tcpdump/print-ipx.c
+++ b/usr.sbin/tcpdump/tcpdump/print-ipx.c
@@ -25,7 +25,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-ipx.c,v 1.6 94/06/20 19:44:38 leres Exp $";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-ipx.c,v 1.1 1995/03/08 12:52:34 olah Exp $";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-isoclns.c b/usr.sbin/tcpdump/tcpdump/print-isoclns.c
index 5f86d5630ebb..a8afd2271148 100644
--- a/usr.sbin/tcpdump/tcpdump/print-isoclns.c
+++ b/usr.sbin/tcpdump/tcpdump/print-isoclns.c
@@ -25,7 +25,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-isoclns.c,v 1.9 94/06/14 20:18:44 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-isoclns.c,v 1.1 1995/03/08 12:52:35 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-llc.c b/usr.sbin/tcpdump/tcpdump/print-llc.c
index cff51b7c8664..98d6f89d1cc6 100644
--- a/usr.sbin/tcpdump/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/tcpdump/print-llc.c
@@ -26,7 +26,7 @@
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-llc.c,v 1.13 94/06/14 20:18:45 leres Exp $";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-llc.c,v 1.1 1995/03/08 12:52:36 olah Exp $";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-nfs.c b/usr.sbin/tcpdump/tcpdump/print-nfs.c
index 63148b21c083..e2c4e44b5d4a 100644
--- a/usr.sbin/tcpdump/tcpdump/print-nfs.c
+++ b/usr.sbin/tcpdump/tcpdump/print-nfs.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/print-nfs.c,v 1.4 1995/08/23 05:18:54 pst Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-nfs.c,v 1.3.4.1 1995/10/06 11:53:46 davidg Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-ntp.c b/usr.sbin/tcpdump/tcpdump/print-ntp.c
index c4fadf1006f2..98f7a2e345d2 100644
--- a/usr.sbin/tcpdump/tcpdump/print-ntp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-ntp.c
@@ -25,7 +25,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-ntp.c,v 1.14 94/06/14 20:18:46 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-ntp.c,v 1.2 1995/03/08 12:52:37 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-null.c b/usr.sbin/tcpdump/tcpdump/print-null.c
index 8e7f3b7faa54..af84f9767679 100644
--- a/usr.sbin/tcpdump/tcpdump/print-null.c
+++ b/usr.sbin/tcpdump/tcpdump/print-null.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-null.c,v 1.14 94/06/10 17:01:35 mccanne Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-null.c,v 1.2 1995/03/08 12:52:38 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-ospf.c b/usr.sbin/tcpdump/tcpdump/print-ospf.c
index 4cae135f38cc..f7aa73b0a298 100644
--- a/usr.sbin/tcpdump/tcpdump/print-ospf.c
+++ b/usr.sbin/tcpdump/tcpdump/print-ospf.c
@@ -23,7 +23,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-ospf.c,v 1.12 94/06/14 20:18:46 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-ospf.c,v 1.2 1995/03/08 12:52:39 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-ppp.c b/usr.sbin/tcpdump/tcpdump/print-ppp.c
index 806f05fc5f98..b3681c76fd97 100644
--- a/usr.sbin/tcpdump/tcpdump/print-ppp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-ppp.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-ppp.c,v 1.18 94/06/10 17:01:37 mccanne Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-ppp.c,v 1.2 1995/03/08 12:52:40 olah Exp $ (LBL)";
#endif
#ifdef PPP
diff --git a/usr.sbin/tcpdump/tcpdump/print-rip.c b/usr.sbin/tcpdump/tcpdump/print-rip.c
index d98b5a4a0fae..c75c25932214 100644
--- a/usr.sbin/tcpdump/tcpdump/print-rip.c
+++ b/usr.sbin/tcpdump/tcpdump/print-rip.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/print-rip.c,v 1.5 1995/08/26 12:40:05 davidg Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-rip.c,v 1.4.4.1 1995/10/06 11:53:48 davidg Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-sl.c b/usr.sbin/tcpdump/tcpdump/print-sl.c
index 3c2b8ea87cdf..1fb6944e08dd 100644
--- a/usr.sbin/tcpdump/tcpdump/print-sl.c
+++ b/usr.sbin/tcpdump/tcpdump/print-sl.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#)$Header: print-sl.c,v 1.28 94/06/10 17:01:38 mccanne Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-sl.c,v 1.2 1995/03/08 12:52:41 olah Exp $ (LBL)";
#endif
#ifdef CSLIP
diff --git a/usr.sbin/tcpdump/tcpdump/print-sunrpc.c b/usr.sbin/tcpdump/tcpdump/print-sunrpc.c
index 938d4b04a639..f33459484c82 100644
--- a/usr.sbin/tcpdump/tcpdump/print-sunrpc.c
+++ b/usr.sbin/tcpdump/tcpdump/print-sunrpc.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-sunrpc.c,v 1.12 94/06/14 20:18:48 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-sunrpc.c,v 1.3 1995/03/08 12:52:43 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-tcp.c b/usr.sbin/tcpdump/tcpdump/print-tcp.c
index 7d5d65cdd1e6..a3d47aaa64cb 100644
--- a/usr.sbin/tcpdump/tcpdump/print-tcp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-tcp.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/print-tcp.c,v 1.3 1995/03/08 13:13:01 olah Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-tcp.c,v 1.4 1995/05/30 03:52:38 rgrimes Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-tftp.c b/usr.sbin/tcpdump/tcpdump/print-tftp.c
index 8771cbf834c8..09967d6583b7 100644
--- a/usr.sbin/tcpdump/tcpdump/print-tftp.c
+++ b/usr.sbin/tcpdump/tcpdump/print-tftp.c
@@ -23,7 +23,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-tftp.c,v 1.20 94/06/14 20:18:49 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-tftp.c,v 1.2 1995/03/08 12:52:45 olah Exp $ (LBL)";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/tcpdump/tcpdump/print-wb.c b/usr.sbin/tcpdump/tcpdump/print-wb.c
index a9322dda1920..1f6f1a7ae660 100644
--- a/usr.sbin/tcpdump/tcpdump/print-wb.c
+++ b/usr.sbin/tcpdump/tcpdump/print-wb.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: print-wb.c,v 1.14 94/06/14 20:18:50 leres Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/print-wb.c,v 1.1 1995/03/08 12:52:46 olah Exp $ (LBL)";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump/tcpdump.c
index 48f6f636b097..9e25c7957084 100644
--- a/usr.sbin/tcpdump/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump/tcpdump.c
@@ -22,7 +22,7 @@
char copyright[] =
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994\nThe Regents of the University of California. All rights reserved.\n";
static char rcsid[] =
- "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/tcpdump.c,v 1.2 1995/03/08 12:52:48 olah Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/tcpdump.c,v 1.3 1995/05/30 03:52:39 rgrimes Exp $ (LBL)";
#endif
/*
diff --git a/usr.sbin/tcpdump/tcpdump/util.c b/usr.sbin/tcpdump/tcpdump/util.c
index 193e18d0492c..0d5565a1f3cb 100644
--- a/usr.sbin/tcpdump/tcpdump/util.c
+++ b/usr.sbin/tcpdump/tcpdump/util.c
@@ -21,7 +21,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/util.c,v 1.3 1995/09/28 15:28:40 wollman Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpdump/util.c,v 1.2.4.1 1995/10/06 11:53:51 davidg Exp $ (LBL)";
#endif
#include <stdlib.h>
diff --git a/usr.sbin/tcpdump/tcpslice/gwtm2secs.c b/usr.sbin/tcpdump/tcpslice/gwtm2secs.c
index d2fcec772efc..3638741f5881 100644
--- a/usr.sbin/tcpdump/tcpslice/gwtm2secs.c
+++ b/usr.sbin/tcpdump/tcpslice/gwtm2secs.c
@@ -20,7 +20,7 @@
*/
#if !defined(lint) && !defined(__GNUC__)
static char rcsid[] =
- "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpslice/gwtm2secs.c,v 1.3 1995/08/23 05:18:56 pst Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpslice/gwtm2secs.c,v 1.2.4.1 1995/10/06 11:54:13 davidg Exp $ (LBL)";
#endif
/*
diff --git a/usr.sbin/tcpdump/tcpslice/search.c b/usr.sbin/tcpdump/tcpslice/search.c
index db74797c1156..1bc4d0044b78 100644
--- a/usr.sbin/tcpdump/tcpslice/search.c
+++ b/usr.sbin/tcpdump/tcpslice/search.c
@@ -20,7 +20,7 @@
*/
#if !defined(lint) && !defined(__GNUC__)
static char rcsid[] =
- "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpslice/search.c,v 1.3 1995/08/23 05:18:57 pst Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpslice/search.c,v 1.2.4.1 1995/10/06 11:54:17 davidg Exp $ (LBL)";
#endif
/*
diff --git a/usr.sbin/tcpdump/tcpslice/tcpslice.1 b/usr.sbin/tcpdump/tcpslice/tcpslice.1
index 184e8e5b3b00..f5bae2647c49 100644
--- a/usr.sbin/tcpdump/tcpslice/tcpslice.1
+++ b/usr.sbin/tcpdump/tcpslice/tcpslice.1
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpslice/tcpslice.1,v 1.3 1995/03/08 12:53:39 olah Exp $ (LBL)
+.\" @(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpslice/tcpslice.1,v 1.4 1995/05/14 15:21:36 gpalmer Exp $ (LBL)
.\"
.\" Copyright (c) 1988-1990 The Regents of the University of California.
.\" All rights reserved.
diff --git a/usr.sbin/tcpdump/tcpslice/tcpslice.c b/usr.sbin/tcpdump/tcpslice/tcpslice.c
index 2c75bea46a52..2e7d0f02a5fe 100644
--- a/usr.sbin/tcpdump/tcpslice/tcpslice.c
+++ b/usr.sbin/tcpdump/tcpslice/tcpslice.c
@@ -22,7 +22,7 @@
char copyright[] =
"@(#) Copyright (c) 1987-1990 The Regents of the University of California.\nAll rights reserved.\n";
static char rcsid[] =
- "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpslice/tcpslice.c,v 1.3 1995/08/23 05:18:59 pst Exp $ (LBL)";
+ "@(#)$Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpslice/tcpslice.c,v 1.2.4.1 1995/10/06 11:54:20 davidg Exp $ (LBL)";
#endif
/*
diff --git a/usr.sbin/tcpdump/tcpslice/util.c b/usr.sbin/tcpdump/tcpslice/util.c
index f53c97953ed3..023e90d53822 100644
--- a/usr.sbin/tcpdump/tcpslice/util.c
+++ b/usr.sbin/tcpdump/tcpslice/util.c
@@ -21,7 +21,7 @@
#if !defined(lint) && !defined(__GNUC__)
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpslice/util.c,v 1.2 1995/08/23 05:19:00 pst Exp $ (LBL)";
+ "@(#) $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/tcpdump/tcpslice/util.c,v 1.1.4.1 1995/10/06 11:54:22 davidg Exp $ (LBL)";
#endif
#include "tcpslice.h"
diff --git a/usr.sbin/xntpd/kernel/chuinit.c b/usr.sbin/xntpd/kernel/chuinit.c
index 80b36a9a6e10..0daab9634899 100644
--- a/usr.sbin/xntpd/kernel/chuinit.c
+++ b/usr.sbin/xntpd/kernel/chuinit.c
@@ -1,7 +1,7 @@
/*
** dynamically loadable chu driver
**
-** $Header: /home/ncvs/src/usr.sbin/xntpd/kernel/chuinit.c,v 1.1.1.1 1994/09/29 23:02:42 wollman Exp $
+** $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/xntpd/kernel/chuinit.c,v 1.2 1995/05/30 03:53:30 rgrimes Exp $
**
** william robertson <rob@agate.berkeley.edu>
*/
diff --git a/usr.sbin/xntpd/kernel/clkinit.c b/usr.sbin/xntpd/kernel/clkinit.c
index b8fe4563bf0f..7c7605cb8511 100644
--- a/usr.sbin/xntpd/kernel/clkinit.c
+++ b/usr.sbin/xntpd/kernel/clkinit.c
@@ -1,7 +1,7 @@
/*
** dynamically loadable clk driver
**
-** $Header: /home/ncvs/src/usr.sbin/xntpd/kernel/clkinit.c,v 1.1.1.1 1994/09/29 23:02:47 wollman Exp $
+** $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/xntpd/kernel/clkinit.c,v 1.2 1995/05/30 03:53:31 rgrimes Exp $
**
** william robertson <rob@agate.berkeley.edu>
*/
diff --git a/usr.sbin/xntpd/parse/clk_trimtaip.c b/usr.sbin/xntpd/parse/clk_trimtaip.c
index 87538f1eb8a1..e0f6c67b0027 100644
--- a/usr.sbin/xntpd/parse/clk_trimtaip.c
+++ b/usr.sbin/xntpd/parse/clk_trimtaip.c
@@ -1,6 +1,6 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_TRIMTAIP)
/*
- * $Header: /src/NTP/REPOSITORY/v3/parse/clk_trimble.c,v 3.9 1994/02/02 17:45:27 kardel Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/xntpd/parse/clk_trimtaip.c,v 1.1.1.1 1994/09/29 23:01:31 wollman Exp $
*
* Trimble SV6 clock support
*/
@@ -108,7 +108,10 @@ cvt_trimtaip(buffer, size, format, clock)
/*
* History:
*
- * $Log: clk_trimble.c,v $
+ * $Log: clk_trimtaip.c,v $
+ * Revision 1.1.1.1 1994/09/29 23:01:31 wollman
+ * xntp 3.4e from Dave Mills @ UDel
+ *
* Revision 3.9 1994/02/02 17:45:27 kardel
* rcs ids fixed
*
diff --git a/usr.sbin/xntpd/parse/clk_trimtsip.c b/usr.sbin/xntpd/parse/clk_trimtsip.c
index 422fac1412ec..e7a04c14c3af 100644
--- a/usr.sbin/xntpd/parse/clk_trimtsip.c
+++ b/usr.sbin/xntpd/parse/clk_trimtsip.c
@@ -1,6 +1,6 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_TRIMTSIP)
/*
- * $Header: /home/ncvs/src/usr.sbin/xntpd/parse/clk_trimtsip.c,v 1.1.1.1 1994/09/29 23:01:31 wollman Exp $
+ * $Header: /pub/FreeBSD/FreeBSD-CVS/src/usr.sbin/xntpd/parse/clk_trimtsip.c,v 1.2 1995/05/30 03:54:13 rgrimes Exp $
*
* Trimble TSIP support - CURRENTLY VERY MUCH UNDER CONSTRUCTION
*/
@@ -468,6 +468,9 @@ getint(bp)
* History:
*
* $Log: clk_trimtsip.c,v $
+ * Revision 1.2 1995/05/30 03:54:13 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.1.1.1 1994/09/29 23:01:31 wollman
* xntp 3.4e from Dave Mills @ UDel
*