Add support for dup()ing fake file descriptors to the simulator.
diff --git a/simulator/wrapsim/Init.c b/simulator/wrapsim/Init.c
index eed650b..3df0efe 100644
--- a/simulator/wrapsim/Init.c
+++ b/simulator/wrapsim/Init.c
@@ -40,6 +40,7 @@
_ws_open64 = dlsym(RTLD_NEXT, "open64");
_ws_close = dlsym(RTLD_NEXT, "close");
+ _ws_dup = dlsym(RTLD_NEXT, "dup");
_ws_read = dlsym(RTLD_NEXT, "read");
_ws_readv = dlsym(RTLD_NEXT, "readv");
_ws_write = dlsym(RTLD_NEXT, "write");
@@ -108,6 +109,8 @@
gWrapSim.fakeFdMap = wsAllocBitVector(kMaxFakeFdCount, 0);
memset(gWrapSim.fakeFdList, 0, sizeof(gWrapSim.fakeFdList));
+ pthread_mutex_init(&gWrapSim.atomicLock, NULL);
+
gWrapSim.numDisplays = 0;
gWrapSim.keyInputDevice = NULL;