C/inportb() and outportb()
Expert: Prince M. Premnath - 3/22/2009
QuestionHi Mr Premnath, I need a favour from you, I was actually using these functions inportb() and outportb() in DOS as dos.h, now i want to run these functions in unix, what would be the header file for these functions. Thanks in advance....
Regards
Azeem
AnswerHai dear Azeem !
The function's what you have mentioned ( inportb() outportb() ) are not standard C library functions and more over this is an exclusive property of Turbo C/C++ you cannot expect these functions on other compilers and over other platform ,the scenario is same for dos.h as well.
In UNIX gcc environment all the port access are similar to the file access, say if you need to access the LPT1 port then this can be made possible just like the common file opening fp = fopen("/dev/lp1" , "r"); and all other read / write operations can be done in the same way how you used to deal with the common text / data files, GCC doesn't have a function support that exclusively deals with the ports
I hope this answer would help you out, to proceed further , revert me in case issue
Thanks and Regards
Prince M. Premnath