Subject: Re: How to produce BEEP
To: None <netbsd-help@NetBSD.ORG>
From: Dante Profeta <profeta@neomedia.it>
List: netbsd-help
Date: 10/17/1996 11:42:44
Mike Long wrote:
> A little UTSLing yielded ioctl(CONSOLE_X_BELL).  So, here's my second
> try:
> 
> #include <unistd.h>
> #include <fcntl.h>
> #include <sys/ioctl.h>
> #define CONSOLE_X_BELL _IOW('t', 123, int[2])
> void beep(void)
> {
>     int f = open("/dev/console", O_WRONLY | O_NOCTTY);
>     int a[2] = { 2600, 500 }; /* pitch (Hz), duration (ms) */
>     if (f >= 0) {
>         ioctl(f, CONSOLE_X_BELL, a);
>         close(f);
>     }
> }

I tried it, but it dosen't works:
ioctl() returns -1

I have the XSERVER option active, and any application that could emit a
beep, indeed emit a beep :)

I run it as root and the mod bits are 4755.
I have also pss0, sp0, spkr0 options enabled.

Any ideas?

Thanks a lot
--
__  ____
_|\an|e_  profeta@neomedia.it