diff -ur buffer-1.19.orig/buffer.c buffer-1.19/buffer.c
--- buffer-1.19.orig/buffer.c	Wed Jun  7 15:30:20 2000
+++ buffer-1.19/buffer.c	Wed Jun  7 15:44:55 2000
@@ -109,6 +109,8 @@
  * Initial revision
  * 
  */
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <signal.h>
@@ -509,7 +511,7 @@
 	if( debug )
 		fprintf( stderr, "%s pbuffer is 0x%08x, buffer_size is %d [%d x %d]\n",
 			proc_string,
-			(char *)pbuffer, buffer_size, blocks, blocksize );
+			(unsigned int) (char *)pbuffer, buffer_size, blocks, blocksize );
 
 #ifdef SYS5
 	memset( (char *)pbuffer, '\0', buffer_size );
diff -ur buffer-1.19.orig/sem.c buffer-1.19/sem.c
--- buffer-1.19.orig/sem.c	Wed Jun  7 15:30:20 2000
+++ buffer-1.19/sem.c	Wed Jun  7 16:00:04 2000
@@ -28,13 +28,14 @@
 
 #include <stdio.h>
 #include <sys/types.h>
+#include <unistd.h>
 #include <sys/stat.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
 #include <errno.h>
 #include "sem.h"
 
-#if defined(SYS5) || defined(ultrix) || defined(_AIX)
+#if defined(SYS5) || defined(ultrix) || defined(_AIX) || defined _SEM_SEMUN_UNDEFINED
 union semun {
 	int val;
 	struct semid_ds *buf;
@@ -95,7 +96,7 @@
 	return sem;
 }
 
-static
+static void
 do_sem( sem_id, pbuf, err )
 	int sem_id;
 	struct sembuf *pbuf;
@@ -152,7 +153,7 @@
 	if( sem_id == -1 )
 		return;
 
-	if( semctl( sem_id, 0, IPC_RMID, NULL ) == -1 ){
+	if( semctl( sem_id, 0, IPC_RMID, (union semun) 0 ) == -1 ){
 		report_proc();
 		perror( "internal error, failed to remove semaphore" );
 	}
