fd: Implement managed file descriptor support

Change-Id: I0c5c438aa2c31ae52e115951b3fb1e85df182fd1
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/fd/dupable.cpp b/test/fd/dupable.cpp
new file mode 100644
index 0000000..2b34f9f
--- /dev/null
+++ b/test/fd/dupable.cpp
@@ -0,0 +1,14 @@
+#include <gtest/gtest.h>
+#include <stdplus/fd/dupable.hpp>
+
+namespace stdplus
+{
+namespace fd
+{
+
+TEST(DupableFd, Noop)
+{
+}
+
+} // namespace fd
+} // namespace stdplus
diff --git a/test/fd/impl.cpp b/test/fd/impl.cpp
new file mode 100644
index 0000000..f2336f5
--- /dev/null
+++ b/test/fd/impl.cpp
@@ -0,0 +1,14 @@
+#include <gtest/gtest.h>
+#include <stdplus/fd/impl.hpp>
+
+namespace stdplus
+{
+namespace fd
+{
+
+TEST(DupableFd, Noop)
+{
+}
+
+} // namespace fd
+} // namespace stdplus
diff --git a/test/fd/intf.cpp b/test/fd/intf.cpp
new file mode 100644
index 0000000..d4cc8c2
--- /dev/null
+++ b/test/fd/intf.cpp
@@ -0,0 +1,4 @@
+#include <stdplus/fd/intf.hpp>
+int main(int, char*[])
+{
+}
diff --git a/test/fd/managed.cpp b/test/fd/managed.cpp
new file mode 100644
index 0000000..003c4e3
--- /dev/null
+++ b/test/fd/managed.cpp
@@ -0,0 +1,14 @@
+#include <gtest/gtest.h>
+#include <stdplus/fd/managed.hpp>
+
+namespace stdplus
+{
+namespace fd
+{
+
+TEST(DupableFd, Noop)
+{
+}
+
+} // namespace fd
+} // namespace stdplus
diff --git a/test/fd/mock.cpp b/test/fd/mock.cpp
new file mode 100644
index 0000000..0cc6dfd
--- /dev/null
+++ b/test/fd/mock.cpp
@@ -0,0 +1,12 @@
+#include <gtest/gtest.h>
+#include <stdplus/fd/gmock.hpp>
+
+namespace stdplus
+{
+
+TEST(Mock, Instantiate)
+{
+    FdMock fd;
+}
+
+} // namespace stdplus
diff --git a/test/fd/ops.cpp b/test/fd/ops.cpp
new file mode 100644
index 0000000..2d52101
--- /dev/null
+++ b/test/fd/ops.cpp
@@ -0,0 +1,17 @@
+#include <gtest/gtest.h>
+#include <stdplus/fd/ops.hpp>
+
+namespace stdplus
+{
+namespace fd
+{
+
+TEST(Flags, Flags)
+{
+    FdFlags f = FdFlags(0).set(FdFlag::CloseOnExec).unset(FdFlag::CloseOnExec);
+    f.set(FdFlag::CloseOnExec).unset(FdFlag::CloseOnExec);
+    EXPECT_EQ(0, static_cast<int>(f));
+}
+
+} // namespace fd
+} // namespace stdplus