Commit ffe3d5cf authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Pavel Emelyanov

add int(CTL_32)

Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 66d1a60e
...@@ -23,6 +23,7 @@ enum { ...@@ -23,6 +23,7 @@ enum {
#define __CTL_U32A 3 /* Array of u32 */ #define __CTL_U32A 3 /* Array of u32 */
#define __CTL_U64A 4 /* Array of u64 */ #define __CTL_U64A 4 /* Array of u64 */
#define __CTL_STR 5 /* String */ #define __CTL_STR 5 /* String */
#define CTL_32 6 /* Single s32 */
#define CTL_U32A(n) (__CTL_U32A | ((n) << CTL_SHIFT)) #define CTL_U32A(n) (__CTL_U32A | ((n) << CTL_SHIFT))
#define CTL_U64A(n) (__CTL_U64A | ((n) << CTL_SHIFT)) #define CTL_U64A(n) (__CTL_U64A | ((n) << CTL_SHIFT))
......
...@@ -132,17 +132,21 @@ static int sysctl_show_##__type(int fd, \ ...@@ -132,17 +132,21 @@ static int sysctl_show_##__type(int fd, \
GEN_SYSCTL_READ_FUNC(u32, strtoul); GEN_SYSCTL_READ_FUNC(u32, strtoul);
GEN_SYSCTL_READ_FUNC(u64, strtoull); GEN_SYSCTL_READ_FUNC(u64, strtoull);
GEN_SYSCTL_READ_FUNC(s32, strtol);
GEN_SYSCTL_WRITE_FUNC(u32, "%u "); GEN_SYSCTL_WRITE_FUNC(u32, "%u ");
GEN_SYSCTL_WRITE_FUNC(u64, "%"PRIu64" "); GEN_SYSCTL_WRITE_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_WRITE_FUNC(s32, "%d ");
GEN_SYSCTL_PRINT_FUNC(u32, "%u "); GEN_SYSCTL_PRINT_FUNC(u32, "%u ");
GEN_SYSCTL_PRINT_FUNC(u64, "%"PRIu64" "); GEN_SYSCTL_PRINT_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_PRINT_FUNC(char, "%c"); GEN_SYSCTL_PRINT_FUNC(char, "%c");
GEN_SYSCTL_PRINT_FUNC(s32, "%d ");
GEN_SYSCTL_SHOW_FUNC(u32, "%u "); GEN_SYSCTL_SHOW_FUNC(u32, "%u ");
GEN_SYSCTL_SHOW_FUNC(u64, "%"PRIu64" "); GEN_SYSCTL_SHOW_FUNC(u64, "%"PRIu64" ");
GEN_SYSCTL_SHOW_FUNC(char, "%c"); GEN_SYSCTL_SHOW_FUNC(char, "%c");
GEN_SYSCTL_SHOW_FUNC(s32, "%d ");
static int static int
sysctl_write_char(int fd, struct sysctl_req *req, char *arg, int nr) 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) ...@@ -198,6 +202,9 @@ static int __sysctl_op(int dir, struct sysctl_req *req, int op)
case CTL_U32: case CTL_U32:
__SYSCTL_OP(ret, fd, req, u32, nr, op); __SYSCTL_OP(ret, fd, req, u32, nr, op);
break; break;
case CTL_32:
__SYSCTL_OP(ret, fd, req, s32, nr, op);
break;
case __CTL_U64A: case __CTL_U64A:
nr = CTL_LEN(req->type); nr = CTL_LEN(req->type);
case CTL_U64: case CTL_U64:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment