From e5a1983e4384a44e45486fb9a48bdba375a529b6 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 6 Jun 2023 11:56:21 +0200 Subject: cooker: Draft quality: mknod/mknodat, sets of values with "in" While at it: - directly assign 'fd' in eater from install_filter() - turn op_cmp into a description-style thing Signed-off-by: Stefano Brivio --- cooker/calls/fs.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'cooker/calls') diff --git a/cooker/calls/fs.c b/cooker/calls/fs.c index 013dacf..cfc0091 100644 --- a/cooker/calls/fs.c +++ b/cooker/calls/fs.c @@ -69,27 +69,66 @@ static struct arg mknod_args[] = { { 0, { "path", STRING, 0, - 0, 1 /* TODO: PATH_MAX */, + 0, PATH_MAX, { 0 } } }, { 1, { - "mode", UNDEF /* TODO */, FLAGS, + "mode", U32 /* TODO */, 0, 0, 0, { 0 /* TODO */ }, } }, { 2, { - "major", UNDEF /* TODO */, 0, + "major", GNU_DEV_MAJOR, 0, 0, 0, { 0 }, } }, { 2, { - "minor", UNDEF /* TODO */, 0, + "minor", GNU_DEV_MINOR, 0, + 0, 0, + { 0 }, + } + }, + { 0 } +}; + +static struct arg mknodat_args[] = { + { 0, + { + "dirfd", UNDEF, 0, + 0, 1 /* TODO: PATH_MAX */, + { 0 } + } + }, + { 1, + { + "path", STRING, 0, + 0, PATH_MAX, + { 0 } + } + }, + { 2, + { + "mode", UNDEF /* TODO */, FLAGS, + 0, 0, + { 0 /* TODO */ }, + } + }, + { 3, + { + "major", GNU_DEV_MAJOR, 0, + 0, 0, + { 0 }, + } + }, + { 3, + { + "minor", GNU_DEV_MINOR, 0, 0, 0, { 0 }, } @@ -99,5 +138,6 @@ static struct arg mknod_args[] = { struct call syscalls_fs[] = { { __NR_mknod, "mknod", mknod_args }, + { __NR_mknodat, "mknodat", mknodat_args }, { 0 }, }; -- cgit v1.2.3