File: sparc-clone-lockup

package info (click to toggle)
dump 0.4b47-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,316 kB
  • sloc: ansic: 16,267; sh: 5,138; makefile: 161
file content (28 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (3)
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