Data Structures | |
struct | sa_memory |
struct | sa_swap |
Functions | |
SA_EXPORT int | sa_open_memory (void) |
SA_EXPORT int | sa_close_memory (void) |
SA_EXPORT int | sa_get_memory (struct sa_memory *dst) |
SA_EXPORT int | sa_count_swaps (uint16_t *number) |
SA_EXPORT int | sa_get_swap (uint16_t index, struct sa_swap *dst) |
SA_EXPORT int | sa_get_swaps (struct sa_swap *dst, uint16_t dst_size, uint16_t *written) |
SA_EXPORT int sa_open_memory | ( | void | ) |
Prepares the resources needed for retrieving memory statistics. This function exists (and is needed) only when SA_OPEN_MEMORY is defined.
SA_EXPORT int sa_close_memory | ( | void | ) |
This function closes the resources used for retrieving memory statistics. You should call it even when there was a previous error in another function of this API. This function exists (and is needed) only when SA_CLOSE_MEMORY is defined.
SA_EXPORT int sa_get_memory | ( | struct sa_memory * | dst | ) |
Retrieves statistics about the usage of the memory.
dst | Where the statistics will be stored. |
SA_EXPORT int sa_count_swaps | ( | uint16_t * | number | ) |
Gives the total number of swap file systems.
number | The number will be stored here |
SA_EXPORT int sa_get_swap | ( | uint16_t | index, | |
struct sa_swap * | dst | |||
) |
Retrieves statistics from a given swap index.
index | The swap index. It starts from 0. | |
dst | Where the statistics will be stored. |
SA_EXPORT int sa_get_swaps | ( | struct sa_swap * | dst, | |
uint16_t | dst_size, | |||
uint16_t * | written | |||
) |
Retrieves statistics from as many swap fs as possible.
dst | A buffer where the statistics will be stored. | |
dst_size | The number of swap fs that fits in the dst buffer. If it's not big enough dst will be filled but ENOMEM will be returned. | |
written | The amount of swap fs statistics written. |