Home | History | Annotate | only in /src/bin/csh
History log of /src/bin/csh
RevisionDateAuthorComments
 1.43 18-Sep-2025  mrg introduce a couple of new turn-off-gcc-warning variables and use them.

GCC 14 has a new annoying calloc() checker that we turn off in a bunch
of places, and there are a few more dangling-pointer issuse that come up,
but seem bogus.
 1.42 10-Jun-2018  christos branches: 1.42.2;
use SUBDIR.roff suggested by uwe@
 1.41 05-Jul-2014  dholland branches: 1.41.22;
remove .if make(install)
these are seriously bad juju
 1.40 13-Jun-2014  mrg remove the build support for GCC 4.1, and any hacks i found for it.

there could still be more -- i only looked for lines matching
both "HAVE_GCC" and "4" as words (grep -w.)
 1.39 16-Jul-2013  christos branches: 1.39.4;
WARNS=6 [-Wconversion]
 1.38 25-Jan-2013  he When using -ledit, also use -lterminfo, to allow static linking.
 1.37 25-Jan-2013  christos Obey SMALLPROG and don't enable the editor
 1.36 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.35 22-Jan-2013  christos fix compilation without -DEDIT
 1.34 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.33 28-Aug-2011  christos branches: 1.33.2; 1.33.8;
use strpct(3) from libutil.
 1.32 25-Aug-2011  joerg Uses non-literal format strings in err.c
 1.31 14-Aug-2011  christos Document non-literal formats
 1.30 01-Jul-2011  mrg add a comment to confirm a workaround as only being a GCC 4.1 issue.
 1.29 25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.28 29-Aug-2008  gmcgarry Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.
 1.27 01-Jul-2006  mrg branches: 1.27.20;
apply a little -O0 with GCC4 and vax...
 1.26 21-Oct-2003  lukem Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.
 1.25 19-Oct-2003  lukem rework to use the newer _MKMSGCREATE (et al) macros
 1.24 19-Oct-2003  lukem support MAKEVERBOSE
 1.23 01-Aug-2003  lukem Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
 1.22 29-Jul-2003  lukem move ${DEPENDSRCS} target to after .include <bsd.*.mk>
 1.21 28-Jul-2003  lukem Use ${DEPENDSRCS} as a target instead of .depend, now that
<bsd.dep.mk> builds .depend from .dep files.
 1.20 19-Aug-2002  lukem Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
 1.19 13-Apr-1998  lukem refer to COPTS not CFLAGS
 1.18 08-Apr-1998  fair Fix PR#3585 - csh printed a negative percentage of CPU used when the total
CPU usage was more than 6 hours (integer overflow problem).
 1.17 22-Oct-1997  lukem add dependancy line to fix parallel compilation
 1.16 11-Oct-1997  mycroft branches: 1.16.2;
Use bsd.subdir.mk as appropriate.
 1.15 10-Oct-1997  christos CFLAGS->CPPFLAGS
 1.14 20-Jul-1997  christos Remove WARNS=1 from all the subdirectory Makefiles, and add it to Makefile.inc
now that all /bin has been cleaned.
 1.13 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.12 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.11 06-May-1997  gwr Use .PATH.c: ...
 1.10 30-Sep-1996  christos - Use ../usr.bin/printf/printf.c
- Fix built-in which to set the status code correctly.
 1.9 21-Mar-1995  cgd convert to new RCS id conventions.
 1.8 22-Dec-1994  cgd new way of specifying man pages.
 1.7 18-Dec-1994  cgd add USD.doc to subdir list on install
 1.6 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.5 01-Aug-1993  mycroft Add RCS identifiers.
 1.4 26-May-1993  proven Compiles with gcc-2.3.3 now.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16.2.2 08-May-1998  mycroft Pull up 1.18, per request of fair.
 1.16.2.1 07-Nov-1997  lukem pull up rev 1.17 from trunk (approval from thorpej)
 1.27.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.33.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.8.1 25-Feb-2013  tls resync with head
 1.33.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.39.4.1 10-Aug-2014  tls Rebase.
 1.41.22.1 25-Jun-2018  pgoyette Sync with HEAD
 1.42.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.42.2.1 21-Apr-2020  martin Sync with HEAD
 1.16 24-Apr-2024  nia csh: add a reallocarray function for using inside csh
 1.15 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.14 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.13 22-Jan-2013  christos branches: 1.13.30; 1.13.32;
Remove alloc builtin, it did not work anyway since most modern malloc
implementation use a combination of sbrk/mmap.
 1.12 07-Aug-2003  agc branches: 1.12.54; 1.12.60;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.11 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.10 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.9 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.8 28-Jul-1998  mycroft Delint (partially).
 1.7 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.60.1 25-Feb-2013  tls resync with head
 1.12.54.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.32.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.13.32.2 21-Apr-2020  martin Sync with HEAD
 1.13.32.1 10-Jun-2019  christos Sync with HEAD
 1.13.30.1 18-Jan-2019  pgoyette Synch with HEAD
 1.10 19-Jan-2012  christos branches: 1.10.42;
PR/45856: Bernhard "Burnhard" Riedel: Infinite loop on &nbsp; input. Sending
char 160 in the input to csh, lead it to an infinite loop, because tcsh tables
counted this as a space character, but the word logic switch does not. Change
that character tables, so that this does not count as a spacing character
anymore, by syncing the table with the one from tcsh.
 1.9 07-Aug-2003  agc branches: 1.9.54;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.8 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.7 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.9.54.1 17-Apr-2012  yamt sync with head
 1.10.42.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.10.42.1 21-Apr-2020  martin Sync with HEAD
 1.9 19-Jan-2012  christos branches: 1.9.42;
PR/45856: Bernhard "Burnhard" Riedel: Infinite loop on &nbsp; input. Sending
char 160 in the input to csh, lead it to an infinite loop, because tcsh tables
counted this as a space character, but the word logic switch does not. Change
that character tables, so that this does not count as a spacing character
anymore, by syncing the table with the one from tcsh.
 1.8 07-Aug-2003  agc branches: 1.8.54;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.7 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.54.1 17-Apr-2012  yamt sync with head
 1.9.42.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.42.1 21-Apr-2020  martin Sync with HEAD
 1.11 11-Sep-2021  christos like zsh, have jobs -Z do setproctitle
 1.10 22-Jan-2013  christos branches: 1.10.32;
Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.9 07-Aug-2003  agc branches: 1.9.54; 1.9.60;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.8 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.7 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.9.60.1 25-Feb-2013  tls resync with head
 1.9.54.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.32.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.10.32.1 21-Apr-2020  martin Sync with HEAD
 1.59 25-Mar-2025  riastradh csh(1): Nix trailing whitespace in man page.

No functional change intended.
 1.58 22-Mar-2025  christos Improve the description of the jobs built-in.
 1.57 28-Aug-2022  hgutch branches: 1.57.4;
Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
 1.56 09-Jul-2022  uwe csh(1): fix punctuation at the end of an .Xr line
 1.55 11-Sep-2021  christos like zsh, have jobs -Z do setproctitle
 1.54 03-Jul-2017  wiz branches: 1.54.6;
Remove workaround for ancient HTML generation code.
 1.53 10-Aug-2016  sevan C Shell appeared in 2BSD, not 3BSD
 1.52 22-Jan-2013  wiz Bump date for previous.
 1.51 22-Jan-2013  christos Remove alloc builtin, it did not work anyway since most modern malloc
implementation use a combination of sbrk/mmap.
 1.50 22-Mar-2012  wiz branches: 1.50.2;
Fix whitespace nits. Suggested by Bug Hunting.
 1.49 09-Mar-2011  njoly branches: 1.49.4;
Fix sub-section references.
 1.48 22-Mar-2010  joerg Use .In instead of .Aq .Pa for signal.h.
 1.47 29-Mar-2009  wiz Bump date for previous.
 1.46 29-Mar-2009  mrg - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.45 13-Mar-2009  joerg Use .Rs/.Re for reference to C shell introduction.
 1.44 03-Mar-2009  wiz Remove weird backslash that somehow must have crept in.
Found by joerg and mdocml.
 1.43 20-Apr-2004  jschauma branches: 1.43.32; 1.43.34;
The correct syntax for csh's pushd with a numeric argument is
pushd +n
not
pushd n
 1.42 17-Apr-2004  wiz Document rlimit sbsize; case consistency; bump date.
 1.41 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.40 14-Jul-2003  wiz cpu -> CPU.
 1.39 01-May-2003  wiz Some grammar and punctuation fixes from jmc@openbsd.
 1.38 05-Apr-2003  wiz Bump date for last.
 1.37 05-Apr-2003  fair Additional text & formatting for the csh "limit" command;
