Mon Jan 5 01:26:30 2009 UTC ()
fix sem prototypes.


(christos)
diff -r1.4.30.2 -r1.4.30.3 src/sys/compat/sys/sem.h

cvs diff -r1.4.30.2 -r1.4.30.3 src/sys/compat/sys/sem.h (switch to unified diff)

--- src/sys/compat/sys/sem.h 2008/11/09 23:28:36 1.4.30.2
+++ src/sys/compat/sys/sem.h 2009/01/05 01:26:30 1.4.30.3
@@ -1,109 +1,109 @@ @@ -1,109 +1,109 @@
1/* $NetBSD: sem.h,v 1.4.30.2 2008/11/09 23:28:36 christos Exp $ */ 1/* $NetBSD: sem.h,v 1.4.30.3 2009/01/05 01:26:30 christos Exp $ */
2 2
3/* 3/*
4 * SVID compatible sem.h file 4 * SVID compatible sem.h file
5 * 5 *
6 * Author: Daniel Boulet 6 * Author: Daniel Boulet
7 */ 7 */
8 8
9#ifndef _COMPAT_SYS_SEM_H_ 9#ifndef _COMPAT_SYS_SEM_H_
10#define _COMPAT_SYS_SEM_H_ 10#define _COMPAT_SYS_SEM_H_
11 11
12#include <compat/sys/ipc.h> 12#include <compat/sys/ipc.h>
13 13
14struct semid_ds14 { 14struct semid_ds14 {
15 struct ipc_perm14 sem_perm; /* operation permission struct */ 15 struct ipc_perm14 sem_perm; /* operation permission struct */
16 struct __sem *sem_base; /* pointer to first semaphore in set */ 16 struct __sem *sem_base; /* pointer to first semaphore in set */
17 unsigned short sem_nsems; /* number of sems in set */ 17 unsigned short sem_nsems; /* number of sems in set */
18 int32_t sem_otime; /* last operation time */ 18 int32_t sem_otime; /* last operation time */
19 long sem_pad1; /* SVABI/386 says I need this here */ 19 long sem_pad1; /* SVABI/386 says I need this here */
20 int32_t sem_ctime; /* last change time */ 20 int32_t sem_ctime; /* last change time */
21 /* Times measured in secs since */ 21 /* Times measured in secs since */
22 /* 00:00:00 GMT, Jan. 1, 1970 */ 22 /* 00:00:00 GMT, Jan. 1, 1970 */
23 long sem_pad2; /* SVABI/386 says I need this here */ 23 long sem_pad2; /* SVABI/386 says I need this here */
24 long sem_pad3[4]; /* SVABI/386 says I need this here */ 24 long sem_pad3[4]; /* SVABI/386 says I need this here */
25}; 25};
26 26
27struct semid_ds13 { 27struct semid_ds13 {
28 struct ipc_perm sem_perm; /* operation permission structure */ 28 struct ipc_perm sem_perm; /* operation permission structure */
29 unsigned short sem_nsems; /* number of semaphores in set */ 29 unsigned short sem_nsems; /* number of semaphores in set */
30 int32_t sem_otime; /* last semop() time */ 30 int32_t sem_otime; /* last semop() time */
31 int32_t sem_ctime; /* last time changed by semctl() */ 31 int32_t sem_ctime; /* last time changed by semctl() */
32 32
33 /* 33 /*
34 * These members are private and used only in the internal 34 * These members are private and used only in the internal
35 * implementation of this interface. 35 * implementation of this interface.
36 */ 36 */
37 struct __sem *_sem_base; /* pointer to first semaphore in set */ 37 struct __sem *_sem_base; /* pointer to first semaphore in set */
38}; 38};
39__BEGIN_DECLS 39__BEGIN_DECLS
40static __inline void __semid_ds14_to_native(const struct semid_ds14 *, struct semid_ds *); 40static __inline void __semid_ds14_to_native(const struct semid_ds14 *, struct semid_ds *);
41static __inline void __native_to_semid_ds14(const struct semid_ds *, struct semid_ds14 *); 41static __inline void __native_to_semid_ds14(const struct semid_ds *, struct semid_ds14 *);
42static __inline void __semid_ds13_to_native(const struct semid_ds13 *, struct semid_ds *); 42static __inline void __semid_ds13_to_native(const struct semid_ds13 *, struct semid_ds *);
43static __inline void __native_to_semid_ds13(const struct semid_ds *, struct semid_ds13 *); 43static __inline void __native_to_semid_ds13(const struct semid_ds *, struct semid_ds13 *);
44 44
45static __inline void 45static __inline void
46__semid_ds13_to_native(const struct semid_ds13 *osembuf, struct semid_ds *sembuf) 46__semid_ds13_to_native(const struct semid_ds13 *osembuf, struct semid_ds *sembuf)
47{ 47{
48 48
49 sembuf->sem_perm = osembuf->sem_perm; 49 sembuf->sem_perm = osembuf->sem_perm;
50 50
51#define CVT(x) sembuf->x = osembuf->x 51#define CVT(x) sembuf->x = osembuf->x
52 CVT(sem_nsems); 52 CVT(sem_nsems);
53 CVT(sem_otime); 53 CVT(sem_otime);
54 CVT(sem_ctime); 54 CVT(sem_ctime);
55#undef CVT 55#undef CVT
56} 56}
57 57
58static __inline void 58static __inline void
59__native_to_semid_ds13(const struct semid_ds *sembuf, struct semid_ds13 *osembuf) 59__native_to_semid_ds13(const struct semid_ds *sembuf, struct semid_ds13 *osembuf)
60{ 60{
61 61
62 osembuf->sem_perm = sembuf->sem_perm; 62 osembuf->sem_perm = sembuf->sem_perm;
63 63
64#define CVT(x) osembuf->x = sembuf->x 64#define CVT(x) osembuf->x = sembuf->x
65#define CVTI(x) osembuf->x = (int)sembuf->x 65#define CVTI(x) osembuf->x = (int)sembuf->x
66 CVT(sem_nsems); 66 CVT(sem_nsems);
67 CVTI(sem_otime); 67 CVTI(sem_otime);
68 CVTI(sem_ctime); 68 CVTI(sem_ctime);
69#undef CVT 69#undef CVT
70#undef CVTI 70#undef CVTI
71} 71}
72 72
73static __inline void 73static __inline void
74__semid_ds14_to_native(const struct semid_ds14 *osembuf, struct semid_ds *sembuf) 74__semid_ds14_to_native(const struct semid_ds14 *osembuf, struct semid_ds *sembuf)
75{ 75{
76 76
77 __ipc_perm14_to_native(&osembuf->sem_perm, &sembuf->sem_perm); 77 __ipc_perm14_to_native(&osembuf->sem_perm, &sembuf->sem_perm);
78 78
79#define CVT(x) sembuf->x = osembuf->x 79#define CVT(x) sembuf->x = osembuf->x
80 CVT(sem_nsems); 80 CVT(sem_nsems);
81 CVT(sem_otime); 81 CVT(sem_otime);
82 CVT(sem_ctime); 82 CVT(sem_ctime);
83#undef CVT 83#undef CVT
84} 84}
85 85
86static __inline void 86static __inline void
87__native_to_semid_ds14(const struct semid_ds *sembuf, struct semid_ds14 *osembuf) 87__native_to_semid_ds14(const struct semid_ds *sembuf, struct semid_ds14 *osembuf)
88{ 88{
89 89
90 __native_to_ipc_perm14(&sembuf->sem_perm, &osembuf->sem_perm); 90 __native_to_ipc_perm14(&sembuf->sem_perm, &osembuf->sem_perm);
91 91
92#define CVT(x) osembuf->x = sembuf->x 92#define CVT(x) osembuf->x = sembuf->x
93#define CVTI(x) osembuf->x = (int)sembuf->x 93#define CVTI(x) osembuf->x = (int)sembuf->x
94 CVT(sem_nsems); 94 CVT(sem_nsems);
95 CVTI(sem_otime); 95 CVTI(sem_otime);
96 CVTI(sem_ctime); 96 CVTI(sem_ctime);
97#undef CVT 97#undef CVT
98#undef CVTI 98#undef CVTI
99} 99}
100 100
101int semctl(int, int, int, union __semun); 101int semctl(int, int, int, ...);
102int __semctl(int, int, int, union __semun *); 102int __semctl(int, int, int, union __semun *);
103int __semctl13(int, int, int, ...); 103int __semctl13(int, int, int, ...);
104int __semctl14(int, int, int, ...); 104int __semctl14(int, int, int, ...);
105int __semctl50(int, int, int, ...); 105int __semctl50(int, int, int, ...);
106int ____semctl50(int, int, int, void *); 106int ____semctl50(int, int, int, ...);
107__END_DECLS 107__END_DECLS
108 108
109#endif /* !_COMPAT_SYS_SEM_H_ */ 109#endif /* !_COMPAT_SYS_SEM_H_ */