diff options
| author | christos <christos@NetBSD.org> | 2004-04-17 15:40:12 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2004-04-17 15:40:12 +0000 |
| commit | 6acf809e533f2e8897a865aed89572d255cd3a06 (patch) | |
| tree | 7dc8a9bf0bd5b2f19b576fcee0f07297e21af4ef /bin | |
| parent | 9a3ad9349279a9bbc117f78b2cf9ffb19df2326e (diff) | |
understand rlimit sbsize
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/csh/func.c | 7 | ||||
| -rw-r--r-- | bin/ksh/c_ulimit.c | 9 | ||||
| -rw-r--r-- | bin/ksh/ksh.Man | 8 | ||||
| -rw-r--r-- | bin/sh/miscbltin.c | 9 | ||||
| -rw-r--r-- | bin/sh/sh.1 | 4 |
5 files changed, 24 insertions, 13 deletions
diff --git a/bin/csh/func.c b/bin/csh/func.c index 9f5e764f73f..8c4f4382dd6 100644 --- a/bin/csh/func.c +++ b/bin/csh/func.c @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.27 2003/12/17 17:32:16 christos Exp $ */ +/* $NetBSD: func.c,v 1.28 2004/04/17 15:40:52 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: func.c,v 1.27 2003/12/17 17:32:16 christos Exp $"); +__RCSID("$NetBSD: func.c,v 1.28 2004/04/17 15:40:52 christos Exp $"); #endif #endif /* not lint */ @@ -1099,6 +1099,7 @@ static const struct limits { { RLIMIT_MEMLOCK, "memorylocked", 1024, "kbytes" }, { RLIMIT_NPROC, "maxproc", 1, "" }, { RLIMIT_NOFILE, "openfiles", 1, "" }, + { RLIMIT_SBSIZE, "sbsize", 1, "bytes" }, { -1, NULL, 0, NULL } }; @@ -1242,7 +1243,7 @@ plim(const struct limits *lp, Char hard) struct rlimit rlim; RLIM_TYPE limit; - (void)fprintf(cshout, "%s \t", lp->limname); + (void)fprintf(cshout, "%-13.13s", lp->limname); (void)getrlimit(lp->limconst, &rlim); limit = hard ? rlim.rlim_max : rlim.rlim_cur; diff --git a/bin/ksh/c_ulimit.c b/bin/ksh/c_ulimit.c index 0e0b09de856..7305a2e1c82 100644 --- a/bin/ksh/c_ulimit.c +++ b/bin/ksh/c_ulimit.c @@ -1,4 +1,4 @@ -/* $NetBSD: c_ulimit.c,v 1.5 2003/06/23 11:38:54 agc Exp $ */ +/* $NetBSD: c_ulimit.c,v 1.6 2004/04/17 15:40:12 christos Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -20,7 +20,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: c_ulimit.c,v 1.5 2003/06/23 11:38:54 agc Exp $"); +__RCSID("$NetBSD: c_ulimit.c,v 1.6 2004/04/17 15:40:12 christos Exp $"); #endif @@ -117,7 +117,10 @@ c_ulimit(wp) # endif /* UL_GMEMLIM */ #endif /* RLIMIT_VMEM */ #ifdef RLIMIT_SWAP - { "swap(kbytes)", RLIMIT_SWAP, RLIMIT_SWAP, 1024, 'w' }, + { "swap(kbytes)", RLIMIT, RLIMIT_SWAP, RLIMIT_SWAP, 1024, 'w' }, +#endif +#ifdef RLIMIT_SBSIZE + { "sbsize(bytes)", RLIMIT, RLIMIT_SBSIZE, RLIMIT_SBSIZE, 1, 'b' }, #endif { (char *) 0 } }; diff --git a/bin/ksh/ksh.Man b/bin/ksh/ksh.Man index 99d61fdb436..9632f23a376 100644 --- a/bin/ksh/ksh.Man +++ b/bin/ksh/ksh.Man @@ -1,5 +1,5 @@ '\" t -.\" $NetBSD: ksh.Man,v 1.16 2004/02/13 11:36:08 wiz Exp $ +.\" $NetBSD: ksh.Man,v 1.17 2004/04/17 15:40:12 christos Exp $ .\"{{{}}} .\"{{{ Notes about man page .\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific @@ -2591,8 +2591,8 @@ Exported functions are not implemented yet. T} .TE .\"}}} -.\"{{{ ulimit [-acdfHlmnpsStvw] [value] -.IP "\fBulimit\fP [\fB\-acdfHlmnpsStvw\fP] [\fIvalue\fP]" +.\"{{{ ulimit [-abcdfHlmnpsStvw] [value] +.IP "\fBulimit\fP [\fB\-abcdfHlmnpsStvw\fP] [\fIvalue\fP]" Display or set process limits. If no options are used, the file size limit (\fB\-f\fP) is assumed. \fBvalue\fP, if specified, may be either be an arithmetic expression or the @@ -2610,6 +2610,8 @@ Displays all limits; unless \fB\-H\fP is used, soft limits are displayed. Set the hard limit only (default is to set both hard and soft limits). .IP \fB\-S\fP Set the soft limit only (default is to set both hard and soft limits). +.IP \fB\-b\fP +Impose a size limit of \fIn\fP bytes on the size of socket buffers. .IP \fB\-c\fP Impose a size limit of \fIn\fP blocks on the size of core dumps. .IP \fB\-d\fP diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 22a1525f4df..999c957a755 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -1,4 +1,4 @@ -/* $NetBSD: miscbltin.c,v 1.32 2003/08/07 09:05:35 agc Exp $ */ +/* $NetBSD: miscbltin.c,v 1.33 2004/04/17 15:41:29 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: miscbltin.c,v 1.32 2003/08/07 09:05:35 agc Exp $"); +__RCSID("$NetBSD: miscbltin.c,v 1.33 2004/04/17 15:41:29 christos Exp $"); #endif #endif /* not lint */ @@ -290,6 +290,9 @@ static const struct limits limits[] = { #ifdef RLIMIT_SWAP { "swap(kbytes)", RLIMIT_SWAP, 1024, 'w' }, #endif +#ifdef RLIMIT_SBSIZE + { "sbsize(kbytes)", RLIMIT_SBSIZE, 1, 'b' }, +#endif { (char *) 0, 0, 0, '\0' } }; @@ -306,7 +309,7 @@ ulimitcmd(int argc, char **argv) struct rlimit limit; what = 'f'; - while ((optc = nextopt("HSatfdsmcnpl")) != '\0') + while ((optc = nextopt("HSabtfdsmcnpl")) != '\0') switch (optc) { case 'H': how = HARD; diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index f4151d75cbd..98f7c71c5f3 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: sh.1,v 1.74 2003/12/21 11:16:23 wiz Exp $ +.\" $NetBSD: sh.1,v 1.75 2004/04/17 15:41:29 christos Exp $ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -1711,6 +1711,8 @@ The limit to be interrogated or set, then, is chosen by specifying any one of these flags: .It Fl a show all the current limits +.It Fl b +show or set the limit on the socket buffer size of a process (in bytes) .It Fl t show or set the limit on CPU time (in seconds) .It Fl f |