hopefully this satisfies PR 11658
 1.36 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.35 25-Sep-2002  wiz New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
 1.34 08-Feb-2002  ross branches: 1.34.2;
Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.33 06-Feb-2002  ross type in ^ directly, instead of \(ua which isn't in all the fonts
 1.32 12-Dec-2001  wiz Document set time variables, and the format strings recognized.
Based on the patch provided by Jonathan Perkins in PR 14465.
 1.31 17-Oct-2001  wiz Whitespace, punctuation fixes. Sort sections.
 1.30 16-Mar-2001  fair Add references to getrlimit(2) and setrlimit(2) under the csh built-in
"limit" command, so as to more completely document the workings of this
command, per PR 11658.
 1.29 07-Nov-2000  lukem fix borken Xr
 1.28 05-Oct-2000  ad insure -> ensure
 1.27 21-May-2000  mason Improved style: "For definiteness" becomes "For example".
 1.26 28-Sep-1999  bouyer xref sysctl(8) (for proc.<pid>.rlimits)
 1.25 30-Jul-1999  hubertf branches: 1.25.2;
Document csh's -m switch.

Patch submitted in PR 5802 by Greg A. Woods <woods@planix.com>
 1.24 20-Apr-1999  mycroft More punctuation glitches.
 1.23 20-Apr-1999  mycroft Fix formatting of kill commands.
 1.22 20-Apr-1999  mycroft Fix a few obvious formatting glitches: missing paragraph break, highlighted
parens.
 1.21 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.20 24-Jan-1999  ross Document the bizarre right-to-left grouping of csh expression terms.
 1.19 11-Jun-1998  msaitoh fix some bugs.
 1.18 28-May-1998  msaitoh fix a bug.
 1.17 28-May-1998  msaitoh fix "/bin/login" to '/usr/bin/login"
 1.16 10-May-1998  kleink * Add support for POSIX "kill [-s signame] pid" syntax; actually fixes PR 5327.
* Complete the "kill -l [exitstatus]" syntax.
* Sync with the documentation and no longer permit the use of full signal
names in the "kill [-sig] pid" syntax, e.g. -SIGHUP.
 1.15 20-Oct-1997  enami - Fix .Nm usage (same of .Nm is replaced with .Sx, .Em, .Ic etc).
- Use .Sx to refer section.
 1.14 23-Jun-1997  pk Use .Xr (from PR#3627)
 1.13 12-May-1997  mikel fix xrefs: sigvec(2) -> sigaction(2), killpg(2) -> killpg(3).
 1.12 08-Mar-1997  mouse alternate -> alternative, per PR 2643
 1.11 30-Jun-1996  jtc Fix formatting of description of @ command; From PR #2577
 1.10 21-Mar-1995  cgd branches: 1.10.6;
convert to new RCS id conventions.
 1.9 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.8 03-Feb-1994  jtc spelling mistakes
 1.7 01-Aug-1993  mycroft Add RCS indentifiers.
 1.6 13-Jul-1993  cgd fix some spacing/character problems...
 1.5 22-Apr-1993  mycroft Fix various bugs in man pages (from 386BSD patch 130).
 1.4 22-Apr-1993  mycroft Fix various bugs in man pages (from 386BSD patch 130).
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.6.1 30-Jun-1996  jtc Pull up rev 1.11; Even this late in the game, documentation fixes can't hurt
 1.25.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.34.2.1 15-Jun-2003  tron Pull up revision 1.37 (requested by fair in ticket #1243):
Additional text & formatting for the csh "limit" command;
hopefully this satisfies PR 11658
 1.43.34.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.43.32.1 01-Apr-2009  snj Pull up following revision(s) (requested by mrg in ticket #622):
bin/csh/csh.1: revision 1.46
bin/csh/func.c: revision 1.37
bin/ps/print.c: revision 1.111
bin/ps/ps.c: revision 1.74
bin/sh/miscbltin.c: revision 1.38
bin/sh/sh.1: revision 1.92 via patch
external/bsd/top/dist/machine/m_netbsd.c: revision 1.7
lib/libkvm/kvm_proc.c: revision 1.82
sys/arch/mips/mips/cpu_exec.c: revision 1.55
sys/compat/darwin/darwin_exec.c: revision 1.57
sys/compat/ibcs2/ibcs2_exec.c: revision 1.73
sys/compat/irix/irix_resource.c: revision 1.15
sys/compat/linux/arch/amd64/linux_exec_machdep.c: revision 1.16
sys/compat/linux/arch/i386/linux_exec_machdep.c: revision 1.12
sys/compat/linux/common/linux_limit.h: revision 1.5
sys/compat/osf1/osf1_resource.c: revision 1.14
sys/compat/svr4/svr4_resource.c: revision 1.18
sys/compat/svr4_32/svr4_32_resource.c: revision 1.17
sys/kern/exec_subr.c: revision 1.62
sys/kern/init_sysctl.c: revision 1.160
sys/kern/kern_exec.c: revision 1.288
sys/kern/kern_resource.c: revision 1.151
sys/sys/param.h: patch
sys/sys/resource.h: revision 1.31
sys/sys/sysctl.h: revision 1.184
sys/uvm/uvm_extern.h: revision 1.153
sys/uvm/uvm_glue.c: revision 1.136
sys/uvm/uvm_mmap.c: revision 1.128
usr.bin/systat/ps.c: revision 1.32
- - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.
- - adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.
- - add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)
- - patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)
- - patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.
- - update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)
this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.
tested on i386 and sparc64, build tested on several other platforms.
thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.49.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.49.4.1 17-Apr-2012  yamt sync with head
 1.50.2.1 25-Feb-2013  tls resync with head
 1.54.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.54.6.1 21-Apr-2020  martin Sync with HEAD
 1.57.4.1 02-Aug-2025  perseant Sync with HEAD
 1.56 15-Sep-2022  martin Fix the build for variants that do not define EDIT.
 1.55 14-Sep-2022  christos Update editing before prompt printing.
 1.54 14-Sep-2022  christos defer editing setup/cleanup to when we are interactive.
 1.53 09-Aug-2020  dholland Use the right size for several calloc calls.

When allocating for a Char **, it should use sizeof(Char *), not
sizeof(Char **). This doesn't actually affect the results except
on DS9000 though :-)

(part 2, the instance in this file was as far as I can tell
inexplicably missed by CVS on the first go...)
 1.52 09-Aug-2020  dholland Clarify some comments.
 1.51 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.50 03-Apr-2020  joerg Don't depend on common declarations.
 1.49 12-Jan-2020  christos remove unused
 1.48 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.47 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.46 16-Jul-2013  christos branches: 1.46.26; 1.46.28;
WARNS=6 [-Wconversion]
 1.45 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.44 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.43 22-Jan-2012  christos branches: 1.43.6;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@
 1.42 29-Aug-2011  joerg branches: 1.42.2;
Use __dead
 1.41 20-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
 1.40 16-Jul-2007  christos branches: 1.40.12;
no need to have cshbool; just make them int
 1.39 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.38 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.37 24-Apr-2006  snj It's "its."
 1.36 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.35 19-Aug-2004  christos Deal with RESCUE
 1.34 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.33 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.32 06-Jan-2003  wiz descriptor, not decriptor.
 1.31 10-Jul-2002  wiz Fix a typo in a comment. moritz@jodeit.org via OpenBSD.
 1.30 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.29 08-Mar-2002  christos % set verbose echo
% echo foo >& bar
% cat bar
guess what you get:
echo foo
foo
 1.28 16-Sep-2001  wiz Use setprogname. Patch by Petri Koistinen.
 1.27 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.26 04-Sep-2000  christos fix globbing problem when importing $PATH from environment. Reported by
Michael Shalayeff.
 1.25 31-May-2000  christos branches: 1.25.2;
decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.24 28-Jul-1998  mycroft branches: 1.24.8;
Be more retentive about use of NOTREACHED and noreturn.
 1.23 28-Jul-1998  mycroft Delint.
 1.22 28-Jul-1998  mycroft Delint (partially).
 1.21 28-Jul-1998  mycroft Delint (partially).
 1.20 27-Jul-1998  mycroft const propagation.
 1.19 08-Apr-1998  fair Fix csh to use <paths.h> _PATH_DEFPATH as the default path, absent a PATH
from the environment.
 1.18 01-Apr-1998  kleink Need <time.h> for time() prototype.
 1.17 04-Jul-1997  christos branches: 1.17.2;
Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.16 13-Jan-1997  tls kill register
 1.15 31-Oct-1996  christos Quote all imported environment variables, so that we don't core dump with
