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:[EMAIL PROTECTED]
Red Hat, Inc.

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

Reply via email to