diff options
author | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
commit | 5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch) | |
tree | 4470480d904b65cf14ca524f96f79eca818c3eaf /nptl/tst-sem13.c | |
parent | 199fc19d3aaaf57944ef036e15904febe877fc93 (diff) | |
download | glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.gz glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.xz glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.zip |
Prepare for radical source tree reorganization. zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage directory, REORG.TODO, except for files that will certainly still exist in their current form at top level when we're done (COPYING, COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which are moved to the new directory OldChangeLogs, instead), and the generated file INSTALL (which is just deleted; in the new order, there will be no generated files checked into version control).
Diffstat (limited to 'nptl/tst-sem13.c')
-rw-r--r-- | nptl/tst-sem13.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/nptl/tst-sem13.c b/nptl/tst-sem13.c deleted file mode 100644 index 1560e91443..0000000000 --- a/nptl/tst-sem13.c +++ /dev/null @@ -1,75 +0,0 @@ -#include <errno.h> -#include <semaphore.h> -#include <stdio.h> -#include <unistd.h> -#include <pthread.h> -#include <internaltypes.h> - - -static int -do_test (void) -{ - union - { - sem_t s; - struct new_sem ns; - } u; - - if (sem_init (&u.s, 0, 0) != 0) - { - puts ("sem_init failed"); - return 1; - } - - struct timespec ts = { 0, 1000000001 }; /* Invalid. */ - errno = 0; - if (sem_timedwait (&u.s, &ts) >= 0) - { - puts ("sem_timedwait did not fail"); - return 1; - } - if (errno != EINVAL) - { - perror ("sem_timedwait did not fail with EINVAL"); - return 1; - } -#if __HAVE_64B_ATOMICS - unsigned int nwaiters = (u.ns.data >> SEM_NWAITERS_SHIFT); -#else - unsigned int nwaiters = u.ns.nwaiters; -#endif - if (nwaiters != 0) - { - printf ("sem_timedwait modified nwaiters: %d\n", nwaiters); - return 1; - } - - ts.tv_sec = /* Invalid. */ -2; - ts.tv_nsec = 0; - errno = 0; - if (sem_timedwait (&u.s, &ts) >= 0) - { - puts ("2nd sem_timedwait did not fail"); - return 1; - } - if (errno != ETIMEDOUT) - { - perror ("2nd sem_timedwait did not fail with ETIMEDOUT"); - return 1; - } -#if __HAVE_64B_ATOMICS - nwaiters = (u.ns.data >> SEM_NWAITERS_SHIFT); -#else - nwaiters = u.ns.nwaiters; -#endif - if (nwaiters != 0) - { - printf ("2nd sem_timedwait modified nwaiters: %d\n", nwaiters); - return 1; - } - - return 0; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" |