2.1.109 and /dev/vcs?

Pavel Janik ml. (Pavel.Janik@inet.cz)
Fri, 17 Jul 1998 23:46:08 +0200


Hi,

try this on 2.1.109-vanilla (2.1.105 is ok). It should display digital
clock on the upper right corner of the screen:

--- cut here ---
#include <fcntl.h>
#include <time.h>

void
fatal(char *s) {
perror(s);
exit(1);
}

int
main(){
int fd;
int cols = 80;
time_t tid;
struct tm *t;
char tijd[10];

if((fd = open("/dev/vcs0", O_WRONLY)) < 0)
fatal("/dev/vcs0");

while(1) {
lseek(fd, cols-9, 0);
tid = time(0);
t = localtime(&tid);
sprintf(tijd, " %02d:%02d:%02d", t->tm_hour, t->tm_min, t->tm_sec);
write(fd, tijd, 9);
usleep(500000L);
}
}
--- cut here ---

It seems that writing to /dev/vcs0 makes the console singing "Ugh,
lalala, I love you baby..."

-- 
Pavel Janik ml.
Pavel.Janik@inet.cz

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html