set term='unknown*'
./csh
or we don't have security problems with:
set path=('`/bin/rm -fr *`' /usr/local)
./csh
Reported by Donn Seeley...
 1.14 29-Apr-1995  mycroft Use POSIX signal semantics. Change p_pid and p_jobid to pid_t's.
 1.13 21-Mar-1995  mycroft Use POSIX signals.
 1.12 21-Mar-1995  cgd convert to new RCS id conventions.
 1.11 30-Jan-1995  mycroft Use S_IS*().
 1.10 20-Jan-1995  mycroft Remove `.' from default PATH.
 1.9 15-Jan-1995  mycroft Remove the gratuitous `security' warnings.
 1.8 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.7 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.6 12-Feb-1994  cgd minor cleanup
 1.5 12-Nov-1993  cgd be rational about foreground process groups; pull code in from tcsh!
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.2.1 08-May-1998  mycroft Pull up 1.18-1.19, per request of fair.
 1.24.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.2.1 04-Sep-2000  christos pullup 1.25 -> 1.26: don't glob $PATH when importing it.
[approved by jhawk]
 1.40.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.42.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.42.2.1 17-Apr-2012  yamt sync with head
 1.43.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.6.1 25-Feb-2013  tls resync with head
 1.46.28.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.46.28.3 21-Apr-2020  martin Sync with HEAD
 1.46.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.46.28.1 10-Jun-2019  christos Sync with HEAD
 1.46.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.30 24-Apr-2024  nia csh: add a helper definition for the reallocarray function
 1.29 03-Apr-2020  joerg Don't depend on common declarations.
 1.28 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.27 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.26 16-Jul-2013  christos branches: 1.26.26; 1.26.28;
WARNS=6 [-Wconversion]
 1.25 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.24 22-Jan-2013  christos fix compilation without -DEDIT
 1.23 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.22 09-Nov-2011  christos branches: 1.22.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.21 16-Jul-2007  christos branches: 1.21.34;
no need to have cshbool; just make them int
 1.20 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.19 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.18 10-Jul-2007  dogcow exposure of bool elsewhere in the code requires the addition of stdbool;
