summaryrefslogtreecommitdiff
path: root/src/shared/nsflags.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-12-29 17:11:42 +0900
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:49:49 +0200
commitf2e564a3e0a57ff225102e8eb9b5f936e0c9f160 (patch)
tree01bb352492a5c0319bab673db82491a00f3fa917 /src/shared/nsflags.h
parent6c33853a2de7ada8d55d411f6a407ff1b69fa526 (diff)
nsflags: add namespace_flag_to_string_many_with_check()
The function will be used in later commits.
Diffstat (limited to 'src/shared/nsflags.h')
-rw-r--r--src/shared/nsflags.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/nsflags.h b/src/shared/nsflags.h
index 5aff9245b..f374a4883 100644
--- a/src/shared/nsflags.h
+++ b/src/shared/nsflags.h
@@ -44,6 +44,13 @@ int namespace_flag_from_string_many(const char *name, unsigned long *ret);
#endif // 0
int namespace_flag_to_string_many(unsigned long flags, char **ret);
+static inline int namespace_flag_to_string_many_with_check(unsigned long n, char **s) {
+ if ((n & NAMESPACE_FLAGS_ALL) != n)
+ return -EINVAL;
+
+ return namespace_flag_to_string_many(n, s);
+}
+
struct namespace_flag_map {
unsigned long flag;
const char *name;