+/*
+ * beep.c -- Let's beep a little bit ;-)
+ * Written by Alex Barton, alex@barton.de, 2000-11-18
+ * Last changes: 2003-04-09, alex
+ */
+
+#define COUNT 3
+
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int main( void )
+{
+ FILE *fd;
+ int i = 0;
+
+ fd = fopen( "/dev/console", "w" );
+ if( ! fd )
+ {
+ /* Oops, Fehler ... */
+ printf( "Can't open /dev/console: %s\n", strerror( errno ));
+ return 1;
+ }
+
+ /* Ok, Datei (Device) geƶffnet ... */
+ while( i < COUNT )
+ {
+ fputs( "\x07", fd );
+ fflush( fd );
+ i++;
+ if( i >= COUNT ) break;
+ sleep( 1 );
+ }
+ fclose( fd );
+
+ return 0;
+} /* main */
+
+/* -eof- */