in addition, proc.c cleverly has a variable that was initially defined "int",
but had in the actual declaration "bool". oops.
 1.17 29-Apr-2007  msaitoh fix typos
 1.16 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.14 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.13 13-Dec-2000  scw Sprinkle some `extern' qualifiers for initialised globals.
 1.12 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.11 28-Jul-1998  mycroft branches: 1.11.8;
Delint (partially).
 1.10 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.9 21-Mar-1995  cgd convert to new RCS id conventions.
 1.8 30-Jan-1995  mycroft Use S_IS*().
 1.7 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.6 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.5 27-Sep-1993  mycroft #include <sys/types.h>, for magnum stuff.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.34.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.34.1 10-Nov-2011  yamt sync with head
 1.22.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.6.1 25-Feb-2013  tls resync with head
 1.26.28.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.26.28.3 21-Apr-2020  martin Sync with HEAD
 1.26.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.26.28.1 10-Jun-2019  christos Sync with HEAD
 1.26.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.36 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.35 09-Aug-2020  dholland Use the right size for several calloc calls.

When allocating for a Char **, it should use sizeof(Char *), not
sizeof(Char **). This doesn't actually affect the results except
on DS9000 though :-)
 1.34 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.33 03-Apr-2020  joerg Don't depend on common declarations.
 1.32 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.31 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.30 16-Jul-2013  christos branches: 1.30.26; 1.30.28;
WARNS=6 [-Wconversion]
 1.29 16-Jul-2007  christos branches: 1.29.34; 1.29.40;
no need to have cshbool; just make them int
 1.28 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.27 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.26 05-Apr-2006  christos save the home directory.
 1.25 18-Mar-2006  christos Coverity CID 1760: Plug memory leak.
 1.24 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.23 10-May-2004  christos avoid overflow in strcpy.
 1.22 07-Aug-2003  agc branches: 1.22.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.21 19-Oct-2002  provos use readlink with bufsize - 1; approved thorpej.
 1.20 12-Aug-2002  itojun calloc() arg mistake. it's (nelem, size). from openbsd
 1.19 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.18 03-Nov-2001  lukem branches: 1.18.2;
fix WARNS=2
 1.17 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.16 08-Oct-2000  is Format string auditing by Bill Sommerfeld.
 1.15 19-Mar-1999  christos branches: 1.15.2; 1.15.10;
braces for gcc-2.8.1
 1.14 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.13 28-Jul-1998  mycroft Delint (partially).
 1.12 27-Jul-1998  mycroft const propagation.
 1.11 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.10 13-Jan-1997  tls kill register
 1.9 21-Mar-1995  cgd convert to new RCS id conventions.
 1.8 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.7 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.6 31-Jul-1994  mycroft Fix bogus freeing of memory.
 1.5 01-Aug-1993  mycroft branches: 1.5.2;
Add RCS identifiers.
 1.4 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.3 22-Mar-1993  cgd added rcs ids to all files
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.2.1 01-Aug-1994  cgd from trunk.
 1.15.10.2 12-May-2004  jmc Pullup patch (requested by kleink in ticket #147)

Use readlink with bufsize - 1.
 1.15.10.1 08-Oct-2000  is Pullup from trunc, requested by is, approved by jhawk:
dir.c 1.16, dig.c 1.2, host.c 1.3
Format string cleanups by sommerfeld.
 1.15.2.1 08-Oct-2000  he Pull up revision 1.16 (requested by is):
Format string cleanup.
 1.18.2.2 11-May-2004  tron Pull up revision 1.23 (requested by kleink in ticket #1688):
avoid overflow in strcpy.
 1.18.2.1 11-May-2004  tron Pull up revision 1.21 (requested by kleink in ticket #1688):
use readlink with bufsize - 1; approved thorpej.
 1.22.2.1 11-May-2004  tron Pull up revision 1.23 (requested by kleink in ticket #306):
avoid overflow in strcpy.
 1.29.40.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.28.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.30.28.3 21-Apr-2020  martin Sync with HEAD
 1.30.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.30.28.1 10-Jun-2019  christos Sync with HEAD
 1.30.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.9 03-Apr-2020  joerg Don't depend on common declarations.
 1.8 07-Aug-2003  agc branches: 1.8.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.7 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.98.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.8.98.2 21-Apr-2020  martin Sync with HEAD
 1.8.98.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.31 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.30 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.29 16-Jul-2013  christos branches: 1.29.26; 1.29.28;
WARNS=6 [-Wconversion]
 1.28 09-Nov-2011  christos branches: 1.28.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.27 29-Aug-2011  joerg branches: 1.27.2;
Use __dead
 1.26 16-Jul-2007  christos no need to have cshbool; just make them int
 1.25 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.24 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.23 18-Mar-2006  christos Coverity CID 1763: Plug memory leak.
 1.22 18-Mar-2006  christos Coverity CID 1766: Plug memory leak.
 1.21 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.20 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.19 30-Jan-2002  christos stderror does not return.
 1.18 30-Jan-2002  itohy Fix problem where
% echo $20000000000
Segmentation fault (core dumped)
 1.17 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.16 03-Nov-2000  christos Correct stupid cast problem. Pointed out by simon burge.
 1.15 31-Oct-2000  christos Avoid turning into a random file writing tool when using here-doc's.
Reported to BUGTRAQ by proton <proton@ENERGYMECH.NET>.
 1.14 31-May-2000  christos branches: 1.14.2;
decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.13 19-Aug-1998  thorpej branches: 1.13.2; 1.13.8;
Add some braces to make egcs happy.
 1.12 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.9 13-Jan-1997  tls kill register
 1.8 27-Sep-1995  jtc Update lseek() constants:
L_SET -> SEEK_SET
L_INCR -> SEEK_CUR
L_XTND -> SEEK_END
 1.7 21-Mar-1995  cgd convert to new RCS id conventions.
 1.6 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.1 04-Nov-2000  he Pull up revisions 1.15-1.16 (requested by christos):
Avoid overwriting existing files when creating files used
for ``here'' documents, thereby closing a security hole.
 1.14.2.2 05-Nov-2000  tv Pullup 1.16 [christos]:
Correct stupid cast problem. Pointed out by simon burge.
 1.14.2.1 01-Nov-2000  tv Pullup 1.15 [christos]:
Avoid turning into a random file writing tool when using here-doc's.
Reported to BUGTRAQ by proton <proton@ENERGYMECH.NET>.
 1.27.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.2.1 10-Nov-2011  yamt sync with head
 1.28.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.29.28.2 21-Apr-2020  martin Sync with HEAD
 1.29.28.1 10-Jun-2019  christos Sync with HEAD
 1.29.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.26 20-Mar-2025  buhrow Cause jobs -l to actually show process ID's again.
Thanks to rvp for the initial patch.
See: http://mail-index.NetBSD.org/current-users/2025/03/17/msg046284.html
for the full discussion of this fix.
-Brian
 1.25 08-Apr-2022  andvar branches: 1.25.4;
fix various typos, mainly in comments, but also log messages, docs, game text.
 1.24 11-Sep-2021  christos like zsh, have jobs -Z do setproctitle
 1.23 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.22 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.21 16-Jul-2013  christos branches: 1.21.26; 1.21.28;
WARNS=6 [-Wconversion]
 1.20 14-Feb-2009  lukem branches: 1.20.6; 1.20.12;
fix -Wsign-compare issues
 1.19 17-Mar-2006  dmcmahill branches: 1.19.28;
Correct a check for an index being in bounds for a static array.
 1.18 05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.17 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.16 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.15 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.14 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.13 28-Jul-1998  mycroft branches: 1.13.8;
Be more retentive about use of NOTREACHED and noreturn.
 1.12 28-Jul-1998  mycroft Delint (partially).
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 27-Jul-1998  mycroft Slight code reduction.
 1.9 27-Jul-1998  mycroft const propagation.
 1.8 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.7 13-Jan-1997  tls kill register
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.19.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.20.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.21.28.2 21-Apr-2020  martin Sync with HEAD
 1.21.28.1 10-Jun-2019  christos Sync with HEAD
 1.21.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.25.4.1 02-Aug-2025  perseant Sync with HEAD
 1.33 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.32 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.31 16-Mar-2016  christos branches: 1.31.14; 1.31.16;
add Will Robinson comment.
 1.30 16-Mar-2016  christos Avoid gcc-5 conversion warning (|= expands to int)
 1.29 16-Jul-2013  christos WARNS=6 [-Wconversion]
 1.28 14-Feb-2009  lukem branches: 1.28.6; 1.28.12;
fix -Wsign-compare issues
 1.27 15-Dec-2007  perry branches: 1.27.12;
convert __attribute__s to applicable cdefs.h macros
 1.26 16-Jul-2007  christos branches: 1.26.4;
no need to have cshbool; just make them int
 1.25 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.24 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.23 13-May-2006  christos Coverity CID 3330: Initialize uninitialized variable.
 1.22 17-Feb-2005  xtraeme Kill __P().
 1.21 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.20 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.19 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.18 08-Mar-2002  christos % set verbose echo
% echo foo >& bar
% cat bar
guess what you get:
echo foo
foo
 1.17 03-Nov-2001  lukem fix WARNS=2
 1.16 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.15 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.14 28-Jul-1998  mycroft Delint (partially).
 1.13 28-Jul-1998  mycroft Delint (partially).
 1.12 26-Jul-1998  mycroft const poisoning.
 1.11 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.10 13-Jan-1997  tls kill register
 1.9 30-Sep-1996  christos - Use ../usr.bin/printf/printf.c
- Fix built-in which to set the status code correctly.
 1.8 23-May-1995  christos Fixed bug where 'which /bin/csh' reports .//bin/csh, by copying the
current tcsh code.
 1.7 21-Mar-1995  mycroft Use POSIX signals.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.26.4.1 09-Jan-2008  matt sync with HEAD
 1.27.12.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.28.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.16.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.31.16.2 21-Apr-2020  martin Sync with HEAD
 1.31.16.1 10-Jun-2019  christos Sync with HEAD
 1.31.14.1 18-Jan-2019  pgoyette Synch with HEAD
 1.22 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.21 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.20 14-Feb-2009  lukem branches: 1.20.46; 1.20.48;
fix -Wsign-compare issues
 1.19 16-Jul-2007  christos branches: 1.19.20;
no need to have cshbool; just make them int
 1.18 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.17 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.16 13-May-2006  christos Coverity CID 3331: Remove impossible test.
 1.15 10-May-2006  mrg rename exp2() to csh_exp2(). (bah, we don't even have an exp2())
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.13 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.11 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.10 28-Jul-1998  mycroft Delint (partially).
 1.9 19-Oct-1997  mycroft Remove bogus use of S_IFLNK.
 1.8 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.7 13-Jan-1997  tls kill register
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.19.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.20.48.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.20.48.2 21-Apr-2020  martin Sync with HEAD
 1.20.48.1 10-Jun-2019  christos Sync with HEAD
 1.20.46.1 18-Jan-2019  pgoyette Synch with HEAD
 1.35 24-Apr-2024  nia csh: add a reallocarray function for using inside csh
 1.34 15-Sep-2022  martin Fix the build for variants that do not define EDIT.
 1.33 14-Sep-2022  christos defer editing setup/cleanup to when we are interactive.
 1.32 23-Apr-2020  simonb Add '-t' option for tcsh-style time output.
 1.31 05-Jan-2019  christos branches: 1.31.2;
Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.30 15-Jul-2017  christos branches: 1.30.2; 1.30.4; 1.30.6;
Add a variant that passes the format, so that time(1) can use it.
 1.29 16-Jul-2013  christos WARNS=6 [-Wconversion]
 1.28 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.27 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.26 22-Jan-2013  christos Remove alloc builtin, it did not work anyway since most modern malloc
implementation use a combination of sbrk/mmap.
 1.25 27-Dec-2012  christos sprinkle const, no functional change intended.
 1.24 09-Nov-2011  christos branches: 1.24.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.23 29-Aug-2011  joerg branches: 1.23.2;
Use __dead
 1.22 24-Dec-2007  perry __attribute__((__noreturn__)) to __dead
 1.21 16-Jul-2007  christos branches: 1.21.4;
no need to have cshbool; just make them int
 1.20 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.19 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.18 24-Feb-2007  matt No functional changes. Cleanup time printing code so it can be used
elsewhere in the tree.
 1.17 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.16 17-Feb-2005  xtraeme Kill __P().
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.14 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.13 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.12 28-Jul-1998  mycroft Delint (partially).
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 26-Jul-1998  mycroft const poisoning.
 1.9 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.8 31-Oct-1996  christos Quote all imported environment variables, so that we don't core dump with
set term='unknown*'
./csh
or we don't have security problems with:
set path=('`/bin/rm -fr *`' /usr/local)
./csh
Reported by Donn Seeley...
 1.7 21-Mar-1995  mycroft Remove dead externs.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.21.4.1 09-Jan-2008  matt sync with HEAD
 1.23.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.23.2.2 23-Jan-2013  yamt sync with head
 1.23.2.1 10-Nov-2011  yamt sync with head
 1.24.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.6.1 25-Feb-2013  tls resync with head
 1.30.6.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.30.6.2 21-Apr-2020  martin Sync with HEAD
 1.30.6.1 10-Jun-2019  christos Sync with HEAD
 1.30.4.1 18-Jan-2019  pgoyette Synch with HEAD
 1.30.2.2 15-Jul-2017  christos 1624
 1.30.2.1 15-Jul-2017  christos file extern.h was added on branch perseant-stdc-iso10646 on 2017-07-15 14:35:56 +0000
 1.31.2.1 25-Apr-2020  martin Pull up following revision(s) (requested by simonb in ticket #853):

bin/csh/time.c: revision 1.22
usr.bin/time/time.c: revision 1.24
bin/csh/extern.h: revision 1.32
usr.bin/time/time.1: revision 1.29
usr.bin/time/ext.h: revision 1.4

Add '-t' option for tcsh-style time output.
 1.34 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.33 29-Sep-2020  msaitoh s/occurence/occurrence/
 1.32 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.31 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.30 16-Jul-2013  christos branches: 1.30.26; 1.30.28;
WARNS=6 [-Wconversion]
 1.29 24-Sep-2011  christos branches: 1.29.2; 1.29.8;
csh has no business using TTYHOG
 1.28 14-Feb-2009  lukem fix -Wsign-compare issues
 1.27 16-Jul-2007  christos branches: 1.27.20;
no need to have cshbool; just make them int
 1.26 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.25 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.24 24-Apr-2006  snj It's "its."
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.22 08-Feb-2003  christos remove maxitems limit (from Todd Miller)
 1.21 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.20 12-Aug-2002  itojun calloc() arg mistake. it's (nelem, size). from openbsd
 1.19 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.18 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.17 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.16 23-Mar-1999  itohy branches: 1.16.8;
cleanup
 1.15 26-Dec-1998  itohy Fixed ancient bug in csh(1) "filec" implementation.
We need not wait for a while any longer after pressing ESC or ^D.

Problem description:
If a user types characters during performing completion (ESC)
or listings (^D), the chars are inserted at weird position of
the command line.
This makes the command line unusable and irritates the user.
I noticed this on 386BSD(98), probably six years ago.

This change fixes the bug by implementing salvage of the characters.
The salvaged chars are added at the end of the command line.
An extra ioctl(FIONREAD) is required to work-around a glitch on
kernel tty driver.
 1.14 28-Jul-1998  mycroft Delint (partially).
 1.13 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.12 13-Jan-1997  tls kill register
 1.11 08-Nov-1996  christos Fix bug reported by Chris Torek: use TCSADRAIN instead of TCSANOW, to avoid
dropping characters.
 1.10 21-Mar-1995  mycroft Use POSIX signals.
 1.9 21-Mar-1995  cgd convert to new RCS id conventions.
 1.8 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.7 28-Apr-1994  pk Use TCSADRAIN to avoid loosing chars on slow lines.
 1.6 09-Mar-1994  cgd tchars needn't be static any more
 1.5 07-Mar-1994  cgd i'm surprised this ever worked right before...
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.27.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.29.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.30.28.2 21-Apr-2020  martin Sync with HEAD
 1.30.28.1 10-Jun-2019  christos Sync with HEAD
 1.30.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.45 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.44 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.43 06-Jan-2019  christos PR/53837: Michael Scholz: src/bin/csh/func.c from current has a superfluous
fprintf
 1.42 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.41 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.40 16-Jul-2013  christos branches: 1.40.26; 1.40.28;
WARNS=6 [-Wconversion]
 1.39 09-Jun-2012  christos branches: 1.39.2;
support RLIMIT_NTHR
 1.38 31-Aug-2011  plunky branches: 1.38.2;
NULL does not need a cast
 1.37 29-Mar-2009  mrg - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.36 15-Sep-2007  ragge branches: 1.36.12; 1.36.14;
Needs errno.h if !gcc.
 1.35 16-Jul-2007  christos branches: 1.35.4;
no need to have cshbool; just make them int
 1.34 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.33 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.32 29-Apr-2007  msaitoh fix typos
 1.31 18-Mar-2006  christos branches: 1.31.4; 1.31.6;
Coverity CID 1228: protect against calling close with negative value.
 1.30 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.29 13-May-2004  christos Keep track of the while level, when popping loops because of a breaksw.
This is nasty...
 1.28 17-Apr-2004  christos understand rlimit sbsize
 1.27 17-Dec-2003  christos Handle breaksw inside while loop (from tcsh)
Really: test commits on new cvs binary.
 1.26 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.25 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.24 28-May-2002  wiz Since we have rlim_t, use it.
Approved by kleink.
 1.23 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.22 17-Dec-2001  christos make sure that rlim_cur >= rlim_max in all the setrlimit(2) cases.
 1.21 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.20 14-Mar-2001  christos echo;echo;echo; should echo
 1.19 06-Jan-2001  christos eliminate nested extern decls.
 1.18 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.17 19-Aug-1998  thorpej branches: 1.17.8;
Add some braces to make egcs happy.
 1.16 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.15 28-Jul-1998  mycroft Delint (partially).
 1.14 28-Jul-1998  mycroft Delint (partially).
 1.13 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.12 13-Jan-1997  tls kill register
 1.11 09-Feb-1996  christos fix bug where
child% suspend
parent% bg
parent% fg
Fg would not work anymore, it would say Suspended (tty input).
 1.10 21-Mar-1995  mycroft Use POSIX signals.
 1.9 21-Mar-1995  cgd convert to new RCS id conventions.
 1.8 04-Dec-1994  cgd from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.
 1.7 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.6 05-May-1994  cgd rlimit foo
 1.5 23-Aug-1993  mycroft RLIMIT_OFILE --> RLIMIT_NOFILE
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.31.6.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.31.4.2 13-Dec-2007  gmcgarry Wrong branch.
 1.31.4.1 12-Dec-2007  gmcgarry pcc says we need errno.h
 1.35.4.1 06-Nov-2007  matt sync with HEAD
 1.36.14.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.36.12.1 01-Apr-2009  snj Pull up following revision(s) (requested by mrg in ticket #622):
bin/csh/csh.1: revision 1.46
bin/csh/func.c: revision 1.37
bin/ps/print.c: revision 1.111
bin/ps/ps.c: revision 1.74
bin/sh/miscbltin.c: revision 1.38
bin/sh/sh.1: revision 1.92 via patch
external/bsd/top/dist/machine/m_netbsd.c: revision 1.7
lib/libkvm/kvm_proc.c: revision 1.82
sys/arch/mips/mips/cpu_exec.c: revision 1.55
sys/compat/darwin/darwin_exec.c: revision 1.57
sys/compat/ibcs2/ibcs2_exec.c: revision 1.73
sys/compat/irix/irix_resource.c: revision 1.15
sys/compat/linux/arch/amd64/linux_exec_machdep.c: revision 1.16
sys/compat/linux/arch/i386/linux_exec_machdep.c: revision 1.12
sys/compat/linux/common/linux_limit.h: revision 1.5
sys/compat/osf1/osf1_resource.c: revision 1.14
sys/compat/svr4/svr4_resource.c: revision 1.18
sys/compat/svr4_32/svr4_32_resource.c: revision 1.17
sys/kern/exec_subr.c: revision 1.62
sys/kern/init_sysctl.c: revision 1.160
sys/kern/kern_exec.c: revision 1.288
sys/kern/kern_resource.c: revision 1.151
sys/sys/param.h: patch
sys/sys/resource.h: revision 1.31
sys/sys/sysctl.h: revision 1.184
sys/uvm/uvm_extern.h: revision 1.153
sys/uvm/uvm_glue.c: revision 1.136
sys/uvm/uvm_mmap.c: revision 1.128
usr.bin/systat/ps.c: revision 1.32
- - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.
- - adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.
- - add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)
- - patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)
- - patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.
- - update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)
this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.
tested on i386 and sparc64, build tested on several other platforms.
thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.38.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.38.2.1 30-Oct-2012  yamt sync with head
 1.39.2.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.40.28.2 21-Apr-2020  martin Sync with HEAD
 1.40.28.1 10-Jun-2019  christos Sync with HEAD
 1.40.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.32 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.31 05-Jan-2019  christos put back x in xrealloc
 1.30 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.29 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.28 27-Apr-2017  christos branches: 1.28.8; 1.28.10;
switch to a backtracking instead of a recursive pattern matcher.
 1.27 16-Jul-2013  christos branches: 1.27.18;
WARNS=6 [-Wconversion]
 1.26 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.25 16-Jul-2007  christos branches: 1.25.34; 1.25.40;
no need to have cshbool; just make them int
 1.24 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.23 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.22 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.21 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.20 08-Mar-2002  christos Fix:
% set N2=`echo 1; echo 2; \
? echo 3`
% echo $N2
1 2
so that
% echo $N2
1 2 3
 1.19 03-Nov-2001  lukem fix WARNS=2
 1.18 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.17 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.16 28-Jul-1998  mycroft branches: 1.16.8;
Be more retentive about use of NOTREACHED and noreturn.
 1.15 28-Jul-1998  mycroft Delint (partially).
 1.14 19-Jun-1998  kleink GLOB_QUOTE is dead; per POSIX, backslash quoting of special characters being
enabled is the default behaviour.
 1.13 31-Mar-1998  kleink GLOB_ABEND -> GLOB_ABORTED
 1.12 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.11 13-Jan-1997  tls kill register
 1.10 21-Mar-1995  cgd convert to new RCS id conventions.
 1.9 21-Sep-1994  mycroft Remove a couple of changes we no longer need.
 1.8 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.7 01-Jul-1994  pk save state of `gflag' across calls to backeval(), allowing globbing to
