1 /* 2 * Copyright (C) 2015 Cyril Hrubis <chrubis (at) suse.cz> 3 * 4 * Licensed under the GNU GPLv2 or later. 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13 * the GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 /* 20 * 1. Block on a bitset futex and wait for timeout, the difference between 21 * normal futex and bitset futex is that that the later have absolute timeout. 22 * 2. Check that the futex waited for expected time. 23 */ 24 25 #include <errno.h> 26 27 #include "test.h" 28 #include "futextest.h" 29 #include "futex_wait_bitset.h" 30 31 const char *TCID="futex_wait_bitset02"; 32 const int TST_TOTAL=1; 33 34 #define DEFAULT_TIMEOUT_US 100010 35 36 int main(int argc, char *argv[]) 37 { 38 int lc; 39 40 tst_timer_check(CLOCK_REALTIME); 41 42 tst_parse_opts(argc, argv, NULL, NULL); 43 44 for (lc = 0; TEST_LOOPING(lc); lc++) 45 verify_futex_wait_bitset(DEFAULT_TIMEOUT_US, CLOCK_REALTIME); 46 47 tst_exit(); 48 } 49