Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/semaphore.h
+++ new/usr/src/head/semaphore.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 #ifndef _SEMAPHORE_H
28 30 #define _SEMAPHORE_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 #include <sys/feature_tests.h>
33 33
34 34 #include <sys/types.h>
35 35 #include <sys/fcntl.h>
36 36
37 37 #ifdef __cplusplus
38 38 extern "C" {
39 39 #endif
40 40
41 41 typedef struct {
42 42 /* this structure must be the same as sema_t in <synch.h> */
43 43 uint32_t sem_count; /* semaphore count */
44 44 uint16_t sem_type;
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
45 45 uint16_t sem_magic;
46 46 upad64_t sem_pad1[3]; /* reserved for a mutex_t */
47 47 upad64_t sem_pad2[2]; /* reserved for a cond_t */
48 48 } sem_t;
49 49
50 50 #define SEM_FAILED ((sem_t *)(-1))
51 51
52 52 /*
53 53 * function prototypes
54 54 */
55 -#if defined(__STDC__)
56 55 int sem_init(sem_t *, int, unsigned int);
57 56 int sem_destroy(sem_t *);
58 57 sem_t *sem_open(const char *, int, ...);
59 58 int sem_close(sem_t *);
60 59 int sem_unlink(const char *);
61 60 int sem_wait(sem_t *);
62 61 /*
63 62 * Inclusion of <time.h> breaks X/Open and POSIX namespace.
64 63 * The timespec structure while allowed in XPG6 and POSIX.1003d-1999,
65 64 * is not permitted in prior POSIX or X/Open specifications even
66 65 * though functions beginning with sem_* are allowed.
67 66 */
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
68 67 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
69 68 struct timespec;
70 69 int sem_timedwait(sem_t *_RESTRICT_KYWD,
71 70 const struct timespec *_RESTRICT_KYWD);
72 71 int sem_reltimedwait_np(sem_t *_RESTRICT_KYWD,
73 72 const struct timespec *_RESTRICT_KYWD);
74 73 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
75 74 int sem_trywait(sem_t *);
76 75 int sem_post(sem_t *);
77 76 int sem_getvalue(sem_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
78 -#else
79 -int sem_init();
80 -int sem_destroy();
81 -sem_t *sem_open();
82 -int sem_close();
83 -int sem_unlink();
84 -int sem_wait();
85 -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
86 -int sem_timedwait();
87 -int sem_reltimedwait_np();
88 -#endif /* #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
89 -int sem_trywait();
90 -int sem_post();
91 -int sem_getvalue();
92 -#endif /* __STDC__ */
93 77
94 78 #ifdef __cplusplus
95 79 }
96 80 #endif
97 81
98 82 #endif /* _SEMAPHORE_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX