<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Linux::SysInfo - Perl interface to the sysinfo Linux system call.</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:Gentoo@chii.profvince.com" />
</head>

<body style="background-color: white">

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#version">VERSION</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#export">EXPORT</a></li>
	<li><a href="#functions">FUNCTIONS</a></li>
	<ul>

		<li><a href="#sysinfo"><code>sysinfo</code></a></li>
	</ul>

	<li><a href="#constants">CONSTANTS</a></li>
	<ul>

		<li><a href="#ls_has_extended">LS_HAS_EXTENDED</a></li>
	</ul>

	<li><a href="#binary_compatibility">BINARY COMPATIBILITY</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#author">AUTHOR</a></li>
	<li><a href="#bugs">BUGS</a></li>
	<li><a href="#support">SUPPORT</a></li>
	<li><a href="#copyright___license">COPYRIGHT &amp; LICENSE</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Linux::SysInfo - Perl interface to the <code>sysinfo(2)</code> Linux system call.</p>
<p>
</p>
<hr />
<h1><a name="version">VERSION</a></h1>
<p>Version 0.02</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
    use Linux::SysInfo qw/sysinfo/;</pre>
<pre>
    my $si = sysinfo;
    print &quot;$_: $si-&gt;{$_}\n&quot; for keys %$si;</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module is a wrapper around the <code>sysinfo(2)</code> Linux system call. It gives information about the current uptime, load average, memory usage and processes running. Other systems have also this system call (e.g. Solaris), but in most cases the returned information is different.</p>
<p>
</p>
<hr />
<h1><a name="export">EXPORT</a></h1>
<p>The only function of this module, <code>sysinfo</code>, and the constant <code>LS_HAS_EXTENDED</code> are only exported on request.</p>
<p>
</p>
<hr />
<h1><a name="functions">FUNCTIONS</a></h1>
<p>
</p>
<h2><a name="sysinfo"><code>sysinfo</code></a></h2>
<p>This function takes no argument. It returns undef on failure or a hash reference whose keys are the members name of the struct sysinfo on success :</p>
<dl>
<dt><strong><a name="item_uptime"><code>uptime</code></a></strong>

<dd>
<p>Seconds elapsed since the system booted.</p>
</dd>
</li>
<dt><strong><a name="item_load1_2c_load5_2c_load15"><code>load1</code>, <code>load5</code>, <code>load15</code></a></strong>

<dd>
<p>1, 5 and 15 minutes load average.</p>
</dd>
</li>
<dt><strong><a name="item_totalram"><code>totalram</code></a></strong>

<dd>
<p>Total usable main memory size.</p>
</dd>
</li>
<dt><strong><a name="item_freeram"><code>freeram</code></a></strong>

<dd>
<p>Available memory size.</p>
</dd>
</li>
<dt><strong><a name="item_sharedram"><code>sharedram</code></a></strong>

<dd>
<p>Amount of shared memory.</p>
</dd>
</li>
<dt><strong><a name="item_bufferram"><code>bufferram</code></a></strong>

<dd>
<p>Memory used by buffers.</p>
</dd>
</li>
<dt><strong><a name="item_totalswap"><code>totalswap</code></a></strong>

<dd>
<p>Total swap space size.</p>
</dd>
</li>
<dt><strong><a name="item_freeswap"><code>freeswap</code></a></strong>

<dd>
<p>Swap space stil available.</p>
</dd>
</li>
<dt><strong><a name="item_procs"><code>procs</code></a></strong>

<dd>
<p>Number of current processes.</p>
</dd>
</li>
</dl>
<p>Prior to Linux 2.3.23 on i386 and 2.3.48 on all other architectures, the memory sizes were given in bytes. Since then, the following members are also available and all the memory sizes are given as multiples of mem_unit bytes :</p>
<dl>
<dt><strong><a name="item_totalhigh"><code>totalhigh</code></a></strong>

<dd>
<p>Total high memory size.</p>
</dd>
</li>
<dt><strong><a name="item_freehigh"><code>freehigh</code></a></strong>

<dd>
<p>Available high memory size.</p>
</dd>
</li>
<dt><strong><a name="item_mem_unit"><code>mem_unit</code></a></strong>

<dd>
<p>Memory unit size in bytes.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="constants">CONSTANTS</a></h1>
<p>
</p>
<h2><a name="ls_has_extended">LS_HAS_EXTENDED</a></h2>
<p>This constant is set to 1 if your kernel supports the three extended fields <a href="#item_totalhigh"><code>totalhigh</code></a>, <a href="#item_freehigh"><code>freehigh</code></a> and <a href="#item_mem_unit"><code>mem_unit</code></a> ; and to 0 otherwise.</p>
<p>
</p>
<hr />
<h1><a name="binary_compatibility">BINARY COMPATIBILITY</a></h1>
<p>If you upgrade your kernel to a greater version than 2.3.23 on i386 or 2.3.48 on any other platform, you will need to rebuild the module to access the extended fields.</p>
<p>Moreover, since the perl hash function has changed after the 5.6 version, you will also need to recompile the module if you upgrade your perl from a version earlier than 5.6.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>The <code>sysinfo(2)</code> man page.</p>
<p><a href="/Sys/Info.html">the Sys::Info manpage</a> : Gather information about your system.</p>
<p><a href="/Sys/CpuLoad.html">the Sys::CpuLoad manpage</a> : Try several different methods to retrieve the load average.</p>
<p><a href="/BSD/getloadavg.html">the BSD::getloadavg manpage</a> : Wrapper to the <code>getloadavg(3)</code> BSD system call.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Vincent Pit, <code>&lt;perl at profvince.com&gt;</code></p>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>Please report any bugs or feature requests to
<code>bug-linux-sysinfo at rt.cpan.org</code>, or through the web interface at
<a href="http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Linux-SysInfo">http://rt.cpan.org/NoAuth/ReportBug.html</a>.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.</p>
<p>
</p>
<hr />
<h1><a name="support">SUPPORT</a></h1>
<p>You can find documentation for this module with the perldoc command.</p>
<pre>
    perldoc Linux::SysInfo</pre>
<p>
</p>
<hr />
<h1><a name="copyright___license">COPYRIGHT &amp; LICENSE</a></h1>
<p>Copyright 2007 Vincent Pit, all rights reserved.</p>
<p>This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.</p>

</body>

</html>
