1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
$NetBSD: patch-ab,v 1.3 2005/11/10 17:31:48 joerg Exp $
--- sem.c.orig 1994-10-04 16:44:53.000000000 +0000
+++ sem.c
@@ -32,8 +32,10 @@
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>
+#include <sys/param.h>
-#if defined(SYS5) || defined(ultrix) || defined(_AIX)
+#if defined(SYS5) || defined(ultrix) || defined(_AIX) \
+ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 104110000))
union semun {
int val;
struct semid_ds *buf;
@@ -60,7 +62,6 @@ sem_set( sem_id, semn, val )
int val;
{
union semun arg;
- extern int errno;
arg.val = val;
@@ -148,10 +149,17 @@ void
remove_sems( sem_id )
int sem_id;
{
+#if defined(__NetBSD__) && defined(__NetBSD_Version__) \
+ && (__NetBSD_Version__ < 104110000)
+ union semun dummy;
+#else
+#define dummy NULL
+#endif
+
if( sem_id == -1 )
return;
- if( semctl( sem_id, 0, IPC_RMID, NULL ) == -1 ){
+ if( semctl( sem_id, 0, IPC_RMID, dummy ) == -1 ){
report_proc();
perror( "internal error, failed to remove semaphore" );
}
|