===========================================================
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#define BEEP_TIME 150
#define BEEP_OK 1000
#define BEEP_WARN 2000
#define BEEP_ERR 4000
#include <sys/kd.h>
static void beep(unsigned int, unsigned int);
int
main(int argc, char **argv)
{
beep(500, 1000);
beep(500, 2000);
beep(500, 4000);
return 0;
}
static
void beep(unsigned int ms, unsigned int freq)
{
int fd, arg;
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
return;
arg = (ms << 16) | freq;
ioctl(fd, KDMKTONE, arg);
close(fd);
usleep(ms*1000);
}
===========================================================
-- B. D. Elliott bde@nwlink.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/