summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-05-03 23:36:00 +0000
committermarcel <marcel@FreeBSD.org>2008-05-03 23:36:00 +0000
commit0e04be019638f430a0a5aebb9f28cd5a7d615c12 (patch)
tree36ddc40fe37ff76d54d07608dec92a89188c180c
parent2352203e2bb3e35113a04a2eecd62e185148adfe (diff)
downloadFreeBSD-src-0e04be019638f430a0a5aebb9f28cd5a7d615c12.zip
FreeBSD-src-0e04be019638f430a0a5aebb9f28cd5a7d615c12.tar.gz
Unbreak build: gnu sort has been configured to grope inside struct
__sFILE. It's opaque now, so add a function that returns the pending output bytes. Pointy hat: jhb
-rw-r--r--gnu/usr.bin/sort/config.h2
-rw-r--r--include/stdio.h3
-rw-r--r--lib/libc/stdio/stdio.c7
3 files changed, 11 insertions, 1 deletions
diff --git a/gnu/usr.bin/sort/config.h b/gnu/usr.bin/sort/config.h
index 44f944c..279456c 100644
--- a/gnu/usr.bin/sort/config.h
+++ b/gnu/usr.bin/sort/config.h
@@ -1240,7 +1240,7 @@
#define PACKAGE_VERSION "5.3.0-20040812-FreeBSD"
/* the number of pending output bytes on stream `fp' */
-#define PENDING_OUTPUT_N_BYTES fp->_p - fp->_bf._base
+#define PENDING_OUTPUT_N_BYTES __fgetpendout(fp)
/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
/* #undef PRI_MACROS_BROKEN */
diff --git a/include/stdio.h b/include/stdio.h
index 9186ca0..2bd5b24 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -249,8 +249,11 @@ int setlinebuf(FILE *);
int vasprintf(char **, const char *, __va_list)
__printflike(2, 0);
+/* XXX used by libftpio */
void *__fgetcookie(FILE *);
void __fsetfileno(FILE *, int);
+/* XXX used by sort */
+size_t __fgetpendout(FILE *);
/*
* The system error table contains messages for the first sys_nerr
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index 3da2957..b6d01e3 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -53,6 +53,13 @@ __fgetcookie(FILE *fp)
return (fp->_cookie);
}
+size_t
+__fgetpendout(FILE *fp)
+{
+
+ return (fp->_p - fp->_bf._base);
+}
+
void
__fsetfileno(FILE *fp, int fd)
{
OpenPOWER on IntegriCloud