Removed linux_code
Change-Id: I7327828d2c9efdf03172d1b90f49d5c51fbba86e
diff --git a/aos/core.cc b/aos/core.cc
new file mode 100644
index 0000000..3af3270
--- /dev/null
+++ b/aos/core.cc
@@ -0,0 +1,32 @@
+#include <sys/wait.h>
+#include <sys/select.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <string>
+
+#include "aos/init.h"
+#include "aos/util/run_command.h"
+
+// Initializes shared memory. This is the only file that will create the shared
+// memory file if it doesn't already exist (and set everything up).
+//
+// Will also touch the file given as a first argument.
+
+int main(int argc, char **argv) {
+ aos::InitCreate();
+
+ if (argc > 1) {
+ const int result = ::aos::util::RunCommand(
+ (std::string("touch '") + argv[1] + "'").c_str());
+ if (result == -1 || !WIFEXITED(result) || WEXITSTATUS(result) != 0) {
+ fprintf(stderr, "`touch '%s'` failed; result = %x\n", argv[1], result);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ select(0, NULL, NULL, NULL, NULL); // wait forever
+ aos::Cleanup();
+}