update a bit
authorHajime Tazaki <tazaki@nict.go.jp>
Mon, 06 Aug 2012 20:45:50 +0900
changeset 257d5166e0dc25
parent 24 02787e1dfd96
child 26 0fca5307fd86
update a bit
120410-dce-umip-support.patch
dce_macro_alt.patch
dce_test_improve.patch
fedora8-nontimerfd.patch
series
     1.1 --- a/120410-dce-umip-support.patch	Wed Jul 04 17:06:26 2012 +0900
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,528 +0,0 @@
     1.4 -support umip(mip6d) with ns-3-linux for NEMO/MIP6
     1.5 -
     1.6 -diff -r d540b4660837 model/dce-fd.cc
     1.7 ---- a/model/dce-fd.cc	Fri Jun 29 14:47:27 2012 +0900
     1.8 -+++ b/model/dce-fd.cc	Fri Jun 29 18:26:32 2012 +0900
     1.9 -@@ -367,11 +367,30 @@
    1.10 -     }
    1.11 - 
    1.12 -   UnixFd *socket = factory->CreateSocket (domain, type, protocol);
    1.13 -+  if (!socket)
    1.14 -+    return -1;
    1.15 -   socket->IncFdCount ();
    1.16 -   current->process->openFiles[fd] = new FileUsage (fd, socket);
    1.17 - 
    1.18 -   return fd;
    1.19 - }
    1.20 -+int dce_socketpair (int domain, int type, int protocol, int sv[2])
    1.21 -+{
    1.22 -+  sv[0] = dce_socket (domain, type, protocol);
    1.23 -+  if (sv[0] < 0)
    1.24 -+    {
    1.25 -+      return -1;
    1.26 -+    }
    1.27 -+
    1.28 -+  sv[1] = dce_socket (domain, type, protocol);
    1.29 -+  if (sv[1] < 0)
    1.30 -+    {
    1.31 -+      return -1;
    1.32 -+    }
    1.33 -+
    1.34 -+  return 0;
    1.35 -+}
    1.36 -+
    1.37 - int dce_bind (int fd, const struct sockaddr *my_addr, socklen_t addrlen)
    1.38 - {
    1.39 -   Thread *current = Current ();
    1.40 -diff -r d540b4660837 model/dce-manager.cc
    1.41 ---- a/model/dce-manager.cc	Fri Jun 29 14:47:27 2012 +0900
    1.42 -+++ b/model/dce-manager.cc	Fri Jun 29 18:26:32 2012 +0900
    1.43 -@@ -1096,6 +1096,22 @@
    1.44 -           libpthread_setup = (void (*)(const struct Libc *))(symbol);
    1.45 -           libpthread_setup (libc);
    1.46 - 
    1.47 -+          h = ld->Load ("librt-ns3.so", RTLD_GLOBAL);
    1.48 -+          if (h == 0)
    1.49 -+            {
    1.50 -+              err = ENOMEM;
    1.51 -+              return 0;
    1.52 -+            }
    1.53 -+          symbol = ld->Lookup (h, "librt_setup");
    1.54 -+          if (symbol == 0)
    1.55 -+            {
    1.56 -+              NS_FATAL_ERROR ("This is not our fake librt !");
    1.57 -+            }
    1.58 -+          // construct librt now
    1.59 -+          void (*librt_setup)(const struct Libc *fn);
    1.60 -+          librt_setup = (void (*)(const struct Libc *))(symbol);
    1.61 -+          librt_setup (libc);
    1.62 -+
    1.63 -           // finally, call into 'main'.
    1.64 -           h = ld->Load (filename, RTLD_GLOBAL);
    1.65 - 
    1.66 -diff -r d540b4660837 model/dce-poll.cc
    1.67 ---- a/model/dce-poll.cc	Fri Jun 29 14:47:27 2012 +0900
    1.68 -+++ b/model/dce-poll.cc	Fri Jun 29 18:26:32 2012 +0900
    1.69 -@@ -180,7 +180,12 @@
    1.70 -         }
    1.71 -     }
    1.72 -   nfds = eventByFd.size ();
    1.73 --  if (nfds == 0)
    1.74 -+
    1.75 -+  // select(2): 
    1.76 -+  // Some  code  calls  select() with all three sets empty, nfds zero, and a
    1.77 -+  // non-NULL timeout as a fairly portable way to sleep with subsecond 
    1.78 -+  // precision.
    1.79 -+  if (nfds == 0 && !timeout)
    1.80 -     {
    1.81 -       current->err = EINVAL;
    1.82 -       return -1;
    1.83 -diff -r d540b4660837 model/dce-signal.cc
    1.84 ---- a/model/dce-signal.cc	Fri Jun 29 14:47:27 2012 +0900
    1.85 -+++ b/model/dce-signal.cc	Fri Jun 29 18:26:32 2012 +0900
    1.86 -@@ -3,6 +3,7 @@
    1.87 - #include "process.h"
    1.88 - #include "ns3/log.h"
    1.89 - #include "ns3/assert.h"
    1.90 -+#include "waiter.h"
    1.91 - #include <vector>
    1.92 - #include <errno.h>
    1.93 - 
    1.94 -@@ -98,6 +99,17 @@
    1.95 - 
    1.96 -   return 0;
    1.97 - }
    1.98 -+
    1.99 -+int dce_sigwait (const sigset_t *set, int *sig)
   1.100 -+{
   1.101 -+  int ret = 0;
   1.102 -+
   1.103 -+  Waiter waiter;
   1.104 -+  waiter.SetTimeout (Seconds (0.0));
   1.105 -+  waiter.WaitDoSignal ();
   1.106 -+
   1.107 -+  return ret;
   1.108 -+}
   1.109 - int dce_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
   1.110 - {
   1.111 -   Thread *current = Current ();
   1.112 -diff -r d540b4660837 model/dce-signal.h
   1.113 ---- a/model/dce-signal.h	Fri Jun 29 14:47:27 2012 +0900
   1.114 -+++ b/model/dce-signal.h	Fri Jun 29 18:26:32 2012 +0900
   1.115 -@@ -17,6 +17,7 @@
   1.116 - int dce_pthread_kill (pthread_t thread, int sig);
   1.117 - void dce_abort ();
   1.118 - int dce_sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
   1.119 -+int dce_sigwait (const sigset_t *set, int *sig);
   1.120 - 
   1.121 - #ifdef __cplusplus
   1.122 - }
   1.123 -diff -r d540b4660837 model/dce-string.cc
   1.124 ---- a/model/dce-string.cc	Fri Jun 29 14:47:27 2012 +0900
   1.125 -+++ b/model/dce-string.cc	Fri Jun 29 18:26:32 2012 +0900
   1.126 -@@ -26,3 +26,9 @@
   1.127 -   /// \todo Do actual checking
   1.128 -   strcpy (__dest, __src); 
   1.129 - }
   1.130 -+
   1.131 -+char *dce_strrchr(char *s, int c)
   1.132 -+{
   1.133 -+  return strrchr (s, c);
   1.134 -+}
   1.135 -+
   1.136 -diff -r d540b4660837 model/dce-string.h
   1.137 ---- a/model/dce-string.h	Fri Jun 29 14:47:27 2012 +0900
   1.138 -+++ b/model/dce-string.h	Fri Jun 29 18:26:32 2012 +0900
   1.139 -@@ -12,6 +12,7 @@
   1.140 - char *dce___strcpy_chk (char *__restrict __dest,
   1.141 - 						const char *__restrict __src,
   1.142 - 						size_t __destlen);
   1.143 -+char *dce_strrchr(char *s, int c);
   1.144 - 
   1.145 - #ifdef __cplusplus
   1.146 - }
   1.147 -diff -r d540b4660837 model/dce-time.cc
   1.148 ---- a/model/dce-time.cc	Fri Jun 29 14:47:27 2012 +0900
   1.149 -+++ b/model/dce-time.cc	Fri Jun 29 18:26:32 2012 +0900
   1.150 -@@ -54,3 +54,12 @@
   1.151 - 
   1.152 -   return asctime_r (tm, Current ()->process->asctime_result);
   1.153 - }
   1.154 -+
   1.155 -+int dce_clock_gettime(clockid_t which_clock, struct timespec *tp)
   1.156 -+{
   1.157 -+  NS_LOG_FUNCTION (Current () << UtilsGetNodeId ());
   1.158 -+  NS_ASSERT (Current () != 0);
   1.159 -+  NS_ASSERT (tp != 0);
   1.160 -+  *tp = UtilsTimeToTimespec (UtilsSimulationTimeToTime (Now ()));
   1.161 -+  return 0;
   1.162 -+}
   1.163 -diff -r d540b4660837 model/dce-time.h
   1.164 ---- a/model/dce-time.h	Fri Jun 29 14:47:27 2012 +0900
   1.165 -+++ b/model/dce-time.h	Fri Jun 29 18:26:32 2012 +0900
   1.166 -@@ -3,6 +3,7 @@
   1.167 - 
   1.168 - #include "sys/dce-time.h"
   1.169 - #include <time.h>
   1.170 -+#include <sys/sysinfo.h>
   1.171 - 
   1.172 - #ifdef __cplusplus
   1.173 - extern "C" {
   1.174 -@@ -13,6 +14,8 @@
   1.175 - struct tm *dce_localtime(const time_t *timep);
   1.176 - char *dce_ctime(const time_t *timep);
   1.177 - char *dce_asctime(const struct tm *tm);
   1.178 -+int dce_clock_gettime(clockid_t which_clock, struct timespec *tp);
   1.179 -+int dce_sysinfo (struct sysinfo *info);
   1.180 - 	
   1.181 - #ifdef __cplusplus
   1.182 - }
   1.183 -diff -r d540b4660837 model/dce.cc
   1.184 ---- a/model/dce.cc	Fri Jun 29 14:47:27 2012 +0900
   1.185 -+++ b/model/dce.cc	Fri Jun 29 18:26:32 2012 +0900
   1.186 -@@ -22,6 +22,8 @@
   1.187 - #include <getopt.h>
   1.188 - #include <limits.h>
   1.189 - #include <fcntl.h>
   1.190 -+#include <net/if.h>
   1.191 -+#include <sys/ioctl.h>
   1.192 - #include "dce-random.h"
   1.193 - #include "net/dce-if.h"
   1.194 - #include "ns3/node.h"
   1.195 -@@ -30,6 +32,7 @@
   1.196 - #include "ns3/names.h"
   1.197 - #include "ns3/random-variable.h"
   1.198 - #include "ns3/ipv4-l3-protocol.h"
   1.199 -+#include "socket-fd-factory.h"
   1.200 - 
   1.201 - NS_LOG_COMPONENT_DEFINE ("Dce");
   1.202 - 
   1.203 -@@ -639,20 +642,60 @@
   1.204 - }
   1.205 - unsigned dce_if_nametoindex (const char *ifname)
   1.206 - {
   1.207 --  int index = 0;
   1.208 --  Ptr<Node> node = Current ()->process->manager->GetObject<Node> ();
   1.209 --  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
   1.210 -+  Thread *current = Current ();
   1.211 -+  Ptr<SocketFdFactory> factory = 0;
   1.212 -+  factory = current->process->manager->GetObject<SocketFdFactory> ();
   1.213 - 
   1.214 --  for (uint32_t i = 0; i < node->GetNDevices (); ++i)
   1.215 -+  if (factory->GetInstanceTypeId () == TypeId::LookupByName ("ns3::LinuxSocketFdFactory"))
   1.216 -     {
   1.217 --      Ptr<NetDevice> dev = node->GetDevice (i);
   1.218 --      if (ifname == Names::FindName (dev))
   1.219 -+      struct ifreq ifr;
   1.220 -+      int fd = dce_socket (AF_INET, SOCK_DGRAM, 0);
   1.221 -+      if (fd < 0)
   1.222 -         {
   1.223 --          index = ipv4->GetInterfaceForDevice (dev);
   1.224 --          return index;
   1.225 -+          return 0;
   1.226 -         }
   1.227 -+
   1.228 -+      strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
   1.229 -+      if (dce_ioctl (fd, SIOCGIFINDEX, (char *)&ifr) < 0)
   1.230 -+        {
   1.231 -+          current->err = errno;
   1.232 -+          return -1;
   1.233 -+        }
   1.234 -+      return ifr.ifr_ifindex;
   1.235 -     }
   1.236 --  return 0;
   1.237 -+  else
   1.238 -+    {
   1.239 -+      int index = 0;
   1.240 -+      Ptr<Node> node = Current ()->process->manager->GetObject<Node> ();
   1.241 -+      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
   1.242 -+
   1.243 -+      for (uint32_t i = 0; i < node->GetNDevices (); ++i)
   1.244 -+        {
   1.245 -+          Ptr<NetDevice> dev = node->GetDevice (i);
   1.246 -+          if (ifname == Names::FindName (dev))
   1.247 -+            {
   1.248 -+              index = ipv4->GetInterfaceForDevice (dev);
   1.249 -+              return index;
   1.250 -+            }
   1.251 -+        }
   1.252 -+      return 0;
   1.253 -+    }
   1.254 -+}
   1.255 -+char *dce_if_indextoname (unsigned ifindex, char *ifname)
   1.256 -+{
   1.257 -+  struct ifreq ifr;
   1.258 -+  int fd = dce_socket (AF_INET, SOCK_DGRAM, 0);
   1.259 -+  if (fd < 0)
   1.260 -+    {
   1.261 -+      return 0;
   1.262 -+    }
   1.263 -+
   1.264 -+  ifr.ifr_ifindex = ifindex;
   1.265 -+  if (dce_ioctl (fd, SIOCGIFNAME, (char *)&ifr) < 0)
   1.266 -+    {
   1.267 -+      return 0;
   1.268 -+    }
   1.269 -+  return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
   1.270 - }
   1.271 - pid_t dce_fork (void)
   1.272 - {
   1.273 -@@ -849,6 +892,21 @@
   1.274 -   static char loc[] = "";
   1.275 -   return loc;
   1.276 - }
   1.277 -+int dce_sysinfo (struct sysinfo *info)
   1.278 -+{
   1.279 -+  Thread *current = Current ();
   1.280 -+  NS_LOG_FUNCTION (current << UtilsGetNodeId ());
   1.281 -+  NS_ASSERT (current != 0);
   1.282 -+  if (!info)
   1.283 -+    {
   1.284 -+      current->err = ENAMETOOLONG;
   1.285 -+      return -1;
   1.286 -+    }
   1.287 -+
   1.288 -+  info->uptime = (long)UtilsSimulationTimeToTime (Now ()).GetSeconds ();
   1.289 -+  // XXX
   1.290 -+  return 0;
   1.291 -+}
   1.292 - #ifdef HAVE_GETCPUFEATURES
   1.293 - extern "C"
   1.294 - {
   1.295 -diff -r d540b4660837 model/elf-cache.cc
   1.296 ---- a/model/elf-cache.cc	Fri Jun 29 14:47:27 2012 +0900
   1.297 -+++ b/model/elf-cache.cc	Fri Jun 29 18:26:32 2012 +0900
   1.298 -@@ -26,6 +26,9 @@
   1.299 -   overriden.from = "libpthread.so.0";
   1.300 -   overriden.to = "libpthread-ns3.so";
   1.301 -   m_overriden.push_back (overriden);
   1.302 -+  overriden.from = "librt.so.1";
   1.303 -+  overriden.to = "librt-ns3.so";
   1.304 -+  m_overriden.push_back (overriden);
   1.305 - }
   1.306 - 
   1.307 - std::string
   1.308 -diff -r d540b4660837 model/libc-ns3.h
   1.309 ---- a/model/libc-ns3.h	Fri Jun 29 14:47:27 2012 +0900
   1.310 -+++ b/model/libc-ns3.h	Fri Jun 29 18:26:32 2012 +0900
   1.311 -@@ -124,7 +124,8 @@
   1.312 - NATIVE (strcspn)
   1.313 - NATIVE (strspn)
   1.314 - NATIVE_EXPLICIT (strchr, char* (*) (char *, int))
   1.315 --NATIVE_EXPLICIT (strrchr, char * (*) (char *, int))
   1.316 -+NATIVE_EXPLICIT (strrchr, const char * (*) (const char *, int))
   1.317 -+//DCE (strrchr)
   1.318 - NATIVE (strcasecmp)
   1.319 - NATIVE (strncasecmp)
   1.320 - DCE_WITH_ALIAS (strdup) // because C++ defines both const and non-const functions
   1.321 -@@ -149,6 +150,7 @@
   1.322 - NATIVE (htons)
   1.323 - NATIVE (ntohl)
   1.324 - NATIVE (ntohs)
   1.325 -+NATIVE (lockf)
   1.326 - NATIVE (inet_aton)
   1.327 - NATIVE (inet_addr)
   1.328 - NATIVE (inet_network)
   1.329 -@@ -158,9 +160,11 @@
   1.330 - NATIVE (inet_netof)
   1.331 - DCE (inet_ntop)
   1.332 - NATIVE (inet_pton)
   1.333 -+NATIVE (inet6_opt_find)
   1.334 - 
   1.335 - // SYS/SOCKET.H
   1.336 - DCE (socket)
   1.337 -+DCE (socketpair)
   1.338 - DCE (getsockname)
   1.339 - DCE (getpeername)
   1.340 - DCE (bind)
   1.341 -@@ -312,7 +316,8 @@
   1.342 - NATIVE_WITH_ALIAS2 (gmtime_r, localtime_r)
   1.343 - NATIVE (mktime)
   1.344 - NATIVE (strftime)
   1.345 --NATIVE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime) // this is wrong. clock should be changed to DCE implementation
   1.346 -+//DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
   1.347 -+DCE (clock_gettime)
   1.348 - 
   1.349 - // SYS/TIME.H
   1.350 - DCE (gettimeofday)
   1.351 -@@ -320,6 +325,8 @@
   1.352 - DCE (setitimer)
   1.353 - DCE (getitimer)
   1.354 - 
   1.355 -+DCE (sysinfo)
   1.356 -+
   1.357 - // SYS/MAP.H
   1.358 - DCE (mmap)
   1.359 - DCE (mmap64)
   1.360 -@@ -347,6 +354,7 @@
   1.361 - NATIVE (sigdelset)
   1.362 - NATIVE (sigismember)
   1.363 - DCE (sigprocmask)
   1.364 -+DCE    (sigwait)
   1.365 - 
   1.366 - // PTHREAD.H
   1.367 - DCE (pthread_create)
   1.368 -@@ -377,6 +385,13 @@
   1.369 - DCE (pthread_cond_wait)
   1.370 - DCE (pthread_condattr_destroy)
   1.371 - DCE (pthread_condattr_init)
   1.372 -+NATIVE (pthread_rwlock_init)
   1.373 -+NATIVE (pthread_rwlock_unlock)
   1.374 -+NATIVE (pthread_rwlock_wrlock)
   1.375 -+NATIVE (pthread_rwlock_rdlock)
   1.376 -+NATIVE (pthread_rwlock_destroy)
   1.377 -+NATIVE (pthread_setcancelstate)
   1.378 -+NATIVE (pthread_sigmask)
   1.379 - 
   1.380 - // SEMAPHORE.H
   1.381 - DCE (sem_init)
   1.382 -@@ -420,6 +435,7 @@
   1.383 - 
   1.384 - // NET/IF.H
   1.385 - DCE (if_nametoindex)
   1.386 -+DCE (if_indextoname)
   1.387 - 
   1.388 - // DIRENT.H
   1.389 - DCE (opendir)
   1.390 -@@ -479,6 +495,7 @@
   1.391 - 
   1.392 - // NETINET/ETHER.H
   1.393 - NATIVE (ether_aton_r)
   1.394 -+NATIVE (ether_aton)
   1.395 - 
   1.396 - ///////////////////// END OF INVENTAIRE //////////////////////////////////////////////////
   1.397 - 
   1.398 -diff -r d540b4660837 model/librt-ns3.version
   1.399 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.400 -+++ b/model/librt-ns3.version	Fri Jun 29 18:26:32 2012 +0900
   1.401 -@@ -0,0 +1,4 @@
   1.402 -+NS3 {
   1.403 -+global:
   1.404 -+	librt_setup;
   1.405 -+};
   1.406 -diff -r d540b4660837 model/linux-socket-fd-factory.cc
   1.407 ---- a/model/linux-socket-fd-factory.cc	Fri Jun 29 14:47:27 2012 +0900
   1.408 -+++ b/model/linux-socket-fd-factory.cc	Fri Jun 29 18:26:32 2012 +0900
   1.409 -@@ -466,6 +466,7 @@
   1.410 - void
   1.411 - LinuxSocketFdFactory::SetTask (std::string path, std::string value)
   1.412 - {
   1.413 -+  NS_LOG_FUNCTION (path << value);
   1.414 -   std::vector<std::pair<std::string,struct SimSysFile *> > files = GetSysFileList ();
   1.415 -   for (uint32_t i = 0; i < files.size (); i++)
   1.416 -     {
   1.417 -@@ -539,6 +540,7 @@
   1.418 -                                                       this));
   1.419 -   Set (".net.ipv4.conf.all.forwarding", "1");
   1.420 -   Set (".net.ipv4.conf.all.log_martians", "1");
   1.421 -+  Set (".net.ipv6.conf.all.forwarding", "0");
   1.422 - 
   1.423 -   while (!m_earlySysfs.empty ())
   1.424 -     {
   1.425 -diff -r d540b4660837 model/net/dce-if.h
   1.426 ---- a/model/net/dce-if.h	Fri Jun 29 14:47:27 2012 +0900
   1.427 -+++ b/model/net/dce-if.h	Fri Jun 29 18:26:32 2012 +0900
   1.428 -@@ -7,6 +7,7 @@
   1.429 - #endif
   1.430 - 
   1.431 - unsigned dce_if_nametoindex (const char *ifname);
   1.432 -+char *dce_if_indextoname (unsigned ifindex, char *ifname);
   1.433 - 
   1.434 - 
   1.435 - #ifdef __cplusplus
   1.436 -diff -r d540b4660837 model/ns3-socket-fd-factory.cc
   1.437 ---- a/model/ns3-socket-fd-factory.cc	Fri Jun 29 14:47:27 2012 +0900
   1.438 -+++ b/model/ns3-socket-fd-factory.cc	Fri Jun 29 18:26:32 2012 +0900
   1.439 -@@ -166,6 +166,7 @@
   1.440 -   else
   1.441 -     {
   1.442 -       NS_FATAL_ERROR ("unsupported domain");
   1.443 -+      return 0;
   1.444 -     }
   1.445 - 
   1.446 -   return socket;
   1.447 -diff -r d540b4660837 model/sys/dce-socket.h
   1.448 ---- a/model/sys/dce-socket.h	Fri Jun 29 14:47:27 2012 +0900
   1.449 -+++ b/model/sys/dce-socket.h	Fri Jun 29 18:26:32 2012 +0900
   1.450 -@@ -28,6 +28,7 @@
   1.451 - ssize_t dce_sendmsg(int s, const struct msghdr *msg, int flags);
   1.452 - int dce_getsockname(int s, struct sockaddr *name, socklen_t *namelen);
   1.453 - int dce_getpeername(int s, struct sockaddr *name, socklen_t *namelen);
   1.454 -+int dce_socketpair (int domain, int type, int protocol, int sv[2]);
   1.455 - 
   1.456 - #ifdef __cplusplus
   1.457 - }
   1.458 -diff -r d540b4660837 test/test-select.cc
   1.459 ---- a/test/test-select.cc	Fri Jun 29 14:47:27 2012 +0900
   1.460 -+++ b/test/test-select.cc	Fri Jun 29 18:26:32 2012 +0900
   1.461 -@@ -43,9 +43,20 @@
   1.462 -   struct timeval timeout =
   1.463 -   { 0, 0 };
   1.464 -   int nfds = select (timerfd + 1, &fds, NULL, NULL, &timeout);
   1.465 --  close (timerfd);
   1.466 -   // no fds must be ready and select() should complete without errors
   1.467 -   TEST_ASSERT_EQUAL (nfds, 0);
   1.468 -+
   1.469 -+  timeout.tv_sec = 1;
   1.470 -+  timeout.tv_usec = 0;
   1.471 -+  // select(2): 
   1.472 -+  // Some  code  calls  select() with all three sets empty, nfds zero, and a
   1.473 -+  // non-NULL timeout as a fairly portable way to sleep with subsecond 
   1.474 -+  // precision.
   1.475 -+  nfds = select (0, &fds, NULL, NULL, &timeout);
   1.476 -+  // no fds must be ready and select() should complete without errors
   1.477 -+  TEST_ASSERT_EQUAL (nfds, 0);
   1.478 -+
   1.479 -+  close (timerfd);
   1.480 - }
   1.481 - 
   1.482 - static bool
   1.483 -diff -r d540b4660837 wscript
   1.484 ---- a/wscript	Fri Jun 29 14:47:27 2012 +0900
   1.485 -+++ b/wscript	Fri Jun 29 18:26:32 2012 +0900
   1.486 -@@ -74,6 +74,17 @@
   1.487 -         conf.end_msg(libpthread, True)
   1.488 -     conf.env['LIBPTHREAD_FILE'] = libpthread
   1.489 - 
   1.490 -+    conf.start_msg('Searching rt library')
   1.491 -+    librt = search_file ([
   1.492 -+            '/lib64/librt.so.1',
   1.493 -+            '/lib/librt.so.1',
   1.494 -+            ])
   1.495 -+    if librt is None:
   1.496 -+        conf.fatal('not found')
   1.497 -+    else:
   1.498 -+        conf.end_msg(librt, True)
   1.499 -+    conf.env['LIBRT_FILE'] = librt
   1.500 -+
   1.501 -     conf.find_program('readversiondef', var='READVERSIONDEF', mandatory=True)
   1.502 - 
   1.503 -     if Options.options.kernel_stack is not None and os.path.isdir(Options.options.kernel_stack):
   1.504 -@@ -441,6 +452,11 @@
   1.505 -         rule='%s %s | cat ${SRC[0].abspath()} - > ${TGT}' %
   1.506 -         (bld.env['READVERSIONDEF'], bld.env['LIBPTHREAD_FILE']))
   1.507 - 
   1.508 -+    bld(source=['model/librt-ns3.version'],
   1.509 -+        target='model/librt.version',
   1.510 -+        rule='%s %s | cat ${SRC[0].abspath()} - > ${TGT}' %
   1.511 -+        (bld.env['READVERSIONDEF'], bld.env['LIBRT_FILE']))
   1.512 -+
   1.513 -     bld.add_group('dce_use_version_files')
   1.514 - 
   1.515 -     # The very small libc used to replace the glibc
   1.516 -@@ -460,5 +476,15 @@
   1.517 -               linkflags=['-nostdlib', '-lc',
   1.518 -                          '-Wl,--version-script=' + os.path.join('model', 'libpthread.version'),
   1.519 -                          '-Wl,-soname=libpthread.so.0'])
   1.520 -+
   1.521 -+    # The very small librt used to replace the glibc
   1.522 -+    # and forward to the dce_* code
   1.523 -+    bld.shlib(source = ['model/libc.cc', 'model/libc-setup.cc'],
   1.524 -+              target='lib/rt-ns3', cflags=['-g'],
   1.525 -+              defines=['LIBSETUP=librt_setup'],
   1.526 -+              linkflags=['-nostdlib', '-lc',
   1.527 -+                         '-Wl,--version-script=' + os.path.join('model', 'librt.version'),
   1.528 -+                         '-Wl,-soname=librt.so.1'])
   1.529 -+
   1.530 -     if bld.env['ENABLE_VDL']:                     
   1.531 -         bld.add_subdirs(['utils'])
     2.1 --- a/dce_macro_alt.patch	Wed Jul 04 17:06:26 2012 +0900
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,120 +0,0 @@
     2.4 -diff -r ae3103c9ee50 model/libc-dce.cc
     2.5 ---- a/model/libc-dce.cc	Fri Apr 27 19:40:18 2012 +0900
     2.6 -+++ b/model/libc-dce.cc	Tue May 29 18:16:48 2012 +0900
     2.7 -@@ -143,6 +143,9 @@
     2.8 - 
     2.9 - #define DCE(name) (*libc)->name ## _fn = (func_t)(__typeof(&name))dce_ ## name;
    2.10 - #define DCET(rtype,name) DCE(name)
    2.11 -+#define DCE2(name,rtype,...) (*libc)->name ## _fn = dce_ ## name;
    2.12 -+#define DCE3(name,rtype,t1,t2) (*libc)->name ## _fn = dce_ ## name;
    2.13 -+#define DCE4(name,rtype,t1,t2,t3) (*libc)->name ## _fn = dce_ ## name;
    2.14 - 
    2.15 - #define NATIVE(name)							\
    2.16 -   (*libc)->name ## _fn = (func_t)name;
    2.17 -diff -r ae3103c9ee50 model/libc-ns3.h
    2.18 ---- a/model/libc-ns3.h	Fri Apr 27 19:40:18 2012 +0900
    2.19 -+++ b/model/libc-ns3.h	Tue May 29 18:16:48 2012 +0900
    2.20 -@@ -14,6 +14,7 @@
    2.21 -  * the internal implementation
    2.22 -  */
    2.23 - 
    2.24 -+
    2.25 - #ifndef DCE
    2.26 - #error Macro DCE should be defined before including libc-ns3.h
    2.27 - #endif
    2.28 -@@ -330,8 +331,8 @@
    2.29 - DCE    (pthread_key_delete)
    2.30 - DCE    (pthread_mutex_destroy)
    2.31 - DCE    (pthread_mutex_init)
    2.32 --DCE    (pthread_mutex_lock)
    2.33 --DCE    (pthread_mutex_unlock)
    2.34 -+DCE2    (pthread_mutex_lock, int, pthread_mutex_t *)
    2.35 -+DCE2    (pthread_mutex_unlock, int, pthread_mutex_t *)
    2.36 - DCE    (pthread_mutex_trylock)
    2.37 - DCE    (pthread_mutexattr_init)
    2.38 - DCE    (pthread_mutexattr_destroy)
    2.39 -@@ -351,8 +352,8 @@
    2.40 - DCE    (pthread_cond_init)
    2.41 - DCE    (pthread_cond_broadcast)
    2.42 - DCE    (pthread_cond_signal)
    2.43 --DCE    (pthread_cond_timedwait)
    2.44 --DCE    (pthread_cond_wait)
    2.45 -+DCE4    (pthread_cond_timedwait, int, pthread_cond_t*, pthread_mutex_t*, const struct timespec *)
    2.46 -+DCE3    (pthread_cond_wait, int, pthread_cond_t*, pthread_mutex_t*)
    2.47 - DCE    (pthread_condattr_destroy)
    2.48 - DCE    (pthread_condattr_init)
    2.49 - NATIVE (pthread_rwlock_init)
    2.50 -@@ -473,7 +474,8 @@
    2.51 - DCE (initgroups)
    2.52 - 
    2.53 - // this is wrong. clock should be changed to DCE implementation
    2.54 --DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    2.55 -+DCE3 (clock_gettime, int, clockid_t, struct timespec *)
    2.56 -+//DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    2.57 - //NATIVE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    2.58 - 
    2.59 - // setjmp.h
    2.60 -@@ -536,6 +538,9 @@
    2.61 - 
    2.62 - #undef DCE
    2.63 - #undef DCET
    2.64 -+#undef DCE2
    2.65 -+#undef DCE3
    2.66 -+#undef DCE4
    2.67 - #undef NATIVE
    2.68 - #undef NATIVE_WITH_ALIAS
    2.69 - #undef NATIVE_WITH_ALIAS2
    2.70 -diff -r ae3103c9ee50 model/libc.cc
    2.71 ---- a/model/libc.cc	Fri Apr 27 19:40:18 2012 +0900
    2.72 -+++ b/model/libc.cc	Tue May 29 18:16:48 2012 +0900
    2.73 -@@ -38,6 +38,26 @@
    2.74 - #define DCET(rtype,name)                                                               \
    2.75 -         GCC_BUILTIN_APPLYT(rtype,name,name)
    2.76 - 
    2.77 -+#define c99_tail(...)     _c99_tail (__VA_ARGS__)
    2.78 -+#define _c99_tail(x,...)  __VA_ARGS__
    2.79 -+
    2.80 -+#define DCE2(name,rtype,...)                                    \
    2.81 -+  rtype name (__VA_ARGS__ a1)                                   \
    2.82 -+  {                                                             \
    2.83 -+    return g_libc.name ## _fn (a1);                             \
    2.84 -+  }
    2.85 -+
    2.86 -+#define DCE3(name,rtype,t1,t2)                  \
    2.87 -+  rtype name (t1 a1, t2 a2)                     \
    2.88 -+  {                                             \
    2.89 -+    return g_libc.name ## _fn (a1,a2);          \
    2.90 -+  }
    2.91 -+  
    2.92 -+#define DCE4(name,rtype,...)                    \
    2.93 -+  rtype name (t1 a1, t2 a2,t3 a3)               \
    2.94 -+  {                                             \
    2.95 -+    return g_libc.name ## _fn (a1,a2,a3);       \
    2.96 -+  }
    2.97 - 
    2.98 - #define DCE_WITH_ALIAS(name)					\
    2.99 - 	GCC_BUILTIN_APPLY(__ ## name,name)			\
   2.100 -diff -r ae3103c9ee50 model/libc.h
   2.101 ---- a/model/libc.h	Fri Apr 27 19:40:18 2012 +0900
   2.102 -+++ b/model/libc.h	Tue May 29 18:16:48 2012 +0900
   2.103 -@@ -1,13 +1,19 @@
   2.104 - #ifndef LIBC_H
   2.105 - #define LIBC_H
   2.106 - 
   2.107 -+#define _SYS_SELECT_H
   2.108 -+#include <sys/types.h>
   2.109 -+#undef _SYS_SELECT_H
   2.110 -+
   2.111 - struct Libc
   2.112 - {
   2.113 - 
   2.114 - #define DCE(name) void (*name ## _fn)(...);
   2.115 - 
   2.116 - #define DCET(rtype, name) DCE(name)
   2.117 --
   2.118 -+#define DCE2(name,rtype,...) rtype (*name ## _fn)(__VA_ARGS__);
   2.119 -+#define DCE3(name,rtype,t1,t2) rtype (*name ## _fn)(t1,t2);
   2.120 -+#define DCE4(name,rtype,t1,t2,t3) rtype (*name ## _fn)(t1,t2,t3);
   2.121 - #include "libc-ns3.h"
   2.122 - 
   2.123 - };
     3.1 --- a/dce_test_improve.patch	Wed Jul 04 17:06:26 2012 +0900
     3.2 +++ b/dce_test_improve.patch	Mon Aug 06 20:45:50 2012 +0900
     3.3 @@ -1,36 +1,104 @@
     3.4 -diff -r 79c17eb3f698 -r 27bc248c09ff utils/dce-runner.c
     3.5 ---- a/utils/dce-runner.c	Mon Jun 25 14:31:51 2012 +0900
     3.6 -+++ b/utils/dce-runner.c	Wed Jun 27 11:22:47 2012 +0900
     3.7 -@@ -57,9 +57,30 @@
     3.8 -       return 1;
     3.9 +improve test-case to cover pthread/ucontext, dlm/cooja, with vdl/no-vdl
    3.10 +
    3.11 +diff -r 9c972df8a320 test/dce-manager-test.cc
    3.12 +--- a/test/dce-manager-test.cc	Mon Jul 09 17:35:31 2012 +0200
    3.13 ++++ b/test/dce-manager-test.cc	Tue Jul 10 00:56:45 2012 +0900
    3.14 +@@ -25,7 +25,8 @@
    3.15 + class DceManagerTestCase : public TestCase
    3.16 + {
    3.17 + public:
    3.18 +-  DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename, bool useNet, bool useK);
    3.19 ++  DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename, 
    3.20 ++                      bool useNet, bool useK);
    3.21 + private:
    3.22 +   virtual void DoRun (void);
    3.23 +   static void Finished (int *pstatus, uint16_t pid, int status);
    3.24 +@@ -37,9 +38,16 @@
    3.25 +   bool m_useNet;
    3.26 + };
    3.27 + 
    3.28 +-DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration, std::string stdin, bool useNet, bool useK)
    3.29 +-  : TestCase ("Check that process \"" + filename + "\" completes correctly."),
    3.30 +-    m_filename (filename), m_stdinFilename ( stdin), m_maxDuration ( maxDuration ), m_useKernel (useK), m_useNet (useNet)
    3.31 ++DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration, 
    3.32 ++                                        std::string stdin, bool useNet, bool useK)
    3.33 ++  : TestCase ("Check that process \"" + filename +
    3.34 ++              (useK ? " (kernel" : " (ns3)") + 
    3.35 ++              "\" completes correctly."),
    3.36 ++    m_filename (filename), 
    3.37 ++    m_stdinFilename (stdin),
    3.38 ++    m_maxDuration (maxDuration),
    3.39 ++    m_useKernel (useK),
    3.40 ++    m_useNet (useNet)
    3.41 + {
    3.42 + //  mtrace ();
    3.43 + }
    3.44 +@@ -83,7 +91,6 @@
    3.45 +           apps = dce.Install (nodes.Get (0));
    3.46 +           apps.Start (Seconds (3.0));
    3.47 + 
    3.48 +-          //dceManager.SetTaskManagerAttribute( "FiberManagerType", StringValue ( "UcontextFiberManager" ) );
    3.49 +         } else
    3.50 +         {
    3.51 +           dceManager.Install (nodes);
    3.52 +@@ -164,7 +171,7 @@
    3.53 +       {  "test-random", 0, "", false },
    3.54 +       {  "test-local-socket", 0, "", false },
    3.55 +       {  "test-poll", 3200, "", true },
    3.56 +-      //      {  "test-tcp-socket", 320, "", true },
    3.57 ++      {  "test-tcp-socket", 320, "", true },
    3.58 +       {  "test-exec", 0, "" , false},
    3.59 +       /* {  "test-raw-socket", 320, "", true },*/
    3.60 +       {  "test-iperf", 0, "" , false},
    3.61 +@@ -193,7 +200,10 @@
    3.62 + 
    3.63 +   for (unsigned int i = 0; i < sizeof(tests)/sizeof(testPair); i++)
    3.64 +     {
    3.65 +-      AddTestCase (new DceManagerTestCase (tests[i].name,  Seconds (tests[i].duration), tests[i].stdinfile, tests[i].useNet, useKernel () ) );
    3.66 ++      AddTestCase (new DceManagerTestCase (tests[i].name,  Seconds (tests[i].duration), 
    3.67 ++                                           tests[i].stdinfile, 
    3.68 ++                                           tests[i].useNet, 
    3.69 ++                                           useKernel ()));
    3.70       }
    3.71 -   void *entry = lookup_entry_point (h);
    3.72 --  argv[-1] = (char*)((long)argc);
    3.73 -+  argv[-1] = (char*)((long)3);
    3.74 -   argv[0] = argv[1];
    3.75 --  argv[1] = "--ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[]";
    3.76 + }
    3.77 + 
    3.78 +diff -r 9c972df8a320 utils/test.sh
    3.79 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    3.80 ++++ b/utils/test.sh	Tue Jul 10 00:56:45 2012 +0900
    3.81 +@@ -0,0 +1,20 @@
    3.82 ++#!/bin/sh
    3.83  +
    3.84 -+  /* Default is DlmLoader */
    3.85 -+  if (argc > 2 &&
    3.86 -+      strncmp (argv[2], "--cooja", 4) == 0)
    3.87 -+    {
    3.88 -+      argv[1] = "--ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[]";
    3.89 -+    }
    3.90 -+  else
    3.91 -+    {
    3.92 -+      argv[1] = "--ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[]";
    3.93 -+    }
    3.94 ++. ./utils/setenv.sh
    3.95 ++#VERBOSE=""
    3.96  +
    3.97 -+  /* Default is PthreadFiber */
    3.98 -+  if (argc > 3 &&
    3.99 -+      strncmp (argv[3], "--ucontext", 4) == 0)
   3.100 -+    {
   3.101 -+      argv[2] = "--ns3::TaskManager::FiberManagerType=UcontextFiberManager";
   3.102 -+    }
   3.103 -+  else
   3.104 -+    {
   3.105 -+      argv[2] = "--ns3::TaskManager::FiberManagerType=PthreadFiberManager";
   3.106 -+    }
   3.107 - #if defined (__x86_64__)
   3.108 -   __asm__ ("\txor %%rbp,%%rbp\n"
   3.109 - 	   "\txor %%rdx,%%rdx\n"
   3.110 ++echo -n "Cooja (non-vdl) + Pthread:  "
   3.111 ++NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce $VERBOSE
   3.112 ++echo -n "Cooja (non-vdl) + Ucontext: "
   3.113 ++NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce $VERBOSE
   3.114 ++
   3.115 ++echo -n "Cooja (vdl) + Pthread:      "
   3.116 ++NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
   3.117 ++
   3.118 ++echo -n "Cooja (vdl) + Ucontext:     "
   3.119 ++NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
   3.120 ++
   3.121 ++echo -n "Dlm (vdl) + Pthread:        "
   3.122 ++NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
   3.123 ++echo -n "Dlm (vdl) + Ucontext:       "
   3.124 ++NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
   3.125 +diff -r 9c972df8a320 wscript
   3.126 +--- a/wscript	Mon Jul 09 17:35:31 2012 +0200
   3.127 ++++ b/wscript	Tue Jul 10 00:56:45 2012 +0900
   3.128 +@@ -136,8 +136,12 @@
   3.129 + def build_dce_tests(module, kern):
   3.130 +     if kern:
   3.131 +         module.add_runner_test(needed=['core', 'dce', 'internet'],  source=['test/dce-manager-test.cc', 'test/with-kernel.cc'])
   3.132 ++        module.add_runner_test(needed=['core', 'dce', 'internet'],  source=['test/dce-manager-test.cc', 'test/with-kernel.cc'],
   3.133 ++                               linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
   3.134 +     else:
   3.135 +         module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'])
   3.136 ++        module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'],
   3.137 ++                               linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
   3.138 +     	    
   3.139 +     module.add_test(features='cxx cxxshlib', source=['test/test-macros.cc'], 
   3.140 +                     target='lib/test', linkflags=['-Wl,-soname=libtest.so'])
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/fedora8-nontimerfd.patch	Mon Aug 06 20:45:50 2012 +0900
     4.3 @@ -0,0 +1,305 @@
     4.4 +support Fedora8, timerfd check in configure, macro improvements, fix the issue of scandir imcompatibility
     4.5 +
     4.6 +diff -r 4c90fdff71a0 model/dce-dirent.cc
     4.7 +--- a/model/dce-dirent.cc	Mon Jul 16 13:56:16 2012 +0200
     4.8 ++++ b/model/dce-dirent.cc	Wed Jul 18 14:28:29 2012 +0900
     4.9 +@@ -236,9 +236,16 @@
    4.10 +   rewinddir (dirp);
    4.11 +   ds->fd = saveFd;
    4.12 + }
    4.13 ++
    4.14 ++#ifdef USE_SCANDIR_VOIDPTR
    4.15 ++int dce_scandir (const char *dirp, struct dirent ***namelist,
    4.16 ++    int (*filter)(const struct dirent *),
    4.17 ++    int (*compar)(const void *, const void *))
    4.18 ++#else
    4.19 + int dce_scandir (const char *dirp, struct dirent ***namelist,
    4.20 +     int (*filter)(const struct dirent *),
    4.21 +     int (*compar)(const struct dirent **, const struct dirent **))
    4.22 ++#endif
    4.23 + {
    4.24 +   NS_LOG_FUNCTION (Current () << UtilsGetNodeId () );
    4.25 +   NS_ASSERT (Current () != 0);
    4.26 +diff -r 4c90fdff71a0 model/dce-dirent.h
    4.27 +--- a/model/dce-dirent.h	Mon Jul 16 13:56:16 2012 +0200
    4.28 ++++ b/model/dce-dirent.h	Wed Jul 18 14:28:29 2012 +0900
    4.29 +@@ -35,9 +35,24 @@
    4.30 + int dce_closedir (DIR *dirp);
    4.31 + int dce_dirfd (DIR *dirp);
    4.32 + void dce_rewinddir (DIR *dirp);
    4.33 ++
    4.34 ++// For the compatibility of 4th argument of scandir()
    4.35 ++#define USE_SCANDIR_VOIDPTR
    4.36 ++#if defined( __GLIBC_PREREQ  )
    4.37 ++# if  __GLIBC_PREREQ(2,10)
    4.38 ++#  undef USE_SCANDIR_VOIDPTR
    4.39 ++# endif
    4.40 ++#endif
    4.41 ++
    4.42 ++#ifdef USE_SCANDIR_VOIDPTR
    4.43 ++int dce_scandir (const char *dirp, struct dirent ***namelist,
    4.44 ++    int (*filter)(const struct dirent *),
    4.45 ++                 int (*compar)(const void *, const void *));
    4.46 ++#else
    4.47 + int dce_scandir (const char *dirp, struct dirent ***namelist,
    4.48 +        int (*filter)(const struct dirent *),
    4.49 +        int (*compar)(const struct dirent **, const struct dirent **));
    4.50 ++#endif
    4.51 + 
    4.52 + #ifdef __cplusplus
    4.53 + }
    4.54 +diff -r 4c90fdff71a0 model/libc-dce.cc
    4.55 +--- a/model/libc-dce.cc	Mon Jul 16 13:56:16 2012 +0200
    4.56 ++++ b/model/libc-dce.cc	Wed Jul 18 14:28:29 2012 +0900
    4.57 +@@ -12,7 +12,9 @@
    4.58 + #include "sys/dce-mman.h"
    4.59 + #include "sys/dce-stat.h"
    4.60 + #include "sys/dce-select.h"
    4.61 ++#ifdef HAVE_SYS_TIMER_H
    4.62 + #include "sys/dce-timerfd.h"
    4.63 ++#endif
    4.64 + #include "dce-unistd.h"
    4.65 + #include "dce-netdb.h"
    4.66 + #include "dce-pthread.h"
    4.67 +@@ -67,7 +69,9 @@
    4.68 + #include <sys/ioctl.h>
    4.69 + #include <sys/io.h>
    4.70 + #include <sys/mman.h>
    4.71 ++#ifdef HAVE_SYS_TIMER_H
    4.72 + #include <sys/timerfd.h>
    4.73 ++#endif
    4.74 + #include <sys/time.h>
    4.75 + #include <sys/types.h>
    4.76 + #include <sys/resource.h>
    4.77 +@@ -142,6 +146,7 @@
    4.78 + #define DCE(name) (*libc)->name ## _fn = (func_t)(__typeof(&name))dce_ ## name;
    4.79 + #define DCET(rtype,name) DCE(name)
    4.80 + #define DCE_EXPLICIT(name,rtype,...) (*libc)->name ## _fn = dce_ ## name;
    4.81 ++#define NATIVE_EXPLICIT2(name,rtype,...) (*libc)->name ## _fn = name;
    4.82 + 
    4.83 + #define NATIVE(name)							\
    4.84 +   (*libc)->name ## _fn = (func_t)name;
    4.85 +diff -r 4c90fdff71a0 model/libc-ns3.h
    4.86 +--- a/model/libc-ns3.h	Mon Jul 16 13:56:16 2012 +0200
    4.87 ++++ b/model/libc-ns3.h	Wed Jul 18 14:28:29 2012 +0900
    4.88 +@@ -108,7 +108,7 @@
    4.89 + NATIVE (strerror_r)
    4.90 + NATIVE (strcoll)
    4.91 + NATIVE (memset)
    4.92 +-NATIVE (memcpy)
    4.93 ++NATIVE_EXPLICIT2 (memcpy, void *, void *, const void *, size_t)
    4.94 + NATIVE (bcopy)
    4.95 + NATIVE (memcmp)
    4.96 + NATIVE (memmove)
    4.97 +@@ -426,11 +426,14 @@
    4.98 + // CTYPE.H
    4.99 + NATIVE (toupper)
   4.100 + NATIVE (tolower)
   4.101 ++NATIVE (_tolower)
   4.102 + 
   4.103 + // SYS/TIMERFD.H
   4.104 ++#ifdef HAVE_SYS_TIMER_H
   4.105 + DCE (timerfd_create)
   4.106 + DCE (timerfd_settime)
   4.107 + DCE (timerfd_gettime)
   4.108 ++#endif  /* HAVE_SYS_TIMER_H */
   4.109 + 
   4.110 + // NET/IF.H
   4.111 + DCE (if_nametoindex)
   4.112 +@@ -541,6 +544,7 @@
   4.113 + #undef NATIVE_WITH_ALIAS
   4.114 + #undef NATIVE_WITH_ALIAS2
   4.115 + #undef NATIVE_EXPLICIT
   4.116 ++#undef NATIVE_EXPLICIT2
   4.117 + #undef DCE_WITH_ALIAS
   4.118 + #undef DCE_WITH_ALIAS2
   4.119 + 
   4.120 +diff -r 4c90fdff71a0 model/libc.cc
   4.121 +--- a/model/libc.cc	Mon Jul 16 13:56:16 2012 +0200
   4.122 ++++ b/model/libc.cc	Wed Jul 18 14:28:29 2012 +0900
   4.123 +@@ -79,6 +79,12 @@
   4.124 + 	GCC_BUILTIN_APPLY(internal,name)			\
   4.125 + 	weak_alias(internal, name);
   4.126 +    
   4.127 ++#define NATIVE_EXPLICIT2(name,rtype,...)                                    \
   4.128 ++  rtype name (FULL_ARGS(__VA_ARGS__))    \
   4.129 ++  {                                                             \
   4.130 ++    return g_libc.name ## _fn (ARGS(__VA_ARGS__));              \
   4.131 ++  }
   4.132 ++
   4.133 + 
   4.134 + // Note: it looks like that the stdio.h header does
   4.135 + // not define putc and getc as macros if you include
   4.136 +diff -r 4c90fdff71a0 model/libc.h
   4.137 +--- a/model/libc.h	Mon Jul 16 13:56:16 2012 +0200
   4.138 ++++ b/model/libc.h	Wed Jul 18 14:28:29 2012 +0900
   4.139 +@@ -13,6 +13,7 @@
   4.140 + #define DCET(rtype, name) DCE(name)
   4.141 + 
   4.142 + #define DCE_EXPLICIT(name,rtype,...) rtype (*name ## _fn)(__VA_ARGS__);
   4.143 ++#define NATIVE_EXPLICIT2(name,rtype,...) rtype (*name ## _fn)(__VA_ARGS__);
   4.144 + #include "libc-ns3.h"
   4.145 + 
   4.146 + };
   4.147 +diff -r 4c90fdff71a0 test/dce-manager-test.cc
   4.148 +--- a/test/dce-manager-test.cc	Mon Jul 16 13:56:16 2012 +0200
   4.149 ++++ b/test/dce-manager-test.cc	Wed Jul 18 14:28:29 2012 +0900
   4.150 +@@ -156,7 +156,9 @@
   4.151 +       {  "test-netdb", 3600, "", true },
   4.152 +       {  "test-env", 0, "", false }, 
   4.153 +       {  "test-cond", 0, "", false}, 
   4.154 ++#ifdef HAVE_SYS_TIMER_H
   4.155 +       {  "test-timer-fd", 0, "", false}, 
   4.156 ++#endif
   4.157 +       {  "test-stdlib", 0, "", false},
   4.158 +       {  "test-fork", 0, "", false },
   4.159 +       {  "test-select", 3600, "", true },
   4.160 +diff -r 4c90fdff71a0 test/test-poll.cc
   4.161 +--- a/test/test-poll.cc	Mon Jul 16 13:56:16 2012 +0200
   4.162 ++++ b/test/test-poll.cc	Wed Jul 18 14:28:29 2012 +0900
   4.163 +@@ -1,7 +1,6 @@
   4.164 + #include <stdlib.h>
   4.165 + #include <sys/time.h>
   4.166 + #include <sys/types.h>
   4.167 +-#include <sys/timerfd.h>
   4.168 + #include <unistd.h>
   4.169 + #include <pthread.h>
   4.170 + #include <stdio.h>
   4.171 +diff -r 4c90fdff71a0 test/test-select.cc
   4.172 +--- a/test/test-select.cc	Mon Jul 16 13:56:16 2012 +0200
   4.173 ++++ b/test/test-select.cc	Wed Jul 18 14:28:29 2012 +0900
   4.174 +@@ -2,7 +2,9 @@
   4.175 + #include <sys/time.h>
   4.176 + #include <sys/types.h>
   4.177 + #include <sys/select.h>
   4.178 ++#ifdef HAVE_SYS_TIMER_H
   4.179 + #include <sys/timerfd.h>
   4.180 ++#endif
   4.181 + #include <unistd.h>
   4.182 + #include <pthread.h>
   4.183 + #include <stdio.h>
   4.184 +@@ -18,6 +20,7 @@
   4.185 + #include "test-macros.h"
   4.186 + 
   4.187 + // test, that select () with timeout={0,0} exits immediately
   4.188 ++#ifdef HAVE_SYS_TIMER_H
   4.189 + static void
   4.190 + test_select_null_null (void)
   4.191 + {
   4.192 +@@ -58,6 +61,7 @@
   4.193 + 
   4.194 +   close (timerfd);
   4.195 + }
   4.196 ++#endif
   4.197 + 
   4.198 + static bool
   4.199 + test_select_read (int fd, int timeOutSec, bool needSuccess)
   4.200 +@@ -771,6 +775,7 @@
   4.201 +   TEST_ASSERT (FD_ISSET (sockfd, &wfds));
   4.202 + }
   4.203 + 
   4.204 ++#ifdef HAVE_SYS_TIMER_H
   4.205 + // test, that select () returns correctly if there is two fds for reading and only one available
   4.206 + // solved with else mustWait=false
   4.207 + static void test_select_rfds (void)
   4.208 +@@ -804,6 +809,7 @@
   4.209 +   // no fds must be ready and select() should complete without errors
   4.210 +   TEST_ASSERT_EQUAL (nfds, 1);
   4.211 + }
   4.212 ++#endif
   4.213 + 
   4.214 + int
   4.215 + main (int argc, char *argv[])
   4.216 +@@ -815,10 +821,14 @@
   4.217 +     {
   4.218 +       test_select_stdin ();
   4.219 +       test_select_stdout_stdin ();
   4.220 ++#ifdef HAVE_SYS_TIMER_H
   4.221 +       test_select_null_null ();
   4.222 ++#endif
   4.223 +       test_select_stdout ();
   4.224 +       test_select_rfds_wfds ();
   4.225 ++#ifdef HAVE_SYS_TIMER_H
   4.226 +       test_select_rfds ();
   4.227 ++#endif
   4.228 +       launch (client1, server1);
   4.229 +       launch (client2, server2);
   4.230 +       launch (client3, server3);
   4.231 +diff -r 4c90fdff71a0 wscript
   4.232 +--- a/wscript	Mon Jul 16 13:56:16 2012 +0200
   4.233 ++++ b/wscript	Wed Jul 18 14:28:29 2012 +0900
   4.234 +@@ -37,6 +37,7 @@
   4.235 +     conf.check(header_name='sys/types.h', define_name='HAVE_SYS_TYPES_H', mandatory=False)
   4.236 +     conf.check(header_name='sys/stat.h', define_name='HAVE_SYS_STAT_H', mandatory=False)
   4.237 +     conf.check(header_name='dirent.h', define_name='HAVE_DIRENT_H', mandatory=False)
   4.238 ++    conf.check(header_name='sys/timerfd.h', define_name='HAVE_SYS_TIMER_H', mandatory=False)
   4.239 + 
   4.240 +     conf.env.prepend_value('LINKFLAGS', '-Wl,--no-as-needed')
   4.241 +     conf.env.append_value('LINKFLAGS', '-pthread')
   4.242 +@@ -91,7 +92,9 @@
   4.243 + 
   4.244 +     if Options.options.kernel_stack is not None and os.path.isdir(Options.options.kernel_stack):
   4.245 +         conf.check(header_name='sim.h',
   4.246 +-                   includes=os.path.join(Options.options.kernel_stack, 'sim/include'))
   4.247 ++                   includes=[os.path.join(Options.options.kernel_stack, 'sim/include'),
   4.248 ++			     os.path.join(Options.options.kernel_stack, 'net-next-2.6/include')])
   4.249 ++
   4.250 +       #  conf.check()
   4.251 +         conf.env['KERNEL_STACK'] = Options.options.kernel_stack
   4.252 + 
   4.253 +@@ -172,7 +175,6 @@
   4.254 +              ['test-netdb', []],
   4.255 +              ['test-env', []],
   4.256 +              ['test-cond', ['PTHREAD']],
   4.257 +-             ['test-timer-fd', []],
   4.258 +              ['test-stdlib', []],
   4.259 +              ['test-select', ['PTHREAD']],
   4.260 +              ['test-random', []],
   4.261 +@@ -194,6 +196,10 @@
   4.262 +              ['test-tsearch', []],
   4.263 +              ['test-signal', []],
   4.264 +              ]
   4.265 ++
   4.266 ++    if module._bld.env['HAVE_SYS_TIMER_H']:
   4.267 ++        tests = tests + [['test-timer-fd', []]]
   4.268 ++
   4.269 +     for name,uselib in tests:
   4.270 +         module.add_test(**dce_kw(target='bin_dce/' + name, source = ['test/' + name + '.cc'],
   4.271 +                                  use = uselib + ['lib/test']))
   4.272 +@@ -201,7 +207,6 @@
   4.273 + def build_dce_examples(module):
   4.274 +     dce_examples = [['udp-server', []],
   4.275 +                     ['udp-client', []],
   4.276 +-                    ['udp-perf', ['m']],
   4.277 +                     ['tcp-server', []],
   4.278 +                     ['tcp-client', []],
   4.279 +                     ['tcp-loopback', []],
   4.280 +@@ -211,6 +216,9 @@
   4.281 +                     ['udp-echo-client', []],
   4.282 + #                    ['little-cout', []],
   4.283 +                     ]
   4.284 ++    if module._bld.env['HAVE_SYS_TIMER_H']:
   4.285 ++        dce_examples = dce_examples + [['udp-perf', ['m']]]
   4.286 ++
   4.287 +     for name,lib in dce_examples:
   4.288 +         module.add_example(**dce_kw(target = 'bin_dce/' + name, 
   4.289 +                                     source = ['example/' + name + '.cc'],
   4.290 +@@ -359,7 +367,6 @@
   4.291 +         'model/dce-string.cc',
   4.292 +         'model/dce-env.cc',
   4.293 +         'model/dce-pthread-cond.cc',
   4.294 +-        'model/dce-timerfd.cc',
   4.295 +         'model/dce-time.cc',
   4.296 +         'model/dce-stat.cc',
   4.297 +         'model/dce-syslog.cc',
   4.298 +@@ -424,6 +431,10 @@
   4.299 +         'helper/linux-stack-helper.h',
   4.300 +         'helper/ipv4-dce-routing-helper.h',
   4.301 +         ]
   4.302 ++
   4.303 ++    if bld.env['HAVE_SYS_TIMER_H']:
   4.304 ++        module_source = module_source + ['model/dce-timerfd.cc']
   4.305 ++
   4.306 +     module_source = module_source + kernel_source
   4.307 +     module_headers = module_headers + kernel_headers
   4.308 +     uselib = ns3waf.modules_uselib(bld, ['core', 'network', 'internet', 'netlink'])
     5.1 --- a/series	Wed Jul 04 17:06:26 2012 +0900
     5.2 +++ b/series	Mon Aug 06 20:45:50 2012 +0900
     5.3 @@ -1,9 +1,8 @@
     5.4 +fedora8-nontimerfd.patch
     5.5  dce_test_improve.patch
     5.6 -120410-dce-umip-support.patch
     5.7  hana-dce.patch
     5.8  dns_unbound.patch
     5.9  dns_bind9.patch
    5.10 -dce_macro_alt.patch
    5.11  fedora8-nontimerfd-etc.patch
    5.12  dlm-loader-fix.patch
    5.13  floating_groupd.patch