summaryrefslogtreecommitdiffstats
path: root/libc/stdio/_fopen.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-23 03:19:32 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-23 03:19:32 +0000
commit71c1f8a3e7f3d681360874de732257b62a800798 (patch)
treeb817f80c37547f98c21282bcf6996c609ebe66fe /libc/stdio/_fopen.c
parentaa39b0b2f79973652cbe219eaf580dd02bfb6670 (diff)
downloaduClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.bz2
uClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.xz
Bring in remaining futex support for stdio.
Diffstat (limited to 'libc/stdio/_fopen.c')
-rw-r--r--libc/stdio/_fopen.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c
index 4ca028275..58066ea3f 100644
--- a/libc/stdio/_fopen.c
+++ b/libc/stdio/_fopen.c
@@ -11,10 +11,6 @@ libc_hidden_proto(isatty)
libc_hidden_proto(open)
libc_hidden_proto(fcntl)
-#ifdef __UCLIBC_HAS_THREADS__
-libc_hidden_proto(_stdio_user_locking)
-#endif
-
/*
* Cases:
* fopen64 : filename != NULL, stream == NULL, filedes == -2
@@ -80,13 +76,13 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
while (*++mode) {
# ifdef __UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE__
- if (*mode == 'x') { /* Open exclusive (a glibc extension). */
+ if (*mode == 'x') { /* Open exclusive (a glibc extension). */
open_mode |= O_EXCL;
continue;
}
# endif
# ifdef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
- if (*mode == 'F') { /* Open as large file (uClibc extension). */
+ if (*mode == 'F') { /* Open as large file (uClibc extension). */
open_mode |= O_LARGEFILE;
continue;
}
@@ -106,8 +102,12 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
#ifdef __UCLIBC_HAS_THREADS__
/* We only initialize the mutex in the non-freopen case. */
/* stream->__user_locking = _stdio_user_locking; */
+#ifdef __USE_STDIO_FUTEXES__
+ _IO_lock_init (stream->_lock);
+#else
__stdio_init_mutex(&stream->__lock);
#endif
+#endif
}
#ifdef __UCLIBC_MJN3_ONLY__
@@ -198,8 +198,12 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
#ifdef __UCLIBC_HAS_THREADS__
/* Even in the freopen case, we reset the user locking flag. */
stream->__user_locking = _stdio_user_locking;
+#ifdef __USE_STDIO_FUTEXES__
+ /* _IO_lock_init (stream->_lock); */
+#else
/* __stdio_init_mutex(&stream->__lock); */
#endif
+#endif
#ifdef __STDIO_HAS_OPENLIST
__STDIO_THREADLOCK_OPENLIST;