summaryrefslogtreecommitdiffstats
path: root/wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wrapper.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wrapper.c b/wrapper.c
new file mode 100644
index 0000000..7341631
--- /dev/null
+++ b/wrapper.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * This file is part of nvme-cli
+ *
+ * Copyright (c) 2022 Daniel Wagner, SUSE
+ */
+
+#include <dlfcn.h>
+
+#include <libnvme.h>
+
+const char * __attribute__((weak)) nvme_get_version(enum nvme_version type)
+{
+ const char *(*libnvme_get_version)(enum nvme_version type);
+
+ libnvme_get_version = dlsym(RTLD_NEXT, "nvme_get_version");
+
+ if (libnvme_get_version)
+ return libnvme_get_version(type);
+
+ return "n/a";
+}