System functions; provides system statistics, counters, and feature availability.
More...
Go to the source code of this file.
|
#define | QSC_SYSUTILS_SYSTEM_NAME_MAX 256ULL |
| The system maximum name length.
|
|
#define | QSC_USERNAME_SYSTEM_NAME_MAX 256ULL |
| The maximum user name length.
|
|
System functions; provides system statistics, counters, and feature availability.
This header provides functions for retrieving system-level information including computer name, drive space, memory statistics, process identifiers, and high-resolution time-stamps. It also provides functions to query the current user's identity and the system's up-time since boot.
printf(
"Total Physical Memory: %llu bytes\n", mem_stats.
phystotal);
The memory_statistics state structure.
Definition sysutils.h:116
uint64_t phystotal
Definition sysutils.h:117
QSC_EXPORT_API void qsc_sysutils_memory_statistics(qsc_sysutils_memory_statistics_state *state)
Get the memory statistics from the system.
Definition sysutils.c:121
Reference Links:
◆ qsc_sysutils_computer_name()
Get the computer string name.
- Parameters
-
name | The array receiving the computer name string |
- Returns
- Returns the size of the computer name in characters
◆ qsc_sysutils_drive_space()
Get the system drive space statistics.
- Parameters
-
drive | The drive letter |
state | The struct containing the statistics |
◆ qsc_sysutils_memory_statistics()
Get the memory statistics from the system.
- Parameters
-
state | [qsc_sysutils_memory_statistics_state*] The struct containing the memory statistics |
◆ qsc_sysutils_process_id()
Get the current process id.
- Returns
- [uint32_t] Returns the process id
◆ qsc_sysutils_rdtsc_available()
Get the RDTSC availability status.
- Returns
- [bool] Returns true if RDTSC is available
◆ qsc_sysutils_system_timestamp()
Get the current high-resolution time-stamp.
- Returns
- [uint64_t] Returns the system time-stamp
◆ qsc_sysutils_system_uptime()
Get the system up-time since boot.
- Returns
- [uint64_t] Returns the system up-time
◆ qsc_sysutils_user_identity()
QSC_EXPORT_API void qsc_sysutils_user_identity |
( |
const char * | name, |
|
|
char * | id ) |
Get the users identity string.
- Parameters
-
name | [const char*] The char array that holds the user name |
id | [char*] The output array containing the id string |
◆ qsc_sysutils_user_name()
Get the systems logged-on user name string.
- Parameters
-
name | [char*] The char array that holds the user name |
- Returns
- [size_t] Returns the size of the user name