1/*
2 * Copyright (c) 2002, Intel Corporation. All rights reserved.
3 * Created by:  bing.wei.liu 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 pthread_mutexattr_destroy()
9 *    shall destroy a mutex attributes object.
10 *
11 * Steps:
12 * 1.  Initialize a pthread_mutexattr_t object using pthread_mutexattr_init()
13 * 2.  Destroy the attributes object using pthread_mutexattr_destroy()
14 *
15 */
16
17#include <pthread.h>
18#include <stdio.h>
19#include <errno.h>
20#include "posixtest.h"
21
22
23int main()
24{
25	pthread_mutexattr_t mta;
26	int rc;
27
28	/* Initialize a mutex attributes object */
29	if((rc=pthread_mutexattr_init(&mta)) != 0)
30	{
31		fprintf(stderr,"Cannot initialize mutex attributes object\n");
32		return PTS_UNRESOLVED;
33	}
34
35	/* Destroy the mutex attributes object */
36	if(pthread_mutexattr_destroy(&mta) != 0)
37	{
38		fprintf(stderr,"Error at pthread_mutexattr_destroy(), rc=%d\n", rc);
39		printf("Test FAILED\n");
40		return PTS_FAIL;
41	}
42
43	printf("Test PASSED\n");
44	return PTS_PASS;
45}
46
47
48