OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) |
| 7 |
5 #include "bin/process.h" | 8 #include "bin/process.h" |
6 | 9 |
7 #include <errno.h> | 10 #include <errno.h> // NOLINT |
8 #include <fcntl.h> | 11 #include <fcntl.h> // NOLINT |
9 #include <poll.h> | 12 #include <poll.h> // NOLINT |
10 #include <signal.h> | 13 #include <signal.h> // NOLINT |
11 #include <stdio.h> | 14 #include <stdio.h> // NOLINT |
12 #include <stdlib.h> | 15 #include <stdlib.h> // NOLINT |
13 #include <string.h> | 16 #include <string.h> // NOLINT |
14 #include <sys/wait.h> | 17 #include <sys/wait.h> // NOLINT |
15 #include <unistd.h> | 18 #include <unistd.h> // NOLINT |
16 | 19 |
17 #include "bin/fdutils.h" | 20 #include "bin/fdutils.h" |
18 #include "bin/log.h" | 21 #include "bin/log.h" |
19 #include "bin/thread.h" | 22 #include "bin/thread.h" |
20 | 23 |
21 extern char **environ; | 24 extern char **environ; |
22 | 25 |
23 // ProcessInfo is used to map a process id to the file descriptor for | 26 // ProcessInfo is used to map a process id to the file descriptor for |
24 // the pipe used to communicate the exit code of the process to Dart. | 27 // the pipe used to communicate the exit code of the process to Dart. |
25 // ProcessInfo objects are kept in the static singly-linked | 28 // ProcessInfo objects are kept in the static singly-linked |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 558 |
556 | 559 |
557 void Process::TerminateExitCodeHandler() { | 560 void Process::TerminateExitCodeHandler() { |
558 ExitCodeHandler::TerminateExitCodeThread(); | 561 ExitCodeHandler::TerminateExitCodeThread(); |
559 } | 562 } |
560 | 563 |
561 | 564 |
562 intptr_t Process::CurrentProcessId() { | 565 intptr_t Process::CurrentProcessId() { |
563 return static_cast<intptr_t>(getpid()); | 566 return static_cast<intptr_t>(getpid()); |
564 } | 567 } |
| 568 |
| 569 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |