1 /* $NetBSD: loadkmap.c,v 1.5 2002/01/26 13:21:12 aymeric Exp $ */
6 #include "../../dev/iteioctl.h"
7 #include "../../dev/kbdmap.h"
12 void load_kmap(const char *);
16 main(int argc
, char *argv
[])
20 fprintf (stderr
, "%s keymap\n", argv
[0]);
34 load_kmap(const char *file
)
37 char buf
[sizeof (struct kbdmap
)];
39 if ((fd
= open (file
, 0)) >= 0)
41 if (read (fd
, buf
, sizeof (buf
)) == sizeof (buf
))
43 if (ioctl (0, ITEIOCSKMAP
, buf
) == 0)
46 perror ("ITEIOCSKMAP");
60 char buf
[sizeof (struct kbdmap
)];
61 if (ioctl (0, ITEIOCGKMAP
, buf
) == 0)
62 write (1, buf
, sizeof (buf
));
64 perror ("ITEIOCGKMAP");