1/*
2    Copyright (c) 2003, Intel Corporation. All rights reserved.
3    Created by:  majid.awad 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
9/*
10 * successful unamed semaphore initialization return zero
11 * on successful completion.
12*/
13
14#include <sys/types.h>
15#include <stdio.h>
16#include <errno.h>
17#include <unistd.h>
18#include <semaphore.h>
19#include <sys/stat.h>
20#include <fcntl.h>
21#include "posixtest.h"
22
23#define TEST "5-2"
24#define FUNCTION "sem_init"
25#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
26
27
28int main ()
29{
30	sem_t   mysemp;
31
32	if ( sem_init (&mysemp, 0, 1) == 0 ) {
33                puts("TEST PASSED");
34		sem_destroy(&mysemp);
35                return PTS_PASS;
36        } else {
37                puts("TEST FAILED");
38                return PTS_FAIL;
39	}
40}
41
42