summaryrefslogtreecommitdiff
path: root/libcap/libcap.h
diff options
context:
space:
mode:
authorMaciej Wereski <m.wereski@partner.samsung.com>2014-01-15 15:15:00 (GMT)
committerMaciej Wereski <m.wereski@partner.samsung.com>2014-01-15 15:15:00 (GMT)
commitbcca19a055cbdb0d67985ac08fef491f6d4bb42b (patch)
tree1d49ec65d242cf1dec494570622b3737aef06a03 /libcap/libcap.h
parentb138da4a4b9d57b850ca4d0061969f5e3299861d (diff)
downloadlibcap-bcca19a055cbdb0d67985ac08fef491f6d4bb42b.zip
libcap-bcca19a055cbdb0d67985ac08fef491f6d4bb42b.tar.gz
libcap-bcca19a055cbdb0d67985ac08fef491f6d4bb42b.tar.bz2
Imported Upstream version 2.24upstream/2.24upstream
Diffstat (limited to 'libcap/libcap.h')
-rw-r--r--libcap/libcap.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libcap/libcap.h b/libcap/libcap.h
index 1e66f98..2596c11 100644
--- a/libcap/libcap.h
+++ b/libcap/libcap.h
@@ -12,14 +12,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include <sys/capability.h>
#ifndef __u8
-#define __u8 unsigned char
+#define __u8 uint8_t
#endif /* __8 */
#ifndef __u32
-#define __u32 unsigned int
+#define __u32 uint32_t
#endif /* __u32 */
/* include the names for the caps and a definition of __CAP_BITS */
@@ -197,4 +198,12 @@ extern int capsetp(pid_t pid, cap_t cap_d);
#define PR_GET_SECUREBITS 27
#define PR_SET_SECUREBITS 28
+/*
+ * The library compares sizeof() with integer return values. To avoid
+ * signed/unsigned comparisons, leading to unfortunate
+ * misinterpretations of -1, we provide a convenient cast-to-signed-integer
+ * version of sizeof().
+ */
+#define ssizeof(x) ((ssize_t) sizeof(x))
+
#endif /* LIBCAP_H */