www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/26/15:00:30

From: Lennart Marien <lennartm AT metronet DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with GCC under Win95!?!
Date: Tue, 26 May 1998 20:22:33 +0200
Organization: Metronet
Lines: 41
Message-ID: <356B0869.B6518D2@metronet.de>
References: <356999D4 DOT 626D8E7E AT metronet DOT de> <356AC1A6 DOT 6AA3EC93 AT cais DOT kaist DOT ac DOT kr>
NNTP-Posting-Host: hamburg2.pop.metronet.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ho-Jin Dan schrieb:
> 
> hmm... another getch question is on air... ^^;
> getch is not a ansi member. in other word, <conio.h> is not included in the
> gnu library.
> i think getch() is useful in many ways.
> ok... you can make a getch function such that
> 
> #include <termio.h>
> #include <sys/ioctl.h>
> 
> int getch() {
>    struct termio o, n;
>    char c;
> 
>    ioctl(0, TCGETA, &o);
>    ioctl(0, TCGETA, &n);
> 
>    n.c_lflag &= ~(ICANON | ECHO);
>    n.c_cc[VMIN] = 1;
>    n.c_cc[VTIME]= 0;
> 
>    ioctl(0, TCSETA, &n);
>     while(read(0, &c, 1) <= 0);
>    ioctl(0, TCSETA, &o);
> 
>    return (int)c;
> }

Sorry, I didnīt really understand your point.:-)
The error happens without the getch(); , as well.

main(void)
{
};

Huh!Even *THAT* produces a "general protection fault"!

cu


- Raw text -


  webmaster     delorie software   privacy  
  Copyright Đ 2019   by DJ Delorie     Updated Jul 2019