Swap

Swap — plugin for operations with swap space

Functions

Types and Values

#define BD_SWAP_ERROR
enum BDSwapError

Includes

#include <swap.h>

Description

A plugin for operations with swap space.

Functions

bd_swap_error_quark ()

GQuark
bd_swap_error_quark (void);

bd_swap_mkswap ()

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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)

Types and Values

BD_SWAP_ERROR

#define BD_SWAP_ERROR bd_swap_error_quark ()

enum BDSwapError

Members

BD_SWAP_ERROR_UNKNOWN_STATE

   

BD_SWAP_ERROR_ACTIVATE