OLD | NEW |
1 /* Copyright (c) 2014 Google Inc. All rights reserved. | 1 /* Copyright (c) 2014 Google Inc. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. */ | 3 * found in the LICENSE file. */ |
4 | 4 |
5 #include <python2.7/Python.h> | 5 #include <python2.7/Python.h> |
6 #include <libtar.h> | 6 #include <libtar.h> |
7 #include <locale.h> | 7 #include <locale.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <sys/mount.h> | 10 #include <sys/mount.h> |
11 #include <errno.h> | 11 #include <errno.h> |
12 | 12 |
13 #include "ppapi/cpp/var.h" | 13 #include "ppapi/cpp/var.h" |
14 #include "ppapi/cpp/var_array.h" | 14 #include "ppapi/cpp/var_array.h" |
15 #include "ppapi/cpp/var_dictionary.h" | 15 #include "ppapi/cpp/var_dictionary.h" |
16 #include "ppapi_simple/ps_interface.h" | 16 #include "ppapi_simple/ps_interface.h" |
17 | 17 |
18 #include "nacl_io/nacl_io.h" | 18 #include "nacl_io/nacl_io.h" |
19 #include "ppapi_simple/ps_main.h" | 19 #include "ppapi_simple/ps_main.h" |
20 #include "ppapi_simple/ps_instance.h" | 20 #include "ppapi_simple/ps_instance.h" |
21 | 21 |
22 #ifdef __pnacl__ | 22 #ifdef __pnacl__ |
23 #define DATA_FILE "pydata_pnacl.tar" | 23 #define DATA_FILE "pydata_pnacl.tar" |
24 #else | 24 #else |
25 #error "Unknown arch" | 25 #error "Unknown arch" |
26 #endif | 26 #endif |
27 | 27 |
28 /* TODO(bradnelson): Switch ipython to use cli_main and drop this. */ | 28 /* TODO(bradnelson): Switch ipython to use cli_main and drop this. */ |
29 int nacl_spawn_pid = -1; | |
30 int nacl_spawn_ppid = -1; | |
31 | 29 |
32 static int setup_unix_environment() { | 30 static int setup_unix_environment() { |
33 int ret = umount("/"); | 31 int ret = umount("/"); |
34 if (ret) { | 32 if (ret) { |
35 printf("unmounting root fs failed\n"); | 33 printf("unmounting root fs failed\n"); |
36 return 1; | 34 return 1; |
37 } | 35 } |
38 | 36 |
39 ret = mount("", "/", "memfs", 0, NULL); | 37 ret = mount("", "/", "memfs", 0, NULL); |
40 if (ret) { | 38 if (ret) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 176 |
179 quit = PyRun_SimpleFileEx(main, main_filename, 1); | 177 quit = PyRun_SimpleFileEx(main, main_filename, 1); |
180 | 178 |
181 Py_Finalize(); | 179 Py_Finalize(); |
182 } | 180 } |
183 | 181 |
184 return 0; | 182 return 0; |
185 } | 183 } |
186 | 184 |
187 PPAPI_SIMPLE_REGISTER_MAIN(ipython_kernel_main) | 185 PPAPI_SIMPLE_REGISTER_MAIN(ipython_kernel_main) |
OLD | NEW |