[CRIU] [PATCH 12/22] compel: Export own version via call

Cyrill Gorcunov gorcunov at openvz.org
Wed Oct 19 12:21:27 PDT 2016


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 compel/Makefile                     |  2 ++
 compel/include/uapi/compel/compel.h |  3 +++
 compel/src/lib/compel.c             | 17 +++++++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 compel/src/lib/compel.c

diff --git a/compel/Makefile b/compel/Makefile
index 3de60601087f..9cd86c554584 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -22,6 +22,8 @@ host-lib-y		+= arch/$(ARCH)/src/lib/handle-elf.o
 lib-y			+= src/lib/handle-elf.o
 host-lib-y		+= src/lib/handle-elf.o
 
+lib-y			+= src/lib/compel.o
+
 #
 # This requires arch specific header to
 # be generated into uapi
diff --git a/compel/include/uapi/compel/compel.h b/compel/include/uapi/compel/compel.h
index dcbffdbbf9ea..85ea8214a21d 100644
--- a/compel/include/uapi/compel/compel.h
+++ b/compel/include/uapi/compel/compel.h
@@ -14,6 +14,9 @@ typedef struct {
 	long		value;
 } compel_reloc_t;
 
+/* Report own version */
+extern void compel_version(unsigned int *major, unsigned int *minor, unsigned int *sublevel);
+
 /*
  * Logging
  */
diff --git a/compel/src/lib/compel.c b/compel/src/lib/compel.c
new file mode 100644
index 000000000000..68d1a0d7717d
--- /dev/null
+++ b/compel/src/lib/compel.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "uapi/compel/compel.h"
+
+#include "version.h"
+#include "log.h"
+
+void compel_version(unsigned int *major, unsigned int *minor, unsigned int *sublevel)
+{
+	if (major)
+		*major = COMPEL_SO_VERSION_MAJOR;
+	if (minor)
+		*minor = COMPEL_SO_VERSION_MINOR;
+	if (sublevel)
+		*sublevel = COMPEL_SO_VERSION_SUBLEVEL;
+}
-- 
2.7.4



More information about the CRIU mailing list