|
libsysactivity
0.6.5
|
Data Structures | |
| struct | sa_swap |
Functions | |
| int | sa_open_swap (void) SA_EXPORT |
| int | sa_close_swap (void) SA_EXPORT |
| int | sa_count_swaps (uint16_t *number) SA_EXPORT SA_NONNULL |
| int | sa_reset_swaps () SA_EXPORT |
| int | sa_get_swap (uint16_t index, struct sa_swap *dst) SA_EXPORT SA_NONNULL |
| int | sa_get_swaps (struct sa_swap *dst, uint16_t dst_size, uint16_t *written) SA_EXPORT SA_NONNULL |
| int sa_open_swap | ( | void | ) |
Prepares the resources needed for retrieving swap statistics. This function exists (and is needed) only when SA_OPEN_SWAP is defined.
| int sa_close_swap | ( | void | ) |
This function closes the resources used for retrieving swap 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_SWAP is defined.
| int sa_count_swaps | ( | uint16_t * | number | ) |
Gives the total number of swap file systems. You don't need to call sa_reset_swaps() before this function.
| number | The number will be stored here |
| int sa_reset_swaps | ( | ) |
Refreshes the underlying operating system cache.
| int sa_get_swap | ( | uint16_t | index, |
| struct sa_swap * | dst | ||
| ) |
Retrieves statistics from a given swap index. sa_reset_swaps() should be called at least once before this function and everytime you need fresh values.
| index | The swap index. It starts from 0. |
| dst | Where the statistics will be stored. |
| int sa_get_swaps | ( | struct sa_swap * | dst, |
| uint16_t | dst_size, | ||
| uint16_t * | written | ||
| ) |
Retrieves statistics from as many swap fs as possible. sa_reset_swaps() should be called at least once before this function and everytime you need fresh values.
| 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. |
1.8.9.1