1/*
2 * Copyright (c) 2002, Intel Corporation. All rights reserved.
3 * Created by:  julie.n.fleischer REMOVE-THIS AT intel DOT com
4 * This file is licensed under the GPL license.  For the full content
5 * of this license, see the COPYING file at the top level of this
6 * source tree.
7 *
8 * Test that TIMER_MAX timers can be created.
9 *
10 * For this test, clock CLOCK_REALTIME will be used.
11 */
12
13#include <time.h>
14#include <stdio.h>
15#include <limits.h>
16#include <unistd.h>
17#include "posixtest.h"
18
19int main(int argc, char *argv[])
20{
21	timer_t tid;
22	int i;
23	long scTIMER_MAX=0;
24
25	scTIMER_MAX=sysconf(_SC_TIMER_MAX);
26
27	for (i=0; i<scTIMER_MAX;i++) {
28		if (timer_create(CLOCK_REALTIME, NULL, &tid) != 0) {
29			perror("timer_create() did not return success\n");
30			return PTS_FAIL;
31		}
32	}
33
34	printf("Test PASSED\n");
35	return PTS_PASS;
36}
37