From d6ef4fe5b252612d44020eecf6e3feb9b8233dd5 Mon Sep 17 00:00:00 2001 From: glebius Date: Thu, 8 Dec 2005 13:33:57 +0000 Subject: Suppress logging about unimplemented syscalls to one time per process. This prevents hard flood of the system console. Reviewed by: bde --- sys/compat/linux/linux_util.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sys/compat') diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 6aad44d..49a535d 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -97,19 +97,17 @@ int linux_emul_convpath(struct thread *, char *, enum uio_seg, char **, int); int \ linux_ ## s(struct thread *td, struct linux_ ## s ## _args *args) \ { \ - return (unimplemented_syscall(td, #s)); \ + static pid_t pid; \ + \ + if (pid != td->td_proc->p_pid) { \ + linux_msg(td, "syscall %s not implemented", #s); \ + pid = td->td_proc->p_pid; \ + }; \ + return (ENOSYS); \ } \ struct __hack void linux_msg(const struct thread *td, const char *fmt, ...) __printflike(2, 3); -static __inline int -unimplemented_syscall(struct thread *td, const char *syscallname) -{ - - linux_msg(td, "syscall %s not implemented", syscallname); - return (ENOSYS); -} - #endif /* !_LINUX_UTIL_H_ */ -- cgit v1.1