2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00
criu/include/sysctl.h
Cyrill Gorcunov 830d92b0f0 headers: Unify include guards (in comments) and a few fixes
- fix names in comments
 - add empty lines where needed
 - fix rbtree.h
 - fix syscall-types.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-25 22:40:24 +04:00

35 lines
738 B
C

#ifndef __CR_SYSCTL_H__
#define __CR_SYSCTL_H__
struct sysctl_req {
char *name;
void *arg;
int type;
};
extern int sysctl_op(struct sysctl_req *req, int op);
enum {
CTL_READ,
CTL_WRITE,
CTL_PRINT,
CTL_SHOW,
};
#define CTL_SHIFT 4 /* Up to 16 types */
#define CTL_U32 1 /* Single u32 */
#define CTL_U64 2 /* Single u64 */
#define __CTL_U32A 3 /* Array of u32 */
#define __CTL_U64A 4 /* Array of u64 */
#define __CTL_STR 5 /* String */
#define CTL_U32A(n) (__CTL_U32A | ((n) << CTL_SHIFT))
#define CTL_U64A(n) (__CTL_U64A | ((n) << CTL_SHIFT))
#define CTL_STR(len) (__CTL_STR | ((len) << CTL_SHIFT))
#define CTL_LEN(t) ((t) >> CTL_SHIFT)
#define CTL_TYPE(t) ((t) & ((1 << CTL_SHIFT) - 1))
#endif /* __CR_SYSCTL_H__ */