| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 #include "bin/io_buffer.h" | 6 #include "bin/io_buffer.h" |
| 7 #include "bin/platform.h" | 7 #include "bin/platform.h" |
| 8 #include "bin/process.h" | 8 #include "bin/process.h" |
| 9 #include "bin/socket.h" | 9 #include "bin/socket.h" |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 | 215 |
| 216 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { | 216 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { |
| 217 int64_t status = 0; | 217 int64_t status = 0; |
| 218 // Ignore result if passing invalid argument and just set exit code to 0. | 218 // Ignore result if passing invalid argument and just set exit code to 0. |
| 219 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 219 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
| 220 Process::SetGlobalExitCode(status); | 220 Process::SetGlobalExitCode(status); |
| 221 } | 221 } |
| 222 | 222 |
| 223 | 223 |
| 224 void FUNCTION_NAME(Process_GetExitCode)(Dart_NativeArguments args) { |
| 225 Dart_SetReturnValue(args, Dart_NewInteger(Process::GlobalExitCode())); |
| 226 } |
| 227 |
| 228 |
| 224 void FUNCTION_NAME(Process_Sleep)(Dart_NativeArguments args) { | 229 void FUNCTION_NAME(Process_Sleep)(Dart_NativeArguments args) { |
| 225 int64_t milliseconds = 0; | 230 int64_t milliseconds = 0; |
| 226 // Ignore result if passing invalid argument and just set exit code to 0. | 231 // Ignore result if passing invalid argument and just set exit code to 0. |
| 227 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &milliseconds); | 232 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &milliseconds); |
| 228 TimerUtils::Sleep(milliseconds); | 233 TimerUtils::Sleep(milliseconds); |
| 229 } | 234 } |
| 230 | 235 |
| 231 | 236 |
| 232 void FUNCTION_NAME(Process_Pid)(Dart_NativeArguments args) { | 237 void FUNCTION_NAME(Process_Pid)(Dart_NativeArguments args) { |
| 233 // Ignore result if passing invalid argument and just set exit code to 0. | 238 // Ignore result if passing invalid argument and just set exit code to 0. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 int external_length = strlen(system_string); | 302 int external_length = strlen(system_string); |
| 298 uint8_t* buffer = NULL; | 303 uint8_t* buffer = NULL; |
| 299 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer); | 304 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer); |
| 300 memmove(buffer, system_string, external_length); | 305 memmove(buffer, system_string, external_length); |
| 301 if (utf8 != system_string) free(const_cast<char*>(system_string)); | 306 if (utf8 != system_string) free(const_cast<char*>(system_string)); |
| 302 Dart_SetReturnValue(args, external_array); | 307 Dart_SetReturnValue(args, external_array); |
| 303 } | 308 } |
| 304 | 309 |
| 305 } // namespace bin | 310 } // namespace bin |
| 306 } // namespace dart | 311 } // namespace dart |
| OLD | NEW |