summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/local.h
diff options
context:
space:
mode:
authornathanw <nathanw@NetBSD.org>2003-07-18 21:50:41 +0000
committernathanw <nathanw@NetBSD.org>2003-07-18 21:50:41 +0000
commitad09d62fccedf9d8cbddb98aaa2b917136d9802d (patch)
treef29c67f126ad1905ef08595debce2692e95cf7cb /lib/libc/stdio/local.h
parentb5665a9b84a4aa2e1bfffd4c9322e9a3fe2445f4 (diff)
Move guts of flockfile()/funlockfile() to __flockfile_internal(), which
takes an additional argument indicating whether this is an internal caller taking the lock or an external (application) caller. When making an internal lock, save the current thread cancellation state and disable cancellation until the matching unlock. This should prevent canccelled threads from exiting inside of stdio while holding a file lock and potentially leaving other parts of the FILE structure in an inconsistent state.
Diffstat (limited to 'lib/libc/stdio/local.h')
-rw-r--r--lib/libc/stdio/local.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index 64e6d2e3916..41c3ab9274c 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -1,4 +1,4 @@
-/* $NetBSD: local.h,v 1.15 2003/03/07 07:11:38 tshiozak Exp $ */
+/* $NetBSD: local.h,v 1.16 2003/07/18 21:50:41 nathanw Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -102,3 +102,5 @@ extern wint_t __fputwc_unlock __P((wchar_t, FILE *));
(fp)->_lb._base = NULL; \
}
+extern void __flockfile_internal __P((FILE *, int));
+extern void __funlockfile_internal __P((FILE *, int));