tvctrl.c revision 1.6 1 /* $NetBSD: tvctrl.c,v 1.6 2003/05/17 10:38:56 isaki Exp $ */
2
3 #include <sys/types.h>
4 #include <sys/ioctl.h>
5 #include <machine/iteioctl.h>
6 #include <err.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9
10 int main(int, char *[]);
11
12 int
13 main(int argc, char *argv[])
14 {
15 unsigned long num;
16 unsigned char ctl;
17 char *ep;
18
19 if (argc < 2) {
20 fprintf(stderr, "usage: %s control_number [...]\n", argv[0]);
21 return 1;
22 }
23 while (argv++, --argc != 0) {
24 num = strtoul(argv[0], &ep, 10);
25 if (num > 255 || *ep != '\0')
26 errx(1, "illegal number -- %s", argv[0]);
27
28 ctl = num;
29 if (ioctl(0, ITETVCTRL, &ctl))
30 err(1, "ioctl(ITETVCTRL)");
31 }
32
33 return 0;
34 }
35