HAVE_TTYNAME macro.
* configure.ac: Add check for ttyname.
* config.h.in: Regenerate.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103794
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-09-02 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * io/unix.c (stream_ttyname): Protect use of ttyname by
+ HAVE_TTYNAME macro.
+ * configure.ac: Add check for ttyname.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+
2005-09-02 Andreas Jaeger <aj@suse.de>
* libgfortran.h: Add prototype for init_compile_options.
/* libm includes truncf */
#undef HAVE_TRUNCF
+/* Define to 1 if you have the `ttyname' function. */
+#undef HAVE_TTYNAME
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-for ac_func in sleep time
+
+for ac_func in sleep time ttyname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
# Check for library functions.
AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize)
AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
-AC_CHECK_FUNCS(sleep time)
+AC_CHECK_FUNCS(sleep time ttyname)
# Check libc for getgid, getpid, getuid
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
char *
stream_ttyname (stream *s)
{
+#ifdef HAVE_TTYNAME
return ttyname (((unix_stream *) s)->fd);
+#else
+ return NULL;
+#endif
}