]> git.saurik.com Git - apple/libc.git/blobdiff - stdio/FreeBSD/local.h
Libc-1044.1.2.tar.gz
[apple/libc.git] / stdio / FreeBSD / local.h
index e5ee7086aeb59ae7c9f7f0cd8f365885998fc632..51262bc814c14c178b6fbcd29fb3cf42c33548c4 100644 (file)
@@ -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);
                    __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 */
 
 
 /* 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 */
        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 _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 _orientation   _extra->orientation
 #define _mbstate       _extra->mbstate
 #define _counted       _extra->counted
 
+
+
 #define        INITEXTRA(fp) do { \
        (fp)->_extra->up = NULL; \
 #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; \
        (fp)->_extra->orientation = 0; \
        memset(&(fp)->_extra->mbstate, 0, sizeof(mbstate_t)); \
        (fp)->_extra->counted = 0; \