pkgsrc/misc/buffer/patches/patch-ab
2005-11-10 17:31:47 +00:00

43 lines
1 KiB
Text

$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" );
}