programn

Jaroslav Brandis brandis na savba.sk
Pondělí Leden 19 16:35:42 CET 1998


Ja mam asi nejaky problem s kniznicami.  Pretoze pri kompilacii mi to posle
toto:
/tmp/cca213021.o: In function '
ain':
/tmp/cca213021.o(.text+0x4e): undefined reference to inw'
/tmp/cca213021.o(.text+0x63): undefined reference to outw'
/tmp/cca213021.o(.text+0x9b): undefined reference to inw'
/tmp/cca213021.o(.text+0xb3): undefined reference to outw'

Na kompilaciu som pouzil iba toto: gcc -o program.bin program.c

Takze este otazka ako to skompilovat aby to nehubovalo?

> 
> #include <stdio.h>
> #include <time.h>
> #include <unistd.h>
> #define port 0x2fc
> 
> void main()
> {
>   time_t cas;
>   if ( iopl(3) )  // povoleni operace s porty
>  {            // kdyz to nema suid root, tak to nepude
>   printf("Nebezi to na ROOTa!\n");
> 
>   return;
>  }
>   cas=time(NULL);
>   printf("\n\nZaciatok cakania.");
>   outw(port,inw(port)|1);       // misto outport outw 
>                                 // a misto inport inw
>   while(cas+5>time(NULL)){}  printf("\nUz si sa dockal");
>   outw(port,inw(port)&254);
> }
> 
> Nevim, jestli to pude, ale zakladni techniky jsou doufam 
> zrejme...
> Program musi byt samozrejme pusten s pravy root.
> 
> 
> 


Další informace o konferenci Linux