Skip to contentSkip to conversation

man: Document ulimit -v

PATCH In review Gioele Barabucci 3 participants 5 messages Jan 11, 2016 – Jun 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 man: Document ulimit -v

Document that ulimit can set the RLIMIT_AS limit (virtual memory) with the -v flag.

---
 src/dash.1 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/dash.1 +4 -1
index 832eae7..8b8026d 100644
@@ -2114,7 +2114,7 @@ printed; for commands and tracked aliases the complete pathname of the
 command is printed.
 .It ulimit Xo
 .Op Fl H \*(Ba Fl S
-.Op Fl a \*(Ba Fl tfdscmlpn Op Ar value
+.Op Fl a \*(Ba Fl tfdscmlpnv Op Ar value
 .Xc
 Inquire about or set the hard or soft limits on processes or set new
 limits.
@@ -2164,6 +2164,9 @@ show or set the limit on the number of processes this user can
 have at one time
 .It Fl n
 show or set the limit on the number files a process can have open at once
+.It Fl v
+show or set the limit on the total virtual memory that can be
+in use by a process (in kilobytes)
 .It Fl r
 show or set the limit on the real-time scheduling priority of a process
 .El
Signature · 1 line
2.6.4
#1 lore raw
Quoted 2 lines · Gioele Barabucci

Document that ulimit can set the RLIMIT_AS limit (virtual memory) with the -v flag.

I don't know much about RLIMIT_AS, but I know that it isn't supported on all systems where dash runs, eg OpenBSD. Maybe is it Linux-specific?

Anyway, it would be better if the manpage said that the -v flag may not be implemented on all platforms.

The same could be said about ulimit -w. (I did not check the other flags).

Quoted 30 lines
---
 src/dash.1 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/dash.1 +4 -1
index 832eae7..8b8026d 100644
@@ -2114,7 +2114,7 @@ printed; for commands and tracked aliases the complete pathname of the
 command is printed.
 .It ulimit Xo
 .Op Fl H \*(Ba Fl S
-.Op Fl a \*(Ba Fl tfdscmlpn Op Ar value
+.Op Fl a \*(Ba Fl tfdscmlpnv Op Ar value
 .Xc
 Inquire about or set the hard or soft limits on processes or set new
 limits.
@@ -2164,6 +2164,9 @@ show or set the limit on the number of processes this user can
 have at one time
 .It Fl n
 show or set the limit on the number files a process can have open at once
+.It Fl v
+show or set the limit on the total virtual memory that can be
+in use by a process (in kilobytes)
 .It Fl r
 show or set the limit on the real-time scheduling priority of a process
 .El
Signature · 1 line
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
#2 lore raw
Quoted 5 lines · Jérémie Courrèges-Anglas
Quoted 2 lines · Gioele Barabucci

Document that ulimit can set the RLIMIT_AS limit (virtual memory) with the -v flag.

Quoted 7 lines

I don't know much about RLIMIT_AS, but I know that it isn't supported on all systems where dash runs, eg OpenBSD. Maybe is it Linux-specific?

Anyway, it would be better if the manpage said that the -v flag may not be implemented on all platforms.

The same could be said about ulimit -w. (I did not check the other flags).

Rather than doing that we could just pass the manpage through cpp or some similar mechanism so that this becomes conditional.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#3 lore raw
Quoted 9 lines · Herbert Xu
Quoted 8 lines · Jérémie Courrèges-Anglas
Quoted 2 lines · Gioele Barabucci

Document that ulimit can set the RLIMIT_AS limit (virtual memory) with the -v flag.

I don't know much about RLIMIT_AS, but I know that it isn't supported on all systems where dash runs, eg OpenBSD. Maybe is it Linux-specific?

Quoted 7 lines
Quoted 4 lines

Anyway, it would be better if the manpage said that the -v flag may not be implemented on all platforms.

The same could be said about ulimit -w. (I did not check the other flags).

Rather than doing that we could just pass the manpage through cpp or some similar mechanism so that this becomes conditional.

I wonder how much it is worth the effort in this case.

RLIMIT_AS is defined by POSIX [1] since 1997 [2], so one can suppose that it is available anywhere (indeed the man page of OpenBSD refers to the missing RLIMIT_AS as a bug). If it is not available, an invocation of ulimit -v will complain about the unknown option. We could just add to the description "(not available on systems that lack support for RLIMIT_AS, e.g. OpenBSD)".

Other cases like -w can be ignored: they manipulate non-standard RLIMIT extensions that are no-ops on Linux since long ago (and I suppose also in other systems).

Regards,

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/setrlimit.html
[2] http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysresource.h.html

--
Gioele Barabucci <[email protected]>

#4 lore raw
In reply to Gioele Barabucci
Quoted 6 lines · Gioele Barabucci

Document that ulimit can set the RLIMIT_AS limit (virtual memory) with the -v flag.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt