about summary refs log tree commit diff
path: root/nptl/tst-sem5.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-18 22:07:25 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-18 22:07:25 -0700
commit3d77b2687f984700f40e26e0fb06c99eeea1c033 (patch)
treef50d532eaad90a723373dda7b5615ab4399efb74 /nptl/tst-sem5.c
parent32c6c342b6bc10396785a4542c22f6f95deca684 (diff)
downloadglibc-3d77b2687f984700f40e26e0fb06c99eeea1c033.tar.gz
glibc-3d77b2687f984700f40e26e0fb06c99eeea1c033.tar.xz
glibc-3d77b2687f984700f40e26e0fb06c99eeea1c033.zip
Add more sem_timedwait tests.
Diffstat (limited to 'nptl/tst-sem5.c')
-rw-r--r--nptl/tst-sem5.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nptl/tst-sem5.c b/nptl/tst-sem5.c
index cb85b8e769..d3ebe26a40 100644
--- a/nptl/tst-sem5.c
+++ b/nptl/tst-sem5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -73,6 +73,20 @@ do_test (void)
       return 1;
     }
 
+  struct timespec ts2;
+  if (clock_gettime (CLOCK_REALTIME, &ts2) != 0)
+    {
+      puts ("clock_gettime failed");
+      return 1;
+    }
+
+  if (ts2.tv_sec < ts.tv_sec
+      || (ts2.tv_sec == ts.tv_sec && ts2.tv_nsec < ts.tv_nsec))
+    {
+      puts ("timeout too short");
+      return 1;
+    }
+
   return 0;
 }