Added a kqueue class which isn't being used yet, but was part of trying to work around the limitations with the unix select() call and how it is limited to FD_SETSIZE file descriptors.
Also added a TimeSpecTimeout class which can be used with any calls that take a "struct timespec *" as an argument. It is used by the KQueue class.
Also updated some project settings.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175377 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Utility/TimeSpecTimeout.cpp b/source/Utility/TimeSpecTimeout.cpp
new file mode 100644
index 0000000..33b3b4e
--- /dev/null
+++ b/source/Utility/TimeSpecTimeout.cpp
@@ -0,0 +1,48 @@
+//===--------------------- TimeSpecTimeout.cpp ------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "TimeSpecTimeout.h"
+
+using namespace lldb_private;
+
+const struct timespec *
+TimeSpecTimeout::SetAbsoluteTimeoutMircoSeconds32 (uint32_t timeout_usec)
+{
+ if (timeout_usec == UINT32_MAX)
+ {
+ m_infinite = true;
+ }
+ else
+ {
+ m_infinite = false;
+ TimeValue time_value(TimeValue::Now());
+ time_value.OffsetWithMicroSeconds(timeout_usec);
+ m_timespec = time_value.GetAsTimeSpec();
+ }
+ return GetTimeSpecPtr ();
+}
+
+const struct timespec *
+TimeSpecTimeout::SetRelativeTimeoutMircoSeconds32 (uint32_t timeout_usec)
+{
+ if (timeout_usec == UINT32_MAX)
+ {
+ m_infinite = true;
+ }
+ else
+ {
+ m_infinite = false;
+ TimeValue time_value;
+ time_value.OffsetWithMicroSeconds(timeout_usec);
+ m_timespec = time_value.GetAsTimeSpec();
+ }
+ return GetTimeSpecPtr ();
+}
+
+