delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/11/08/08:31:35

Date: Thu, 8 Nov 2001 15:27:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: ROLAND <roland_asmann AT yahoo DOT com>
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: <Pine.SUN.3.91.1011108152403.13841B-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


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