OLD | NEW |
1 //===--- Unix/Watchdog.inc - Unix Watchdog Implementation -------*- C++ -*-===// | 1 //===--- Unix/Watchdog.inc - Unix Watchdog Implementation -------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file provides the generic Unix implementation of the Watchdog class. | 10 // This file provides the generic Unix implementation of the Watchdog class. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 #ifdef HAVE_UNISTD_H | 14 #ifdef HAVE_UNISTD_H |
15 #include <unistd.h> | 15 #include <unistd.h> |
16 #endif | 16 #endif |
17 | 17 |
18 namespace llvm { | 18 namespace llvm { |
19 namespace sys { | 19 namespace sys { |
20 Watchdog::Watchdog(unsigned int seconds) { | 20 Watchdog::Watchdog(unsigned int seconds) { |
21 #ifdef HAVE_UNISTD_H | 21 #ifdef HAVE_UNISTD_H |
| 22 #ifndef __native_client__ |
22 alarm(seconds); | 23 alarm(seconds); |
| 24 #endif // __native_client__ |
23 #endif | 25 #endif |
24 } | 26 } |
25 | 27 |
26 Watchdog::~Watchdog() { | 28 Watchdog::~Watchdog() { |
27 #ifdef HAVE_UNISTD_H | 29 #ifdef HAVE_UNISTD_H |
| 30 #ifndef __native_client__ |
28 alarm(0); | 31 alarm(0); |
| 32 #endif //__native_client__ |
29 #endif | 33 #endif |
30 } | 34 } |
31 } | 35 } |
32 } | 36 } |
OLD | NEW |