| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #if !defined(DART_IO_DISABLED) | 5 #if !defined(DART_IO_DISABLED) |
| 6 | 6 |
| 7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
| 8 #if defined(TARGET_OS_FUCHSIA) | 8 #if defined(TARGET_OS_FUCHSIA) |
| 9 | 9 |
| 10 #include "bin/process.h" | 10 #include "bin/process.h" |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 mx_status_t status = | 733 mx_status_t status = |
| 734 mx_handle_duplicate(mx_job_default(), MX_RIGHT_SAME_RIGHTS, &job); | 734 mx_handle_duplicate(mx_job_default(), MX_RIGHT_SAME_RIGHTS, &job); |
| 735 if (status != NO_ERROR) { | 735 if (status != NO_ERROR) { |
| 736 mx_handle_close(binary_vmo); | 736 mx_handle_close(binary_vmo); |
| 737 } | 737 } |
| 738 CHECK_FOR_ERROR(status, "mx_handle_duplicate"); | 738 CHECK_FOR_ERROR(status, "mx_handle_duplicate"); |
| 739 | 739 |
| 740 // Set up the launchpad. | 740 // Set up the launchpad. |
| 741 launchpad_t* lp = NULL; | 741 launchpad_t* lp = NULL; |
| 742 launchpad_create(job, program_arguments_[0], &lp); | 742 launchpad_create(job, program_arguments_[0], &lp); |
| 743 launchpad_arguments(lp, program_arguments_count_, program_arguments_); | 743 launchpad_set_args(lp, program_arguments_count_, program_arguments_); |
| 744 launchpad_environ(lp, program_environment_); | 744 launchpad_set_environ(lp, program_environment_); |
| 745 launchpad_clone_mxio_root(lp); | 745 launchpad_clone(lp, LP_CLONE_MXIO_ROOT); |
| 746 // TODO(zra): Use the supplied working directory when launchpad adds an | 746 // TODO(zra): Use the supplied working directory when launchpad adds an |
| 747 // API to set it. | 747 // API to set it. |
| 748 launchpad_clone_mxio_cwd(lp); | 748 launchpad_clone(lp, LP_CLONE_MXIO_CWD); |
| 749 launchpad_add_pipe(lp, &write_out_, 0); | 749 launchpad_add_pipe(lp, &write_out_, 0); |
| 750 launchpad_add_pipe(lp, &read_in_, 1); | 750 launchpad_add_pipe(lp, &read_in_, 1); |
| 751 launchpad_add_pipe(lp, &read_err_, 2); | 751 launchpad_add_pipe(lp, &read_err_, 2); |
| 752 launchpad_add_vdso_vmo(lp); | 752 launchpad_add_vdso_vmo(lp); |
| 753 launchpad_elf_load(lp, binary_vmo); | 753 launchpad_elf_load(lp, binary_vmo); |
| 754 launchpad_load_vdso(lp, MX_HANDLE_INVALID); | 754 launchpad_load_vdso(lp, MX_HANDLE_INVALID); |
| 755 *launchpad = lp; | 755 *launchpad = lp; |
| 756 return NO_ERROR; | 756 return NO_ERROR; |
| 757 } | 757 } |
| 758 | 758 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 void Process::ClearSignalHandler(intptr_t signal) { | 815 void Process::ClearSignalHandler(intptr_t signal) { |
| 816 UNIMPLEMENTED(); | 816 UNIMPLEMENTED(); |
| 817 } | 817 } |
| 818 | 818 |
| 819 } // namespace bin | 819 } // namespace bin |
| 820 } // namespace dart | 820 } // namespace dart |
| 821 | 821 |
| 822 #endif // defined(TARGET_OS_FUCHSIA) | 822 #endif // defined(TARGET_OS_FUCHSIA) |
| 823 | 823 |
| 824 #endif // !defined(DART_IO_DISABLED) | 824 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |