/* * portio_debug.c --- User mode program to change the debugging flag * for the portio driver. * *----------------------------------------------------------------------- * * Copyright 1999 Illinois Institute of Technology * * See the file "LICENSE" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * */ #include #include #include #include #include #include "portio.h" int main( int argc, char *argv[] ) { int debug_setting, fd, status; char usage[] = "Usage: portio_debug debug_setting\n"; if ( argc != 2 ) { fputs( usage, stderr ); exit(1); } debug_setting = atoi( argv[1] ); fd = open( PORTIO_DEVICE, O_RDONLY ); if ( fd == (-1) ) { perror( "portio_debug: open failed" ); exit(1); } status = ioctl( fd, PORTIO_DEBUG_IOCTL, &debug_setting ); if ( status < 0 ) { perror( "portio_debug: ioctl failed" ); exit(1); } exit(0); }