nanosleep() doesn't write remaining time if there's an error - but it's when return value == -1 and errno == EINTR when the remaining time must be written.
Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-12-12 22:01:13.000000000 -0700 +++ qemu/linux-user/syscall.c 2007-12-12 22:08:49.000000000 -0700 @@ -5134,7 +5134,7 @@ if (copy_from_user_timespec(&req, arg1)) goto efault; ret = get_errno(nanosleep(&req, &rem)); - if (!is_error(ret) && arg2) { + if (ret == -TARGET_EINTR && arg2) { if (copy_to_user_timespec(arg2, &rem)) goto efault; }