mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
2003-08-29 Jakub Jelinek <jakub@redhat.com> * libio/Makefile: Compile fputc.c, fputwc.c, freopen64.c, freopen.c, fseek.c, fseeko64.c, fseeko.c, ftello64.c, ftello.c, fwide.c, getc.c, getchar.c, getwc.c, getwchar.c, iofclose.c, iofflush.c, iofgetpos64.c, iofgetpos.c, iofgets.c, iofgetws.c, iofputs.c, iofputws.c, iofread.c, iofsetpos64.c, iofsetpos.c, ioftell.c, iofwrite.c, iogetdelim.c, iogetline.c, iogets.c, iogetwline.c, ioputs.c, ioseekoff.c, ioseekpos.c, iosetbuffer.c, iosetvbuf.c, ioungetc.c, ioungetwc.c, oldfileops.c, oldiofclose.c, oldiofgetpos64.c, oldiofgetpos.c, oldiofsetpos64.c, oldiofsetpos.c, peekc.c, putc.c, putchar.c, putwc.c, putwchar.c and rewind.c with exceptions. * sysdeps/generic/bits/stdio-lock.h (_IO_acquire_lock, _IO_release_lock): Define. * libio/fileops.c (_IO_new_file_underflow): Use it. * libio/fputc.c (fputc): Likewise. * libio/fputwc.c (fputwc): Likewise. * libio/freopen64.c (freopen64): * libio/freopen.c (freopen): Likewise. * libio/fseek.c (fseek): Likewise. * libio/fseeko64.c (fseeko64): Likewise. * libio/fseeko.c (fseeko): Likewise. * libio/ftello64.c (ftello64): Likewise. * libio/ftello.c (ftello): Likewise. * libio/fwide.c (fwide): Likewise. * libio/getc.c (_IO_getc): Likewise. * libio/getchar.c (getchar): Likewise. * libio/getwc.c (_IO_getwc): Likewise. * libio/getwchar.c (getwchar): Likewise. * libio/iofclose.c (_IO_new_fclose): * libio/iofflush.c (_IO_fflush): Likewise. * libio/iofgetpos64.c (_IO_new_fgetpos64): Likewise. * libio/iofgetpos.c (_IO_new_fgetpos): Likewise. * libio/iofgets.c (_IO_fgets): Likewise. * libio/iofgetws.c (fgetws): Likewise. * libio/iofputs.c (_IO_fputs): * libio/iofputws.c (_IO_fputs): Likewise. * libio/iofread.c (_IO_fread): Likewise. * libio/iofsetpos64.c (_IO_new_fsetpos64): Likewise. * libio/iofsetpos.c (_IO_new_fsetpos): Likewise. * libio/ioftell.c (_IO_ftell): Likewise. * libio/iofwrite.c (_IO_fwrite): Likewise. * libio/iogetdelim.c (_IO_getdelim): Likewise. * libio/iogets.c (_IO_gets): Likewise. * libio/ioputs.c (_IO_puts): Likewise. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. * libio/iosetbuffer.c (_IO_setbuffer): Likewise. * libio/iosetvbuf.c (_IO_setvbuf): Likewise. * libio/ioungetc.c (_IO_ungetc): Likewise. * libio/ioungetwc.c (ungetwc): Likewise. * libio/oldiofclose.c (_IO_old_fclose): Likewise. * libio/oldiofgetpos64.c (_IO_old_fgetpos64): Likewise. * libio/oldiofgetpos.c (_IO_old_fgetpos): Likewise. * libio/oldiofsetpos64.c (_IO_old_fsetpos64): Likewise. * libio/oldiofsetpos.c (_IO_old_fsetpos): Likewise. * libio/peekc.c (_IO_peekc_locked): Likewise. * libio/putc.c (_IO_putc): Likewise. * libio/putchar.c (putchar): Likewise. * libio/putwc.c (putwc): Likewise. * libio/putwchar.c (putwchar): Likewise. * libio/rewind.c (rewind): Likewise. * libio/wfileops.c (_IO_wfile_underflow): Likewise.
This commit is contained in:
64
ChangeLog
64
ChangeLog
@ -1,3 +1,67 @@
|
|||||||
|
2003-08-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* libio/Makefile: Compile fputc.c, fputwc.c, freopen64.c, freopen.c,
|
||||||
|
fseek.c, fseeko64.c, fseeko.c, ftello64.c, ftello.c, fwide.c, getc.c,
|
||||||
|
getchar.c, getwc.c, getwchar.c, iofclose.c, iofflush.c, iofgetpos64.c,
|
||||||
|
iofgetpos.c, iofgets.c, iofgetws.c, iofputs.c, iofputws.c, iofread.c,
|
||||||
|
iofsetpos64.c, iofsetpos.c, ioftell.c, iofwrite.c, iogetdelim.c,
|
||||||
|
iogetline.c, iogets.c, iogetwline.c, ioputs.c, ioseekoff.c,
|
||||||
|
ioseekpos.c, iosetbuffer.c, iosetvbuf.c, ioungetc.c, ioungetwc.c,
|
||||||
|
oldfileops.c, oldiofclose.c, oldiofgetpos64.c, oldiofgetpos.c,
|
||||||
|
oldiofsetpos64.c, oldiofsetpos.c, peekc.c, putc.c, putchar.c, putwc.c,
|
||||||
|
putwchar.c and rewind.c with exceptions.
|
||||||
|
* sysdeps/generic/bits/stdio-lock.h (_IO_acquire_lock,
|
||||||
|
_IO_release_lock): Define.
|
||||||
|
* libio/fileops.c (_IO_new_file_underflow): Use it.
|
||||||
|
* libio/fputc.c (fputc): Likewise.
|
||||||
|
* libio/fputwc.c (fputwc): Likewise.
|
||||||
|
* libio/freopen64.c (freopen64):
|
||||||
|
* libio/freopen.c (freopen): Likewise.
|
||||||
|
* libio/fseek.c (fseek): Likewise.
|
||||||
|
* libio/fseeko64.c (fseeko64): Likewise.
|
||||||
|
* libio/fseeko.c (fseeko): Likewise.
|
||||||
|
* libio/ftello64.c (ftello64): Likewise.
|
||||||
|
* libio/ftello.c (ftello): Likewise.
|
||||||
|
* libio/fwide.c (fwide): Likewise.
|
||||||
|
* libio/getc.c (_IO_getc): Likewise.
|
||||||
|
* libio/getchar.c (getchar): Likewise.
|
||||||
|
* libio/getwc.c (_IO_getwc): Likewise.
|
||||||
|
* libio/getwchar.c (getwchar): Likewise.
|
||||||
|
* libio/iofclose.c (_IO_new_fclose):
|
||||||
|
* libio/iofflush.c (_IO_fflush): Likewise.
|
||||||
|
* libio/iofgetpos64.c (_IO_new_fgetpos64): Likewise.
|
||||||
|
* libio/iofgetpos.c (_IO_new_fgetpos): Likewise.
|
||||||
|
* libio/iofgets.c (_IO_fgets): Likewise.
|
||||||
|
* libio/iofgetws.c (fgetws): Likewise.
|
||||||
|
* libio/iofputs.c (_IO_fputs):
|
||||||
|
* libio/iofputws.c (_IO_fputs): Likewise.
|
||||||
|
* libio/iofread.c (_IO_fread): Likewise.
|
||||||
|
* libio/iofsetpos64.c (_IO_new_fsetpos64): Likewise.
|
||||||
|
* libio/iofsetpos.c (_IO_new_fsetpos): Likewise.
|
||||||
|
* libio/ioftell.c (_IO_ftell): Likewise.
|
||||||
|
* libio/iofwrite.c (_IO_fwrite): Likewise.
|
||||||
|
* libio/iogetdelim.c (_IO_getdelim): Likewise.
|
||||||
|
* libio/iogets.c (_IO_gets): Likewise.
|
||||||
|
* libio/ioputs.c (_IO_puts): Likewise.
|
||||||
|
* libio/ioseekoff.c (_IO_seekoff): Likewise.
|
||||||
|
* libio/ioseekpos.c (_IO_seekpos): Likewise.
|
||||||
|
* libio/iosetbuffer.c (_IO_setbuffer): Likewise.
|
||||||
|
* libio/iosetvbuf.c (_IO_setvbuf): Likewise.
|
||||||
|
* libio/ioungetc.c (_IO_ungetc): Likewise.
|
||||||
|
* libio/ioungetwc.c (ungetwc): Likewise.
|
||||||
|
* libio/oldiofclose.c (_IO_old_fclose): Likewise.
|
||||||
|
* libio/oldiofgetpos64.c (_IO_old_fgetpos64): Likewise.
|
||||||
|
* libio/oldiofgetpos.c (_IO_old_fgetpos): Likewise.
|
||||||
|
* libio/oldiofsetpos64.c (_IO_old_fsetpos64): Likewise.
|
||||||
|
* libio/oldiofsetpos.c (_IO_old_fsetpos): Likewise.
|
||||||
|
* libio/peekc.c (_IO_peekc_locked): Likewise.
|
||||||
|
* libio/putc.c (_IO_putc): Likewise.
|
||||||
|
* libio/putchar.c (putchar): Likewise.
|
||||||
|
* libio/putwc.c (putwc): Likewise.
|
||||||
|
* libio/putwchar.c (putwchar): Likewise.
|
||||||
|
* libio/rewind.c (rewind): Likewise.
|
||||||
|
* libio/wfileops.c (_IO_wfile_underflow): Likewise.
|
||||||
|
|
||||||
2003-08-29 Ulrich Drepper <drepper@redhat.com>
|
2003-08-29 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* signal/signal.h: sighold, sigrelse, sigignore, sigset were
|
* signal/signal.h: sighold, sigrelse, sigignore, sigset were
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Thread package specific definitions of stream lock type. Generic version.
|
/* Thread package specific definitions of stream lock type. Generic version.
|
||||||
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -45,5 +45,14 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
|
|||||||
#define _IO_cleanup_region_end(_doit) \
|
#define _IO_cleanup_region_end(_doit) \
|
||||||
__libc_cleanup_region_end (_doit)
|
__libc_cleanup_region_end (_doit)
|
||||||
|
|
||||||
|
#if defined _LIBC && !defined NOT_IN_libc
|
||||||
|
# define _IO_acquire_lock(_fp) \
|
||||||
|
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
|
||||||
|
_IO_flockfile (_fp)
|
||||||
|
|
||||||
|
# define _IO_release_lock(_fp) \
|
||||||
|
_IO_funlockfile (_fp); \
|
||||||
|
_IO_cleanup_region_end (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* bits/stdio-lock.h */
|
#endif /* bits/stdio-lock.h */
|
||||||
|
@ -75,10 +75,60 @@ CPPFLAGS += -D_IO_MTSAFE_IO
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Support for exception handling.
|
# Support for exception handling.
|
||||||
CFLAGS-genops.c = $(exceptions)
|
|
||||||
CFLAGS-wgenops.c = $(exceptions)
|
|
||||||
CFLAGS-fileops.c = $(exceptions)
|
CFLAGS-fileops.c = $(exceptions)
|
||||||
|
CFLAGS-fputc.c = $(exceptions)
|
||||||
|
CFLAGS-fputwc.c = $(exceptions)
|
||||||
|
CFLAGS-freopen64.c = $(exceptions)
|
||||||
|
CFLAGS-freopen.c = $(exceptions)
|
||||||
|
CFLAGS-fseek.c = $(exceptions)
|
||||||
|
CFLAGS-fseeko64.c = $(exceptions)
|
||||||
|
CFLAGS-fseeko.c = $(exceptions)
|
||||||
|
CFLAGS-ftello64.c = $(exceptions)
|
||||||
|
CFLAGS-ftello.c = $(exceptions)
|
||||||
|
CFLAGS-fwide.c = $(exceptions)
|
||||||
|
CFLAGS-genops.c = $(exceptions)
|
||||||
|
CFLAGS-getc.c = $(exceptions)
|
||||||
|
CFLAGS-getchar.c = $(exceptions)
|
||||||
|
CFLAGS-getwc.c = $(exceptions)
|
||||||
|
CFLAGS-getwchar.c = $(exceptions)
|
||||||
|
CFLAGS-iofclose.c = $(exceptions)
|
||||||
|
CFLAGS-iofflush.c = $(exceptions)
|
||||||
|
CFLAGS-iofgetpos64.c = $(exceptions)
|
||||||
|
CFLAGS-iofgetpos.c = $(exceptions)
|
||||||
|
CFLAGS-iofgets.c = $(exceptions)
|
||||||
|
CFLAGS-iofgetws.c = $(exceptions)
|
||||||
|
CFLAGS-iofputs.c = $(exceptions)
|
||||||
|
CFLAGS-iofputws.c = $(exceptions)
|
||||||
|
CFLAGS-iofread.c = $(exceptions)
|
||||||
|
CFLAGS-iofsetpos64.c = $(exceptions)
|
||||||
|
CFLAGS-iofsetpos.c = $(exceptions)
|
||||||
|
CFLAGS-ioftell.c = $(exceptions)
|
||||||
|
CFLAGS-iofwrite.c = $(exceptions)
|
||||||
|
CFLAGS-iogetdelim.c = $(exceptions)
|
||||||
|
CFLAGS-iogetline.c = $(exceptions)
|
||||||
|
CFLAGS-iogets.c = $(exceptions)
|
||||||
|
CFLAGS-iogetwline.c = $(exceptions)
|
||||||
|
CFLAGS-ioputs.c = $(exceptions)
|
||||||
|
CFLAGS-ioseekoff.c = $(exceptions)
|
||||||
|
CFLAGS-ioseekpos.c = $(exceptions)
|
||||||
|
CFLAGS-iosetbuffer.c = $(exceptions)
|
||||||
|
CFLAGS-iosetvbuf.c = $(exceptions)
|
||||||
|
CFLAGS-ioungetc.c = $(exceptions)
|
||||||
|
CFLAGS-ioungetwc.c = $(exceptions)
|
||||||
|
CFLAGS-oldfileops.c = $(exceptions)
|
||||||
|
CFLAGS-oldiofclose.c = $(exceptions)
|
||||||
|
CFLAGS-oldiofgetpos64.c = $(exceptions)
|
||||||
|
CFLAGS-oldiofgetpos.c = $(exceptions)
|
||||||
|
CFLAGS-oldiofsetpos64.c = $(exceptions)
|
||||||
|
CFLAGS-oldiofsetpos.c = $(exceptions)
|
||||||
|
CFLAGS-peekc.c = $(exceptions)
|
||||||
|
CFLAGS-putc.c = $(exceptions)
|
||||||
|
CFLAGS-putchar.c = $(exceptions)
|
||||||
|
CFLAGS-putwc.c = $(exceptions)
|
||||||
|
CFLAGS-putwchar.c = $(exceptions)
|
||||||
|
CFLAGS-rewind.c = $(exceptions)
|
||||||
CFLAGS-wfileops.c = $(exceptions)
|
CFLAGS-wfileops.c = $(exceptions)
|
||||||
|
CFLAGS-wgenops.c = $(exceptions)
|
||||||
# XXX Do we need filedoalloc and wfiledoalloc? Others?
|
# XXX Do we need filedoalloc and wfiledoalloc? Others?
|
||||||
|
|
||||||
CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
|
CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
|
||||||
|
@ -562,16 +562,13 @@ _IO_new_file_underflow (fp)
|
|||||||
traditional Unix systems did this for stdout. stderr better
|
traditional Unix systems did this for stdout. stderr better
|
||||||
not be line buffered. So we do just that here
|
not be line buffered. So we do just that here
|
||||||
explicitly. --drepper */
|
explicitly. --drepper */
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdout);
|
||||||
_IO_stdout);
|
|
||||||
_IO_flockfile (_IO_stdout);
|
|
||||||
|
|
||||||
if ((_IO_stdout->_flags & (_IO_LINKED | _IO_NO_WRITES | _IO_LINE_BUF))
|
if ((_IO_stdout->_flags & (_IO_LINKED | _IO_NO_WRITES | _IO_LINE_BUF))
|
||||||
== (_IO_LINKED | _IO_LINE_BUF))
|
== (_IO_LINKED | _IO_LINE_BUF))
|
||||||
_IO_OVERFLOW (_IO_stdout, EOF);
|
_IO_OVERFLOW (_IO_stdout, EOF);
|
||||||
|
|
||||||
_IO_funlockfile (_IO_stdout);
|
_IO_release_lock (_IO_stdout);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -35,11 +35,9 @@ fputc (c, fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_putc_unlocked (c, fp);
|
result = _IO_putc_unlocked (c, fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -35,13 +35,11 @@ fputwc (wc, fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_fwide (fp, 1) < 0)
|
if (_IO_fwide (fp, 1) < 0)
|
||||||
result = WEOF;
|
result = WEOF;
|
||||||
else
|
else
|
||||||
result = _IO_putwc_unlocked (wc, fp);
|
result = _IO_putwc_unlocked (wc, fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,7 @@ freopen (filename, mode, fp)
|
|||||||
CHECK_FILE (fp, NULL);
|
CHECK_FILE (fp, NULL);
|
||||||
if (!(fp->_flags & _IO_IS_FILEBUF))
|
if (!(fp->_flags & _IO_IS_FILEBUF))
|
||||||
return NULL;
|
return NULL;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (filename == NULL && _IO_fileno (fp) >= 0)
|
if (filename == NULL && _IO_fileno (fp) >= 0)
|
||||||
{
|
{
|
||||||
fd = __dup (_IO_fileno (fp));
|
fd = __dup (_IO_fileno (fp));
|
||||||
@ -84,7 +83,6 @@ freopen (filename, mode, fp)
|
|||||||
if (filename != NULL)
|
if (filename != NULL)
|
||||||
free ((char *) filename);
|
free ((char *) filename);
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,7 @@ freopen64 (filename, mode, fp)
|
|||||||
CHECK_FILE (fp, NULL);
|
CHECK_FILE (fp, NULL);
|
||||||
if (!(fp->_flags & _IO_IS_FILEBUF))
|
if (!(fp->_flags & _IO_IS_FILEBUF))
|
||||||
return NULL;
|
return NULL;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (filename == NULL && _IO_fileno (fp) >= 0)
|
if (filename == NULL && _IO_fileno (fp) >= 0)
|
||||||
{
|
{
|
||||||
fd = __dup (_IO_fileno (fp));
|
fd = __dup (_IO_fileno (fp));
|
||||||
@ -68,8 +67,7 @@ freopen64 (filename, mode, fp)
|
|||||||
if (filename != NULL)
|
if (filename != NULL)
|
||||||
free ((char *) filename);
|
free ((char *) filename);
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,1995,1996,1997,1998,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,11 +37,9 @@ fseek (fp, offset, whence)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, -1);
|
CHECK_FILE (fp, -1);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_fseek (fp, offset, whence);
|
result = _IO_fseek (fp, offset, whence);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (fseek)
|
libc_hidden_def (fseek)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,10 +36,8 @@ fseeko (fp, offset, whence)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, -1);
|
CHECK_FILE (fp, -1);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_fseek (fp, offset, whence);
|
result = _IO_fseek (fp, offset, whence);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,11 +38,9 @@ fseeko64 (fp, offset, whence)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, -1);
|
CHECK_FILE (fp, -1);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_fseek (fp, offset, whence);
|
result = _IO_fseek (fp, offset, whence);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995-2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -37,16 +37,14 @@ ftello (fp)
|
|||||||
{
|
{
|
||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
CHECK_FILE (fp, -1L);
|
CHECK_FILE (fp, -1L);
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
if (fp->_mode <= 0)
|
if (fp->_mode <= 0)
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
#ifdef EIO
|
#ifdef EIO
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995-2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,16 +38,14 @@ ftello64 (fp)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
CHECK_FILE (fp, -1L);
|
CHECK_FILE (fp, -1L);
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
if (fp->_mode <= 0)
|
if (fp->_mode <= 0)
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
#ifdef EIO
|
#ifdef EIO
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -44,13 +44,9 @@ fwide (fp, mode)
|
|||||||
or the orientation already has been determined. */
|
or the orientation already has been determined. */
|
||||||
return fp->_mode;
|
return fp->_mode;
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
|
|
||||||
result = _IO_fwide (fp, mode);
|
result = _IO_fwide (fp, mode);
|
||||||
|
_IO_release_lock (fp);
|
||||||
_IO_funlockfile (fp);
|
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,11 +37,9 @@ _IO_getc (fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_getc_unlocked (fp);
|
result = _IO_getc_unlocked (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -34,12 +34,9 @@ int
|
|||||||
getchar ()
|
getchar ()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdin);
|
||||||
_IO_stdin);
|
|
||||||
_IO_flockfile (_IO_stdin);
|
|
||||||
result = _IO_getc_unlocked (_IO_stdin);
|
result = _IO_getc_unlocked (_IO_stdin);
|
||||||
_IO_funlockfile (_IO_stdin);
|
_IO_release_lock (_IO_stdin);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -37,11 +38,9 @@ _IO_getwc (fp)
|
|||||||
{
|
{
|
||||||
wint_t result;
|
wint_t result;
|
||||||
CHECK_FILE (fp, WEOF);
|
CHECK_FILE (fp, WEOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_getwc_unlocked (fp);
|
result = _IO_getwc_unlocked (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -34,11 +34,8 @@ wint_t
|
|||||||
getwchar ()
|
getwchar ()
|
||||||
{
|
{
|
||||||
wint_t result;
|
wint_t result;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdin);
|
||||||
_IO_stdin);
|
|
||||||
_IO_flockfile (_IO_stdin);
|
|
||||||
result = _IO_getwc_unlocked (_IO_stdin);
|
result = _IO_getwc_unlocked (_IO_stdin);
|
||||||
_IO_funlockfile (_IO_stdin);
|
_IO_release_lock (_IO_stdin);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -57,15 +57,13 @@ _IO_new_fclose (fp)
|
|||||||
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
||||||
INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
|
INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
||||||
status = INTUSE(_IO_file_close_it) (fp);
|
status = INTUSE(_IO_file_close_it) (fp);
|
||||||
else
|
else
|
||||||
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
|
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
|
||||||
_IO_FINISH (fp);
|
_IO_FINISH (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (fp->_mode > 0)
|
if (fp->_mode > 0)
|
||||||
{
|
{
|
||||||
#if _LIBC
|
#if _LIBC
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,1995,1996,1997,1998,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,11 +39,9 @@ _IO_fflush (fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_SYNC (fp) ? EOF : 0;
|
result = _IO_SYNC (fp) ? EOF : 0;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995-2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,8 +38,7 @@ _IO_new_fgetpos (fp, posp)
|
|||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
@ -72,8 +71,7 @@ _IO_new_fgetpos (fp, posp)
|
|||||||
posp->__state = fp->_wide_data->_IO_state;
|
posp->__state = fp->_wide_data->_IO_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995-2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,16 +38,14 @@ _IO_new_fgetpos64 (fp, posp)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
if (fp->_mode <= 0)
|
if (fp->_mode <= 0)
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
/* ANSI explicitly requires setting errno to a positive value on
|
/* ANSI explicitly requires setting errno to a positive value on
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -40,8 +41,7 @@ _IO_fgets (buf, n, fp)
|
|||||||
CHECK_FILE (fp, NULL);
|
CHECK_FILE (fp, NULL);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
/* This is very tricky since a file descriptor may be in the
|
/* This is very tricky since a file descriptor may be in the
|
||||||
non-blocking mode. The error flag doesn't mean much in this
|
non-blocking mode. The error flag doesn't mean much in this
|
||||||
case. We return an error only when there is a new error. */
|
case. We return an error only when there is a new error. */
|
||||||
@ -59,8 +59,7 @@ _IO_fgets (buf, n, fp)
|
|||||||
result = buf;
|
result = buf;
|
||||||
}
|
}
|
||||||
fp->_IO_file_flags |= old_error;
|
fp->_IO_file_flags |= old_error;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2001
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -40,8 +41,7 @@ fgetws (buf, n, fp)
|
|||||||
CHECK_FILE (fp, NULL);
|
CHECK_FILE (fp, NULL);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
/* This is very tricky since a file descriptor may be in the
|
/* This is very tricky since a file descriptor may be in the
|
||||||
non-blocking mode. The error flag doesn't mean much in this
|
non-blocking mode. The error flag doesn't mean much in this
|
||||||
case. We return an error only when there is a new error. */
|
case. We return an error only when there is a new error. */
|
||||||
@ -58,7 +58,6 @@ fgetws (buf, n, fp)
|
|||||||
result = buf;
|
result = buf;
|
||||||
}
|
}
|
||||||
fp->_IO_file_flags |= old_error;
|
fp->_IO_file_flags |= old_error;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,11 @@ _IO_fputs (str, fp)
|
|||||||
_IO_size_t len = strlen (str);
|
_IO_size_t len = strlen (str);
|
||||||
int result = EOF;
|
int result = EOF;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if ((_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
|
if ((_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
|
||||||
&& _IO_sputn (fp, str, len) == len)
|
&& _IO_sputn (fp, str, len) == len)
|
||||||
result = 1;
|
result = 1;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (_IO_fputs)
|
libc_hidden_def (_IO_fputs)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,12 +37,10 @@ fputws (str, fp)
|
|||||||
_IO_size_t len = __wcslen (str);
|
_IO_size_t len = __wcslen (str);
|
||||||
int result = EOF;
|
int result = EOF;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_fwide (fp, 1) == 1
|
if (_IO_fwide (fp, 1) == 1
|
||||||
&& _IO_sputn (fp, (char *) str, len) == len)
|
&& _IO_sputn (fp, (char *) str, len) == len)
|
||||||
result = 1;
|
result = 1;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,1995,1997,1998,1999,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -39,11 +40,9 @@ _IO_fread (buf, size, count, fp)
|
|||||||
CHECK_FILE (fp, 0);
|
CHECK_FILE (fp, 0);
|
||||||
if (bytes_requested == 0)
|
if (bytes_requested == 0)
|
||||||
return 0;
|
return 0;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested);
|
bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return bytes_requested == bytes_read ? count : bytes_read / size;
|
return bytes_requested == bytes_read ? count : bytes_read / size;
|
||||||
}
|
}
|
||||||
INTDEF(_IO_fread)
|
INTDEF(_IO_fread)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 1995, 1997-2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,8 +37,7 @@ _IO_new_fsetpos (fp, posp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
== _IO_pos_BAD)
|
== _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
@ -57,8 +57,7 @@ _IO_new_fsetpos (fp, posp)
|
|||||||
/* This is a stateful encoding, restore the state. */
|
/* This is a stateful encoding, restore the state. */
|
||||||
fp->_wide_data->_IO_state = posp->__state;
|
fp->_wide_data->_IO_state = posp->__state;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 1995, 1997-2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -37,8 +38,7 @@ _IO_new_fsetpos64 (fp, posp)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
== _IO_pos_BAD)
|
== _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
@ -58,8 +58,7 @@ _IO_new_fsetpos64 (fp, posp)
|
|||||||
/* This is a stateful encoding, safe the state. */
|
/* This is a stateful encoding, safe the state. */
|
||||||
fp->_wide_data->_IO_state = posp->__state;
|
fp->_wide_data->_IO_state = posp->__state;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
|
@ -36,16 +36,14 @@ _IO_ftell (fp)
|
|||||||
{
|
{
|
||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
CHECK_FILE (fp, -1L);
|
CHECK_FILE (fp, -1L);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
if (_IO_vtable_offset (fp) != 0 || fp->_mode <= 0)
|
if (_IO_vtable_offset (fp) != 0 || fp->_mode <= 0)
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
}
|
}
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
#ifdef EIO
|
#ifdef EIO
|
||||||
|
@ -40,12 +40,10 @@ _IO_fwrite (buf, size, count, fp)
|
|||||||
CHECK_FILE (fp, 0);
|
CHECK_FILE (fp, 0);
|
||||||
if (request == 0)
|
if (request == 0)
|
||||||
return 0;
|
return 0;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
|
if (_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
|
||||||
written = _IO_sputn (fp, (const char *) buf, request);
|
written = _IO_sputn (fp, (const char *) buf, request);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (written == request)
|
if (written == request)
|
||||||
return count;
|
return count;
|
||||||
else
|
else
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1994, 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1994,1996,1997,1998,2001,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -55,8 +55,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
CHECK_FILE (fp, -1);
|
CHECK_FILE (fp, -1);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_ferror_unlocked (fp))
|
if (_IO_ferror_unlocked (fp))
|
||||||
{
|
{
|
||||||
result = -1;
|
result = -1;
|
||||||
@ -120,8 +119,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
|
|||||||
result = cur_len;
|
result = cur_len;
|
||||||
|
|
||||||
unlock_return:
|
unlock_return:
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1996, 1997, 1998, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1996,1997,1998,2002,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,9 +36,7 @@ _IO_gets (buf)
|
|||||||
int ch;
|
int ch;
|
||||||
char *retval;
|
char *retval;
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdin);
|
||||||
_IO_stdin);
|
|
||||||
_IO_flockfile (_IO_stdin);
|
|
||||||
ch = _IO_getc_unlocked (_IO_stdin);
|
ch = _IO_getc_unlocked (_IO_stdin);
|
||||||
if (ch == EOF)
|
if (ch == EOF)
|
||||||
{
|
{
|
||||||
@ -67,8 +65,7 @@ _IO_gets (buf)
|
|||||||
buf[count] = 0;
|
buf[count] = 0;
|
||||||
retval = buf;
|
retval = buf;
|
||||||
unlock_return:
|
unlock_return:
|
||||||
_IO_funlockfile (_IO_stdin);
|
_IO_release_lock (_IO_stdin);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,9 +34,7 @@ _IO_puts (str)
|
|||||||
{
|
{
|
||||||
int result = EOF;
|
int result = EOF;
|
||||||
_IO_size_t len = strlen (str);
|
_IO_size_t len = strlen (str);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdout);
|
||||||
_IO_stdout);
|
|
||||||
_IO_flockfile (_IO_stdout);
|
|
||||||
|
|
||||||
if ((_IO_vtable_offset (_IO_stdout) != 0
|
if ((_IO_vtable_offset (_IO_stdout) != 0
|
||||||
|| _IO_fwide (_IO_stdout, -1) == -1)
|
|| _IO_fwide (_IO_stdout, -1) == -1)
|
||||||
@ -44,8 +42,7 @@ _IO_puts (str)
|
|||||||
&& _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
|
&& _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
|
||||||
result = len + 1;
|
result = len + 1;
|
||||||
|
|
||||||
_IO_funlockfile (_IO_stdout);
|
_IO_release_lock (_IO_stdout);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,12 +81,8 @@ _IO_seekoff (fp, offset, dir, mode)
|
|||||||
{
|
{
|
||||||
_IO_off64_t retval;
|
_IO_off64_t retval;
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
|
|
||||||
retval = _IO_seekoff_unlocked (fp, offset, dir, mode);
|
retval = _IO_seekoff_unlocked (fp, offset, dir, mode);
|
||||||
|
_IO_release_lock (fp);
|
||||||
_IO_funlockfile (fp);
|
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1997,1998,1999,2002,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -59,12 +59,8 @@ _IO_seekpos (fp, pos, mode)
|
|||||||
{
|
{
|
||||||
_IO_off64_t retval;
|
_IO_off64_t retval;
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
|
|
||||||
retval = _IO_seekpos_unlocked (fp, pos, mode);
|
retval = _IO_seekpos_unlocked (fp, pos, mode);
|
||||||
|
_IO_release_lock (fp);
|
||||||
_IO_funlockfile (fp);
|
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,7 @@ _IO_setbuffer (fp, buf, size)
|
|||||||
_IO_size_t size;
|
_IO_size_t size;
|
||||||
{
|
{
|
||||||
CHECK_FILE (fp, );
|
CHECK_FILE (fp, );
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
fp->_flags &= ~_IO_LINE_BUF;
|
fp->_flags &= ~_IO_LINE_BUF;
|
||||||
if (!buf)
|
if (!buf)
|
||||||
size = 0;
|
size = 0;
|
||||||
@ -44,8 +43,7 @@ _IO_setbuffer (fp, buf, size)
|
|||||||
if (_IO_vtable_offset (fp) == 0 && fp->_mode == 0 && _IO_CHECK_WIDE (fp))
|
if (_IO_vtable_offset (fp) == 0 && fp->_mode == 0 && _IO_CHECK_WIDE (fp))
|
||||||
/* We also have to set the buffer using the wide char function. */
|
/* We also have to set the buffer using the wide char function. */
|
||||||
(void) _IO_WSETBUF (fp, buf, size);
|
(void) _IO_WSETBUF (fp, buf, size);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
}
|
}
|
||||||
INTDEF(_IO_setbuffer)
|
INTDEF(_IO_setbuffer)
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -40,8 +41,7 @@ _IO_setvbuf (fp, buf, mode, size)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case _IOFBF:
|
case _IOFBF:
|
||||||
@ -96,8 +96,7 @@ _IO_setvbuf (fp, buf, mode, size)
|
|||||||
result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
|
result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
|
||||||
|
|
||||||
unlock_return:
|
unlock_return:
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF(_IO_setvbuf)
|
INTDEF(_IO_setvbuf)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993,1996,1997,1998,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1996,1997,1998,2002,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,11 +36,9 @@ _IO_ungetc (c, fp)
|
|||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return EOF;
|
return EOF;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = INTUSE(_IO_sputbackc) (fp, (unsigned char) c);
|
result = INTUSE(_IO_sputbackc) (fp, (unsigned char) c);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993, 1996-1999, 2001, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -35,14 +36,12 @@ ungetwc (c, fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, WEOF);
|
CHECK_FILE (fp, WEOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
_IO_fwide (fp, 1);
|
_IO_fwide (fp, 1);
|
||||||
if (c == WEOF)
|
if (c == WEOF)
|
||||||
result = WEOF;
|
result = WEOF;
|
||||||
else
|
else
|
||||||
result = INTUSE(_IO_sputbackwc) (fp, c);
|
result = INTUSE(_IO_sputbackwc) (fp, c);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -52,15 +52,13 @@ _IO_old_fclose (fp)
|
|||||||
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
||||||
INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
|
INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
|
||||||
|
|
||||||
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
|
||||||
status = _IO_old_file_close_it (fp);
|
status = _IO_old_file_close_it (fp);
|
||||||
else
|
else
|
||||||
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
|
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
|
||||||
_IO_FINISH (fp);
|
_IO_FINISH (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (_IO_have_backup (fp))
|
if (_IO_have_backup (fp))
|
||||||
INTUSE(_IO_free_backup_area) (fp);
|
INTUSE(_IO_free_backup_area) (fp);
|
||||||
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
|
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,95,96,97,98,99,2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,13 +39,11 @@ _IO_old_fgetpos (fp, posp)
|
|||||||
{
|
{
|
||||||
_IO_off_t pos;
|
_IO_off_t pos;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
/* ANSI explicitly requires setting errno to a positive value on
|
/* ANSI explicitly requires setting errno to a positive value on
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,95,96,97,98,99,2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -39,13 +40,11 @@ _IO_old_fgetpos64 (fp, posp)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
_IO_off64_t pos;
|
_IO_off64_t pos;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
|
||||||
if (_IO_in_backup (fp))
|
if (_IO_in_backup (fp))
|
||||||
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
pos -= fp->_IO_save_end - fp->_IO_save_base;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
if (pos == _IO_pos_BAD)
|
if (pos == _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
/* ANSI explicitly requires setting errno to a positive value on
|
/* ANSI explicitly requires setting errno to a positive value on
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,95,97,98,99,2000,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -37,8 +38,7 @@ _IO_old_fsetpos (fp, posp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
== _IO_pos_BAD)
|
== _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
@ -52,8 +52,7 @@ _IO_old_fsetpos (fp, posp)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = 0;
|
result = 0;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1993,95,97,98,99,2000,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -39,8 +40,7 @@ _IO_old_fsetpos64 (fp, posp)
|
|||||||
#ifdef _G_LSEEK64
|
#ifdef _G_LSEEK64
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
== _IO_pos_BAD)
|
== _IO_pos_BAD)
|
||||||
{
|
{
|
||||||
@ -54,8 +54,7 @@ _IO_old_fsetpos64 (fp, posp)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = 0;
|
result = 0;
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,10 +36,8 @@ _IO_peekc_locked (fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_peekc_unlocked (fp);
|
result = _IO_peekc_unlocked (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -28,11 +29,9 @@ _IO_putc (c, fp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
CHECK_FILE (fp, EOF);
|
CHECK_FILE (fp, EOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_putc_unlocked (c, fp);
|
result = _IO_putc_unlocked (c, fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF(_IO_putc)
|
INTDEF(_IO_putc)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1991,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -26,12 +26,9 @@ putchar (c)
|
|||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdout);
|
||||||
_IO_stdout);
|
|
||||||
_IO_flockfile (_IO_stdout);
|
|
||||||
result = _IO_putc_unlocked (c, _IO_stdout);
|
result = _IO_putc_unlocked (c, _IO_stdout);
|
||||||
_IO_funlockfile (_IO_stdout);
|
_IO_release_lock (_IO_stdout);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1991,95,96,97,98,99,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 1999, 2002, 2003
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -26,11 +27,9 @@ putwc (wc, fp)
|
|||||||
{
|
{
|
||||||
wint_t result;
|
wint_t result;
|
||||||
CHECK_FILE (fp, WEOF);
|
CHECK_FILE (fp, WEOF);
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
result = _IO_putwc_unlocked (wc, fp);
|
result = _IO_putwc_unlocked (wc, fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (putwc)
|
libc_hidden_def (putwc)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
|
/* Copyright (C) 1991,95,96,97,98,99,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -24,11 +24,8 @@ putwchar (wc)
|
|||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
{
|
{
|
||||||
wint_t result;
|
wint_t result;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdout);
|
||||||
_IO_stdout);
|
|
||||||
_IO_flockfile (_IO_stdout);
|
|
||||||
result = _IO_putwc_unlocked (wc, _IO_stdout);
|
result = _IO_putwc_unlocked (wc, _IO_stdout);
|
||||||
_IO_funlockfile (_IO_stdout);
|
_IO_release_lock (_IO_stdout);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1993,96,97,98,2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1993,96,97,98,2002,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -33,11 +33,9 @@ rewind (fp)
|
|||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
{
|
{
|
||||||
CHECK_FILE (fp, );
|
CHECK_FILE (fp, );
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_acquire_lock (fp);
|
||||||
_IO_flockfile (fp);
|
|
||||||
_IO_rewind (fp);
|
_IO_rewind (fp);
|
||||||
_IO_clearerr (fp);
|
_IO_clearerr (fp);
|
||||||
_IO_funlockfile (fp);
|
_IO_release_lock (fp);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
}
|
}
|
||||||
libc_hidden_def (rewind)
|
libc_hidden_def (rewind)
|
||||||
|
@ -217,16 +217,13 @@ _IO_wfile_underflow (fp)
|
|||||||
traditional Unix systems did this for stdout. stderr better
|
traditional Unix systems did this for stdout. stderr better
|
||||||
not be line buffered. So we do just that here
|
not be line buffered. So we do just that here
|
||||||
explicitly. --drepper */
|
explicitly. --drepper */
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
_IO_acquire_lock (_IO_stdout);
|
||||||
_IO_stdout);
|
|
||||||
_IO_flockfile (_IO_stdout);
|
|
||||||
|
|
||||||
if ((_IO_stdout->_flags & (_IO_LINKED | _IO_NO_WRITES | _IO_LINE_BUF))
|
if ((_IO_stdout->_flags & (_IO_LINKED | _IO_NO_WRITES | _IO_LINE_BUF))
|
||||||
== (_IO_LINKED | _IO_LINE_BUF))
|
== (_IO_LINKED | _IO_LINE_BUF))
|
||||||
_IO_OVERFLOW (_IO_stdout, EOF);
|
_IO_OVERFLOW (_IO_stdout, EOF);
|
||||||
|
|
||||||
_IO_funlockfile (_IO_stdout);
|
_IO_release_lock (_IO_stdout);
|
||||||
_IO_cleanup_region_end (0);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
2003-08-29 Jakub Jelinek <jakuB@redhat.com>
|
2003-08-29 Jakub Jelinek <jakuB@redhat.com>
|
||||||
|
|
||||||
* tst-cancel.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
|
* tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
|
||||||
sigemptyset before sigaddset. Reported by jreiser@BitWagon.com.
|
sigemptyset before sigaddset. Reported by jreiser@BitWagon.com.
|
||||||
|
|
||||||
2003-08-27 Ulrich Drepper <drepper@redhat.com>
|
2003-08-27 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Thread package specific definitions of stream lock type. Generic version.
|
/* Thread package specific definitions of stream lock type. NPTL version.
|
||||||
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -85,5 +85,26 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
|
|||||||
#define _IO_cleanup_region_end(_doit) \
|
#define _IO_cleanup_region_end(_doit) \
|
||||||
__libc_cleanup_region_end (_doit)
|
__libc_cleanup_region_end (_doit)
|
||||||
|
|
||||||
|
#if defined _LIBC && !defined NOT_IN_libc
|
||||||
|
|
||||||
|
# ifdef __EXCEPTIONS
|
||||||
|
# define _IO_acquire_lock(_fp) \
|
||||||
|
do { \
|
||||||
|
auto inline __attribute__((always_inline)) void \
|
||||||
|
_IO_acquire_lock_fct (int *p __attribute__ ((__unused__))) \
|
||||||
|
{ \
|
||||||
|
if (((_fp)->_flags & _IO_USER_LOCK) == 0) \
|
||||||
|
_IO_funlockfile (_fp); \
|
||||||
|
} \
|
||||||
|
int _IO_acquire_lock_dummy \
|
||||||
|
__attribute__ ((cleanup (_IO_acquire_lock_fct))); \
|
||||||
|
_IO_flockfile (_fp)
|
||||||
|
|
||||||
|
# else
|
||||||
|
# define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
|
||||||
|
# endif
|
||||||
|
# define _IO_release_lock(_fp) ; } while (0)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* bits/stdio-lock.h */
|
#endif /* bits/stdio-lock.h */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Thread package specific definitions of stream lock type. Generic version.
|
/* Thread package specific definitions of stream lock type. Generic version.
|
||||||
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -45,5 +45,14 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
|
|||||||
#define _IO_cleanup_region_end(_doit) \
|
#define _IO_cleanup_region_end(_doit) \
|
||||||
__libc_cleanup_region_end (_doit)
|
__libc_cleanup_region_end (_doit)
|
||||||
|
|
||||||
|
#if defined _LIBC && !defined NOT_IN_libc
|
||||||
|
# define _IO_acquire_lock(_fp) \
|
||||||
|
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
|
||||||
|
_IO_flockfile (_fp)
|
||||||
|
|
||||||
|
# define _IO_release_lock(_fp) \
|
||||||
|
_IO_funlockfile (_fp); \
|
||||||
|
_IO_cleanup_region_end (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* bits/stdio-lock.h */
|
#endif /* bits/stdio-lock.h */
|
||||||
|
Reference in New Issue
Block a user