Re: [PATCH] 2.5.17 /dev/ports

Vojtech Pavlik (vojtech@suse.cz)
Sun, 26 May 2002 17:28:10 +0200


On Sun, May 26, 2002 at 02:53:37PM +0100, Riley Williams wrote:

> Would the following be what you had intended?
>
> #include <linux/io.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int argc, char **argv) {
> int byte, port, result = 0;

iopl(3);
>
> switch (argc) {
> case 2:
> port = atoi(argv[1]);
> result = inb(port);
> break;
>
> case 3:
> port = atoi(argv[1]);
> byte = atoi(argv[2]);
> outb(port, byte);
> break;
>
> default:
> fprintf(stderr, "Usage: %s port [byte]\n", argv[0]);
> break;
> }
> return result;
> }

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/