ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Everything is simple people, conio header uses simple Windows callings that are defined in windows.h. That is the part of code I used in one of my programs, I have taken the code from conio.c.
If I remember correct, conio is indeed a Borland invention. It was a very thin layer over the M$ DOS library (its not an OS). It was a buit lighter than a full stdio implementation. Later, other C compiler vendors in the M$ world started supporting it (I remember Watcom C/C++).
Conio typical use was to do user interaction. You could see if a key was pressed without waiting using _kbhit. In the UNIX world, your best bet is to use select(2) on the file descriptor 0 (the one stdin uses). If you do not like BSDisms, try SYSV style poll. Both are available on Linux and glibc systems.
Other functions can b e reasonably approximated with the stdio functions. _getch is a bit harder, because it does not echo. You will have to check that you are talking to a tty (see isatty(3)), and turn echo off. See the low level I/O and serial line stuff in your glibc documentation. Or, check the source code login.c in util-linux.
Anyway, here (http://www.digitalmars.com/rtl/conio.html) is a short reference of conio.h. Copy the header to your /usr/include and enjoy reimplementing some 20 year old obsolete library.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.