LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   ioperm() problem (https://www.linuxquestions.org/questions/programming-9/ioperm-problem-497004/)

hua 10-30-2006 02:14 PM

ioperm() problem
 
Hello

I need to work out some parallel port output signals.

I found a short program to test bits on that port.
It tells I need to set the permission with ioperm() as this:

Code:

#include <asm/io.h>
#include <iostream>
#include <cstdlib>
#include <unistd.h>

#define base 0x378          /* printer port base address */
#define value 255            /* numeric value to send to printer port */

using namespace std;

main(int argc, char **argv)
{
  if (ioperm(base,1,1))
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

  outb(value, base);
}

but when i try to compile it reports error:
`ioperm' undeclared (first use this function)

help pls.

Mara 10-30-2006 03:05 PM

Add
Code:

#include <sys/io.h>

hua 11-02-2006 04:05 AM

Great
 
Thank you, it works.


All times are GMT -5. The time now is 01:27 AM.