DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ulimit(1)


ulimit -- set or display a resource limit

Synopsis

/u95/u95/bin/ulimit -HSacdfmnstv [limit]

Description

This shell script executes the builtin command of the same name as implemented by the /u95/bin/sh shell. See ksh(1) for more information on this shell. Use ulimit to set or display a resource limit. The available resource limits are listed below.

The limit for a specified resource is set when limit is specified. The value of limit can be a number in the unit specified below with each resource, or the value unlimited.

The -H and -S options specify whether the hard limit or the soft limit, respectively, for the given resource is set. A hard limit cannot be increased once it is set. A soft limit can be increased up to the value of the hard limit. If neither the -H nor -S options is specified, the limit applies to both. Only a process with SYSOPS privilege can increase a hard resource limit.

If limit is omitted, the current soft resource limit is displayed, unless -H is specified to print the hard limit.

When more than one resource is specified, then the limit name and unit is printed before the value.

Command options


-a
Lists all of the current resource limits.

-c
The number of 512-byte blocks on the size of core dumps.

-d
The number of K-bytes on the size of the data area.

-f
The number of 512-byte blocks on files that can be written by the current process and its child processes (files of any size may be read). On file systems (such as vxfs file systems) that support large files, setting this limit to unlimited represents the largest file size supported on the file system. See ``Notices'', below.

-m
The number of K-bytes on the size of physical memory.

-n
The number of file descriptors plus 1.

-s
The number of K-bytes on the size of the stack area.

-t
The number of CPU seconds to be used by each process.

-v
The number of K-bytes for virtual memory.

If no option is given, -f is assumed; that is, you can specify a limit with or without the preceding -f option, and both cases are interpreted as an attempt to raise the file size limit.

Operands


limit
Gives the resource-specific limit to use as the new resource limit.

unlimited
Sets the largest allowable resource limit. It is necessary to set limit to the value unlimited for access to large files (greater than 2GB in size). See ``Changing the maximum allowed file size (ulimit)'' in the UnixWare 7 System Handbook for more information.

Environment variables

The following environment variables affect the execution of ulimit:

LANG
Provide a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).

LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

Output

The standard output is used when no limit operand is present. If the current number of blocks is limited, the number of blocks in the current limit is written to standard output.

Exit codes

An exit code of ``0''indicates successful completion; an exit code greater than ``0'' indicates that a request for a higher limit was rejected or an error occurred.

Usage

Since ulimit affects the current shell execution environment, if it is called in a separate utility execution environment, such as one of the following:
   nohup ulimit -f 10000
   env ulimit 10000
it will not affect the file size limit of the caller's environment.

Once a limit has been decreased by a process, it cannot be increased (unless a process has SYSOPS privilege), even back to the original system limit.

Examples

Set the file size limit to 51,200 bytes:
   ulimit -f 100

Standards Conformance

X/Open Portability Guide, Version 4.

References

intro(1), intro(2), ksh(1), privilege(5), ulimit(2), ``Large File Support''.

Notices

Considerations for large file support

Large files (larger than 2GB) are supported in this release. However, file size limits are only discretely settable up to 2GB (more precisely, 2GB -1 byte). Setting a file size limit greater than or equal to 2GB -1 has the equivalent effect to setting the file size limit to unlimited. unlimited is currently defined as RLIM_INFINITY (see resource.h).
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005