1
/* $Id: syscall_ioperm.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
16
#include <sys/io.h> /* for glibc */
20
int main(int argc, char *argv[])
22
unsigned long from, num;
24
fprintf(stderr, "usage: %s <from> <num>\n",
29
if ( (from = strtoul(argv[1], NULL, 0)) == 0) {
30
if (errno == EINVAL) {
31
fprintf(stderr, "FAIL: no <from> argument in '%s'\n",
36
if ( (num = strtoul(argv[2], NULL, 0)) == 0) {
37
if (errno == EINVAL) {
38
fprintf(stderr, "FAIL: no <num> argument in '%s'\n",
43
if (from > 0x3ff || (from + num) > 0x3ff) {
44
fprintf(stderr, "FAIL: out of range (0x3ff)\n");
47
if (ioperm(from, num, 1) == -1) {
48
fprintf(stderr, "FAIL: ioperm failed - %s\n",