Subject: Re: How to produce BEEP
To: None <profeta@neomedia.it>
From: Mike Long <mike.long@analog.com>
List: netbsd-help
Date: 10/17/1996 11:38:36
>Date: Thu, 17 Oct 1996 11:42:44 +0200
>From: Dante Profeta <profeta@neomedia.it>
>
>Mike Long wrote:
>> #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.
>
>Any ideas?

Code very similar to that above (s/void beep(void)/int main()/) worked
for me.  I use pccons instead of pcvt; that might have something to do
with it.
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil