system |
The os_system
class is comprised of static member functions that
access general information about your operating system. This class is useful for
obtaining system-wide information, such as the name and release number of the
operating system, as well as predefined system limits. You cannot create
instances of os_system .
The following example uses os_system
to display several attributes of the operating system.
#include <iostream>
#include <ospace/unix.h>
int
main()
{
os_unix_toolkit initialize;
cout << "platform_version: " << os_system::platform_version() << endl;
cout << "hardware_version: " << os_system::hardware_version() << endl;
cout << "machine: " << os_system::machine() << endl;
cout << "page_size: " << os_system::page_size() << endl;
return 0;
}
platform_version: 5.4
hardware_version: Generic_101945-10
machine: sun4m
page_size: 4096
Additional system limits can be
obtained using static members of os_this_process
.
The following example accesses
the maximum number of files that can be open. This system information is
accessible via os_this_process::open_file_limit()
.
#include <iostream>
#include <ospace/unix.h>
int
main()
{
os_unix_toolkit initialize;
cout << "max open files = " << os_this_process::open_file_limit();
cout << endl;
return 0;
}
max open files = 64
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.