aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2022-04-10 14:49:26 -0700
committerAndrew G. Morgan <morgan@kernel.org>2022-04-10 14:49:26 -0700
commitfc029cb5170361981b6d971fe56ff60f1ab10b45 (patch)
tree1af0ccb779a39254fe8e13337601def46147cde2
parentceaa591b012610d3fe402d33e7d7ca14716cf965 (diff)
downloadlibcap-fc029cb5170361981b6d971fe56ff60f1ab10b45.tar.gz
Include LIBCAP_{MAJOR,MINOR} #define's in sys/capability.h
It looks like various distributions are fairly far behind HEAD for their version of libcap. This way folk can work around a lack of features in their code. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--Makefile3
-rw-r--r--libcap/include/sys/capability.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 84c90c8..a3337a6 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,9 @@ distclean: clean
@echo "CONFIRM Go package cap has right version dependency on cap/psx:"
for x in $$(find . -name go.mod); do $(BUILD_FGREP) -v "module" $$x | $(BUILD_FGREP) "kernel.org/pub/linux/libs/security/libcap" > /dev/null || continue ; $(BUILD_FGREP) "v$(GOMAJOR).$(VERSION).$(MINOR)" $$x > /dev/null && continue ; echo "$$x is not updated. Try running: ./gomods.sh v$(GOMAJOR).$(VERSION).$(MINOR)" ; exit 1 ; done
@echo "ALL go.mod files updated"
+ @echo "Confirm headers export current version"
+ $(BUILD_FGREP) "#define LIBCAP_MAJOR $(VERSION)" libcap/include/sys/capability.h
+ $(BUILD_FGREP) "#define LIBCAP_MINOR $(MINOR)" libcap/include/sys/capability.h
@echo "Now validate that everything is checked in to a clean tree.."
test -z "$$(git status --ignored -s)"
@echo "All good!"
diff --git a/libcap/include/sys/capability.h b/libcap/include/sys/capability.h
index c85413b..730af37 100644
--- a/libcap/include/sys/capability.h
+++ b/libcap/include/sys/capability.h
@@ -15,6 +15,12 @@ extern "C" {
#endif
/*
+ * Provide a programmatic way to #ifdef around features.
+ */
+#define LIBCAP_MAJOR 2
+#define LIBCAP_MINOR 63
+
+/*
* This file complements the kernel file by providing prototype
* information for the user library.
*/