summaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak2012-04-03 13:20:32 +0200
committerKarel Zak2012-04-03 13:20:32 +0200
commitce4dd666f4e4cab7f0a41274c6b48da8e41860fd (patch)
tree00e2b8b3912ebf543239067ccae538d413b086fc /libmount/src/utils.c
parentlibmount: clean up MNT_FMT_* usage in parser (diff)
downloadkernel-qcow2-util-linux-ce4dd666f4e4cab7f0a41274c6b48da8e41860fd.tar.gz
kernel-qcow2-util-linux-ce4dd666f4e4cab7f0a41274c6b48da8e41860fd.tar.xz
kernel-qcow2-util-linux-ce4dd666f4e4cab7f0a41274c6b48da8e41860fd.zip
libmount: add support to parse /proc/swaps
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index ca1eb88d8..e740d83d0 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -705,6 +705,17 @@ done:
}
/**
+ * mnt_get_swaps_path:
+ *
+ * Returns: path to /proc/swaps or $LIBMOUNT_SWAPS.
+ */
+const char *mnt_get_swaps_path(void)
+{
+ const char *p = safe_getenv("LIBMOUNT_SWAPS");
+ return p ? : _PATH_PROC_SWAPS;
+}
+
+/**
* mnt_get_fstab_path:
*
* Returns: path to /etc/fstab or $LIBMOUNT_FSTAB.