From e7c2883bfd13e329ef5acff5caddef46e0b02708 Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sun, 18 Aug 2024 02:25:51 +0000 Subject: Use struct __sFILE instead of FILE in thread locking callback declarations to reduce pollution. Declare __isthreaded in thread_private.h where it's really needed. ok deraadt@ --- src/lib/libc/include/thread_private.h | 11 ++++++----- 1 file 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 @@ -/* $OpenBSD: thread_private.h,v 1.36 2021/01/06 19:54:17 otto Exp $ */ +/* $OpenBSD: thread_private.h,v 1.37 2024/08/18 02:25:51 guenther Exp $ */ /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman */ #ifndef _THREAD_PRIVATE_H_ #define _THREAD_PRIVATE_H_ -#include /* for FILE and __isthreaded */ +extern int __isthreaded; #define _MALLOC_MUTEXES 32 void _malloc_init(int); @@ -77,14 +77,15 @@ PROTO_NORMAL(_malloc_init); * Returns the address of the thread's TCB. */ +struct __sFILE; struct pthread; struct thread_callbacks { int *(*tc_errnoptr)(void); /* MUST BE FIRST */ void *(*tc_tcb)(void); __dead void (*tc_canceled)(void); - void (*tc_flockfile)(FILE *); - int (*tc_ftrylockfile)(FILE *); - void (*tc_funlockfile)(FILE *); + void (*tc_flockfile)(struct __sFILE *); + int (*tc_ftrylockfile)(struct __sFILE *); + void (*tc_funlockfile)(struct __sFILE *); void (*tc_malloc_lock)(int); void (*tc_malloc_unlock)(int); void (*tc_atexit_lock)(void); -- cgit v1.2.3-55-g6feb