summaryrefslogtreecommitdiff
path: root/src/main/command_executor.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-06-01 13:21:05 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2014-06-01 13:21:11 -0400
commit30e1feed2331bb44338363228fe73e82ab7c7c3d (patch)
tree30170fe19642fa5167700dbdc6c636a4497ca6ba /src/main/command_executor.cpp
parent46ef5191d9423fef8078552fe7f5c3ad8f1aea3f (diff)
Fix for Windows builds (rlimit doesn't exist on Windows).
Diffstat (limited to 'src/main/command_executor.cpp')
-rw-r--r--src/main/command_executor.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/command_executor.cpp b/src/main/command_executor.cpp
index 94f9a6100..87836b116 100644
--- a/src/main/command_executor.cpp
+++ b/src/main/command_executor.cpp
@@ -21,20 +21,27 @@
#include "smt/options.h"
-#include <sys/resource.h>
+#ifndef __WIN32__
+# include <sys/resource.h>
+#endif /* ! __WIN32__ */
namespace CVC4 {
namespace main {
-//function to set no limit on CPU time.
-//this is used for competitions while a solution (proof or model) is being dumped.
-void setNoLimitCPU(){
+// Function to cancel any (externally-imposed) limit on CPU time.
+// This is used for competitions while a solution (proof or model)
+// is being dumped (so that we don't give "sat" or "unsat" then get
+// interrupted partway through outputting a proof!).
+void setNoLimitCPU() {
+ // Windows doesn't have these things, just ignore
+#ifndef __WIN32__
struct rlimit rlc;
- int st = getrlimit(RLIMIT_CPU, &rlc );
- if( st==0 ){
+ int st = getrlimit(RLIMIT_CPU, &rlc);
+ if(st == 0) {
rlc.rlim_cur = rlc.rlim_max;
- setrlimit(RLIMIT_CPU, &rlc );
+ setrlimit(RLIMIT_CPU, &rlc);
}
+#endif /* ! __WIN32__ */
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback