Date: Thu, 8 Nov 2001 15:27:17 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: ROLAND cc: djgpp AT delorie DOT com Subject: Re: Problems with sgtty.h, ioctl.h and termios.h In-Reply-To: <20011108130844.10497.qmail@web9102.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 8 Nov 2001, ROLAND wrote: > struct sgttyb lkterm; > > termst() > > { > if(ioctl(f3,TIOCEXCL)==0 && > ioctl(f4,TIOCEXCL)==0){ > lkterm.sg_ispeed = bdrate; > lkterm.sg_ospeed = bdrate; > lkterm.sg_erase = ERASECH; > lkterm.sg_kill = KILLCH; > lkterm.sg_flags = FLAG; > if(ioctl(f3,TIOCSETP,&lkterm)!=0 || > ioctl(f4,TIOCSETP,&lkterm)!=0){ > error("terminalsettings can not be > changed",-1,"\n"); > finish(-1); > } > } > else{ > error("device is busy",-1,"\n"); > finish(-1); > } > } > > finish(a) > > int a; > { > ioctl(f3,TIOCNXCL); > ioctl(f4,TIOCNXCL); > exit(a); > } What device is open on handles f3 and f4? If that is the terminal (as it seems it is), you could try simply commenting out this code, I don't think it's needed with DJGPP. OTOH, if the device is not a terminal, but e.g. an async communication port, then this code will not work with DJGPP at all.