summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/flockfile.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1998-11-20 11:19:02 +0000
committerDavid Leonard <d@cvs.openbsd.org>1998-11-20 11:19:02 +0000
commitf547068f88348f54941dc06da46491f99701933e (patch)
tree8548a6b78719cba1de575b7f49e5f8ac4e6f1683 /lib/libc/stdio/flockfile.c
parent394c7a9821726b84f284c0c4385b1a9198afa0b0 (diff)
Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10) (more md stuff is needed for other libc/arch/*) (setlogin is no longer a special syscall) Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS). Doc some re-entrant routines Add libc_r to intro(3) dig() uses some libc srcs and an extra -I was needed there. Add more md stuff to libc_r. Update includes for the pthreads api Update libc_r TODO
Diffstat (limited to 'lib/libc/stdio/flockfile.c')
-rw-r--r--lib/libc/stdio/flockfile.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/libc/stdio/flockfile.c b/lib/libc/stdio/flockfile.c
new file mode 100644
index 00000000000..d720aee991a
--- /dev/null
+++ b/lib/libc/stdio/flockfile.c
@@ -0,0 +1,49 @@
+/* $OpenBSD: flockfile.c,v 1.1 1998/11/20 11:18:48 d Exp $ */
+
+#include <stdio.h>
+#include "thread_private.h"
+
+#ifndef _THREAD_SAFE
+
+/*
+ * Subroutine versions of the macros in <stdio.h>
+ * Note that these are all no-ops because libc does not do threads.
+ */
+
+#undef flockfile
+#undef ftrylockfile
+#undef funlockfile
+#undef _flockfile_debug
+
+void
+flockfile(fp)
+ FILE * fp;
+{
+}
+
+int
+ftrylockfile(fp)
+ FILE * fp;
+{
+ return 0;
+}
+
+void
+funlockfile(fp)
+ FILE * fp;
+{
+}
+
+void
+_flockfile_debug(fp, fname, lineno)
+ FILE * fp;
+ const char * fname;
+ int lineno;
+{
+}
+
+#else /* _THREAD_SAFE */
+
+/* Actual implementation of file locking in libc_r/uthread/uthread_file.c */
+
+#endif /* _THREAD_SAFE */