diff options
Diffstat (limited to 'newlib/libc/stdio64')
-rw-r--r-- | newlib/libc/stdio64/fdopen64.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio64/fopen64.c | 8 | ||||
-rw-r--r-- | newlib/libc/stdio64/freopen64.c | 23 | ||||
-rw-r--r-- | newlib/libc/stdio64/fseeko64.c | 12 | ||||
-rw-r--r-- | newlib/libc/stdio64/ftello64.c | 8 |
5 files changed, 20 insertions, 35 deletions
diff --git a/newlib/libc/stdio64/fdopen64.c b/newlib/libc/stdio64/fdopen64.c index 659d343e5..49d1f03aa 100644 --- a/newlib/libc/stdio64/fdopen64.c +++ b/newlib/libc/stdio64/fdopen64.c @@ -64,7 +64,7 @@ _DEFUN (_fdopen64_r, (ptr, fd, mode), if ((fp = __sfp (ptr)) == 0) return 0; - _newlib_flockfile_start(fp); + _flockfile(fp); fp->_flags = flags; /* POSIX recommends setting the O_APPEND bit on fd to match append @@ -101,7 +101,7 @@ _DEFUN (_fdopen64_r, (ptr, fd, mode), fp->_flags |= __SL64; - _newlib_flockfile_end(fp); + _funlockfile(fp); return fp; } diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c index 84f7b6e49..aa6775116 100644 --- a/newlib/libc/stdio64/fopen64.c +++ b/newlib/libc/stdio64/fopen64.c @@ -91,16 +91,16 @@ _DEFUN (_fopen64_r, (ptr, file, mode), if ((f = _open64_r (ptr, file, oflags, 0666)) < 0) { - _newlib_sfp_lock_start (); + __sfp_lock_acquire (); fp->_flags = 0; /* release */ #ifndef __SINGLE_THREAD__ __lock_close_recursive (fp->_lock); #endif - _newlib_sfp_lock_end (); + __sfp_lock_release (); return NULL; } - _newlib_flockfile_start (fp); + _flockfile(fp); fp->_file = f; fp->_flags = flags; @@ -121,7 +121,7 @@ _DEFUN (_fopen64_r, (ptr, file, mode), fp->_flags |= __SL64; - _newlib_flockfile_end (fp); + _funlockfile(fp); return fp; } diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index db0e1ee0f..1e2ec7827 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -100,20 +100,11 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), CHECK_INIT (ptr, fp); - /* We can't use the _newlib_flockfile_XXX macros here due to the - interlocked locking with the sfp_lock. */ -#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS) - int __oldcancel; - pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &__oldcancel); -#endif - _flockfile (fp); + _flockfile(fp); if ((flags = __sflags (ptr, mode, &oflags)) == 0) { - _funlockfile (fp); -#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS) - pthread_setcancelstate (__oldcancel, &__oldcancel); -#endif + _funlockfile(fp); _fclose_r (ptr, fp); return NULL; } @@ -214,14 +205,11 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), __sfp_lock_acquire (); fp->_flags = 0; /* set it free */ ptr->_errno = e; /* restore in case _close clobbered */ - _funlockfile (fp); + _funlockfile(fp); #ifndef __SINGLE_THREAD__ __lock_close_recursive (fp->_lock); #endif __sfp_lock_release (); -#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS) - pthread_setcancelstate (__oldcancel, &__oldcancel); -#endif return NULL; } @@ -241,10 +229,7 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), fp->_flags |= __SL64; - _funlockfile (fp); -#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS) - pthread_setcancelstate (__oldcancel, &__oldcancel); -#endif + _funlockfile(fp); return fp; } diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c index b323f97d8..301d6f54f 100644 --- a/newlib/libc/stdio64/fseeko64.c +++ b/newlib/libc/stdio64/fseeko64.c @@ -126,7 +126,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), CHECK_INIT (ptr, fp); - _newlib_flockfile_start (fp); + _flockfile (fp); curoff = fp->_offset; @@ -144,7 +144,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), if ((seekfn = fp->_seek64) == NULL) { ptr->_errno = ESPIPE; /* ??? */ - _newlib_flockfile_exit(fp); + _funlockfile(fp); return EOF; } @@ -169,7 +169,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), curoff = seekfn (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR); if (curoff == -1L) { - _newlib_flockfile_exit(fp); + _funlockfile(fp); return EOF; } } @@ -194,7 +194,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), default: ptr->_errno = EINVAL; - _newlib_flockfile_exit(fp); + _funlockfile(fp); return (EOF); } @@ -294,7 +294,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), if (HASUB (fp)) FREEUB (ptr, fp); fp->_flags &= ~__SEOF; - _newlib_flockfile_exit(fp); + _funlockfile(fp); return 0; } @@ -323,7 +323,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), fp->_p += n; fp->_r -= n; } - _newlib_flockfile_end(fp); + _funlockfile(fp); return 0; /* diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c index c4d6da24b..51dcd2796 100644 --- a/newlib/libc/stdio64/ftello64.c +++ b/newlib/libc/stdio64/ftello64.c @@ -99,12 +99,12 @@ _DEFUN (_ftello64_r, (ptr, fp), CHECK_INIT (ptr, fp); - _newlib_flockfile_start(fp); + _flockfile(fp); if (fp->_seek64 == NULL) { ptr->_errno = ESPIPE; - _newlib_flockfile_exit(fp); + _funlockfile(fp); return -1L; } @@ -121,7 +121,7 @@ _DEFUN (_ftello64_r, (ptr, fp), pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR); if (pos == -1L) { - _newlib_flockfile_exit(fp); + _funlockfile(fp); return pos; } } @@ -146,7 +146,7 @@ _DEFUN (_ftello64_r, (ptr, fp), pos += fp->_p - fp->_bf._base; } - _newlib_flockfile_end(fp); + _funlockfile(fp); return pos; } |