RSC  0.17.1
Host Information Functions

These functions are not guaranteed to be either thread-safe or reentrant. More...

Functions

RSC_EXPORT std::string rsc::os::currentMachineType ()
 Determine and return the machine type, usually CPU architecture, of the local machine. More...
 
RSC_EXPORT std::string rsc::os::currentMachineVersion ()
 Determine and return the version within its type, usually the CPU identification string, of the local machine. More...
 
RSC_EXPORT std::string rsc::os::currentSoftwareType ()
 Determine and return the type of the operating system, usually the kernel name, running on the local machine. More...
 
RSC_EXPORT std::string rsc::os::currentSoftwareVersion ()
 Determine and return the version of the operating system within its type, usually the kernel version string, running on the local machine. More...
 
RSC_EXPORT std::string rsc::os::currentHostname ()
 Determine and return the hostname of the local machine. More...
 
RSC_EXPORT std::string rsc::os::currentHostId ()
 Determine and return a unique id string of the local machine. More...
 
RSC_EXPORT boost::posix_time::ptime rsc::os::currentBootTime ()
 Return the boot time of the local machine. More...
 

Detailed Description

These functions are not guaranteed to be either thread-safe or reentrant.

Function Documentation

boost::posix_time::ptime rsc::os::currentBootTime ( )

Return the boot time of the local machine.

The precision with which the boot time can be determined varies between platforms.

Returns
boost::posix_time::ptime encoding the boot time of the machine.
Exceptions
std::runtime_errorIf determining the boot time fails.

Definition at line 110 of file LinuxHostInfo.cpp.

Referenced by rsc::os::getProcessStartTime().

Here is the caller graph for this function:

std::string rsc::os::currentHostId ( )

Determine and return a unique id string of the local machine.

This unique id should not change over time but callers should still be prepared to deal with that since not all implementation can provide a constant unique id.

Returns
A unique id string for the local machine.
Exceptions
std::runtime_errorIf the unique id cannot be determined.

Definition at line 99 of file LinuxHostInfo.cpp.

References rsc::os::hostId(), and rsc::os::tryFile().

Here is the call graph for this function:

std::string rsc::os::currentHostname ( )

Determine and return the hostname of the local machine.

Note that the hostname can change over time.

Returns
The current hostname of the local machine.
Exceptions
std::runtime_errorIf the hostname cannot be determined.

Definition at line 98 of file PosixUtilities.cpp.

References rsc::os::HOSTNAME_MAX_LENGTH.

std::string rsc::os::currentMachineType ( )

Determine and return the machine type, usually CPU architecture, of the local machine.

Returns
The machine type of the local machine.
Exceptions
std::runtime_errorIf the machine type cannot be determined.

Definition at line 68 of file PosixUtilities.cpp.

References rsc::os::callWithUtsname().

Here is the call graph for this function:

std::string rsc::os::currentMachineVersion ( )

Determine and return the version within its type, usually the CPU identification string, of the local machine.

Returns
The machine version of the local machine.
Exceptions
std::runtime_errorIf the machine version cannot be determined.

Definition at line 47 of file LinuxHostInfo.cpp.

std::string rsc::os::currentSoftwareType ( )

Determine and return the type of the operating system, usually the kernel name, running on the local machine.

Returns
The software type of the local machine.
Exceptions
std::runtime_errorIf the software type cannot be determined.

Definition at line 80 of file PosixUtilities.cpp.

References rsc::os::callWithUtsname().

Here is the call graph for this function:

std::string rsc::os::currentSoftwareVersion ( )

Determine and return the version of the operating system within its type, usually the kernel version string, running on the local machine.

Returns
The software version of the local machine.
Exceptions
std::runtime_errorIf the software version cannot be determined.

Definition at line 90 of file PosixUtilities.cpp.

References rsc::os::callWithUtsname().

Here is the call graph for this function: