From c65fa3dceb2163967bbb7199013e9fccdc6ff46c Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 5 May 2015 09:25:59 -0700 Subject: syscall_emul: fix warn_once behavior The current ignoreWarnOnceFunc doesn't really work as expected, since it will only generate one warning total, for whichever "warn-once" syscall is invoked first. This patch fixes that behavior by keeping a "warned" flag in the SyscallDesc object, allowing suitably flagged syscalls to warn exactly once per syscall. --- src/arch/x86/linux/process.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/arch/x86/linux/process.cc') diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index 9a2bb96b5..ed17d7388 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -231,8 +231,8 @@ static SyscallDesc syscallDescs64[] = { /* 10 */ SyscallDesc("mprotect", ignoreFunc), /* 11 */ SyscallDesc("munmap", munmapFunc), /* 12 */ SyscallDesc("brk", brkFunc), - /* 13 */ SyscallDesc("rt_sigaction", ignoreFunc), - /* 14 */ SyscallDesc("rt_sigprocmask", ignoreFunc), + /* 13 */ SyscallDesc("rt_sigaction", ignoreFunc, SyscallDesc::WarnOnce), + /* 14 */ SyscallDesc("rt_sigprocmask", ignoreFunc, SyscallDesc::WarnOnce), /* 15 */ SyscallDesc("rt_sigreturn", unimplementedFunc), /* 16 */ SyscallDesc("ioctl", ioctlFunc), /* 17 */ SyscallDesc("pread64", unimplementedFunc), @@ -253,7 +253,7 @@ static SyscallDesc syscallDescs64[] = { /* 32 */ SyscallDesc("dup", dupFunc), /* 33 */ SyscallDesc("dup2", unimplementedFunc), /* 34 */ SyscallDesc("pause", unimplementedFunc), - /* 35 */ SyscallDesc("nanosleep", unimplementedFunc), + /* 35 */ SyscallDesc("nanosleep", ignoreFunc, SyscallDesc::WarnOnce), /* 36 */ SyscallDesc("getitimer", unimplementedFunc), /* 37 */ SyscallDesc("alarm", unimplementedFunc), /* 38 */ SyscallDesc("setitimer", unimplementedFunc), -- cgit v1.2.3