Initial revision
authorroland <roland>
Fri, 3 Apr 1992 00:45:48 +0000 (00:45 +0000)
committerroland <roland>
Fri, 3 Apr 1992 00:45:48 +0000 (00:45 +0000)
mach/shortcut.awk [new file with mode: 0644]

diff --git a/mach/shortcut.awk b/mach/shortcut.awk
new file mode 100644 (file)
index 0000000..5b71c2d
--- /dev/null
@@ -0,0 +1,32 @@
+# Icky intimate knowledge of MiG output.
+
+BEGIN { args=""; argsnext=0; echo=1; }
+
+$NF == rpc \
+  {
+    for (i = 1; i < NF; ++i) printf "%s ", $i;
+    print call;
+    next;
+  }
+
+args == "" && $1 == "#else" { argsnext=1; print $0; next; }
+
+argsnext == 1 { args=$0; }
+
+{ argsnext=0; }
+
+/^{/ { echo=0; }
+
+echo == 1 { print $0; }
+
+/^}/ \
+  {
+    print "{";
+    print "  kern_return_t err;";
+    print "  err = " syscall args ";";
+    print "  if (err == MACH_SEND_INTERRUPTED)";
+    print "    err = " rpc args ";";
+    print "  return err;"
+    print "}";
+    echo = 1;
+  }