]> sipb.mit.edu Git - snippets/.git/blobdiff - programming/gccrun
programming: Sync gccrun and disasm from my locker (oops)
[snippets/.git] / programming / gccrun
index 55e6b680b23ac29dedf57b08346769f907379d21..52419311b470c43282c23e3aa336d57345cadc22 100755 (executable)
@@ -18,6 +18,8 @@ cat > "$f/command.c" << EOF
 #include <sys/mman.h>
 #include <sys/ptrace.h>
 #include <sys/syscall.h>
+#include <arpa/inet.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
@@ -28,15 +30,16 @@ cat > "$f/command.c" << EOF
 int
 main(int argc, char *argv[], char *envp[])
 {
-       $@;
+       $1;
        return 0;
 }
 EOF
-if ! gcc -o "$f/command" "$f/command.c"; then
+shift
+if ! gcc -o "$f/command" "$f/command.c" $@; then
     exit 1
 fi
 if [ -n "$wrapper" ]; then
-    "$wrapper" "$f/command"
+    $wrapper "$f/command"
 else
     "$f/command"
 fi