add int(CTL_32)

Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Tikhomirov 2014-10-08 17:21:37 +04:00 committed by Pavel Emelyanov
parent 66d1a60ed4
commit ffe3d5cfda
2 changed files with 8 additions and 0 deletions

View file

@ -23,6 +23,7 @@ enum {
#define __CTL_U32A 3 /* Array of u32 */
#define __CTL_U64A 4 /* Array of u64 */
#define __CTL_STR 5 /* String */
#define CTL_32 6 /* Single s32 */
#define CTL_U32A(n) (__CTL_U32A | ((n) << CTL_SHIFT))
#define CTL_U64A(n) (__CTL_U64A | ((n) << CTL_SHIFT))

View file

@ -132,17 +132,21 @@ static int sysctl_show_##__type(int fd, \
GEN_SYSCTL_READ_FUNC(u32, strtoul);
GEN_SYSCTL_READ_FUNC(u64, strtoull);
GEN_SYSCTL_READ_FUNC(s32, strtol);
GEN_SYSCTL_WRITE_FUNC(u32, "%u ");
GEN_SYSCTL_WRITE_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_WRITE_FUNC(s32, "%d ");
GEN_SYSCTL_PRINT_FUNC(u32, "%u ");
GEN_SYSCTL_PRINT_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_PRINT_FUNC(char, "%c");
GEN_SYSCTL_PRINT_FUNC(s32, "%d ");
GEN_SYSCTL_SHOW_FUNC(u32, "%u ");
GEN_SYSCTL_SHOW_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_SHOW_FUNC(char, "%c");
GEN_SYSCTL_SHOW_FUNC(s32, "%d ");
static int
sysctl_write_char(int fd, struct sysctl_req *req, char *arg, int nr)
@ -198,6 +202,9 @@ static int __sysctl_op(int dir, struct sysctl_req *req, int op)
case CTL_U32:
__SYSCTL_OP(ret, fd, req, u32, nr, op);
break;
case CTL_32:
__SYSCTL_OP(ret, fd, req, s32, nr, op);
break;
case __CTL_U64A:
nr = CTL_LEN(req->type);
case CTL_U64: