On 10/06/16 22:44, ludovic coues wrote:
misc strip attachment. Please send your diff inline or start a new thread on dev
Thanks forthe pointer Ludovic,

sys/dev/audio.c:

@@ -1537,6 +1537,11 @@
     case FIONBIO:
         /* All handled in the upper FS layer. */
         break;
+    case FIOASYNC:
+        /* No async mode, so set is an error, unset is a noop. */
+        if (*(int *)addr)
+            error = EINVAL;
+        break;
     case AUDIO_GETPOS:
         mtx_enter(&audio_lock);
         ap = (struct audio_pos *)addr;


test program:

#include <fcntl.h>
#include <stdio.h>

int
main(void)
{
    int fd, flags;
    if ((fd = open("/dev/audio", O_RDWR | O_NDELAY, 0)) < 0) {
        perror("can't open file");
        return fd;
    }

    if ((flags = fcntl(fd, F_GETFL)) < 0)
        perror("can't get flags!\n");
    else if (fcntl(fd, F_SETFL, flags & ~(O_NDELAY)) < 0)
        perror("can't set flags");
    else
        printf("good!\n");

    close(fd);
    return 0;
}

2016-10-06 2:15 GMT+02:00 Tobias Brodel <brittleh...@gmail.com>:
Somehow sent the inverse of the intended diff, all apologies. Please find the proper diff attached. toby/ On 10/06/16 11:07, Tobias Brodel wrote:
Hi, I've been working on porting an audio application which uses the OSS compatibility layer. It was throwing warnings at runtime about not being able to set flags on /dev/audio. After searching around I found a diff written by Steven McDonald in the misc@ archives: http://openbsd-archive.7691.n7.nabble.com/perl-fctnl-woes-td276032.html Apparently the issue lies with the removal of the FIOASYNC ioctl(2). I've applied the diff on -CURRENT and it has solved my issues - please find the diff and a test program attached. toby/
[demime 1.01d removed an attachment of type text/x-patch which had a name of sys_dev_audio_c.diff]

Reply via email to