X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/4c63d2152434d7a24cd627ef559f93b096274076..23e20b0053d7317ce3facd3fd38db8c73c2c380a:/stdio/FreeBSD/local.h diff --git a/stdio/FreeBSD/local.h b/stdio/FreeBSD/local.h index e5ee708..51262bc 100644 --- a/stdio/FreeBSD/local.h +++ b/stdio/FreeBSD/local.h @@ -94,15 +94,13 @@ extern int __vfwscanf(FILE * __restrict, locale_t, const wchar_t * __restrict, __va_list); extern size_t __fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp); -extern int __sdidinit; +extern pthread_once_t __sdidinit; /* hold a buncha junk that would grow the ABI */ struct __sFILEX { unsigned char *up; /* saved _p when _p is doing ungetc data */ pthread_mutex_t fl_mutex; /* used for MT-safety */ - pthread_t fl_owner; /* current owner */ - int fl_count; /* recursive lock count */ int orientation:2; /* orientation for fwide() */ int counted:1; /* stream counted against STREAM_MAX */ mbstate_t mbstate; /* multibyte conversion state */ @@ -110,17 +108,15 @@ struct __sFILEX { #define _up _extra->up #define _fl_mutex _extra->fl_mutex -#define _fl_owner _extra->fl_owner -#define _fl_count _extra->fl_count #define _orientation _extra->orientation #define _mbstate _extra->mbstate #define _counted _extra->counted + + #define INITEXTRA(fp) do { \ (fp)->_extra->up = NULL; \ - (fp)->_extra->fl_mutex = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER; \ - (fp)->_extra->fl_owner = NULL; \ - (fp)->_extra->fl_count = 0; \ + (fp)->_extra->fl_mutex = (pthread_mutex_t)PTHREAD_RECURSIVE_MUTEX_INITIALIZER; \ (fp)->_extra->orientation = 0; \ memset(&(fp)->_extra->mbstate, 0, sizeof(mbstate_t)); \ (fp)->_extra->counted = 0; \