One more bug in ldconfig -r handling.
[glibc.git] / nptl / tst-sem13.c
blob8756b2262fd9d39c8153d128c015031968700ad2
1 #include <errno.h>
2 #include <semaphore.h>
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <pthread.h>
6 #include <internaltypes.h>
9 static int
10 do_test (void)
12 union
14 sem_t s;
15 struct new_sem ns;
16 } u;
18 if (sem_init (&u.s, 0, 0) != 0)
20 puts ("sem_init failed");
21 return 1;
24 struct timespec ts = { 0, 1000000001 }; /* Invalid. */
25 errno = 0;
26 if (sem_timedwait (&u.s, &ts) >= 0)
28 puts ("sem_timedwait did not fail");
29 return 1;
31 if (errno != EINVAL)
33 puts ("sem_timedwait did not fail with EINVAL");
34 return 1;
36 if (u.ns.nwaiters != 0)
38 puts ("nwaiters modified");
39 return 1;
42 return 0;
45 #define TEST_FUNCTION do_test ()
46 #include "../test-skeleton.c"