[H-GEN] CONIO.H HEADER

Martin Pool mbp at wistful.humbug.org.au
Tue Aug 25 23:39:03 EDT 1998


On Wed, Aug 26, 1998 at 01:05:54PM +1000, Frank Brand wrote:

> Yes, it does enhance I/O but my real difficulty is that I have code,
> which will otherwise run under GCC but has references to conio.h.

Do you mean that the source includes conio.h but doesn't use it?

  duh$ touch conio.h
  duh$ cc -o foo -I . foo.c stuff.c

> It is not a major drama but if I could get a copy of conio.h it
> would save me doing a heap of greps and code changes. I am about to
> search www.linux.org to check and I will try a few other places.
> Coming from a DOS background I just naturally assumed that there
> would be a conio.h. I did not realise it was not standard.

The functions supported in conio.h (doing output direct to the video
hardware) just don't make much sense under linux: having a header file
that declares them is the least of your worries.  If you don't want to
change the original code, you might try creating your own wrappers to
map cprintf into vprintf and so on.

Consider what a Bad Thing it would be if it did work the same way
under linux as under DOS: ssh/telnet connections wouldn't work, xterms
wouldn't work, virtual consoles wouldn't work, it wouldn't be portable
to other architectures, plumbing wouldn't work, and all the programs
would have to run as root.

-- 
Martin Pool




More information about the General mailing list