Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-Tty CPAN distribution.

Report information
The Basics
Id:
45008
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
TODDR [...] cpan.org
Requestors:
martin [...] northamericancomputing.com
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
(no value)
Fixed in:
1.08_02



Subject: IO::Pty.pm
Date: Mon, 13 Apr 2009 17:03:35 +0000
To: bug-IO-Tty@rt.cpan.org
From: "Martin Lira" <martin@northamericancomputing.com>
Hi there!

Would you happen to have any advice to fix this message?

warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Inappropriate ioctl for device at /export/home/var/usr/local/src/IO-Tty-1.08/blib/lib/IO/Pty.pm line 120.

I am running Solaris 10 64 bit.


Thanks,

-Martin


perl Makefile.PL:

Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
Looking for _getpty()...... not found.
Looking for getpt()........ not found.
Looking for grantpt()...... FOUND.
Looking for openpty()...... not found.
Looking for posix_openpt(). FOUND.
Looking for ptsname()...... FOUND.
Looking for ptsname_r().... not found.
Looking for sigaction().... FOUND.
Looking for strlcpy()...... FOUND.
Looking for ttyname()...... FOUND.
Looking for unlockpt()..... FOUND.
Looking for libutil.h...... not found.
Looking for pty.h.......... not found.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. FOUND.
Looking for termio.h....... FOUND.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.
Checking which symbols compile OK...
(sorry for the tedious check, but some systems have not too clean
 header files, to say the least;  '+' means OK, '-' means not defined
 and '*' has compile problems...)
+B0 +B110 +B115200 +B1200 +B134 +B150 +B153600 +B1800 +B19200 +B200 +B230400 +B2400 +B300 +B307200 +B38400 +B460800 +B4800 +B50 +B57600 +B600 +B75 +B76800 +B9600 +BRKINT +BS0 +BS1 +BSDLY +CBAUD +CBAUDEXT -CBRK +CCTS_OFLOW +CDEL +CDSUSP +CEOF +CEOL +CEOL2 +CEOT +CERASE +CESC +CFLUSH +CIBAUD +CIBAUDEXT +CINTR +CKILL +CLNEXT +CLOCAL +CNSWTCH +CNUL +CQUIT +CR0 +CR1 +CR2 +CR3 +CRDLY +CREAD +CRPRNT +CRTSCTS +CRTSXOFF +CRTS_IFLOW +CS5 +CS6 +CS7 +CS8 +CSIZE +CSTART +CSTOP +CSTOPB +CSUSP +CSWTCH +CWERASE +DEFECHO +DIOC +DIOCGETP +DIOCSETP +DOSMODE +ECHO +ECHOCTL +ECHOE +ECHOK +ECHOKE +ECHONL +ECHOPRT +EXTA +EXTB +FF0 +FF1 +FFDLY +FIORDCHK +FLUSHO +HUPCL +ICANON +ICRNL +IEXTEN +IGNBRK +IGNCR +IGNPAR +IMAXBEL +INLCR +INPCK +ISIG +ISTRIP +IUCLC +IXANY +IXOFF +IXON +KBENABLED +LDCHG +LDCLOSE +LDDMAP +LDEMAP +LDGETT +LDGMAP +LDIOC +LDNMAP +LDOPEN +LDSETT +LDSMAP +LOBLK +NCCS +NL0 +NL1 +NLDLY +NOFLSH +OCRNL +OFDEL +OFILL +OLCUC +ONLCR +ONLRET +ONOCR +OPOST +PAGEOUT +PARENB +PAREXT +PARMRK +PARODD +PENDIN +RCV1EN +RTS_TOG +TAB0 +TAB1 +TAB2 +TAB3 +TABDLY +TCDSET +TCFLSH +TCGETA +TCGETS +TCIFLUSH +TCIOFF +TCIOFLUSH +TCION +TCOFLUSH +TCOOFF +TCOON +TCSADRAIN +TCSAFLUSH +TCSANOW +TCSBRK +TCSETA +TCSETAF +TCSETAW -TCSETCTTY +TCSETS +TCSETSF +TCSETSW +TCXONC +TERM_D40 +TERM_D42 +TERM_H45 +TERM_NONE +TERM_TEC +TERM_TEX +TERM_V10 +TERM_V61 +TIOCCBRK +TIOCCDTR -TIOCCONS +TIOCEXCL +TIOCFLUSH +TIOCGETC +TIOCGETD +TIOCGETP +TIOCGLTC +TIOCGPGRP +TIOCGSID +TIOCGSOFTCAR +TIOCGWINSZ +TIOCHPCL +TIOCKBOF +TIOCKBON +TIOCLBIC +TIOCLBIS +TIOCLGET +TIOCLSET +TIOCMBIC +TIOCMBIS +TIOCMGET +TIOCMSET +TIOCM_CAR +TIOCM_CD +TIOCM_CTS +TIOCM_DSR +TIOCM_DTR +TIOCM_LE +TIOCM_RI +TIOCM_RNG +TIOCM_RTS +TIOCM_SR +TIOCM_ST +TIOCNOTTY +TIOCNXCL +TIOCOUTQ +TIOCREMOTE +TIOCSBRK +TIOCSCTTY +TIOCSDTR +TIOCSETC +TIOCSETD +TIOCSETN +TIOCSETP +TIOCSIGNAL +TIOCSLTC +TIOCSPGRP -TIOCSSID +TIOCSSOFTCAR +TIOCSTART +TIOCSTI +TIOCSTOP +TIOCSWINSZ +TM_ANL +TM_CECHO +TM_CINVIS +TM_LCF +TM_NONE +TM_SET +TM_SNL +TOSTOP +VCEOF +VCEOL +VDISCARD +VDSUSP +VEOF +VEOL +VEOL2 +VERASE +VINTR +VKILL +VLNEXT +VMIN +VQUIT +VREPRINT +VSTART +VSTOP +VSUSP +VSWTCH +VT0 +VT1 +VTDLY +VTIME +VWERASE +WRAP +XCASE +XCLUDE +XMT1EN +XTABS

