If DEBUG_ERESTARTSYS is set restart all system calls once.

Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk>
---
 linux-user/syscall.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 04c91fb..80b8fa8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5585,6 +5585,16 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
     struct statfs stfs;
     void *p;
 
+#if defined(DEBUG_ERESTARTSYS) && defined(TARGET_USE_ERESTARTSYS)
+    {
+        static int flag;
+        flag = !flag;
+        if (flag) {
+            return -TARGET_ERESTARTSYS;
+        }
+    }
+#endif
+
 #ifdef DEBUG
     gemu_log("syscall %d", num);
 #endif
-- 
2.1.4


Reply via email to