NetBSD/sys/arch/x68k/usr.bin/tvctrl/tvctrl.c

37 lines
663 B
C
Raw Normal View History

/* $NetBSD: tvctrl.c,v 1.4 1999/01/13 10:23:40 itohy Exp $ */
1998-01-05 23:51:25 +03:00
1996-05-05 16:17:03 +04:00
#include <sys/types.h>
#include <sys/ioctl.h>
#include <machine/iteioctl.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
1996-05-05 16:17:03 +04:00
int main __P((int, char *[]));
int
1996-05-05 16:17:03 +04:00
main(argc, argv)
int argc;
char *argv[];
1996-05-05 16:17:03 +04:00
{
unsigned long num;
unsigned char ctl;
char *ep;
if (argc < 2) {
fprintf(stderr, "usage: %s control_number [...]\n", argv[0]);
return 1;
}
while (argv++, --argc != 0) {
num = strtoul(argv[0], &ep, 10);
if (num > 255 || *ep != '\0')
errx(1, "illegal number -- %s", argv[0]);
ctl = num;
if (ioctl(0, ITETVCTRL, &ctl))
err(1, "ioctl(ITETVCTRL)");
}
return 0;
1996-05-05 16:17:03 +04:00
}