Use the stdio_ext functions provided by solaris and glibc
instead of directly accessing private stdio FILE structure
members. This is needed for 64-bit solaris builds and is more
portable in general since the FILE structure is meant to be
opaque.
This is a backport of commit
aac929badb5e40a59ae77ae69fc43df8f6f376fc,
without the changes to remove duplicate code.
Reviewed-on: http://gerrit.openafs.org/3257
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
aac929badb5e40a59ae77ae69fc43df8f6f376fc)
Change-Id: I2953fe9d27edb30365266b1f4372e5fd18baf06e
Reviewed-on: http://gerrit.openafs.org/9604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
search.h \
security/pam_modules.h \
signal.h \
+ stdio_ext.h \
stdlib.h \
string.h \
strings.h \
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#ifdef HAVE_STDIO_EXT_H
+#include <stdio_ext.h>
+#endif
#include <afs/procmgmt.h>
#include <rx/xdr.h>
#ifdef AFS_LINUX20_ENV
if (stdin->_IO_read_ptr < stdin->_IO_read_end)
return 1;
+#elif defined(HAVE_STDIO_EXT_H)
+ if (__fbufsize(stdin) > 0)
+ return 1;
#else
if (stdin->_cnt > 0)
return 1;
#include <stdio.h>
+#ifdef HAVE_STDIO_EXT_H
+#include <stdio_ext.h>
+#endif
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#include <time.h>
return 1;
#endif
#else
+#if defined(HAVE_STDIO_EXT_H)
+ if (__fbufsize(stdin) > 0)
+ return 1;
+#else /* HAVE_STDIO_EXT_H */
if (stdin->_cnt > 0)
return 1;
+#endif /* HAVE_STDIO_EXT_H */
#endif
#endif