Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 30 May 2001 09:00:00 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Unix "script" utility continued... cygwin newbie need a porting expert's help..
Message-ID: <20010530090000.B23313@cygbert.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <3B145DA4.D511783C@lakes.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <3B145DA4.D511783C@lakes.com>; from pdykes@lakes.com on Tue, May 29, 2001 at 09:40:36PM -0500

On Tue, May 29, 2001 at 09:40:36PM -0500, Perry Dykes wrote:
> Still working on making a cygwin "script" utility. First, the source,
> found the "script.c" utility in the util-linux rpm. Now attempting to
> port. Got the compilation down to 2 problems, the warning, I can
> address, but the error gcc spits out at line 387 has me stumped. Does
> anyone know if the the following TIOCSCTTY attribute is supported or has
> an alternative value:
> 
>        (void) ioctl(slave, TIOCSCTTY, 0);

Open with O_NOCTTY.

> Here is the compilation output:
> 
> $ gcc -I../lib script.c -o script.exe
> script.c: In function `main':
> script.c:125: warning: assignment makes pointer from integer without a
> cast
> script.c: In function `getslave':
> script.c:387: `TIOCSCTTY' undeclared (first use in this function)
> script.c:387: (Each undeclared identifier is reported only once
> script.c:387: for each function it appears in.)
> 
> The modified source is attached. In the source file, I have been
> avoiding the PTY support, not sure cygwin has that. Advise or where to
> look for info on this would be great.

Cygwin supports streams ptys:

    master = open ("/dev/ptmx", O_RDWR);
    grantpt(master);
    unlockpt(master);
    slave = open (ptsname(master), O_RDWR | O_NOCTTY);   

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

