build-sys: determine availability of __fpending()

Needed to for making Cygwin more possible.

Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5656
Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-04-23 14:26:23 +02:00
parent 5759de0c3c
commit 78288764e4
2 changed files with 12 additions and 0 deletions

View File

@ -152,6 +152,7 @@ AC_CHECK_HEADERS([ \
pty.h \
security/pam_misc.h \
stdint.h \
stdio_ext.h \
stdlib.h \
sys/disk.h \
sys/disklabel.h \
@ -245,6 +246,7 @@ AC_CHECK_DECL([lseek64],
#include <unistd.h>])
AC_CHECK_FUNCS([ \
__fpending \
__secure_getenv \
err \
errx \

View File

@ -2,12 +2,22 @@
#define UTIL_LINUX_CLOSESTREAM_H
#include <stdio.h>
#ifdef HAVE_STDIO_EXT_H
#include <stdio_ext.h>
#endif
#include <unistd.h>
#include "c.h"
#include "nls.h"
#ifndef HAVE___FPENDING
static inline int
__fpending(FILE *stream __attribute__((__unused__)))
{
return 0;
}
#endif
static inline int
close_stream(FILE * stream)
{