Subject: Re: How to produce BEEP
To: Dante Profeta <profeta@neomedia.it>
From: Joao Carlos Mendes Luis <jonny@mailhost.coppe.ufrj.br>
List: netbsd-help
Date: 10/16/1996 13:56:03
#define quoting(Dante Profeta)
// >Hi all,
// >I've to emit a series of 'beeps', put I cannot use printf("%c\n",0x07);
// 
// Well, sorry, I didn't explain why I cannot use printf... This is the
// reason:
// I cannot use printf because my prg is started by cron, and cron send a
// mail to root for every char putted on the standard output, so my BEEP
// isn't produced in real time: I can hear it only when I read root's
// mails.
// 
// I hoped, to avoid this behaviour, for a system call to produce a BEEP.
// 
// P.S. I haven't any sound card. I have to use the internal speeker.
// 
// Is there a work around?
// 


Oh.  Now this is easy !!!

Just this:

{
  int console;

  console = open( "/dev/console", O_WRONLY );
  ...
  write( console, "\007", 1 );  /*  BEEP on the console */
  ...
}

					Jonny

--
Joao Carlos Mendes Luis			jonny@gta.ufrj.br
+55 21 290-4698 ( Job )			jonny@cisi.coppe.ufrj.br
Network Manager				UFRJ/COPPE/CISI
Universidade Federal do Rio de Janeiro