continue after backquote expansion. (fix for bug #309)
 1.6 07-Feb-1994  cgd don't core when handed "grep \'{\' *". also, fix the error message
when that happens.
 1.5 03-Nov-1993  mycroft Patch from Dan Muntz to mimic original csh when doing multiple globbings, some
of which don't match anything.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.40.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.40.1 25-Feb-2013  tls resync with head
 1.25.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.18.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.28.10.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.28.10.2 21-Apr-2020  martin Sync with HEAD
 1.28.10.1 10-Jun-2019  christos Sync with HEAD
 1.28.8.1 18-Jan-2019  pgoyette Synch with HEAD
 1.22 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.21 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.20 16-Jul-2013  christos branches: 1.20.26; 1.20.28;
WARNS=6 [-Wconversion]
 1.19 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.18 16-Jul-2007  christos branches: 1.18.34; 1.18.40;
no need to have cshbool; just make them int
 1.17 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.16 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.14 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.13 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 28-Jul-1998  mycroft Delint (partially).
 1.9 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.8 13-Jan-1997  tls kill register
 1.7 21-Mar-1995  mycroft Use POSIX signals.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.18.40.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.40.1 25-Feb-2013  tls resync with head
 1.18.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.20.28.2 21-Apr-2020  martin Sync with HEAD
 1.20.28.1 10-Jun-2019  christos Sync with HEAD
 1.20.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.12 11-Sep-2021  christos like zsh, have jobs -Z do setproctitle
 1.11 22-Jan-2013  christos branches: 1.11.32;
Remove alloc builtin, it did not work anyway since most modern malloc
implementation use a combination of sbrk/mmap.
 1.10 07-Aug-2003  agc branches: 1.10.54; 1.10.60;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.9 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.8 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.7 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.60.1 25-Feb-2013  tls resync with head
 1.10.54.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.32.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.11.32.1 21-Apr-2020  martin Sync with HEAD
 1.38 02-Oct-2020  christos undo previous for 'r' and 'e' modifiers; they should no go further than
the last '/'.
 1.37 30-Sep-2020  christos Fix
% set x='a/b c/d.e'
% echo $x:q:h
 1.36 09-Aug-2020  dholland Use the right size for several calloc calls.

When allocating for a Char **, it should use sizeof(Char *), not
sizeof(Char **). This doesn't actually affect the results except
on DS9000 though :-)
 1.35 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.34 01-Feb-2019  mrg compare pointers with NULL not '\0'.
 1.33 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.32 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.31 06-Aug-2013  christos branches: 1.31.24; 1.31.26;
