summaryrefslogtreecommitdiff
path: root/misc/buffer/patches/patch-ab
blob: 6759f97d6c2c836aaf75a3a6929a29f981c27dfa (plain)
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
$NetBSD: patch-ab,v 1.2 1999/09/12 16:50:41 kim Exp $

--- sem.c.orig	Wed Jul 14 11:59:18 1993
+++ sem.c	Sun Sep 12 12:45:24 1999
@@ -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;
@@ -148,10 +150,17 @@
 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" );
 	}