From 5844f4bc4111248b9de0c2efa422cafcdaa69cf1 Mon Sep 17 00:00:00 2001 From: Filip Bozuta Date: Fri, 19 Jun 2020 14:33:30 +0200 Subject: linux-user: Add strace support for printing arguments of chown()/lchown() This patch implements strace argument printing functionality for syscalls: *chown, lchown - change ownership of a file int chown(const char *pathname, uid_t owner, gid_t group) int lchown(const char *pathname, uid_t owner, gid_t group) man page: https://www.man7.org/linux/man-pages/man2/lchown.2.html Implementation notes: Both syscalls use strings as arguments and thus a separate printing function was stated in "strace.list" for them. Both syscalls share the same number and types of arguments and thus share a same definition in file "syscall.c". This defintion uses existing functions "print_string()" to print the string argument and "print_raw_param()" to print other two arguments that are of basic types. Signed-off-by: Filip Bozuta Reviewed-by: Laurent Vivier Message-Id: <20200619123331.17387-6-filip.bozuta@syrmia.com> Signed-off-by: Laurent Vivier --- linux-user/strace.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux-user/strace.list') diff --git a/linux-user/strace.list b/linux-user/strace.list index a4a8c61969..e99030c9ef 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -71,7 +71,7 @@ { TARGET_NR_chmod, "chmod" , NULL, print_chmod, NULL }, #endif #ifdef TARGET_NR_chown -{ TARGET_NR_chown, "chown" , NULL, NULL, NULL }, +{ TARGET_NR_chown, "chown" , NULL, print_chown, NULL }, #endif #ifdef TARGET_NR_chown32 { TARGET_NR_chown32, "chown32" , NULL, NULL, NULL }, @@ -475,7 +475,7 @@ { TARGET_NR_kill, "kill", NULL, print_kill, NULL }, #endif #ifdef TARGET_NR_lchown -{ TARGET_NR_lchown, "lchown" , NULL, NULL, NULL }, +{ TARGET_NR_lchown, "lchown" , NULL, print_lchown, NULL }, #endif #ifdef TARGET_NR_lchown32 { TARGET_NR_lchown32, "lchown32" , NULL, NULL, NULL }, -- cgit v1.2.3