CID 1060854: Wrong sizeof argument (SIZEOF_MISMATCH)
 1.30 16-Jul-2013  christos WARNS=6 [-Wconversion]
 1.29 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.28 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.27 17-Jan-2010  wiz branches: 1.27.6; 1.27.12;
Match curly braces in undef(FILEC) case. Found by cppcheck.
 1.26 16-Jul-2007  christos no need to have cshbool; just make them int
 1.25 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.24 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.23 17-Mar-2006  christos branches: 1.23.4; 1.23.6;
Coverity CID 1762. Fix resource leak.
 1.22 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.21 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.20 03-Nov-2001  lukem fix WARNS=2
 1.19 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.18 14-Dec-2000  simonb Need alvec global variable now.
 1.17 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.16 19-Mar-1999  christos branches: 1.16.8;
printf format portability.
 1.15 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.14 28-Jul-1998  mycroft Delint (partially).
 1.13 28-Jul-1998  mycroft Delint (partially).
 1.12 29-Mar-1998  mrg make sincereal "static int" rather than just "static"
 1.11 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.10 13-Jan-1997  tls kill register
 1.9 27-Sep-1995  jtc Update lseek() constants:
L_SET -> SEEK_SET
L_INCR -> SEEK_CUR
L_XTND -> SEEK_END
 1.8 29-Apr-1995  mycroft Use POSIX signal semantics. Change p_pid and p_jobid to pid_t's.
 1.7 21-Mar-1995  cgd convert to new RCS id conventions.
 1.6 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.6.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.23.4.2 13-Dec-2007  gmcgarry Wrong branch.
 1.23.4.1 12-Dec-2007  gmcgarry compile without FILEC defined.
 1.27.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.12.1 25-Feb-2013  tls resync with head
 1.27.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.26.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.31.26.2 21-Apr-2020  martin Sync with HEAD
 1.31.26.1 10-Jun-2019  christos Sync with HEAD
 1.31.24.1 18-Jan-2019  pgoyette Synch with HEAD
 1.23 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.22 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.21 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.20 16-Jul-2013  christos branches: 1.20.26; 1.20.28;
WARNS=6 [-Wconversion]
 1.19 18-Mar-2006  christos branches: 1.19.42; 1.19.48;
Coverity CID 872: Possible NULL deref.
 1.18 17-Mar-2006  christos Coverity CID 1226: Remove bogus close call.
 1.17 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.16 06-Jan-2004  christos Simplify previous; if F_CLOSEM fails, just fall back doing the old thing.
Calling stderror here is not safe, because we might have not setjmp()'ed
yet.
 1.15 05-Jan-2004  christos use F_CLOSEM if it is available.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.13 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 28-Jul-1998  mycroft Delint (partially).
 1.9 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.8 13-Jan-1997  tls kill register
 1.7 31-Oct-1996  christos Quote all imported environment variables, so that we don't core dump with
set term='unknown*'
./csh
or we don't have security problems with:
set path=('`/bin/rm -fr *`' /usr/local)
./csh
Reported by Donn Seeley...
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.19.48.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.42.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.20.28.2 21-Apr-2020  martin Sync with HEAD
 1.20.28.1 10-Jun-2019  christos Sync with HEAD
 1.20.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.21 09-Aug-2020  dholland Use the right size for several calloc calls.

When allocating for a Char **, it should use sizeof(Char *), not
sizeof(Char **). This doesn't actually affect the results except
on DS9000 though :-)
 1.20 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.19 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.18 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.17 16-Jul-2007  christos branches: 1.17.76; 1.17.78;
no need to have cshbool; just make them int
 1.16 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.15 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.13 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 03-Nov-2001  lukem fix WARNS=2
 1.11 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.10 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.9 28-Jul-1998  mycroft Delint (partially).
 1.8 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.7 13-Jan-1997  tls kill register
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.78.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.17.78.2 21-Apr-2020  martin Sync with HEAD
 1.17.78.1 10-Jun-2019  christos Sync with HEAD
 1.17.76.1 18-Jan-2019  pgoyette Synch with HEAD
 1.8 07-Aug-2003  agc branches: 1.8.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.7 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.8.98.1 21-Apr-2020  martin Sync with HEAD
 1.5 21-Sep-1994  mycroft Clean up deleted files.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7 30-Sep-1996  christos - Use ../usr.bin/printf/printf.c
- Fix built-in which to set the status code correctly.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.44 05-Jul-2025  mlelstv Indentation.
 1.43 20-Mar-2025  buhrow Cause jobs -l to actually show process ID's again.
Thanks to rvp for the initial patch.
See: http://mail-index.NetBSD.org/current-users/2025/03/17/msg046284.html
for the full discussion of this fix.
-Brian
 1.42 16-Sep-2021  christos branches: 1.42.4;
provide a way to reset setproctitle.
 1.41 11-Sep-2021  christos like zsh, have jobs -Z do setproctitle
 1.40 09-Aug-2020  dholland Don't cast the value returned from *malloc. No change to compiler output.
 1.39 03-Apr-2020  joerg Don't depend on common declarations.
 1.38 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.37 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.36 16-Jul-2013  christos branches: 1.36.26; 1.36.28;
WARNS=6 [-Wconversion]
 1.35 09-Nov-2011  christos branches: 1.35.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.34 16-Jul-2007  christos branches: 1.34.34;
no need to have cshbool; just make them int
 1.33 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.32 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.31 10-Jul-2007  dogcow exposure of bool elsewhere in the code requires the addition of stdbool;
in addition, proc.c cleverly has a variable that was initially defined "int",
but had in the actual declaration "bool". oops.
 1.30 24-Feb-2007  matt No functional changes. Cleanup time printing code so it can be used
elsewhere in the tree.
 1.29 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.28 19-Sep-2003  itojun make signal range check consistent.
 1.27 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.26 08-Feb-2003  christos use strtol() for better error handling in builtin kill (Peter Jeremy)
 1.25 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.24 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.23 03-Nov-2001  lukem fix WARNS=2
 1.22 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.21 06-Jan-2001  christos eliminate nested extern decls.
 1.20 19-May-1999  kleink Remove a bogus whitespace match in the builtin kill(1)'s `-s' parsing;
noticed by Chris Demetriou.
 1.19 09-May-1999  cgd fix incorrect operation caused by the previous checkin.
 1.18 08-May-1999  christos Fix unaligned access memory problem introduced from the -s fix.
 1.17 19-Mar-1999  christos branches: 1.17.2;
- don't use union wait
- printf portability
- add braces for gcc-2.8.1
 1.16 11-Dec-1998  kleink Built-in kill: also accept symbolic signal names prefixed with "SIG".
 1.15 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.14 28-Jul-1998  mycroft Delint (partially).
 1.13 28-Jul-1998  mycroft Delint (partially).
 1.12 10-May-1998  kleink * Add support for POSIX "kill [-s signame] pid" syntax; actually fixes PR 5327.
