tst-timer4.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /* Tests for POSIX timer implementation.
  2. Copyright (C) 2004 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License as
  7. published by the Free Software Foundation; either version 2.1 of the
  8. License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; see the file COPYING.LIB. If
  15. not, see <http://www.gnu.org/licenses/>. */
  16. #include <errno.h>
  17. #include <signal.h>
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include <time.h>
  21. #include <unistd.h>
  22. #if _POSIX_THREADS
  23. # include <pthread.h>
  24. # ifndef TEST_CLOCK
  25. # define TEST_CLOCK CLOCK_REALTIME
  26. # endif
  27. pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
  28. pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
  29. timer_t timer_none, timer_sig1, timer_sig2, timer_thr1, timer_thr2;
  30. int thr1_cnt, thr1_err;
  31. union sigval thr1_sigval;
  32. struct timespec thr1_ts;
  33. static void
  34. thr1 (union sigval sigval)
  35. {
  36. pthread_mutex_lock (&lock);
  37. thr1_err = clock_gettime (TEST_CLOCK, &thr1_ts);
  38. if (thr1_cnt >= 5)
  39. {
  40. struct itimerspec it = { };
  41. thr1_err |= timer_settime (timer_thr1, 0, &it, NULL);
  42. }
  43. thr1_sigval = sigval;
  44. ++thr1_cnt;
  45. pthread_cond_signal (&cond);
  46. pthread_mutex_unlock (&lock);
  47. }
  48. int thr2_cnt, thr2_err;
  49. union sigval thr2_sigval;
  50. size_t thr2_guardsize;
  51. struct timespec thr2_ts;
  52. static void
  53. thr2 (union sigval sigval)
  54. {
  55. pthread_attr_t nattr;
  56. int err = 0;
  57. size_t guardsize = -1;
  58. int ret = pthread_getattr_np (pthread_self (), &nattr);
  59. if (ret)
  60. {
  61. errno = ret;
  62. printf ("*** pthread_getattr_np failed: %m\n");
  63. err = 1;
  64. }
  65. else
  66. {
  67. ret = pthread_attr_getguardsize (&nattr, &guardsize);
  68. if (ret)
  69. {
  70. errno = ret;
  71. printf ("*** pthread_attr_getguardsize failed: %m\n");
  72. err = 1;
  73. }
  74. if (pthread_attr_destroy (&nattr) != 0)
  75. {
  76. puts ("*** pthread_attr_destroy failed");
  77. err = 1;
  78. }
  79. }
  80. pthread_mutex_lock (&lock);
  81. thr2_err = clock_gettime (TEST_CLOCK, &thr2_ts) | err;
  82. if (thr2_cnt >= 5)
  83. {
  84. struct itimerspec it = { };
  85. thr2_err |= timer_settime (timer_thr2, 0, &it, NULL);
  86. }
  87. thr2_sigval = sigval;
  88. ++thr2_cnt;
  89. thr2_guardsize = guardsize;
  90. pthread_cond_signal (&cond);
  91. pthread_mutex_unlock (&lock);
  92. }
  93. volatile int sig1_cnt, sig1_err;
  94. volatile union sigval sig1_sigval;
  95. struct timespec sig1_ts;
  96. static void
  97. sig1_handler (int sig, siginfo_t *info, void *ctx)
  98. {
  99. int err = 0;
  100. if (sig != SIGRTMIN) err |= 1 << 0;
  101. if (info->si_signo != SIGRTMIN) err |= 1 << 1;
  102. if (info->si_code != SI_TIMER) err |= 1 << 2;
  103. if (clock_gettime (TEST_CLOCK, &sig1_ts) != 0)
  104. err |= 1 << 3;
  105. if (sig1_cnt >= 5)
  106. {
  107. struct itimerspec it = { };
  108. if (timer_settime (timer_sig1, 0, &it, NULL))
  109. err |= 1 << 4;
  110. }
  111. sig1_err |= err;
  112. sig1_sigval = info->si_value;
  113. ++sig1_cnt;
  114. }
  115. volatile int sig2_cnt, sig2_err;
  116. volatile union sigval sig2_sigval;
  117. struct timespec sig2_ts;
  118. static void
  119. sig2_handler (int sig, siginfo_t *info, void *ctx)
  120. {
  121. int err = 0;
  122. if (sig != SIGRTMIN + 1) err |= 1 << 0;
  123. if (info->si_signo != SIGRTMIN + 1) err |= 1 << 1;
  124. if (info->si_code != SI_TIMER) err |= 1 << 2;
  125. if (clock_gettime (TEST_CLOCK, &sig2_ts) != 0)
  126. err |= 1 << 3;
  127. if (sig2_cnt >= 5)
  128. {
  129. struct itimerspec it = { };
  130. if (timer_settime (timer_sig2, 0, &it, NULL))
  131. err |= 1 << 4;
  132. }
  133. sig2_err |= err;
  134. sig2_sigval = info->si_value;
  135. ++sig2_cnt;
  136. }
  137. /* Check if end is later or equal to start + nsec. */
  138. static int
  139. check_ts (const char *name, const struct timespec *start,
  140. const struct timespec *end, long msec)
  141. {
  142. struct timespec ts = *start;
  143. ts.tv_sec += msec / 1000000;
  144. ts.tv_nsec += (msec % 1000000) * 1000;
  145. if (ts.tv_nsec >= 1000000000)
  146. {
  147. ++ts.tv_sec;
  148. ts.tv_nsec -= 1000000000;
  149. }
  150. if (end->tv_sec < ts.tv_sec
  151. || (end->tv_sec == ts.tv_sec && end->tv_nsec < ts.tv_nsec))
  152. {
  153. printf ("\
  154. *** timer %s invoked too soon: %ld.%09ld instead of expected %ld.%09ld\n",
  155. name, (long) end->tv_sec, end->tv_nsec,
  156. (long) ts.tv_sec, ts.tv_nsec);
  157. return 1;
  158. }
  159. else
  160. return 0;
  161. }
  162. #define TIMEOUT 15
  163. #define TEST_FUNCTION do_test ()
  164. static int
  165. do_test (void)
  166. {
  167. int result = 0;
  168. #ifdef TEST_CLOCK_MISSING
  169. const char *missing = TEST_CLOCK_MISSING (TEST_CLOCK);
  170. if (missing != NULL)
  171. {
  172. printf ("%s missing, skipping test\n", missing);
  173. return 0;
  174. }
  175. #endif
  176. struct timespec ts;
  177. if (clock_gettime (TEST_CLOCK, &ts) != 0)
  178. {
  179. printf ("*** clock_gettime failed: %m\n");
  180. result = 1;
  181. }
  182. else
  183. printf ("clock_gettime returned timespec = { %ld, %ld }\n",
  184. (long) ts.tv_sec, ts.tv_nsec);
  185. if (clock_getres (TEST_CLOCK, &ts) != 0)
  186. {
  187. printf ("*** clock_getres failed: %m\n");
  188. result = 1;
  189. }
  190. else
  191. printf ("clock_getres returned timespec = { %ld, %ld }\n",
  192. (long) ts.tv_sec, ts.tv_nsec);
  193. struct sigevent ev;
  194. memset (&ev, 0x11, sizeof (ev));
  195. ev.sigev_notify = SIGEV_NONE;
  196. if (timer_create (TEST_CLOCK, &ev, &timer_none) != 0)
  197. {
  198. printf ("*** timer_create for timer_none failed: %m\n");
  199. return 1;
  200. }
  201. struct sigaction sa = { .sa_sigaction = sig1_handler,
  202. .sa_flags = SA_SIGINFO };
  203. sigemptyset (&sa.sa_mask);
  204. sigaction (SIGRTMIN, &sa, NULL);
  205. sa.sa_sigaction = sig2_handler;
  206. sigaction (SIGRTMIN + 1, &sa, NULL);
  207. memset (&ev, 0x22, sizeof (ev));
  208. ev.sigev_notify = SIGEV_SIGNAL;
  209. ev.sigev_signo = SIGRTMIN;
  210. ev.sigev_value.sival_ptr = &ev;
  211. if (timer_create (TEST_CLOCK, &ev, &timer_sig1) != 0)
  212. {
  213. printf ("*** timer_create for timer_sig1 failed: %m\n");
  214. return 1;
  215. }
  216. memset (&ev, 0x33, sizeof (ev));
  217. ev.sigev_notify = SIGEV_SIGNAL;
  218. ev.sigev_signo = SIGRTMIN + 1;
  219. ev.sigev_value.sival_int = 163;
  220. if (timer_create (TEST_CLOCK, &ev, &timer_sig2) != 0)
  221. {
  222. printf ("*** timer_create for timer_sig2 failed: %m\n");
  223. return 1;
  224. }
  225. memset (&ev, 0x44, sizeof (ev));
  226. ev.sigev_notify = SIGEV_THREAD;
  227. ev.sigev_notify_function = thr1;
  228. ev.sigev_notify_attributes = NULL;
  229. ev.sigev_value.sival_ptr = &ev;
  230. if (timer_create (TEST_CLOCK, &ev, &timer_thr1) != 0)
  231. {
  232. printf ("*** timer_create for timer_thr1 failed: %m\n");
  233. return 1;
  234. }
  235. pthread_attr_t nattr;
  236. if (pthread_attr_init (&nattr)
  237. || pthread_attr_setguardsize (&nattr, 0))
  238. {
  239. puts ("*** pthread_attr_t setup failed");
  240. result = 1;
  241. }
  242. memset (&ev, 0x55, sizeof (ev));
  243. ev.sigev_notify = SIGEV_THREAD;
  244. ev.sigev_notify_function = thr2;
  245. ev.sigev_notify_attributes = &nattr;
  246. ev.sigev_value.sival_int = 111;
  247. if (timer_create (TEST_CLOCK, &ev, &timer_thr2) != 0)
  248. {
  249. printf ("*** timer_create for timer_thr2 failed: %m\n");
  250. return 1;
  251. }
  252. int ret = timer_getoverrun (timer_thr1);
  253. if (ret != 0)
  254. {
  255. if (ret == -1)
  256. printf ("*** timer_getoverrun failed: %m\n");
  257. else
  258. printf ("*** timer_getoverrun returned %d != 0\n", ret);
  259. result = 1;
  260. }
  261. struct itimerspec it;
  262. it.it_value.tv_sec = 0;
  263. it.it_value.tv_nsec = -26;
  264. it.it_interval.tv_sec = 0;
  265. it.it_interval.tv_nsec = 0;
  266. if (timer_settime (timer_sig1, 0, &it, NULL) == 0)
  267. {
  268. puts ("*** timer_settime with negative tv_nsec unexpectedly succeeded");
  269. result = 1;
  270. }
  271. else if (errno != EINVAL)
  272. {
  273. printf ("*** timer_settime with negative tv_nsec did not fail with "
  274. "EINVAL: %m\n");
  275. result = 1;
  276. }
  277. it.it_value.tv_nsec = 100000;
  278. it.it_interval.tv_nsec = 1000000000;
  279. if (timer_settime (timer_sig2, 0, &it, NULL) == 0)
  280. {
  281. puts ("\
  282. *** timer_settime with tv_nsec 1000000000 unexpectedly succeeded");
  283. result = 1;
  284. }
  285. else if (errno != EINVAL)
  286. {
  287. printf ("*** timer_settime with tv_nsec 1000000000 did not fail with "
  288. "EINVAL: %m\n");
  289. result = 1;
  290. }
  291. #if 0
  292. it.it_value.tv_nsec = 0;
  293. it.it_interval.tv_nsec = -26;
  294. if (timer_settime (timer_thr1, 0, &it, NULL) != 0)
  295. {
  296. printf ("\
  297. !!! timer_settime with it_value 0 it_interval invalid failed: %m\n");
  298. /* FIXME: is this mandated by POSIX?
  299. result = 1; */
  300. }
  301. it.it_interval.tv_nsec = 3000000000;
  302. if (timer_settime (timer_thr2, 0, &it, NULL) != 0)
  303. {
  304. printf ("\
  305. !!! timer_settime with it_value 0 it_interval invalid failed: %m\n");
  306. /* FIXME: is this mandated by POSIX?
  307. result = 1; */
  308. }
  309. #endif
  310. struct timespec startts;
  311. if (clock_gettime (TEST_CLOCK, &startts) != 0)
  312. {
  313. printf ("*** clock_gettime failed: %m\n");
  314. result = 1;
  315. }
  316. it.it_value.tv_nsec = 100000000;
  317. it.it_interval.tv_nsec = 0;
  318. if (timer_settime (timer_none, 0, &it, NULL) != 0)
  319. {
  320. printf ("*** timer_settime timer_none failed: %m\n");
  321. result = 1;
  322. }
  323. it.it_value.tv_nsec = 200000000;
  324. if (timer_settime (timer_thr1, 0, &it, NULL) != 0)
  325. {
  326. printf ("*** timer_settime timer_thr1 failed: %m\n");
  327. result = 1;
  328. }
  329. it.it_value.tv_nsec = 300000000;
  330. if (timer_settime (timer_thr2, 0, &it, NULL) != 0)
  331. {
  332. printf ("*** timer_settime timer_thr2 failed: %m\n");
  333. result = 1;
  334. }
  335. it.it_value.tv_nsec = 400000000;
  336. if (timer_settime (timer_sig1, 0, &it, NULL) != 0)
  337. {
  338. printf ("*** timer_settime timer_sig1 failed: %m\n");
  339. result = 1;
  340. }
  341. it.it_value.tv_nsec = 500000000;
  342. if (TEMP_FAILURE_RETRY (timer_settime (timer_sig2, 0, &it, NULL)) != 0)
  343. {
  344. printf ("*** timer_settime timer_sig2 failed: %m\n");
  345. result = 1;
  346. }
  347. pthread_mutex_lock (&lock);
  348. while (thr1_cnt == 0 || thr2_cnt == 0)
  349. pthread_cond_wait (&cond, &lock);
  350. pthread_mutex_unlock (&lock);
  351. while (sig1_cnt == 0 || sig2_cnt == 0)
  352. {
  353. ts.tv_sec = 0;
  354. ts.tv_nsec = 100000000;
  355. nanosleep (&ts, NULL);
  356. }
  357. pthread_mutex_lock (&lock);
  358. if (thr1_cnt != 1)
  359. {
  360. printf ("*** thr1 not called exactly once, but %d times\n", thr1_cnt);
  361. result = 1;
  362. }
  363. else if (thr1_err)
  364. {
  365. puts ("*** an error occurred in thr1");
  366. result = 1;
  367. }
  368. else if (thr1_sigval.sival_ptr != &ev)
  369. {
  370. printf ("*** thr1_sigval.sival_ptr %p != %p\n",
  371. thr1_sigval.sival_ptr, &ev);
  372. result = 1;
  373. }
  374. else if (check_ts ("thr1", &startts, &thr1_ts, 200000))
  375. result = 1;
  376. if (thr2_cnt != 1)
  377. {
  378. printf ("*** thr2 not called exactly once, but %d times\n", thr2_cnt);
  379. result = 1;
  380. }
  381. else if (thr2_err)
  382. {
  383. puts ("*** an error occurred in thr2");
  384. result = 1;
  385. }
  386. else if (thr2_sigval.sival_int != 111)
  387. {
  388. printf ("*** thr2_sigval.sival_ptr %d != 111\n", thr2_sigval.sival_int);
  389. result = 1;
  390. }
  391. else if (check_ts ("thr2", &startts, &thr2_ts, 300000))
  392. result = 1;
  393. else if (thr2_guardsize != 0)
  394. {
  395. printf ("*** thr2 guardsize %zd != 0\n", thr2_guardsize);
  396. result = 1;
  397. }
  398. pthread_mutex_unlock (&lock);
  399. if (sig1_cnt != 1)
  400. {
  401. printf ("*** sig1 not called exactly once, but %d times\n", sig1_cnt);
  402. result = 1;
  403. }
  404. else if (sig1_err)
  405. {
  406. printf ("*** errors occurred in sig1 handler %x\n", sig1_err);
  407. result = 1;
  408. }
  409. else if (sig1_sigval.sival_ptr != &ev)
  410. {
  411. printf ("*** sig1_sigval.sival_ptr %p != %p\n",
  412. sig1_sigval.sival_ptr, &ev);
  413. result = 1;
  414. }
  415. else if (check_ts ("sig1", &startts, &sig1_ts, 400000))
  416. result = 1;
  417. if (sig2_cnt != 1)
  418. {
  419. printf ("*** sig2 not called exactly once, but %d times\n", sig2_cnt);
  420. result = 1;
  421. }
  422. else if (sig2_err)
  423. {
  424. printf ("*** errors occurred in sig2 handler %x\n", sig2_err);
  425. result = 1;
  426. }
  427. else if (sig2_sigval.sival_int != 163)
  428. {
  429. printf ("*** sig2_sigval.sival_ptr %d != 163\n", sig2_sigval.sival_int);
  430. result = 1;
  431. }
  432. else if (check_ts ("sig2", &startts, &sig2_ts, 500000))
  433. result = 1;
  434. if (timer_gettime (timer_none, &it) != 0)
  435. {
  436. printf ("*** timer_gettime timer_none failed: %m\n");
  437. result = 1;
  438. }
  439. else if (it.it_value.tv_sec || it.it_value.tv_nsec
  440. || it.it_interval.tv_sec || it.it_interval.tv_nsec)
  441. {
  442. printf ("\
  443. *** timer_gettime timer_none returned { %ld.%09ld, %ld.%09ld }\n",
  444. (long) it.it_value.tv_sec, it.it_value.tv_nsec,
  445. (long) it.it_interval.tv_sec, it.it_interval.tv_nsec);
  446. result = 1;
  447. }
  448. if (clock_gettime (TEST_CLOCK, &startts) != 0)
  449. {
  450. printf ("*** clock_gettime failed: %m\n");
  451. result = 1;
  452. }
  453. it.it_value.tv_sec = 1;
  454. it.it_value.tv_nsec = 0;
  455. it.it_interval.tv_sec = 0;
  456. it.it_interval.tv_nsec = 100000000;
  457. if (timer_settime (timer_none, 0, &it, NULL) != 0)
  458. {
  459. printf ("*** timer_settime timer_none failed: %m\n");
  460. result = 1;
  461. }
  462. it.it_value.tv_nsec = 100000000;
  463. it.it_interval.tv_nsec = 200000000;
  464. if (timer_settime (timer_thr1, 0, &it, NULL) != 0)
  465. {
  466. printf ("*** timer_settime timer_thr1 failed: %m\n");
  467. result = 1;
  468. }
  469. it.it_value.tv_nsec = 200000000;
  470. it.it_interval.tv_nsec = 300000000;
  471. if (timer_settime (timer_thr2, 0, &it, NULL) != 0)
  472. {
  473. printf ("*** timer_settime timer_thr2 failed: %m\n");
  474. result = 1;
  475. }
  476. it.it_value.tv_nsec = 300000000;
  477. it.it_interval.tv_nsec = 400000000;
  478. if (timer_settime (timer_sig1, 0, &it, NULL) != 0)
  479. {
  480. printf ("*** timer_settime timer_sig1 failed: %m\n");
  481. result = 1;
  482. }
  483. it.it_value.tv_nsec = 400000000;
  484. it.it_interval.tv_nsec = 500000000;
  485. if (TEMP_FAILURE_RETRY (timer_settime (timer_sig2, 0, &it, NULL)) != 0)
  486. {
  487. printf ("*** timer_settime timer_sig2 failed: %m\n");
  488. result = 1;
  489. }
  490. pthread_mutex_lock (&lock);
  491. while (thr1_cnt < 6 || thr2_cnt < 6)
  492. pthread_cond_wait (&cond, &lock);
  493. pthread_mutex_unlock (&lock);
  494. while (sig1_cnt < 6 || sig2_cnt < 6)
  495. {
  496. ts.tv_sec = 0;
  497. ts.tv_nsec = 100000000;
  498. nanosleep (&ts, NULL);
  499. }
  500. pthread_mutex_lock (&lock);
  501. if (thr1_err)
  502. {
  503. puts ("*** an error occurred in thr1");
  504. result = 1;
  505. }
  506. else if (check_ts ("thr1", &startts, &thr1_ts, 1100000 + 4 * 200000))
  507. result = 1;
  508. if (thr2_err)
  509. {
  510. puts ("*** an error occurred in thr2");
  511. result = 1;
  512. }
  513. else if (check_ts ("thr2", &startts, &thr2_ts, 1200000 + 4 * 300000))
  514. result = 1;
  515. else if (thr2_guardsize != 0)
  516. {
  517. printf ("*** thr2 guardsize %zd != 0\n", thr2_guardsize);
  518. result = 1;
  519. }
  520. pthread_mutex_unlock (&lock);
  521. if (sig1_err)
  522. {
  523. printf ("*** errors occurred in sig1 handler %x\n", sig1_err);
  524. result = 1;
  525. }
  526. else if (check_ts ("sig1", &startts, &sig1_ts, 1300000 + 4 * 400000))
  527. result = 1;
  528. if (sig2_err)
  529. {
  530. printf ("*** errors occurred in sig2 handler %x\n", sig2_err);
  531. result = 1;
  532. }
  533. else if (check_ts ("sig2", &startts, &sig2_ts, 1400000 + 4 * 500000))
  534. result = 1;
  535. if (timer_gettime (timer_none, &it) != 0)
  536. {
  537. printf ("*** timer_gettime timer_none failed: %m\n");
  538. result = 1;
  539. }
  540. else if (it.it_interval.tv_sec || it.it_interval.tv_nsec != 100000000)
  541. {
  542. printf ("\
  543. !!! second timer_gettime timer_none returned it_interval %ld.%09ld\n",
  544. (long) it.it_interval.tv_sec, it.it_interval.tv_nsec);
  545. /* FIXME: For now disabled.
  546. result = 1; */
  547. }
  548. if (timer_delete (timer_none) != 0)
  549. {
  550. printf ("*** timer_delete for timer_none failed: %m\n");
  551. result = 1;
  552. }
  553. if (timer_delete (timer_sig1) != 0)
  554. {
  555. printf ("*** timer_delete for timer_sig1 failed: %m\n");
  556. result = 1;
  557. }
  558. if (timer_delete (timer_sig2) != 0)
  559. {
  560. printf ("*** timer_delete for timer_sig2 failed: %m\n");
  561. result = 1;
  562. }
  563. if (timer_delete (timer_thr1) != 0)
  564. {
  565. printf ("*** timer_delete for timer_thr1 failed: %m\n");
  566. result = 1;
  567. }
  568. if (timer_delete (timer_thr2) != 0)
  569. {
  570. printf ("*** timer_delete for timer_thr2 failed: %m\n");
  571. result = 1;
  572. }
  573. return result;
  574. }
  575. #else
  576. # define TEST_FUNCTION 0
  577. #endif
  578. #include "../test-skeleton.c"