1 /* $NetBSD: loadkmap.c,v 1.8 2005/12/11 12:19:45 christos Exp $ */
3 * loadkmap - load keyboard map (for NetBSD/X680x0)
4 * from: amiga/stand/loadkmap/loadkmap.c
5 * Copyright 1994 by Masaru Oki
9 __RCSID("$NetBSD: loadkmap.c,v 1.8 2005/12/11 12:19:45 christos Exp $");
13 #include <sys/types.h>
14 #include <sys/ioctl.h>
15 #include <machine/kbdmap.h>
16 #include <machine/iteioctl.h>
18 void load_kmap(const char *);
21 main(int argc
, char *argv
[])
25 fprintf(stderr
, "Usage: %s kmapfile\n", argv
[0]);
34 load_kmap(const char *file
)
36 unsigned char buf
[sizeof(struct kbdmap
)];
39 if ((fd
= open(file
, 0)) >= 0) {
40 if (read(fd
, buf
, sizeof(buf
)) == sizeof(buf
)) {
41 if (ioctl(0, ITEIOCSKMAP
, buf
) == 0)
44 perror("ITEIOCSKMAP");
46 perror("read kbdmap");
51 perror("open kbdmap");