* Complete the "kill -l [exitstatus]" syntax.
* Sync with the documentation and no longer permit the use of full signal
names in the "kill [-sig] pid" syntax, e.g. -SIGHUP.
 1.11 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.10 13-Jan-1997  tls kill register
 1.9 29-Apr-1995  mycroft Use POSIX signal semantics. Change p_pid and p_jobid to pid_t's.
 1.8 21-Mar-1995  mycroft Use POSIX signals.
 1.7 21-Mar-1995  mycroft Update to use timer{add,sub}().
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.2.1 21-Jun-1999  perry pullup 1.17->1.20 (cgd): fix potential memory corruption with "kill" builtin
 1.34.34.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.34.34.1 10-Nov-2011  yamt sync with head
 1.35.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.28.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.36.28.3 21-Apr-2020  martin Sync with HEAD
 1.36.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.36.28.1 10-Jun-2019  christos Sync with HEAD
 1.36.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.42.4.1 02-Aug-2025  perseant Sync with HEAD
 1.15 03-Apr-2020  joerg Don't depend on common declarations.
 1.14 16-Jul-2013  christos branches: 1.14.28;
WARNS=6 [-Wconversion]
 1.13 09-Nov-2011  christos branches: 1.13.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.12 16-Jul-2007  christos branches: 1.12.34;
no need to have cshbool; just make them int
 1.11 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.10 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.8 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.7 29-Apr-1995  mycroft Use POSIX signal semantics. Change p_pid and p_jobid to pid_t's.
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.34.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.34.1 10-Nov-2011  yamt sync with head
 1.13.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.14.28.2 21-Apr-2020  martin Sync with HEAD
 1.14.28.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.32 05-Feb-2020  fox bin/csh: Fix the -Wclobber warning.

Mark the variable as volatile as it can be clobbered when a vfork occurs.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
 1.31 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.30 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.29 29-Aug-2011  joerg branches: 1.29.42; 1.29.44;
Use __dead
 1.28 16-Jul-2007  christos no need to have cshbool; just make them int
 1.27 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.26 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.25 15-Oct-2006  christos sprinkle volatile
 1.24 28-Sep-2004  christos Don't forget to FIOCLEX the internal copies of stdout,stderr,stddiag when
we invoke a subshell. Otherwise the executed command gets invoked with
17,18,19 open.
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.22 12-Jul-2003  itojun strlcpy
 1.21 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.20 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.19 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.18 02-Nov-1999  tron Avoid segmenation fault if an external command is invoked in parse only
mode. Problem noted by Josh Lynch PR bin/8732.
 1.17 19-Mar-1999  christos branches: 1.17.4;
add braces for gcc-2.8.1
 1.16 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.15 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.14 28-Jul-1998  mycroft Delint.
 1.13 28-Jul-1998  mycroft Delint (partially).
 1.12 28-Jul-1998  mycroft Delint (partially).
 1.11 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.10 13-Jan-1997  tls kill register
 1.9 27-Sep-1995  jtc Update lseek() constants:
L_SET -> SEEK_SET
L_INCR -> SEEK_CUR
L_XTND -> SEEK_END
 1.8 21-Mar-1995  mycroft Use POSIX signals.
 1.7 21-Mar-1995  cgd convert to new RCS id conventions.
 1.6 23-Sep-1994  mycroft Eliminate uses of some obsolete functions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.29.44.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.29.44.3 21-Apr-2020  martin Sync with HEAD
 1.29.44.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.29.44.1 10-Jun-2019  christos Sync with HEAD
 1.29.42.1 18-Jan-2019  pgoyette Synch with HEAD
 1.40 15-Sep-2022  martin Fix the build for variants that do not define EDIT.
 1.39 14-Sep-2022  christos defer editing setup/cleanup to when we are interactive.
 1.38 15-Aug-2021  christos Turn on EL_SAFEREAD
 1.37 12-Jan-2020  christos Add file completion.
 1.36 12-Jan-2020  christos PR/54853: Greg Oster: unable to 'unset filec' or 'unset edit' in csh
While here allow set edit=vi
 1.35 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.34 05-Jan-2019  maya Remove Free, s/xfree/free/.

Standard C says that free should be a no-op for a NULL pointer, so
we don't need an extra function to do this.

While here, add an XXX about a wrong sounding comment
 1.33 16-Jul-2013  christos branches: 1.33.26; 1.33.28;
WARNS=6 [-Wconversion]
 1.32 03-Apr-2013  christos Make shifting variables reflect their environment counterparts. Makes
"shift path" work as expected.
 1.31 23-Jan-2013  christos make history kind of work :-), turn libedit support on.
 1.30 22-Jan-2013  christos Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
 1.29 16-Jul-2007  christos branches: 1.29.34; 1.29.40;
no need to have cshbool; just make them int
 1.28 16-Jul-2007  christos PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
 1.27 16-Jul-2007  dogcow Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
 1.26 29-Apr-2007  msaitoh fix typos
 1.25 14-May-2006  christos Fix two uninitialized variables with XXX: GCC.
 1.24 24-Apr-2006  snj It's "its."
 1.23 21-Mar-2006  christos Coverity CID 2736: Remove 16 bit int compat code.
 1.22 17-Mar-2006  christos Coverity CID 1324: Check adrof return; not really possible.
 1.21 17-Mar-2006  christos Coverity CID 610: Dead code
 1.20 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.19 16-Jan-2003  kleink Rename `sigset' locals to avoid symbol shadowing warning.
 1.18 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.17 03-Nov-2001  lukem fix WARNS=2
 1.16 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.15 31-May-2000  christos decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K
 1.14 19-Mar-1999  christos branches: 1.14.8;
add braces for gcc-2.8.1
 1.13 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.12 28-Jul-1998  mycroft Delint (partially).
 1.11 28-Jul-1998  mycroft Delint (partially).
 1.10 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.9 13-Jan-1997  tls kill register
 1.8 21-Mar-1995  mycroft Use POSIX signals.
 1.7 21-Mar-1995  cgd convert to new RCS id conventions.
 1.6 15-Jan-1995  mycroft Remove the gratuitous `security' warnings.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.14.8.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.29.40.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.40.2 23-Jun-2013  tls resync from head
 1.29.40.1 25-Feb-2013  tls resync with head
 1.29.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.28.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.33.28.3 21-Apr-2020  martin Sync with HEAD
 1.33.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.33.28.1 10-Jun-2019  christos Sync with HEAD
 1.33.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.17 24-Apr-2024  nia csh: replace malloc(x * y) and realloc(x * y) with reallocarray
 1.16 05-Jan-2019  christos Welcome to the 21th century csh: retire "ptr_t" now that we have "void *"
 1.15 16-Jul-2013  christos branches: 1.15.26; 1.15.28;
WARNS=6 [-Wconversion]
 1.14 27-Dec-2012  christos sprinkle const, no functional change intended.
 1.13 07-Aug-2003  agc branches: 1.13.54; 1.13.60;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.12 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.11 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.10 28-Jul-1998  mycroft Delint (partially).
 1.9 26-Jul-1998  mycroft const poisoning.
 1.8 04-Jul-1997  christos Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.7 13-Jan-1997  tls kill register
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.60.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.60.1 25-Feb-2013  tls resync with head
 1.13.54.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.54.1 23-Jan-2013  yamt sync with head
 1.15.28.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.15.28.2 21-Apr-2020  martin Sync with HEAD
 1.15.28.1 10-Jun-2019  christos Sync with HEAD
 1.15.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.9 28-Aug-2011  christos use strpct(3) from libutil.
 1.8 13-Feb-2009  abs Use u_int counter to count from 0 to u_int: for (u = 0; u < digits; u++)
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 12-Dec-2007  lukem branches: 1.6.4;
use __RCSID()
 1.5 14-Sep-2001  wiz branches: 1.5.26;
ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.4 19-Mar-1999  christos include <limits.h> instead of <machine/limits.h>
 1.3 31-Jan-1999  mrg minor KNF nits, space damage.
 1.2 08-May-1998  fair branches: 1.2.2;
KNF + copyright assignment to TNF
 1.1 08-Apr-1998  fair Fix PR#3585 - csh printed a negative percentage of CPU used when the total
CPU usage was more than 6 hours (integer overflow problem).
 1.2.2.2 08-May-1998  mycroft Pull up 1.1-1.2, per request of fair.
 1.2.2.1 08-May-1998  mycroft file strpct.c was added on branch netbsd-1-3 on 1998-05-08 22:21:06 +0000
 1.5.26.1 09-Jan-2008  matt sync with HEAD
 1.6.4.1 18-May-2008  yamt sync with head.
 1.7.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.26 02-Mar-2025  riastradh bin/csh/time.c: Break overlong line.
 1.25 28-Feb-2025  simonb Cast a time_t explicity to (double) to avoid gcc conversion warning.
 1.24 28-Feb-2025  simonb Fix delta time display when prec != 1.
 1.23 17-Oct-2020  mlelstv branches: 1.23.8;
