summaryrefslogtreecommitdiffstats
path: root/libc/stdio/fileext.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-01-21 19:42:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-21 19:42:44 +0000
commit2a8c929aaf8d34d2b6e89ed9c8b6da163316143e (patch)
tree992748f27c1ee609a1dba97d7a9e19b0df7689c0 /libc/stdio/fileext.h
parent8476b8ed9e290d79cd00e7801c505268f0e8ec15 (diff)
parent8c4994bbc1a9a01e34ea92c91eb5b2d1a27bd074 (diff)
downloadbionic-2a8c929aaf8d34d2b6e89ed9c8b6da163316143e.zip
bionic-2a8c929aaf8d34d2b6e89ed9c8b6da163316143e.tar.gz
bionic-2a8c929aaf8d34d2b6e89ed9c8b6da163316143e.tar.bz2
Merge "Implement __fsetlocking."
Diffstat (limited to 'libc/stdio/fileext.h')
-rw-r--r--libc/stdio/fileext.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/libc/stdio/fileext.h b/libc/stdio/fileext.h
index 25b7bda..75230cd 100644
--- a/libc/stdio/fileext.h
+++ b/libc/stdio/fileext.h
@@ -33,6 +33,7 @@
#define _FILEEXT_H_
#include <pthread.h>
+#include <stdbool.h>
__BEGIN_DECLS
@@ -40,9 +41,10 @@ __BEGIN_DECLS
* file extension
*/
struct __sfileext {
- struct __sbuf _ub; /* ungetc buffer */
+ struct __sbuf _ub; /* ungetc buffer */
struct wchar_io_data _wcio; /* wide char io status */
- pthread_mutex_t _lock; /* file lock */
+ pthread_mutex_t _lock; /* file lock */
+ bool _stdio_handles_locking; /* __fsetlocking support */
};
#define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
@@ -54,7 +56,8 @@ do { \
_UB(fp)._base = NULL; \
_UB(fp)._size = 0; \
WCIO_INIT(fp); \
- _FLOCK(fp).value = __PTHREAD_RECURSIVE_MUTEX_INIT_VALUE; \
+ _FLOCK(fp).value = __PTHREAD_RECURSIVE_MUTEX_INIT_VALUE; \
+ _EXT(fp)->_stdio_handles_locking = true; \
} while (0)
#define _FILEEXT_SETUP(f, fext) \