1/*
2 * Copyright (c) 2004, Intel Corporation. All rights reserved.
3 * Created by:  crystal.xiong 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 pthread_attr_setscope()
9 *
10 * Steps:
11 * 1.  Initialize a pthread_attr_t object using pthread_attr_init()
12 * 2.  Call pthread_attr_setscope with unsupported scope
13 *     parameter
14 *
15 */
16
17#include <pthread.h>
18#include <stdio.h>
19#include <stdlib.h>
20#include <errno.h>
21#include "posixtest.h"
22
23#define TEST "5-1"
24#define FUNCTION "pthread_attr_setscope"
25#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
26
27/* What is the unsupported value of scope paramter? */
28#define UNSUPSCOPE -1
29
30int main()
31{
32	if (1) {
33		printf("Untested for now, cannot find a unsupported inheritsched value\n");
34		return PTS_UNTESTED;
35	}
36	int                   rc=0;
37	pthread_attr_t        attr;
38
39	rc = pthread_attr_init(&attr);
40	if (rc != 0) {
41		printf(ERROR_PREFIX "pthread_attr_init\n");
42		exit(PTS_UNRESOLVED);
43	}
44
45  	rc = pthread_attr_setscope(&attr, UNSUPSCOPE);
46	if ((rc != ENOTSUP)) {
47		printf(ERROR_PREFIX "pthread_attr_setscope\n");
48		exit(PTS_UNRESOLVED);
49	}
50  	rc = pthread_attr_destroy(&attr);
51	if( rc != 0) {
52		printf(ERROR_PREFIX "pthread_attr_destroy\n");
53		exit(PTS_UNRESOLVED);
54	}
55	printf("Test PASS\n");
56	return PTS_PASS;
57}
58
59
60
61
62