summaryrefslogtreecommitdiff
path: root/libc/stdio/stdio.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-03-21 09:17:51 +0000
committerEric Andersen <andersen@codepoet.org>2002-03-21 09:17:51 +0000
commit73bd0903fe1ba8189c8657c1583796f08c8028bb (patch)
treea8721baa8e1daeea55c31506424ebd80877a9747 /libc/stdio/stdio.c
parent1095574b9d296cb31f0051872f99bd7b36278c9e (diff)
Compile in flockfile and friends by default
-Erik
Diffstat (limited to 'libc/stdio/stdio.c')
-rw-r--r--libc/stdio/stdio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index 49d2a74c6..8ee1a16e2 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -1007,7 +1007,9 @@ int __fsetlocking(FILE *stream, int locking_mode)
void flockfile(FILE *stream)
{
+#ifdef __STDIO_THREADSAFE
pthread_mutex_lock(&stream->lock);
+#endif
}
#endif
@@ -1016,7 +1018,11 @@ void flockfile(FILE *stream)
int ftrylockfile(FILE *stream)
{
+#ifdef __STDIO_THREADSAFE
return pthread_mutex_trylock(&stream->lock);
+#else
+ return 1;
+#endif
}
#endif
@@ -1025,7 +1031,9 @@ int ftrylockfile(FILE *stream)
void funlockfile(FILE *stream)
{
+#ifdef __STDIO_THREADSAFE
pthread_mutex_unlock(&stream->lock);
+#endif
}
#endif