From 50478c6dadc2accfab5bfe72d278ede17c2e13cf Mon Sep 17 00:00:00 2001 From: TerraTech <1118433+TerraTech@users.noreply.github.com> Date: Wed, 10 Apr 2019 00:43:28 -0700 Subject: Add option [-V|--version] to emit version string Add the 'zfs version' and 'zpool version' subcommands to display the version of the user space utilities and loaded zfs kernel module. For example: $ zfs version zfs-0.8.0-rc3_169_g67e0366b88 zfs-kmod-0.8.0-rc3_169_g67e0366b88 The '-V' and '--version' aliases were added to support the common convention of using 'zfs --version` to obtain the version information. Reviewed-by: Brian Behlendorf Reviewed-by: Matthew Ahrens Reviewed-by: Richard Laager Signed-off-by: TerraTech <1118433+TerraTech@users.noreply.github.com> Closes #2501 Closes #8567 --- include/libzfs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/libzfs.h') diff --git a/include/libzfs.h b/include/libzfs.h index b604f1194..8d79fe69e 100644 --- a/include/libzfs.h +++ b/include/libzfs.h @@ -815,6 +815,13 @@ void libzfs_free_str_array(char **strs, int count); int libzfs_envvar_is_set(char *envvar); +/* + * Utility functions for zfs version + */ +extern void zfs_version_userland(char *, int); +extern int zfs_version_kernel(char *, int); +extern int zfs_version_print(void); + /* * Given a device or file, determine if it is part of a pool. */ -- cgit v1.2.3