Swap

Swap — plugin for operations with swap space

Synopsis

#include <swap.h>

GQuark              bd_swap_error_quark                 (void);
#define             BD_SWAP_ERROR
enum                BDSwapError;
gboolean            bd_swap_mkswap                      (gchar *device,
                                                         gchar *label,
                                                         GError **error);
gboolean            bd_swap_swapon                      (gchar *device,
                                                         gint priority,
                                                         GError **error);
gboolean            bd_swap_swapoff                     (gchar *device,
                                                         GError **error);
gboolean            bd_swap_swapstatus                  (gchar *device,
                                                         GError **error);

Description

A plugin for operations with swap space.

Details

bd_swap_error_quark ()

GQuark              bd_swap_error_quark                 (void);

BD_SWAP_ERROR

#define             BD_SWAP_ERROR

enum BDSwapError

typedef enum {
    BD_SWAP_ERROR_UNKNOWN_STATE,
    BD_SWAP_ERROR_ACTIVATE,
} BDSwapError;

BD_SWAP_ERROR_UNKNOWN_STATE

BD_SWAP_ERROR_ACTIVATE


bd_swap_mkswap ()

gboolean            bd_swap_mkswap                      (gchar *device,
                                                         gchar *label,
                                                         GError **error);

device :

a device to create swap space on

label :

a label for the swap space device. [allow-none]

error :

place to store error (if any). [out]

Returns :

whether the swap space was successfully created or not

bd_swap_swapon ()

gboolean            bd_swap_swapon                      (gchar *device,
                                                         gint priority,
                                                         GError **error);

device :

swap device to activate

priority :

priority of the activated device or -1 to use the default

error :

place to store error (if any). [out]

Returns :

whether the swap device was successfully activated or not

bd_swap_swapoff ()

gboolean            bd_swap_swapoff                     (gchar *device,
                                                         GError **error);

device :

swap device to deactivate

error :

place to store error (if any). [out]

Returns :

whether the swap device was successfully deactivated or not

bd_swap_swapstatus ()

gboolean            bd_swap_swapstatus                  (gchar *device,
                                                         GError **error);

device :

swap device to get status of

error :

place to store error (if any). [out]

Returns :

TRUE if the swap device is active, FALSE if not active or failed to determine (error) is set not a non-NULL value in such case)