summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/local.h
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-03-01 05:22:14 +0000
committerdeischen <deischen@FreeBSD.org>2001-03-01 05:22:14 +0000
commit2d1163e370d4fb97297838d1fe7872a653dce6bb (patch)
tree56a1f702941fc746f602720d30a3421e37510f80 /lib/libc/stdio/local.h
parent242ddf3c95fd6a4a22fdc278c485bbbcffe01ae8 (diff)
downloadFreeBSD-src-2d1163e370d4fb97297838d1fe7872a653dce6bb.zip
FreeBSD-src-2d1163e370d4fb97297838d1fe7872a653dce6bb.tar.gz
Hide the definition of struct __sFILEX and add the needed
lock definitions to it. flockfile state is now allocated along with the rest of FILE. This eliminates the need for a separate allocation of flockfile state as well as eliminating the mutex/lock used to serialize its allocation.
Diffstat (limited to 'lib/libc/stdio/local.h')
-rw-r--r--lib/libc/stdio/local.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index 2f95a58..4f5242a 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -39,6 +39,7 @@
*/
#include <sys/types.h> /* for off_t */
+#include <pthread.h>
/*
* Information local to this implementation of stdio,
@@ -67,6 +68,15 @@ extern int __vfprintf __P((FILE *, const char *, _BSD_VA_LIST_));
extern int __sdidinit;
+
+/* hold a buncha junk that would grow the ABI */
+struct __sFILEX {
+ unsigned char *_up; /* saved _p when _p is doing ungetc data */
+ pthread_mutex_t fl_mutex; /* used for MT-safety */
+ pthread_t fl_owner; /* current owner */
+ int fl_count; /* recursive lock count */
+};
+
/*
* Return true iff the given FILE cannot be written now.
*/
OpenPOWER on IntegriCloud