#APOUT_OPTIONS?= -DEMU211 -DEMUV1 -DNATIVES -DRUN_V1_RAW \
-DDEBUG -DZERO_MEMORY -DWRITEBASE
# These flags should be fine for most cases
-APOUT_OPTIONS?= -DEMU211 -DEMUv1 -DNATIVES
+APOUT_OPTIONS?= -DEMU211 -DEMUv1 -DNATIVES -DDEBUG
# These flags for speed
#CFLAGS+= -DEMU211 -DNATIVES -DINLINE=inline -O2 -Winline -Wall \
--- /dev/null
+#!/bin/sh
+echo ":apout410:M::\\x08\\x01::`pwd`/apout:" >/proc/sys/fs/binfmt_misc/register
+echo ":apout411:M::\\x09\\x01::`pwd`/apout:" >/proc/sys/fs/binfmt_misc/register
Envp[Envc] = NULL;
if (load_a_out(name, origpath, want_env) == -1) {
+#if 1 // Nick
+ struct stat statbuf;
+ if (stat(name, &statbuf) == 0) {
+ free(origpath); // note: clobbers name
+ if (Argc >= MAX_ARGS)
+ Argv[--Argc] = NULL;
+ for (i = Argc++; i >= 1; --i)
+ Argv[i + 1] = Argv[i];
+ Argv[1] = strdup((char *) &dspace[uarg1]);
+ origpath = "/bin/sh";
+ name = xlate_filename(origpath);
+ if (load_a_out(name, origpath, want_env) != -1)
+ goto ok;
+ }
+#endif
for (Argc--; Argc >= 0; Argc--)
free(Argv[Argc]);
for (Envc--; Envc >= 0; Envc--)
errno = ENOENT;
return (-1);
}
+ free(origpath); // Nick... fix memory leak
+#if 1 // Nick
+ok:
+#endif
run(); /* Ok, so it's recursive, I dislike setjmp */
return (0);
}