Print real maxrss value like other shells.
 1.22 23-Apr-2020  simonb Add '-t' option for tcsh-style time output.
 1.21 15-Jul-2017  christos branches: 1.21.2; 1.21.6; 1.21.8;
Add a variant that passes the format, so that time(1) can use it.
 1.20 16-Jul-2013  christos WARNS=6 [-Wconversion]
 1.19 09-Nov-2011  christos branches: 1.19.6;
sync with /usr/bin/time, use CLOCK_MONOTONIC
 1.18 28-Aug-2011  christos branches: 1.18.2;
use strpct(3) from libutil.
 1.17 24-Feb-2008  dholland Dividing by a time_t makes the result time_t, so it should be cast to long
when being printf'd as a long.
 1.16 24-Feb-2007  matt branches: 1.16.4; 1.16.8;
No functional changes. Cleanup time printing code so it can be used
elsewhere in the tree.
 1.15 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.13 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 14-Sep-2001  wiz ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
 1.11 12-Jun-2001  wiz receive, not recieve
 1.10 08-Apr-1998  fair Fix PR#3585 - csh printed a negative percentage of CPU used when the total
CPU usage was more than 6 hours (integer overflow problem).
 1.9 04-Jul-1997  christos branches: 1.9.2;
Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
 1.8 13-Jan-1997  tls kill register
 1.7 21-Mar-1995  mycroft Update to use timer{add,sub}().
 1.6 21-Mar-1995  cgd convert to new RCS id conventions.
 1.5 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.9.2.1 08-May-1998  mycroft Pull up 1.10, per request of fair.
 1.16.8.1 24-Mar-2008  keiichi sync with head.
 1.16.4.1 23-Mar-2008  matt sync with HEAD
 1.18.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.2.1 10-Nov-2011  yamt sync with head
 1.19.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.8.1 25-Apr-2020  martin Pull up following revision(s) (requested by simonb in ticket #853):

bin/csh/time.c: revision 1.22
usr.bin/time/time.c: revision 1.24
bin/csh/extern.h: revision 1.32
usr.bin/time/time.1: revision 1.29
usr.bin/time/ext.h: revision 1.4

Add '-t' option for tcsh-style time output.
 1.21.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.21.6.1 21-Apr-2020  martin Sync with HEAD
 1.21.2.2 15-Jul-2017  christos 1624
 1.21.2.1 15-Jul-2017  christos file time.c was added on branch perseant-stdc-iso10646 on 2017-07-15 14:35:56 +0000
 1.23.8.1 02-Aug-2025  perseant Sync with HEAD
 1.9 05-Jul-2014  dholland branches: 1.9.24;
Reorg docs, part 1:
Move all the reference manuals to subdirs of /usr/share/doc/reference.
We have subdirs ref1-ref9, corresponding to man page sections 1-9.

Everything that's the reference manual for a program (sections 1, 6,
8), C interface (sections 2, 3), driver or file system (section 4),
format or configuration (section 5), or kernel internal interface
(section 9) belongs in here.

Section 7 is a little less clear: some things that might go in section
7 if they were a man page aren't really reference manuals. So I'm only
putting things in reference section 7 that are (to me) clearly
reference material, rather than e.g. tutorials, guides, FAQs, etc.
This obviously leaves some room for debate, especially without first
editing the docs with this distinction in mind, but if people hate
what I've done things can always be moved again.

Note also that while roff macro man pages traditionally go in section
7, I have put all the roff documentation (macros, tools, etc.) in one
place in reference/ref1/roff. This will make it easier to find and
also easier to edit it into some kind of coherent form.
 1.8 05-Jul-2014  dholland Rework /usr/share/doc.

Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
- explicit use of soelim
- refer
- tbl
- pic
- eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.
 1.7 18-Oct-2007  tls branches: 1.7.34; 1.7.48;
Rename "csh.a" (the appendix of the document) to csh.ap: the .a suffix
is a bit of a nuisance when using cvs import and export and, of course,
clashes with .a for library archive as well.
 1.6 10-Jul-2003  lukem branches: 1.6.22;
Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO". The new variables are:
TOOL_ASN1_COMPILE TOOL_CAP_MKDB TOOL_CAT TOOL_CKSUM TOOL_COMPILE_ET
TOOL_CONFIG TOOL_CRUNCHGEN TOOL_CTAGS TOOL_DB TOOL_EQN TOOL_FGEN
TOOL_GENCAT TOOL_GROFF TOOL_HEXDUMP TOOL_INDXBIB TOOL_INSTALLBOOT
TOOL_INSTALL_INFO TOOL_M4 TOOL_MAKEFS TOOL_MAKEINFO TOOL_MAKEWHATIS
TOOL_MDSETIMAGE TOOL_MENUC TOOL_MKCSMAPPER TOOL_MKESDB
TOOL_MKLOCALE TOOL_MKMAGIC TOOL_MKTEMP TOOL_MSGC TOOL_MTREE
TOOL_PAX TOOL_PIC TOOL_PREPMKBOOTIMAGE TOOL_PWD_MKDB TOOL_REFER
TOOL_ROFF_ASCII TOOL_ROFF_DVI TOOL_ROFF_HTML TOOL_ROFF_PS
TOOL_ROFF_RAW TOOL_RPCGEN TOOL_SOELIM TOOL_SUNLABEL TOOL_TBL
TOOL_UUDECODE TOOL_VGRIND TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
TOOL_FOO?= foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
TOOL_FOO= ${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
 1.5 05-Jan-2003  pooka Add ${MACROS} to ${ROFF} usage to make output readable

from jbernard@mines.edu in misc/19685
 1.4 21-Dec-1997  christos use obj dirs.
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.6.22.1 06-Nov-2007  matt sync with HEAD
 1.7.48.1 10-Aug-2014  tls Rebase.
 1.7.34.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.24.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.24.1 21-Apr-2020  martin Sync with HEAD
 1.5 07-Aug-2003  agc branches: 1.5.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.4 20-Dec-2001  wiz Whitespace nits.
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.5.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.98.1 21-Apr-2020  martin Sync with HEAD
 1.8 19-Dec-2021  andvar s/backgound/background/
 1.7 07-Aug-2003  agc branches: 1.7.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.6 20-Dec-2001  wiz Whitespace nits.
 1.5 09-Jul-1997  jtc /var/spool/mail -> /var/mail
 1.4 09-Jul-1997  jtc /usr/spool/mail -> /var/spool/mail
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.7.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.98.1 21-Apr-2020  martin Sync with HEAD
 1.5 07-Aug-2003  agc branches: 1.5.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.4 20-Dec-2001  wiz Whitespace nits.
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.5.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.98.1 21-Apr-2020  martin Sync with HEAD
 1.4 07-Aug-2003  agc branches: 1.4.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.4.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.4.98.1 21-Apr-2020  martin Sync with HEAD
 1.6 18-Oct-2007  tls Rename "csh.a" (the appendix of the document) to csh.ap: the .a suffix
is a bit of a nuisance when using cvs import and export and, of course,
clashes with .a for library archive as well.
 1.5 07-Aug-2003  agc branches: 1.5.22;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.4 27-Apr-1998  fair fix nroff error per PR#5347
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.5.22.1 06-Nov-2007  matt sync with HEAD
 1.1 18-Oct-2007  tls branches: 1.1.2; 1.1.74;
Rename "csh.a" (the appendix of the document) to csh.ap: the .a suffix
is a bit of a nuisance when using cvs import and export and, of course,
clashes with .a for library archive as well.
 1.1.74.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.1.74.1 21-Apr-2020  martin Sync with HEAD
 1.1.2.2 06-Nov-2007  matt sync with HEAD
 1.1.2.1 18-Oct-2007  matt file csh.ap was added on branch matt-armv6 on 2007-11-06 23:07:16 +0000
 1.8 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.7 02-Jun-2024  andvar branches: 1.7.2;
Fix various typos, mainly triple letters.
 1.6 05-Dec-2021  msaitoh s/commmand/command/ in comment.
 1.5 07-Aug-2003  agc branches: 1.5.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.4 05-Feb-2003  perry "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.5.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.98.1 21-Apr-2020  martin Sync with HEAD
 1.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 07-Aug-2003  agc branches: 1.4.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.3 21-Mar-1995  cgd convert to new RCS id conventions.
 1.2 21-Sep-1994  mycroft Merge 4.4-Lite version.
 1.1 20-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 20-Sep-1994  mycroft Import original 4.4-Lite version.
 1.4.98.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.4.98.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed