char *InitSys() { int i; PortsFound = 0; for( i = 0; i < NUM_ELTS( PortTest ); ++i ) { if (!AccessPorts(PortTest[i], PortTest[i])) { printf("Failed to get I/O permissions. This program must run as root!\n"); exit(-1); } if( CheckForPort( i, 0x55 ) && CheckForPort( i, 0xaa ) ) { PortAddress[ PortsFound++ ] = PortTest[ i ]; } FreePorts(PortTest[i], PortTest[i]); } return( NULL ); }
char *InitSys() { SEL global; SEL local; int i; DosGetInfoSeg( &global, &local ); GInfoSeg = MK_FP( global, 0 ); PortsFound = 0; for( i = 0; i < NUM_ELTS( PortTest ); ++i ) { AccessPorts( PortTest[i], PortTest[i] ); if( CheckForPort( i, 0x55 ) && CheckForPort( i, 0xaa ) ) { PortAddress[ PortsFound++ ] = PortTest[ i ]; } FreePorts( PortTest[i], PortTest[i] ); } return( 0 ); }