$NetBSD: patch-ac,v 1.5 2003/03/22 05:44:38 dillo Exp $

--- audioIO_SunOS.c.orig	Sat May 31 13:47:58 1997
+++ audioIO_SunOS.c
@@ -8,7 +8,11 @@
 
 #include "amp.h"
 #include <sys/types.h>
+#ifndef OS_NetBSD
 #include <sys/stropts.h>
+#else
+#include <sys/ioctl.h>
+#endif
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -31,13 +35,12 @@ audioOpen(int frequency, int stereo, int
 {
 	int res;
 
-	if ((audio_fd = open("/dev/audio",O_RDWR))==-1) {
+	if ((audio_fd = open("/dev/audio",O_WRONLY))==-1) {
 		die(" unable to open the audio device\n");
 	}
 	DB(audio, msg("Audio device opened on %d\n",audio_fd) );
 
-	if (ioctl(audio_fd,AUDIO_GETINFO,&auinfo)<0)
-		die("Unable to get audio info\n");
+	AUDIO_INITINFO(&auinfo);
 
 	auinfo.play.precision=16;
 	auinfo.play.encoding=AUDIO_ENCODING_LINEAR;
