Fixed the Python help command.
[super-star-trek.git] / src / sstlinux.c
1 #include "config.h"
2 #include "sstlinux.h"
3
4 #ifdef HAVE_LINUX_KD_H
5
6 #include <sys/types.h>
7 #include <fcntl.h>
8 #include <sys/ioctl.h>
9 #include <linux/kd.h>
10
11 static int fd = 0;
12 #endif
13
14 void sound(unsigned int freq)
15 {
16 #ifdef HAVE_LINUX_KD_H
17     if (fd==0)
18         fd=open("/dev/console", O_RDONLY);
19     if (fd>0)
20         ioctl(fd, KDMKTONE, 1193180/freq + (0xFFFF<<16));
21 #endif
22 }
23
24 void nosound(void)
25 {
26 #ifdef HAVE_LINUX_KD_H
27     if(fd>0)
28         ioctl(fd, KDMKTONE, 0);
29 #endif
30 }