Unix and Linux Discussions Tagged with hard |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
11 |
20,988 |
AIX |
|
|
|
2 |
1,750 |
Shell Programming and Scripting |
|
|
|
1 |
5,086 |
Hardware |
|
|
|
1 |
6,646 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
1,900 |
IT Security RSS |
|
|
|
0 |
2,096 |
Cartoons for Geeks |
|
|
|
0 |
2,009 |
Solaris BigAdmin RSS |
|
|
|
0 |
2,584 |
Cartoons for Geeks |
|
|
|
10 |
6,926 |
Programming |
|
|
|
2 |
2,332 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
7,450 |
Linux |
|
|
|
0 |
1,892 |
UNIX and Linux RSS News |
|
|
|
0 |
1,313 |
UNIX and Linux RSS News |
|
|
|
0 |
1,247 |
UNIX and Linux RSS News |
|
|
|
3 |
6,053 |
Red Hat |
|
|
|
1 |
4,398 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
2,292 |
Shell Programming and Scripting |
|
|
|
4 |
2,603 |
HP-UX |
|
|
|
6 |
4,314 |
Shell Programming and Scripting |
|
|
|
3 |
19,413 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,701 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
10,787 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
6,258 |
Filesystems, Disks and Memory |
|
|
|
5 |
5,048 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
9,455 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
4,609 |
Filesystems, Disks and Memory |
|
|
|
1 |
2,714 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
4,275 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,135 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,334 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
8,259 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
2,718 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,140 |
IP Networking |
|
|
|
2 |
2,192 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
40,113 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,873 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,657 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
7,522 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,233 |
Programming |
|
|
|
4 |
5,127 |
UNIX for Advanced & Expert Users |
POSIX_GETRLIMIT(3) 1 POSIX_GETRLIMIT(3)
posix_getrlimit - Return info about system resource limits
SYNOPSIS
array posix_getrlimit (void )
DESCRIPTION
posix_getrlimit(3) returns an array of information about the current resource's soft and hard limits.
Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource.
The hard limit acts as a ceiling for the soft limit. An unprivileged process may only set its soft limit to a value from 0 to the hard
limit, and irreversibly lower its hard limit.
RETURN VALUES
Returns an associative array of elements for each limit that is defined. Each limit has a soft and a hard limit.
List of possible limits returned
+-----------+---------------------------------------------------+
|Limit name | |
| | |
| | Limit description |
| | |
+-----------+---------------------------------------------------+
| core | |
| | |
| | The maximum size of the core file. When 0, not |
| | core files are created. When core files are |
| | larger than this size, they will be truncated at |
| | this size. |
| | |
| totalmem | |
| | |
| | The maximum size of the memory of the process, |
| | in bytes. |
| | |
|virtualmem | |
| | |
| | The maximum size of the virtual memory for the |
| | process, in bytes. |
| | |
| data | |
| | |
| | The maximum size of the data segment for the |
| | process, in bytes. |
| | |
| stack | |
| | |
| | The maximum size of the process stack, in bytes. |
| | |
| rss | |
| | |
| | The maximum number of virtual pages resident in |
| | RAM |
| | |
| maxproc | |
| | |
| | The maximum number of processes that can be cre- |
| | ated for the real user ID of the calling process. |
| | |
| memlock | |
| | |
| | The maximum number of bytes of memory that may |
| | be locked into RAM. |
| | |
| cpu | |
| | |
| | The amount of time the process is allowed to use |
| | the CPU. |
| | |
| filesize | |
| | |
| | The maximum size of the data segment for the |
| | process, in bytes. |
| | |
|openfiles | |
| | |
| | One more than the maximum number of open file |
| | descriptors. |
| | |
+-----------+---------------------------------------------------+
EXAMPLES
Example #1
Example use of posix_getrlimit(3)
<?php
$limits = posix_getrlimit();
print_r($limits);
?>
The above example will output something similar to:
Array
(
[soft core] => 0
[hard core] => unlimited
[soft data] => unlimited
[hard data] => unlimited
[soft stack] => 8388608
[hard stack] => unlimited
[soft totalmem] => unlimited
[hard totalmem] => unlimited
[soft rss] => unlimited
[hard rss] => unlimited
[soft maxproc] => unlimited
[hard maxproc] => unlimited
[soft memlock] => unlimited
[hard memlock] => unlimited
[soft cpu] => unlimited
[hard cpu] => unlimited
[soft filesize] => unlimited
[hard filesize] => unlimited
[soft openfiles] => 1024
[hard openfiles] => 1024
)
NOTES
Note
This is a not POSIX function, but is common on BSD and System V systems. If the system does not support this function, then it will
not be included at compile time. This may be checked with function_exists(3).
SEE ALSO
man page GETRLIMIT(2).
PHP Documentation Group POSIX_GETRLIMIT(3)