QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
sysutils.h File Reference

System functions; provides system statistics, counters, and feature availability. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  qsc_sysutils_drive_space_state
 The drive_space state structure. More...
 
struct  qsc_sysutils_memory_statistics_state
 The memory_statistics state structure. More...
 

Macros

#define QSC_SYSUTILS_SYSTEM_NAME_MAX   256ULL
 The system maximum name length.
 
#define QSC_USERNAME_SYSTEM_NAME_MAX   256ULL
 The maximum user name length.
 

Functions

QSC_EXPORT_API size_t qsc_sysutils_computer_name (char *name)
 Get the computer string name.
 
QSC_EXPORT_API void qsc_sysutils_drive_space (const char *drive, qsc_sysutils_drive_space_state *state)
 Get the system drive space statistics.
 
QSC_EXPORT_API void qsc_sysutils_memory_statistics (qsc_sysutils_memory_statistics_state *state)
 Get the memory statistics from the system.
 
QSC_EXPORT_API uint32_t qsc_sysutils_process_id (void)
 Get the current process id.
 
QSC_EXPORT_API bool qsc_sysutils_rdtsc_available (void)
 Get the RDTSC availability status.
 
QSC_EXPORT_API size_t qsc_sysutils_user_name (char *name)
 Get the systems logged-on user name string.
 
QSC_EXPORT_API uint64_t qsc_sysutils_system_uptime (void)
 Get the system up-time since boot.
 
QSC_EXPORT_API uint64_t qsc_sysutils_system_timestamp (void)
 Get the current high-resolution time-stamp.
 
QSC_EXPORT_API void qsc_sysutils_user_identity (const char *name, char *id)
 Get the users identity string.
 

Detailed Description

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.

// Example: Retrieve and print system memory statistics.
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:

Function Documentation

◆ qsc_sysutils_computer_name()

QSC_EXPORT_API size_t qsc_sysutils_computer_name ( char * name)

Get the computer string name.

Parameters
nameThe array receiving the computer name string
Returns
Returns the size of the computer name in characters

◆ qsc_sysutils_drive_space()

QSC_EXPORT_API void qsc_sysutils_drive_space ( const char * drive,
qsc_sysutils_drive_space_state * state )

Get the system drive space statistics.

Parameters
driveThe drive letter
stateThe struct containing the statistics

◆ qsc_sysutils_memory_statistics()

QSC_EXPORT_API void qsc_sysutils_memory_statistics ( qsc_sysutils_memory_statistics_state * state)

Get the memory statistics from the system.

Parameters
state[qsc_sysutils_memory_statistics_state*] The struct containing the memory statistics

◆ qsc_sysutils_process_id()

QSC_EXPORT_API uint32_t qsc_sysutils_process_id ( void )

Get the current process id.

Returns
[uint32_t] Returns the process id

◆ qsc_sysutils_rdtsc_available()

QSC_EXPORT_API bool qsc_sysutils_rdtsc_available ( void )

Get the RDTSC availability status.

Returns
[bool] Returns true if RDTSC is available

◆ qsc_sysutils_system_timestamp()

QSC_EXPORT_API uint64_t qsc_sysutils_system_timestamp ( void )

Get the current high-resolution time-stamp.

Returns
[uint64_t] Returns the system time-stamp

◆ qsc_sysutils_system_uptime()

QSC_EXPORT_API uint64_t qsc_sysutils_system_uptime ( void )

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()

QSC_EXPORT_API size_t qsc_sysutils_user_name ( char * 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