Go to the documentation of this file. 1 #ifndef _LINUX_HIGHUID_H
2 #define _LINUX_HIGHUID_H
4 #include <linux/types.h>
40 #define DEFAULT_OVERFLOWUID 65534
41 #define DEFAULT_OVERFLOWGID 65534
46 #define high2lowuid(uid) ((uid) & ~0xFFFF ? (old_uid_t)overflowuid : (old_uid_t)(uid))
47 #define high2lowgid(gid) ((gid) & ~0xFFFF ? (old_gid_t)overflowgid : (old_gid_t)(gid))
52 #define low2highuid(uid) ((uid) == (old_uid_t)-1 ? (uid_t)-1 : (uid_t)(uid))
53 #define low2highgid(gid) ((gid) == (old_gid_t)-1 ? (gid_t)-1 : (gid_t)(gid))
55 #define __convert_uid(size, uid) \
56 (size >= sizeof(uid) ? (uid) : high2lowuid(uid))
57 #define __convert_gid(size, gid) \
58 (size >= sizeof(gid) ? (gid) : high2lowgid(gid))
63 #define __convert_uid(size, uid) (uid)
64 #define __convert_gid(size, gid) (gid)
69 #define SET_UID(var, uid) do { (var) = __convert_uid(sizeof(var), (uid)); } while (0)
70 #define SET_GID(var, gid) do { (var) = __convert_gid(sizeof(var), (gid)); } while (0)
84 #define DEFAULT_FS_OVERFLOWUID 65534
85 #define DEFAULT_FS_OVERFLOWGID 65534
91 #define fs_high2lowuid(uid) ((uid) & ~0xFFFF ? (uid16_t)fs_overflowuid : (uid16_t)(uid))
92 #define fs_high2lowgid(gid) ((gid) & ~0xFFFF ? (gid16_t)fs_overflowgid : (gid16_t)(gid))
94 #define low_16_bits(x) ((x) & 0xFFFF)
95 #define high_16_bits(x) (((x) & 0xFFFF0000) >> 16)