PinCRT
Enumerations | Functions
Host machine queries

Enumerations

enum  OS_HOST_CPU_ARCH_TYPE {
  OS_HOST_CPU_ARCH_TYPE_INVALID = 0,
  OS_HOST_CPU_ARCH_TYPE_IA32 = 1,
  OS_HOST_CPU_ARCH_TYPE_INTEL64 = 2
}
 

Functions

OS_RETURN_CODE OS_GetHostName (CHAR *buf, USIZE buflen)
 
OS_RETURN_CODE OS_GetHostCPUArch (OS_HOST_CPU_ARCH_TYPE *arch)
 
const char * OS_CPUArchToString (OS_HOST_CPU_ARCH_TYPE arch)
 
OS_RETURN_CODE OS_GetKernelRelease (CHAR *buf, USIZE bufsize)
 
OS_RETURN_CODE OS_GetOSName (CHAR *buf, USIZE bufsize)
 
OS_RETURN_CODE OS_GetOSVersion (CHAR *buf, USIZE bufsize)
 
OS_RETURN_CODE OS_ReadProcessorFrequency (UINT32 *freq)
 

Detailed Description

Contains API for host related queries

Enumeration Type Documentation

◆ OS_HOST_CPU_ARCH_TYPE

CPU Architecture

Function Documentation

◆ OS_CPUArchToString()

const char* OS_CPUArchToString ( OS_HOST_CPU_ARCH_TYPE  arch)

Get a string representing a certain CPU arch.

Parameters
[in]archThe architecture to get a string for it
Return values
read-onlystring representing the CPU arch
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_GetHostCPUArch()

OS_RETURN_CODE OS_GetHostCPUArch ( OS_HOST_CPU_ARCH_TYPE arch)

Query CPU architecture.

Parameters
[out]archThe architecture of this system's CPU
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_GetHostName()

OS_RETURN_CODE OS_GetHostName ( CHAR *  buf,
USIZE  buflen 
)

Retrieves the host name of the current host - as known by this host

Parameters
[out]bufBuffer to receive the host name
[in]buflenSize of buffer buf in bytes
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_BUFFER_TOO_SHORTIf the buffer buf is too short
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_GetKernelRelease()

OS_RETURN_CODE OS_GetKernelRelease ( CHAR *  buf,
USIZE  bufsize 
)

Get kernel release description string.

Parameters
[out]bufBuffer to receive the release string
[in]bufsizeSize of buffer buf in bytes
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_GetOSName()

OS_RETURN_CODE OS_GetOSName ( CHAR *  buf,
USIZE  bufsize 
)

Get the name of the operating system we're running on.

Parameters
[out]bufBuffer to receive the OS name string
[in]bufsizeSize of buffer buf in bytes
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_GetOSVersion()

OS_RETURN_CODE OS_GetOSVersion ( CHAR *  buf,
USIZE  bufsize 
)

Get the version of the operating system we're running on.

Parameters
[out]bufBuffer to receive the OS version string
[in]bufsizeSize of buffer buf in bytes
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_ReadProcessorFrequency()

OS_RETURN_CODE OS_ReadProcessorFrequency ( UINT32 *  freq)

Get CPU processor frequency in MHz.

Parameters
[out]freqFrequency of the CPU
Return values
OS_RETURN_CODE_NO_ERRORIf the operation succeeded
OS_RETURN_CODE_QUERY_FAILEDIf the operation failed
Availability:
O/S: macOS*
CPU: All