environment
1)compiler: cc -v
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
2)openssh: CVS from 31 jan 2001
3)libc: GNU libc 2.2.1
output form make pty.o is:
#make pty.o
gcc -g -O2 -Wall -I/usr/local/ssl/include -I. -I. -DETCDIR=\"/etc\"
-D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\"
-D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/libexec/ssh-askpass\"
-DHAVE_CONFIG_H -c pty.c
pty.c: In function `pty_allocate':
pty.c:55: warning: implicit declaration of function `openpty'
This is old warning but today i have time to investigate.
GNU libc has pty.h and openssh has pty.h
Problem is that system ( from libc ) pty.h is never included, but !!! OpenSSH
work well good with openpty method.
how to stop this warning and to include pty.h from libc :
1) to rename pty.X to ssh-pty.X plus changes from #include "pty.h" to
#include
"ssh-pty.h" in header/source files
2) to put pty.h in subfolder XXXssh and use #include "XXXssh/pty.h" in
header/source files
3) to add in configure.in line:
......
...*-*-linux*)
CPPFLAGS="-I/usr/include $CPPFLAGS"
......
OPPS this no_dev_ptmx=1 is obsolete for linux kernel 2.2.x
*-*-linux*)
no_dev_ptmx=1
check_for_libcrypt_later=1
In attachment is my patch for PTY defines
I remove in configure.in check for function "openpty",
"_getpty" and for files
"/dev/ptmx", "/dev/ptc" and HARD CODE no_dev_ptmx=1 with
this code :
AC_MSG_CHECKING([for PTYs])
AC_MSG_RESULT()
AC_CHECK_FUNC(openpty,
AC_DEFINE(HAVE_OPENPTY),
AC_CHECK_FUNC(_getpty,
AC_DEFINE(HAVE__GETPTY),
AC_CHECK_FILE("/dev/ptmx",
AC_DEFINE(HAVE_DEV_PTMX),
AC_CHECK_FILE("/dev/ptc",
AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC),
AC_MSG_ERROR(No PTY support for your system)
)
)
)
)
AC_MSG_RESULT(OpenSSH support your PTY)
--------------------------
For linux user who want to use /dev/ptmx :
undef HAVE_OPENPTY and add -D_GNU_SOURCE to CFLAGS.
--------------------------
What is more portable: openpty () method or /dev/ptmx ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.in.patch.gz
Type: application/gzip
Size: 1374 bytes
Desc: not available
Url :
http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20010131/a9fdd795/attachment.bin