2
* Copyright (C) 2002-2005 Novell/SUSE
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation, version 2 of the
13
#include <sys/types.h>
14
#include <sys/io.h> /* for glibc */
18
int main(int argc, char *argv[])
20
unsigned long from, num;
22
fprintf(stderr, "usage: %s <from> <num>\n",
27
if ( (from = strtoul(argv[1], NULL, 0)) == 0) {
28
if (errno == EINVAL) {
29
fprintf(stderr, "FAIL: no <from> argument in '%s'\n",
34
if ( (num = strtoul(argv[2], NULL, 0)) == 0) {
35
if (errno == EINVAL) {
36
fprintf(stderr, "FAIL: no <num> argument in '%s'\n",
41
if (from > 0x3ff || (from + num) > 0x3ff) {
42
fprintf(stderr, "FAIL: out of range (0x3ff)\n");
45
if (ioperm(from, num, 1) == -1) {
46
fprintf(stderr, "FAIL: ioperm failed - %s\n",