From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14171 invoked from network); 28 Jul 2005 18:22:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Jul 2005 18:22:29 -0000 Received: (qmail 97693 invoked from network); 28 Jul 2005 18:22:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jul 2005 18:22:23 -0000 Received: (qmail 29266 invoked by alias); 28 Jul 2005 18:22:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21544 Received: (qmail 29256 invoked from network); 28 Jul 2005 18:22:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Jul 2005 18:22:19 -0000 Received: (qmail 97314 invoked from network); 28 Jul 2005 18:22:19 -0000 Received: from pop.gmx.de (HELO mail.gmx.net) (213.165.64.20) by a.mx.sunsite.dk with SMTP; 28 Jul 2005 18:22:15 -0000 Received: (qmail invoked by alias); 28 Jul 2005 18:22:12 -0000 Received: from Bc8e0.b.pppool.de (EHLO pcdahl4201) [213.7.200.224] by mail.gmx.net (mp025) with SMTP; 28 Jul 2005 20:22:12 +0200 X-Authenticated: #21620914 Message-ID: <006801c593a2$72bb7500$b4c0fea9@pcdahl4201> From: "Thorsten Dahlheimer" To: Subject: PATCH: missing ioctl() prototype on cygwin Date: Thu, 28 Jul 2005 20:30:34 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0065_01C593B3.3506E300" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Y-GMX-Trusted: 0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 This is a multi-part message in MIME format. ------=_NextPart_000_0065_01C593B3.3506E300 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Currently no prototype for ioctl() is picked up when compiling on cygwin: The only prototype there is in (which must be included directly), but the zsh sources include that header only if it defines TIOCGWINSZ (and doesn't), and cygwin's doesn't define TIOCGWINSZ (but does). So I've changed configure.ac and Src/system.h (see attached patch) such that configure now checks whether ioctl() is declared in but not in or , and if this is the case then gets included. Note that I removed the test for CLOBBERS_TYPEAHEAD in Src/system.h, since I couldn't find any reference to that symbol anywhere else (except in the ChangeLogs). Regards, Thorsten Dahlheimer ------=_NextPart_000_0065_01C593B3.3506E300 Content-Type: application/octet-stream; name="ioctl.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ioctl.patch" Index: configure.ac=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/configure.ac,v=0A= retrieving revision 1.35=0A= diff -u -r1.35 configure.ac=0A= --- configure.ac 20 Jul 2005 16:08:18 -0000 1.35=0A= +++ configure.ac 28 Jul 2005 15:55:55 -0000=0A= @@ -575,18 +575,15 @@=0A= fi=0A= fi=0A= =0A= -AC_CACHE_CHECK(POSIX termios, zsh_cv_sys_posix_termios,=0A= -[AC_TRY_LINK([#include =0A= -#include =0A= -#include ],=0A= -[/* SunOS 4.0.3 has termios.h but not the library calls. */=0A= -tcgetattr(0, 0);],=0A= - zsh_cv_sys_posix_termios=3Dyes, zsh_cv_sys_posix_termios=3Dno)])=0A= -=0A= -if test $zsh_cv_sys_posix_termios =3D yes; then=0A= +AH_TEMPLATE([GWINSZ_IN_SYS_IOCTL],=0A= +[Define if TIOCGWINSZ is defined in sys/ioctl.h but not in termios.h.])=0A= +if test $ac_cv_header_termios_h =3D yes; then=0A= AC_CACHE_CHECK(TIOCGWINSZ in termios.h,=0A= zsh_cv_header_termios_h_tiocgwinsz,=0A= - [AC_TRY_LINK([#include =0A= + [AC_TRY_LINK([=0A= +#ifdef HAVE_SYS_TYPES_H=0A= +# include =0A= +#endif=0A= #include ],=0A= [int x =3D TIOCGWINSZ;],=0A= zsh_cv_header_termios_h_tiocgwinsz=3Dyes,=0A= @@ -594,13 +591,13 @@=0A= else=0A= zsh_cv_header_termios_h_tiocgwinsz=3Dno=0A= fi=0A= - =0A= -AH_TEMPLATE([GWINSZ_IN_SYS_IOCTL],=0A= -[Define if your system defines TIOCGWINSZ in sys/ioctl.h.])=0A= if test $zsh_cv_header_termios_h_tiocgwinsz =3D no; then=0A= AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,=0A= zsh_cv_header_sys_ioctl_h_tiocgwinsz,=0A= - [AC_TRY_LINK([#include =0A= + [AC_TRY_LINK([=0A= +#ifdef HAVE_SYS_TYPES_H=0A= +# include =0A= +#endif=0A= #include ],=0A= [int x =3D TIOCGWINSZ;],=0A= zsh_cv_header_sys_ioctl_h_tiocgwinsz=3Dyes,=0A= @@ -1694,24 +1691,12 @@=0A= AC_DEFINE(HAVE_SBRK_PROTO)=0A= fi=0A= =0A= -dnl ----------------------------------=0A= -dnl ioctl and mknod prototypes for OSF=0A= -dnl ----------------------------------=0A= -=0A= -AH_TEMPLATE([HAVE_IOCTL_PROTO],=0A= -[Define to 1 if there is a prototype defined for ioctl() on your = system])=0A= +dnl -----------------------=0A= +dnl mknod prototype for OSF=0A= +dnl -----------------------=0A= AH_TEMPLATE([HAVE_MKNOD_PROTO],=0A= -[Define to 1 if there is a prototype defined for mknod() on your = system])=0A= +[Define to 1 if there is a prototype defined for mknod() on your = system.])=0A= if test "$ac_cv_prog_cc_stdc" !=3D no; then=0A= - AC_CACHE_CHECK(for ioctl prototype in ,=0A= - zsh_cv_header_sys_ioctl_h_ioctl_proto,=0A= - [AC_TRY_COMPILE([#include =0A= - int ioctl(double x);], [int i;],=0A= - zsh_cv_header_sys_ioctl_h_ioctl_proto=3Dno,=0A= - zsh_cv_header_sys_ioctl_h_ioctl_proto=3Dyes)])=0A= - if test $zsh_cv_header_sys_ioctl_h_ioctl_proto =3D yes; then=0A= - AC_DEFINE(HAVE_IOCTL_PROTO)=0A= - fi=0A= AC_CACHE_CHECK(for mknod prototype in ,=0A= zsh_cv_header_sys_stat_h_mknod_proto,=0A= [AC_TRY_COMPILE([#include =0A= @@ -1723,6 +1708,45 @@=0A= fi=0A= fi=0A= =0A= +dnl ----------------------------------------=0A= +dnl presence and location of ioctl prototype=0A= +dnl ----------------------------------------=0A= +AC_CACHE_CHECK(for ioctl prototype in or ,=0A= +zsh_cv_header_unistd_h_termios_h_ioctl_proto,=0A= +[AC_TRY_COMPILE([=0A= +#ifdef HAVE_UNISTD_H=0A= +# include =0A= +#endif=0A= +#ifdef HAVE_TERMIOS_H=0A= +# include =0A= +#endif=0A= +double ioctl();], [int i;],=0A= +zsh_cv_header_unistd_h_termios_h_ioctl_proto=3Dno,=0A= +zsh_cv_header_unistd_h_termios_h_ioctl_proto=3Dyes)])=0A= +=0A= +if test $zsh_cv_header_unistd_h_termios_h_ioctl_proto =3D no; then=0A= + AC_CACHE_CHECK(for ioctl prototype in ,=0A= + zsh_cv_header_sys_ioctl_h_ioctl_proto,=0A= + [AC_TRY_COMPILE([#include =0A= + double ioctl();], [int i;],=0A= + zsh_cv_header_sys_ioctl_h_ioctl_proto=3Dno,=0A= + zsh_cv_header_sys_ioctl_h_ioctl_proto=3Dyes)])=0A= +else=0A= + zsh_cv_header_sys_ioctl_h_ioctl_proto=3Dno=0A= +fi=0A= +=0A= +AH_TEMPLATE([HAVE_IOCTL_PROTO],=0A= +[Define to 1 if there is a prototype defined for ioctl() on your = system.])=0A= +if test $zsh_cv_header_unistd_h_termios_h_ioctl_proto =3D yes || \=0A= + test $zsh_cv_header_sys_ioctl_h_ioctl_proto =3D yes; then=0A= + AC_DEFINE(HAVE_IOCTL_PROTO)=0A= +fi=0A= +AH_TEMPLATE([IOCTL_IN_SYS_IOCTL],=0A= +[Define to 1 if we must include to get a prototype for = ioctl().])=0A= +if test $zsh_cv_header_sys_ioctl_h_ioctl_proto =3D yes; then=0A= + AC_DEFINE(IOCTL_IN_SYS_IOCTL)=0A= +fi=0A= +=0A= dnl -------------------=0A= dnl select() defined in , ie BeOS R4.51=0A= dnl -------------------=0A= Index: Src/system.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/system.h,v=0A= retrieving revision 1.31=0A= diff -u -r1.31 system.h=0A= --- Src/system.h 23 May 2005 14:41:38 -0000 1.31=0A= +++ Src/system.h 28 Jul 2005 15:56:55 -0000=0A= @@ -337,7 +337,7 @@=0A= # endif /* HAVE_TERMIO_H */=0A= #endif /* HAVE_TERMIOS_H */=0A= =0A= -#if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)=0A= +#if defined(GWINSZ_IN_SYS_IOCTL) || defined(IOCTL_IN_SYS_IOCTL)=0A= # include =0A= #endif=0A= #ifdef WINSIZE_IN_PTEM=0A= ------=_NextPart_000_0065_01C593B3.3506E300--