Commit Graph

38 Commits

Author SHA1 Message Date
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
christos 3957d0cafc rlim_t will be unsigned as TOG mandates. 2008-12-28 19:53:37 +00:00
christos c05266af8a fix setmode error handling. 2005-10-01 20:23:54 +00:00
dsl 4803d37f2b Fix the way the 'read' builtin processes IFS. In particular:
- IFS whitespace is now processes correctly,
- Trailing non-whitespace IFS characters are added to the last variable
  iff a subsequent variable would have been assigned a non-null string.
Now passes the 'read' tests in http://www.research.att.com/~gsf/public/ifs.sh
2005-03-19 14:22:50 +00:00
lukem 778dabc229 Correct the description of sbsize; it is parsed in bytes not kbytes. 2004-04-19 01:36:32 +00:00
christos 6acf809e53 understand rlimit sbsize 2004-04-17 15:40:12 +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
christos c02b3bbdf4 Fixes from David Laight:
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
  (so I could unset -e PS1 before running the test shell...)
2002-11-24 22:35:38 +00:00
christos 3380980447 remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
lukem f819878ce7 use more standard %ll_ in favour of %q_ 2001-01-04 15:39:50 +00:00
christos 1d9dab3e95 error message cleanup:
- don't print the builtin name twice
    - explain why things fail
    - no extra newline
2000-11-22 19:20:31 +00:00
christos 26e51b35ac include <stdlib.h> to get the prototype for free() 1998-09-26 19:28:12 +00:00
itohy cc484b787f The return value of setmode(3) is a pointer to malloc()'ed area
and must be freed to avoid memory leaks if called repeatedly.
The leaks occured on symbolic umask command, such as "umask go-w",
which is undocumented.
1998-09-24 17:49:48 +00:00
christos f792cdd756 Cast is*() args to unsigned chars in case the ctype macros are implemented
using arrays.
1998-05-20 00:32:05 +00:00
thorpej a40a144d00 Fix printf formats so they work on the Alpha. 1998-02-04 20:10:16 +00:00
christos e3f5fb922f BSD4_4 is a standard symbol in <sys/param.h>; make sure that files
that need this defined, include <sys/param.h> and don't define it in
the Makefile. Add a comment to that effect.
1998-01-21 10:47:37 +00:00
christos 38c84eeda3 test for the boundary condition in the previous trailing blank fix 1998-01-16 16:26:22 +00:00
christos 2708e4180f PR/4805: Ty Sarna: read builtin does not remove trailing blanks. 1998-01-15 19:39:11 +00:00
kleink 3780e6aa5d Per 1003.2, the (builtin) read utility shall treat the backslash as an
escape character (including line continuation), unless the `-r' option
is specified:
* adopt to this behaviour, add the `-r' option to disable it;
* remove the `-e' option, which was previously necessary to get this behaviour.
1997-11-05 14:05:28 +00:00
christos cd799663e4 Fix compiler warnings. 1997-07-04 21:01:48 +00:00
christos 360e930d42 Make this work on systems that don't have quads 1997-04-11 23:08:15 +00:00
tls 48250187e6 kill 'register' 1997-01-11 02:04:27 +00:00
christos bc73cf950a PR/2808: Remove trailing whitespace (from FreeBSD) 1996-10-16 15:45:03 +00:00
jtc 88fc62fe16 Changed type of rlimit values from quad_t to rlim_t. Cast rlim_t's to
quad_t's and use "%qd" in printf.
Eliminated unneccessary conditional.
1995-06-12 19:44:16 +00:00
christos 07bae7eddd Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0
bug.
1995-05-11 21:28:33 +00:00
cgd 49f0ad8601 convert to new RCS id conventions. 1995-03-21 09:01:59 +00:00
cgd 4ce0d34a31 clean up further. more patches from Jim Jegers 1994-12-05 19:07:32 +00:00
mycroft cafd1f7e9f Add RCS ids. 1994-06-11 16:11:35 +00:00
jtc 98d2c75927 use prototypes provided by header files instead of our own 1994-05-12 17:08:55 +00:00
jtc a81e412494 Include appropriate header files to bring function prototypes into scope. 1994-05-12 17:03:32 +00:00
jtc 759eadefd8 integrate NetBSD's POSIX.2 compliant umask builtin 1994-05-11 17:53:54 +00:00
jtc 37ed7877b2 sync with 4.4lite 1994-05-11 17:09:42 +00:00
cgd 66f99eaedd do right right thing if 'read' given no args. ptd out by Geoff Rehmet 1994-04-06 19:08:14 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
jtc b8be8f1e63 Make umask builtin of shell POSIX 1003.2 compliant:
Print out a symbolic mask with the -S option; and accept symbolic mask
specifications.
1993-07-21 00:02:33 +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