From 5d451abbbfd495983f9af857fec359681d487858 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 18 Apr 2012 10:06:35 +0200 Subject: libmount: add mnt_context_get_options() Signed-off-by: Karel Zak --- libmount/src/context.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libmount/src/context.c') diff --git a/libmount/src/context.c b/libmount/src/context.c index fe5c3f4bb..0d0282de8 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -702,7 +702,7 @@ int mnt_context_set_fstype(struct libmnt_context *cxt, const char *fstype) * mnt_context_get_fstype: * @cxt: mount context * - * Returns: returns pointer or NULL in case of error pr if not set. + * Returns: pointer or NULL in case of error pr if not set. */ const char *mnt_context_get_fstype(struct libmnt_context *cxt) { @@ -733,6 +733,24 @@ int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr) return mnt_fs_append_options(mnt_context_get_fs(cxt), optstr); } +/** + * mnt_context_get_options: + * @cxt: mount context + * + * This function returns mount options set by mnt_context_set_options() or + * mnt_context_append_options(). + * + * Note that *after* mnt_context_prepare_mount() may the mount options string + * also includes options set by mnt_context_set_mflags() or another options + * generated by this library. + * + * Returns: pointer or NULL + */ +const char *mnt_context_get_options(struct libmnt_context *cxt) +{ + return mnt_fs_get_options(mnt_context_get_fs(cxt)); +} + /** * mnt_context_set_fstype_pattern: * @cxt: mount context -- cgit v1.2.3-55-g7522