xref: /freebsd/tools/regression/p1003_1b/p26.c (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*df57947fSPedro F. Giffuni /*-
2*df57947fSPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3*df57947fSPedro F. Giffuni  *
4e5f1b1b1SPeter Dufault  * Copyright (c) 1996-1999
5e5f1b1b1SPeter Dufault  *	HD Associates, Inc.  All rights reserved.
6e5f1b1b1SPeter Dufault  *
7e5f1b1b1SPeter Dufault  * Redistribution and use in source and binary forms, with or without
8e5f1b1b1SPeter Dufault  * modification, are permitted provided that the following conditions
9e5f1b1b1SPeter Dufault  * are met:
10e5f1b1b1SPeter Dufault  * 1. Redistributions of source code must retain the above copyright
11e5f1b1b1SPeter Dufault  *    notice, this list of conditions and the following disclaimer.
12e5f1b1b1SPeter Dufault  * 2. Redistributions in binary form must reproduce the above copyright
13e5f1b1b1SPeter Dufault  *    notice, this list of conditions and the following disclaimer in the
14e5f1b1b1SPeter Dufault  *    documentation and/or other materials provided with the distribution.
15e5f1b1b1SPeter Dufault  * 3. All advertising materials mentioning features or use of this software
16e5f1b1b1SPeter Dufault  *    must display the following acknowledgement:
17e5f1b1b1SPeter Dufault  *	This product includes software developed by HD Associates, Inc
18e5f1b1b1SPeter Dufault  * 4. Neither the name of the author nor the names of any co-contributors
19e5f1b1b1SPeter Dufault  *    may be used to endorse or promote products derived from this software
20e5f1b1b1SPeter Dufault  *    without specific prior written permission.
21e5f1b1b1SPeter Dufault  *
22e5f1b1b1SPeter Dufault  * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
23e5f1b1b1SPeter Dufault  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24e5f1b1b1SPeter Dufault  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25e5f1b1b1SPeter Dufault  * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
26e5f1b1b1SPeter Dufault  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27e5f1b1b1SPeter Dufault  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28e5f1b1b1SPeter Dufault  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29e5f1b1b1SPeter Dufault  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30e5f1b1b1SPeter Dufault  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31e5f1b1b1SPeter Dufault  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32e5f1b1b1SPeter Dufault  * SUCH DAMAGE.
33e5f1b1b1SPeter Dufault  */
34e5f1b1b1SPeter Dufault #define _POSIX_SOURCE
35e5f1b1b1SPeter Dufault #define _POSIX_C_SOURCE 199309L
36e5f1b1b1SPeter Dufault #include <unistd.h>
37e5f1b1b1SPeter Dufault #include <stdio.h>
38e5f1b1b1SPeter Dufault 
p26(int ac,char * av[])39e5f1b1b1SPeter Dufault int p26(int ac, char *av[])
40e5f1b1b1SPeter Dufault {
41e5f1b1b1SPeter Dufault 	int ret = 0;
42e5f1b1b1SPeter Dufault 
43e5f1b1b1SPeter Dufault 	#ifndef _POSIX_VERSION
44e5f1b1b1SPeter Dufault 	printf("POSIX is not supported.\n");
45e5f1b1b1SPeter Dufault 	ret = -1;
46e5f1b1b1SPeter Dufault 	#else	/* _POSIX_VERSION */
47e5f1b1b1SPeter Dufault 
48e5f1b1b1SPeter Dufault 	#if (_POSIX_VERSION == 198808L)
49e5f1b1b1SPeter Dufault 	printf("POSIX.1 is supported but not POSIX.1B (FIPS 151-1)\n");
50e5f1b1b1SPeter Dufault 	#elif (_POSIX_VERSION == 199009L)
51e5f1b1b1SPeter Dufault 	printf("POSIX.1 is supported but not POSIX.1B (FIPS 151-2)\n");
52e5f1b1b1SPeter Dufault 	#elif (_POSIX_VERSION >= 199309L)
53e5f1b1b1SPeter Dufault 	printf("POSIX.1 and POSIX.1B are supported.\n");
54e5f1b1b1SPeter Dufault 	#else
55e5f1b1b1SPeter Dufault 	printf("_POSIX_VERSION (%ld) not 198808, 199009, or >= 199309.\n",
56e5f1b1b1SPeter Dufault 		_POSIX_VERSION);
57e5f1b1b1SPeter Dufault 	ret = -1;
58e5f1b1b1SPeter Dufault 	#endif
59e5f1b1b1SPeter Dufault 
60e5f1b1b1SPeter Dufault 	#endif	/* _POSIX_VERSION */
61e5f1b1b1SPeter Dufault 	return ret;
62e5f1b1b1SPeter Dufault }
63e5f1b1b1SPeter Dufault #ifdef STANDALONE_TESTS
main(int argc,char * argv[])64e5f1b1b1SPeter Dufault int main(int argc, char *argv[]) { return p26(argc, argv); }
65e5f1b1b1SPeter Dufault #endif
66