PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




posix_getrlimit

Name

posix_getrlimit — Return information about system resource consumption limits.

Synopsis

array posix_getrlimit(void)

Returns

An array of resource limit information, or FALSE on failure.

Description

This function queries the system for information about resource limits, such as the maximum filesize, maximum stack size, and so forth. The information is returned in an associative array having the following structure:

  • soft core: Current maximum core file size, in bytes. A value of 0 here means that core files cannot be created at all.

  • hard core: Absolute maximum core file size, in bytes. A value of 0 here means that core files cannot be created at all.

  • soft data: Current maximum data size, in bytes. This value represents the heap plus initialized data plus uninitialized data.

  • hard data: Absolute maximum data size, in bytes. This value represents the heap plus initialized data plus uninitialized data.

  • soft stack: Current maximum stack size, in bytes.

  • hard stack: Absolute maximum stack size, in bytes.

  • soft totalmem: Current maximum virtual memory size, in bytes.

  • hard totalmem: Absolutes maximum virtual memory size, in bytes.

  • soft rss: Current maximum resident set size, in bytes.

  • hard rss: Absolute maximum resident set size, in bytes.

  • soft maxproc: Current maximum number of processes.

  • hard maxproc: Absolute maximum number of processes.

  • soft memlock: Current maximum locked-in-memory address space, in bytes.

  • hard memlock: Absolute maximum locked-in-memory address space, in bytes.

  • soft cpu: Current maximum CPU time for a process, in seconds. If exceeded, the offending process will be sent the SIGXCPU signal.

  • hard cpu: Absolute maximum CPU time for a process, in seconds.

  • soft filesize: Current maximum file size, in bytes. If exceeded, the offending process will be send the SIGXFSZ signal.

  • hard filesize: Absolute maximum file size, in bytes.

  • soft openfiles: Current maximum number of open files per process.

  • hard openfiles: Absolute maximum number of open files per process.



If a given item has not had a limit set on it (either by the system or a user), then its value will be unlimited. This does not mean that the resource is actually unlimited, just that it has not had an explicit upper bound applied to it.

Warning

This is not actually a POSIX function and may not be supported on all systems. On unsupported systems, FALSE will always be returned. It should be supported on most BSD and SysV style systems, such as Linux and FreeBSD.



Version

PHP 3.0.10+, PHP 4.0b4+

Example

Example 1078. Getting a list of system resource limits

if (FALSE === ($pwinfo = posix_getrlimit())) {
    echo "Could not get resource limit information.\n";
} else {
    echo "Resource limit information:\n";
    print_r($pwinfo);
}



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.