Subject: bin/3658: ulimit needs a manpage.
To: None <gnats-bugs@gnats.netbsd.org>
From: Eric Fischer <eric@fudge.uchicago.edu>
List: netbsd-bugs
Date: 05/21/1997 16:20:08
>Number:         3658
>Category:       bin
>Synopsis:       ulimit needs a manpage
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 21 14:35:01 1997
>Last-Modified:
>Originator:     Eric Fischer
>Organization:
The University of Chicago
>Release:        1.2
>Environment:
	
System: NetBSD fudge 1.2 NetBSD 1.2 (FUDGE) #7: Sun Jan 19 16:26:56 CST 1997 eric@fudge:/usr/people/eric/usrsrc/sys/arch/sparc/compile/FUDGE sparc


>Description:

The ulimit shell builtin is not documented except in the sh source code,
and ought to get a mention someplace more accessible.

>How-To-Repeat:

man ulimit, and notice that it doesn't work.  Try to figure
out how it works without documentation.

>Fix:

Include a manpage for ulimit.  Here is one (yes, written with the oldfangled
man macros), based on observation of what the code seems to do:

.TH ULIMIT 1 "May 21, 1997"
.SH NAME
ulimit \- set or inquire about resource limits
.SH SYNOPSIS
.B ulimit
[
.B \-H
\(bv
.B \-S
]
[
.B \-a
\(bv
.B \-tfdscmlpnvw
[
.I value
] ]
.SH DESCRIPTION
.B ulimit
inquires about the hard or soft resource limits on processes
or sets new limits.
The choice between hard limit (which no process is allowed to
violate, and which may not be raised once it has been lowered)
and soft limit (which causes processes to be signalled but not
necessarily killed, and which may be raised) is made with these flags:
.TP
.B \-H
set or inquire about hard limits
.TP
.B \-S
set or inquire about soft limits
.LP
If neither
.B \-H
nor
.B \-S
is specified, the soft limit is displayed or both limits are set.
If both are specified, the last one wins.
.LP
The limit to be interrogated or set, then, is chosen by specifying
any one of these flags:
.TP
.B \-a
show all the current limits
.TP
.B \-t
show or set the limit on
.SM CPU
time (in seconds)
.TP
.B \-f
show or set the limit on the largest file that can be created
(in 512-byte blocks)
.TP
.B \-d
show or set the limit on the data segment size of a process (in kilobytes)
.TP
.B \-s
show or set the limit on the stack size of a process (in kilobytes)
.TP
.B \-c
show or set the limit on the largest core dump size that can be produced 
(in 512-byte blocks)
.TP
.B \-m
show or set the limit on the total physical memory that can be
in use by a process (in kilobytes)
.TP
.B \-l
show or set the limit on how much memory a process can lock with
.BR mlock (2)
(in kilobytes)
.TP
.B \-p
show or set the limit on the number of processes this user can
have at one time
.TP
.B \-n
show or set the limit on the number files a process can have open at once
.LP
If none of these is specified, it is the limit on file size
that is shown or set.
If
.I value
is specified, the limit is set to that number;
otherwise the current limit is displayed.
.LP
The
.B ulimit
command is built into the shell.
.SH SEE ALSO
.BR setrlimit (2),
.BR getrlimit (2),
.BR sh (1).
.SH BUGS
Setting both the hard and soft limits by default makes it far too
easy to set limits to unusable levels and then have no way to return
them to something sane.
>Audit-Trail:
>Unformatted: