Add support for dup()ing fake file descriptors to the simulator.
diff --git a/simulator/wrapsim/Util.c b/simulator/wrapsim/Util.c
new file mode 100644
index 0000000..33d903b
--- /dev/null
+++ b/simulator/wrapsim/Util.c
@@ -0,0 +1,13 @@
+
+#include "Common.h"
+
+int wsAtomicAdd(int *var, int val)
+{
+    int cc;
+    int ret;
+    cc = pthread_mutex_lock(&gWrapSim.atomicLock);
+    ret = *var;
+    *var = *var + val;
+    cc = pthread_mutex_unlock(&gWrapSim.atomicLock);
+    return ret;
+}