History log of /netbsd-current/bin/csh/func.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.45 24-Apr-2024 nia

csh: replace malloc(x * y) and realloc(x * y) with reallocarray


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.44 09-Aug-2020 dholland

Don't cast the value returned from *malloc. No change to compiler output.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127 pgoyette-compat-20190118
# 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


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base tls-maxphys-base
# 1.40 16-Jul-2013 christos

branches: 1.40.26; 1.40.28;
WARNS=6 [-Wconversion]


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.39 09-Jun-2012 christos

branches: 1.39.2;
support RLIMIT_NTHR


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2;
NULL does not need a cast


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 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 :-)


Revision tags: netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.36 15-Sep-2007 ragge

branches: 1.36.12; 1.36.14;
Needs errno.h if !gcc.


Revision tags: matt-mips64-base
# 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


Revision tags: netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 abandoned-netbsd-4-base netbsd-4-base
# 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


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 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


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 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.


Revision tags: fvdl_fs64_base
# 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.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 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.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.18 31-May-2000 christos

decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K


Revision tags: netbsd-1-4-PATCH003 minoura-xpg4dl-base netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 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).


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 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


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 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).


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 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.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 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.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base netbsd-0-8 netbsd-alpha-1
# 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.44 09-Aug-2020 dholland

Don't cast the value returned from *malloc. No change to compiler output.


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127 pgoyette-compat-20190118
# 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


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base tls-maxphys-base
# 1.40 16-Jul-2013 christos

branches: 1.40.26; 1.40.28;
WARNS=6 [-Wconversion]


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.39 09-Jun-2012 christos

branches: 1.39.2;
support RLIMIT_NTHR


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2;
NULL does not need a cast


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 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 :-)


Revision tags: netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.36 15-Sep-2007 ragge

branches: 1.36.12; 1.36.14;
Needs errno.h if !gcc.


Revision tags: matt-mips64-base
# 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


Revision tags: netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 abandoned-netbsd-4-base netbsd-4-base
# 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


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 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


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 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.


Revision tags: fvdl_fs64_base
# 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.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 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.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.18 31-May-2000 christos

decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K


Revision tags: netbsd-1-4-PATCH003 minoura-xpg4dl-base netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 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).


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 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


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 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).


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 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.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 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.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base netbsd-0-8 netbsd-alpha-1
# 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


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 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


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base tls-maxphys-base
# 1.40 16-Jul-2013 christos

branches: 1.40.26;
WARNS=6 [-Wconversion]


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.39 09-Jun-2012 christos

branches: 1.39.2;
support RLIMIT_NTHR


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2;
NULL does not need a cast


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 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 :-)


Revision tags: netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.36 15-Sep-2007 ragge

branches: 1.36.12; 1.36.14;
Needs errno.h if !gcc.


Revision tags: matt-mips64-base
# 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


Revision tags: netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 abandoned-netbsd-4-base netbsd-4-base
# 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


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 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


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 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.


Revision tags: fvdl_fs64_base
# 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.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 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.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.18 31-May-2000 christos

decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K


Revision tags: netbsd-1-4-PATCH003 minoura-xpg4dl-base netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 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).


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 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


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 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).


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 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.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 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.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base netbsd-0-8 netbsd-alpha-1
# 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.40 16-Jul-2013 christos

WARNS=6 [-Wconversion]


# 1.39 08-Jun-2012 christos

branches: 1.39.2;
support RLIMIT_NTHR


# 1.38 30-Aug-2011 plunky

branches: 1.38.2;
NULL does not need a cast


# 1.37 28-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 15-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 17-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 16-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 18-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 27-Jul-1998 mycroft

Delint (partially).


# 1.14 27-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 12-Jan-1997 tls

kill register


# 1.11 08-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 20-Sep-1994 mycroft

Merge 4.4-Lite version.


# 1.6 04-May-1994 cgd

rlimit foo


# 1.5 22-Aug-1993 mycroft

RLIMIT_OFILE --> RLIMIT_NOFILE


# 1.4 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.3 22-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 19-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 05-Jan-2008 wrstuden

Catch up to netbsd-4.0 release.


# 1.31.4.2 12-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 31-Mar-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.