1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
--- a/dump/tape.c
+++ b/dump/tape.c
@@ -738,7 +738,24 @@ rollforward(void)
pid_t
fork_clone_io(void)
{
- return syscall(SYS_clone, CLONE_ARGS);
+ pid_t res,parent;
+ parent=getppid(); /* az hackety hack... */
+
+ res=syscall(SYS_clone, CLONE_ARGS);
+ getppid();
+ /* as per clone call manpage: caching! */
+ getpid();
+#ifdef __alpha__
+ syscall(SYS_getxpid);
+#else
+ syscall(SYS_getpid);
+#endif
+
+ /* az: clone manpage doesn't say jack about what the
+ child receives, but it's NOT ZERO on sparc. however, it seems the
+ ppid is updated and trustworthy - so let's use that... */
+ return parent==getppid()?res:0;
+
}
#endif
#endif
|