diff options
author | guenther <> | 2024-08-18 02:25:51 +0000 |
---|---|---|
committer | guenther <> | 2024-08-18 02:25:51 +0000 |
commit | e7c2883bfd13e329ef5acff5caddef46e0b02708 (patch) | |
tree | 5c724fbd764a5c78f1ed7ca30d70ee04abce9e28 | |
parent | 21e45bbdc2387dc8b79379f0d875052823b478a4 (diff) | |
download | openbsd-e7c2883bfd13e329ef5acff5caddef46e0b02708.tar.gz openbsd-e7c2883bfd13e329ef5acff5caddef46e0b02708.tar.bz2 openbsd-e7c2883bfd13e329ef5acff5caddef46e0b02708.zip |
Use struct __sFILE instead of FILE in thread locking callback
declarations to reduce <stdio.h> pollution. Declare __isthreaded
in thread_private.h where it's really needed.
ok deraadt@
-rw-r--r-- | src/lib/libc/include/thread_private.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h index 237c3fbd03..1ec1071161 100644 --- a/src/lib/libc/include/thread_private.h +++ b/src/lib/libc/include/thread_private.h | |||
@@ -1,11 +1,11 @@ | |||
1 | /* $OpenBSD: thread_private.h,v 1.36 2021/01/06 19:54:17 otto Exp $ */ | 1 | /* $OpenBSD: thread_private.h,v 1.37 2024/08/18 02:25:51 guenther Exp $ */ |
2 | 2 | ||
3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ | 3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ |
4 | 4 | ||
5 | #ifndef _THREAD_PRIVATE_H_ | 5 | #ifndef _THREAD_PRIVATE_H_ |
6 | #define _THREAD_PRIVATE_H_ | 6 | #define _THREAD_PRIVATE_H_ |
7 | 7 | ||
8 | #include <stdio.h> /* for FILE and __isthreaded */ | 8 | extern int __isthreaded; |
9 | 9 | ||
10 | #define _MALLOC_MUTEXES 32 | 10 | #define _MALLOC_MUTEXES 32 |
11 | void _malloc_init(int); | 11 | void _malloc_init(int); |
@@ -77,14 +77,15 @@ PROTO_NORMAL(_malloc_init); | |||
77 | * Returns the address of the thread's TCB. | 77 | * Returns the address of the thread's TCB. |
78 | */ | 78 | */ |
79 | 79 | ||
80 | struct __sFILE; | ||
80 | struct pthread; | 81 | struct pthread; |
81 | struct thread_callbacks { | 82 | struct thread_callbacks { |
82 | int *(*tc_errnoptr)(void); /* MUST BE FIRST */ | 83 | int *(*tc_errnoptr)(void); /* MUST BE FIRST */ |
83 | void *(*tc_tcb)(void); | 84 | void *(*tc_tcb)(void); |
84 | __dead void (*tc_canceled)(void); | 85 | __dead void (*tc_canceled)(void); |
85 | void (*tc_flockfile)(FILE *); | 86 | void (*tc_flockfile)(struct __sFILE *); |
86 | int (*tc_ftrylockfile)(FILE *); | 87 | int (*tc_ftrylockfile)(struct __sFILE *); |
87 | void (*tc_funlockfile)(FILE *); | 88 | void (*tc_funlockfile)(struct __sFILE *); |
88 | void (*tc_malloc_lock)(int); | 89 | void (*tc_malloc_lock)(int); |
89 | void (*tc_malloc_unlock)(int); | 90 | void (*tc_malloc_unlock)(int); |
90 | void (*tc_atexit_lock)(void); | 91 | void (*tc_atexit_lock)(void); |