Commit Graph

38 Commits

Author SHA1 Message Date
plunky
9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
mrg
fcc023545e - 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 :-)
2009-03-29 01:02:48 +00:00
ragge
8b19d01fcd Needs errno.h if !gcc. 2007-09-15 14:33:05 +00:00
christos
b79c2ef26a no need to have cshbool; just make them int 2007-07-16 18:26:09 +00:00
christos
ec01a4a425 PR/36650: Michael van Elst: Get rid of bool, because csh uses bool as a small
int.
2007-07-16 14:07:00 +00:00
dogcow
593a9183f0 Rename bool -> cshbool; despite the name, bool actually holds values other
than 0 or 1. Fixes PR/36650.
2007-07-16 02:26:50 +00:00
msaitoh
8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
christos
4d7c6251da Coverity CID 1228: protect against calling close with negative value. 2006-03-18 06:29:21 +00:00
christos
6310b59691 sprinkle a little const, and now everything compiles with WARNS=3 2005-06-26 19:10:48 +00:00
christos
626d1a4171 Keep track of the while level, when popping loops because of a breaksw.
This is nasty...
2004-05-13 15:25:58 +00:00
christos
6acf809e53 understand rlimit sbsize 2004-04-17 15:40:12 +00:00
christos
9a77f16705 Handle breaksw inside while loop (from tcsh)
Really: test commits on new cvs binary.
2003-12-17 17:32:16 +00:00
agc
b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
kleink
b3df6303a9 Rename `sigset' locals to avoid symbol shadowing warning. 2003-01-16 09:38:37 +00:00
wiz
1da7ff99f7 Since we have rlim_t, use it.
Approved by kleink.
2002-05-28 22:12:25 +00:00
wiz
1815854042 __STDC__ is always defined on NetBSD. 2002-05-25 23:29:16 +00:00
christos
8c43d5ed6d make sure that rlim_cur >= rlim_max in all the setrlimit(2) cases. 2001-12-17 16:38:12 +00:00
wiz
b771e65ba1 ANSIfication and KNF improvements by Petri Koistinen in bin/13689,
with some fixes by me.
2001-09-14 14:03:59 +00:00
christos
5aaa548267 echo;echo;echo; should echo 2001-03-14 18:01:22 +00:00
christos
51b56986d6 eliminate nested extern decls. 2001-01-06 23:56:26 +00:00
christos
0bf6fd0c59 decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K 2000-05-31 22:48:44 +00:00
thorpej
341bd18b4a Add some braces to make egcs happy. 1998-08-19 01:31:46 +00:00
mycroft
ee9e50eacb Be more retentive about use of NOTREACHED and noreturn. 1998-07-28 11:41:40 +00:00
mycroft
5924694d3a Delint (partially). 1998-07-28 02:47:19 +00:00
mycroft
cdbd74da57 Delint (partially). 1998-07-28 02:23:37 +00:00
christos
8ea378c6ac Rename err.h to errnum.h to avoid collision with err.h
Fix compiler warnings.
1997-07-04 21:23:50 +00:00
tls
76adbe2bd3 kill register 1997-01-13 17:53:15 +00:00
christos
a8a54fa636 fix bug where
child% suspend
parent% bg
parent% fg
Fg would not work anymore, it would say Suspended (tty input).
1996-02-09 02:28:29 +00:00
mycroft
7b38403c89 Use POSIX signals. 1995-03-21 18:35:32 +00:00
cgd
49f0ad8601 convert to new RCS id conventions. 1995-03-21 09:01:59 +00:00
cgd
5dad143982 from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.
1994-12-04 07:11:37 +00:00
mycroft
cee2bad89f Merge 4.4-Lite version. 1994-09-21 00:10:23 +00:00
cgd
fc50bbda51 rlimit foo 1994-05-05 03:00:45 +00:00
mycroft
742dcd5655 RLIMIT_OFILE --> RLIMIT_NOFILE 1993-08-23 16:01:56 +00:00
mycroft
a579b792ce Add RCS identifiers. 1993-08-01 18:59:54 +00:00
cgd
06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd
346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00