Show quoted text
>>> Configuration looks good! <<<

Writing IO::Tty::Constant.pm...
DEFINE = -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT
Writing Makefile for IO::Tty



make:

cp Tty.pm blib/lib/IO/Tty.pm
cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
cp Pty.pm blib/lib/IO/Pty.pm
/usr/local/bin/perl /usr/local/lib/perl5/5.10.0/ExtUtils/xsubpp  -typemap /usr/local/lib/perl5/5.10.0/ExtUtils/typemap  Tty.xs > Tty.xsc && mv Tty.xsc Tty.c
cc -c   -m64 -I/usr/local/include/amd64 -I/usr/local/include -xarch=generic64 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O   -DVERSION=\"1.08\" -DXS_VERSION=\"1.08\" -KPIC "-I/usr/local/lib/perl5/5.10.0/i86pc-solaris-64/CORE"  -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c
cc: Warning: -xarch=generic64 is deprecated, use -m64 to create 64-bit programs
Running Mkbootstrap for IO::Tty ()
chmod 644 Tty.bs
rm -f blib/arch/auto/IO/Tty/Tty.so
cc  -G -xarch=generic64 -L/export/home/var/opt/SUNWspro/prod/lib/amd64 -L/lib/amd64 -L/usr/local/lib/amd64 -L/usr/local/lib Tty.o  -o blib/arch/auto/IO/Tty/Tty.so      \
                \
          
cc: Warning: -xarch=generic64 is deprecated, use -m64 to create 64-bit programs
chmod 755 blib/arch/auto/IO/Tty/Tty.so
cp Tty.bs blib/arch/auto/IO/Tty/Tty.bs
chmod 644 blib/arch/auto/IO/Tty/Tty.bs
Manifying blib/man3/IO::Tty::Constant.3
Manifying blib/man3/IO::Tty.3
Manifying blib/man3/IO::Pty.3



make test:

PERL_DL_NONLAZY=1 /usr/local/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..4
Configuration: -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT
Checking for appropriate ioctls: TIOCNOTTY TIOCSCTTY
Checking that returned fd's don't clash with stdin/out/err...
trying posix_openpt()...
trying grantpt()...
trying unlockpt()...
trying ptsname()...
trying to open /dev/pts/2...
trying to I_PUSH ptem...
trying to I_PUSH ldterm...
trying to I_PUSH ttcompat...
ok 1
Checking if child gets pty as controlling terminal...
trying posix_openpt()...
trying grantpt()...
trying unlockpt()...
trying ptsname()...
trying to open /dev/pts/2...
trying to I_PUSH ptem...
trying to I_PUSH ldterm...
trying to I_PUSH ttcompat...
warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Inappropriate ioctl for device at /export/home/var/usr/local/src/IO-Tty-1.08/blib/lib/IO/Pty.pm line 120.
ok 2
gimme on /dev/tty: seems OK!
back on STDOUT: SEEMS OK!
ok 3
Checking basic functionality and how your ptys handle large strings...
  This test may hang on certain systems, even though it is protected
  by alarm().  If the counter stops, try Ctrl-C, the test should continue.

trying posix_openpt()...
trying grantpt()...
trying unlockpt()...
trying ptsname()...
trying to open /dev/pts/2...
trying to I_PUSH ptem...
trying to I_PUSH ldterm...
trying to I_PUSH ttcompat...
isatty($master): NO
isatty($slave): YES
Child PID = 10072
Good, your raw ptys can handle at least 512 bytes at once.
ok 4
Slave got EOF at line 512, byte 0.
Passed 4 of 4 tests.


It is only a warning, the tests pass, so there is no problem to be expected. That ioctl is of no relevance on modern unixen but has to stay due to backward-compatibility reasons. -- RGiersig@cpan.org
Subject: Re: [rt.cpan.org #45008] IO::Pty.pm
Date: Tue, 14 Apr 2009 15:37:06 +0000
To: bug-IO-Tty@rt.cpan.org
From: "Martin Lira" <martin@northamericancomputing.com>
Thank you,

-Martin
 
Show quoted text
-----Original Message-----
From: Roland Giersig via RT [mailto:bug-IO-Tty@rt.cpan.org]
Sent: Tuesday, April 14, 2009 09:55 AM
To: martin@northamericancomputing.com
Subject: [rt.cpan.org #45008] IO::Pty.pm

It is only a warning, the tests pass, so there is no problem to be expected. That ioctl is of no relevance on modern unixen but has to stay due to backward-compatibility reasons. -- RGiersig@cpan.org
May be we could apply the patch below (check if we already have a ctty, if no then try TIOCSCTTY): --- Pty.pm.orig 2010-02-23 17:02:20.600696000 +0530 +++ Pty.pm 2010-02-23 17:02:24.184312000 +0530 @@ -115,13 +115,15 @@ } # Acquire a controlling terminal if this doesn't happen automatically - if (defined TIOCSCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { - warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; - } - } elsif (defined TCSETCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { - warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + if (not open(\*DEVTTY, "/dev/tty")) { + if (defined TIOCSCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { + warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } + } elsif (defined TCSETCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { + warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } } } Thanks. Rajesh
The intendation was screwed in my last update - attaching a patch file instead...
Subject: Pty.pm.patch
--- Pty.pm.orig 2010-02-23 17:02:20.600696000 +0530 +++ Pty.pm 2010-02-23 17:02:24.184312000 +0530 @@ -115,13 +115,15 @@ } # Acquire a controlling terminal if this doesn't happen automatically - if (defined TIOCSCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { - warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; - } - } elsif (defined TCSETCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { - warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + if (not open(\*DEVTTY, "/dev/tty")) { + if (defined TIOCSCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { + warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } + } elsif (defined TCSETCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { + warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } } }
On Tue Feb 23 06:50:29 2010, rmandalemula wrote:
Show quoted text
> The intendation was screwed in my last update - attaching a patch
file
Show quoted text
> instead...
better than the earlier one..
Subject: Pty.pm.patch
--- Pty.pm.orig 2010-02-23 17:02:20.600696000 +0530 +++ Pty.pm 2010-02-23 18:59:00.962299000 +0530 @@ -115,22 +115,23 @@ } # Acquire a controlling terminal if this doesn't happen automatically - if (defined TIOCSCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { - warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; - } - } elsif (defined TCSETCTTY) { - if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { - warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + if (not open(\*DEVTTY, "/dev/tty")) { + if (defined TIOCSCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { + warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } + } elsif (defined TCSETCTTY) { + if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { + warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + } } - } - if (not open(\*DEVTTY, "/dev/tty")) { - warn "Error: could not connect pty as controlling terminal!\n"; - return undef; - } else { - close \*DEVTTY; + if (not open(\*DEVTTY, "/dev/tty")) { + warn "Error: could not connect pty as controlling terminal!\n"; + return undef; + } } + close \*DEVTTY; return 1; }
Thanks for the patch, I'll apply it in the next release. But that will take a few weeks... -- RGiersig@cpan.org
Released in 1.08_02. Tests look good. Will be in 1.09 later this week


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.