Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
/* Linuxthreads - a simple clone()-based implementation of Posix */
|
|
|
|
/* threads for Linux. */
|
|
|
|
/* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr) */
|
|
|
|
/* */
|
|
|
|
/* This program is free software; you can redistribute it and/or */
|
|
|
|
/* modify it under the terms of the GNU Library General Public License */
|
|
|
|
/* as published by the Free Software Foundation; either version 2 */
|
|
|
|
/* of the License, or (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* This program is distributed in the hope that it will be useful, */
|
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
/* GNU Library General Public License for more details. */
|
|
|
|
|
1998-06-25 21:36:00 +02:00
|
|
|
/* Internal locks */
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
|
1998-06-30 14:09:42 +02:00
|
|
|
#include <errno.h>
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
#include <sched.h>
|
|
|
|
#include <time.h>
|
2000-06-26 03:47:56 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <limits.h>
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
#include "pthread.h"
|
|
|
|
#include "internals.h"
|
|
|
|
#include "spinlock.h"
|
1998-06-25 21:36:00 +02:00
|
|
|
#include "restart.h"
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
static void __pthread_acquire(int * spinlock);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-04 02:22:32 +02:00
|
|
|
/* The status field of a spinlock is a pointer whose least significant
|
|
|
|
bit is a locked flag.
|
|
|
|
|
|
|
|
Thus the field values have the following meanings:
|
|
|
|
|
|
|
|
status == 0: spinlock is free
|
|
|
|
status == 1: spinlock is taken; no thread is waiting on it
|
|
|
|
|
|
|
|
(status & 1) == 1: spinlock is taken and (status & ~1L) is a
|
|
|
|
pointer to the first waiting thread; other
|
2000-07-04 10:22:44 +02:00
|
|
|
waiting threads are linked via the p_nextlock
|
2000-07-04 02:22:32 +02:00
|
|
|
field.
|
|
|
|
(status & 1) == 0: same as above, but spinlock is not taken.
|
|
|
|
|
1998-06-25 21:36:00 +02:00
|
|
|
The waiting list is not sorted by priority order.
|
|
|
|
Actually, we always insert at top of list (sole insertion mode
|
|
|
|
that can be performed without locking).
|
|
|
|
For __pthread_unlock, we perform a linear search in the list
|
|
|
|
to find the highest-priority, oldest waiting thread.
|
|
|
|
This is safe because there are no concurrent __pthread_unlock
|
|
|
|
operations -- only the thread that locked the mutex can unlock it. */
|
|
|
|
|
2000-07-04 02:22:32 +02:00
|
|
|
|
2000-05-25 08:15:25 +02:00
|
|
|
void internal_function __pthread_lock(struct _pthread_fastlock * lock,
|
1998-10-29 16:17:25 +01:00
|
|
|
pthread_descr self)
|
1998-06-25 21:36:00 +02:00
|
|
|
{
|
2000-07-04 02:22:32 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
1998-06-25 21:36:00 +02:00
|
|
|
long oldstatus, newstatus;
|
2000-07-04 02:22:32 +02:00
|
|
|
int successful_seizure, spurious_wakeup_count = 0;
|
|
|
|
int spin_count = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
2000-07-12 22:06:44 +02:00
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
2000-07-04 02:22:32 +02:00
|
|
|
{
|
|
|
|
__pthread_acquire(&lock->__spinlock);
|
2000-07-12 22:06:44 +02:00
|
|
|
return;
|
2000-07-04 02:22:32 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
again:
|
|
|
|
|
|
|
|
/* On SMP, try spinning to get the lock. */
|
|
|
|
|
|
|
|
if (__pthread_smp_kernel) {
|
|
|
|
int max_count = lock->__spinlock * 2 + 10;
|
|
|
|
|
|
|
|
for (spin_count = 0; spin_count < max_count; spin_count++) {
|
|
|
|
if (((oldstatus = lock->__status) & 1) == 0) {
|
|
|
|
if(__compare_and_swap(&lock->__status, oldstatus, oldstatus | 1))
|
|
|
|
{
|
|
|
|
if (spin_count)
|
|
|
|
lock->__spinlock += (spin_count - lock->__spinlock) / 8;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2001-02-19 19:47:27 +01:00
|
|
|
__asm __volatile ("" : "=m" (lock->__status) : "0" (lock->__status));
|
2000-07-04 02:22:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
lock->__spinlock += (spin_count - lock->__spinlock) / 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* No luck, try once more or suspend. */
|
1998-06-25 21:36:00 +02:00
|
|
|
|
|
|
|
do {
|
1998-10-27 15:19:07 +01:00
|
|
|
oldstatus = lock->__status;
|
2000-07-04 02:22:32 +02:00
|
|
|
successful_seizure = 0;
|
|
|
|
|
|
|
|
if ((oldstatus & 1) == 0) {
|
|
|
|
newstatus = oldstatus | 1;
|
|
|
|
successful_seizure = 1;
|
1998-06-25 21:36:00 +02:00
|
|
|
} else {
|
1998-10-29 16:17:25 +01:00
|
|
|
if (self == NULL)
|
|
|
|
self = thread_self();
|
2000-07-04 02:22:32 +02:00
|
|
|
newstatus = (long) self | 1;
|
1998-06-25 21:36:00 +02:00
|
|
|
}
|
2000-07-04 02:22:32 +02:00
|
|
|
|
1999-07-09 16:34:22 +02:00
|
|
|
if (self != NULL) {
|
2000-07-04 02:22:32 +02:00
|
|
|
THREAD_SETMEM(self, p_nextlock, (pthread_descr) (oldstatus & ~1L));
|
2000-04-11 19:03:03 +02:00
|
|
|
/* Make sure the store in p_nextlock completes before performing
|
|
|
|
the compare-and-swap */
|
2000-04-16 00:26:34 +02:00
|
|
|
MEMORY_BARRIER();
|
1999-07-09 16:34:22 +02:00
|
|
|
}
|
2000-07-04 02:22:32 +02:00
|
|
|
} while(! __compare_and_swap(&lock->__status, oldstatus, newstatus));
|
Redesigned how cancellation unblocks a thread from internal cancellation points (sem_wait, pthread_join, pthread_cond_{wait,timedwait}). Cancellation won't eat a signal in any of these functions (*required* by POSIX and Single Unix Spec!).
2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
Redesigned how cancellation unblocks a thread from internal
cancellation points (sem_wait, pthread_join,
pthread_cond_{wait,timedwait}).
Cancellation won't eat a signal in any of these functions
(*required* by POSIX and Single Unix Spec!).
* condvar.c: spontaneous wakeup on pthread_cond_timedwait won't eat a
simultaneous condition variable signal (not required by POSIX
or Single Unix Spec, but nice).
* spinlock.c: __pthread_lock queues back any received restarts
that don't belong to it instead of assuming ownership of lock
upon any restart; fastlock can no longer be acquired by two threads
simultaneously.
* restart.h: restarts queue even on kernels that don't have
queued real time signals (2.0, early 2.1), thanks to atomic counter,
avoiding a rare race condition in pthread_cond_timedwait.
2000-01-05 03:09:12 +01:00
|
|
|
|
Update.
* sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
into pthread_spinlock_t. Change all uses.
* spinlock.c: Implement pthread_spin_lock.
Rename __pthread_unlock to __pthread_spin_unlock and define weak
alias for real name.
Define pthread_spin_trylock, pthread_spin_init, and
pthread_spin_destroy.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* condvar.c: Likewise.
* internals.h: Likewise.
* join.c: Likewise.
* manager.c: Likewise.
* mutex.c: Likewise.
* pthread.c: Likewise.
* rwlock.c: Likewise.
* semaphore.c: Likewise.
* signals.c: Likewise.
2000-04-13 07:57:21 +02:00
|
|
|
/* Suspend with guard against spurious wakeup.
|
Redesigned how cancellation unblocks a thread from internal cancellation points (sem_wait, pthread_join, pthread_cond_{wait,timedwait}). Cancellation won't eat a signal in any of these functions (*required* by POSIX and Single Unix Spec!).
2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
Redesigned how cancellation unblocks a thread from internal
cancellation points (sem_wait, pthread_join,
pthread_cond_{wait,timedwait}).
Cancellation won't eat a signal in any of these functions
(*required* by POSIX and Single Unix Spec!).
* condvar.c: spontaneous wakeup on pthread_cond_timedwait won't eat a
simultaneous condition variable signal (not required by POSIX
or Single Unix Spec, but nice).
* spinlock.c: __pthread_lock queues back any received restarts
that don't belong to it instead of assuming ownership of lock
upon any restart; fastlock can no longer be acquired by two threads
simultaneously.
* restart.h: restarts queue even on kernels that don't have
queued real time signals (2.0, early 2.1), thanks to atomic counter,
avoiding a rare race condition in pthread_cond_timedwait.
2000-01-05 03:09:12 +01:00
|
|
|
This can happen in pthread_cond_timedwait_relative, when the thread
|
|
|
|
wakes up due to timeout and is still on the condvar queue, and then
|
|
|
|
locks the queue to remove itself. At that point it may still be on the
|
|
|
|
queue, and may be resumed by a condition signal. */
|
|
|
|
|
2000-07-04 02:22:32 +02:00
|
|
|
if (!successful_seizure) {
|
Redesigned how cancellation unblocks a thread from internal cancellation points (sem_wait, pthread_join, pthread_cond_{wait,timedwait}). Cancellation won't eat a signal in any of these functions (*required* by POSIX and Single Unix Spec!).
2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
Redesigned how cancellation unblocks a thread from internal
cancellation points (sem_wait, pthread_join,
pthread_cond_{wait,timedwait}).
Cancellation won't eat a signal in any of these functions
(*required* by POSIX and Single Unix Spec!).
* condvar.c: spontaneous wakeup on pthread_cond_timedwait won't eat a
simultaneous condition variable signal (not required by POSIX
or Single Unix Spec, but nice).
* spinlock.c: __pthread_lock queues back any received restarts
that don't belong to it instead of assuming ownership of lock
upon any restart; fastlock can no longer be acquired by two threads
simultaneously.
* restart.h: restarts queue even on kernels that don't have
queued real time signals (2.0, early 2.1), thanks to atomic counter,
avoiding a rare race condition in pthread_cond_timedwait.
2000-01-05 03:09:12 +01:00
|
|
|
for (;;) {
|
|
|
|
suspend(self);
|
|
|
|
if (self->p_nextlock != NULL) {
|
|
|
|
/* Count resumes that don't belong to us. */
|
|
|
|
spurious_wakeup_count++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-07-04 02:22:32 +02:00
|
|
|
goto again;
|
Redesigned how cancellation unblocks a thread from internal cancellation points (sem_wait, pthread_join, pthread_cond_{wait,timedwait}). Cancellation won't eat a signal in any of these functions (*required* by POSIX and Single Unix Spec!).
2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
Redesigned how cancellation unblocks a thread from internal
cancellation points (sem_wait, pthread_join,
pthread_cond_{wait,timedwait}).
Cancellation won't eat a signal in any of these functions
(*required* by POSIX and Single Unix Spec!).
* condvar.c: spontaneous wakeup on pthread_cond_timedwait won't eat a
simultaneous condition variable signal (not required by POSIX
or Single Unix Spec, but nice).
* spinlock.c: __pthread_lock queues back any received restarts
that don't belong to it instead of assuming ownership of lock
upon any restart; fastlock can no longer be acquired by two threads
simultaneously.
* restart.h: restarts queue even on kernels that don't have
queued real time signals (2.0, early 2.1), thanks to atomic counter,
avoiding a rare race condition in pthread_cond_timedwait.
2000-01-05 03:09:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Put back any resumes we caught that don't belong to us. */
|
|
|
|
while (spurious_wakeup_count--)
|
|
|
|
restart(self);
|
2000-07-04 02:22:32 +02:00
|
|
|
#endif
|
Update.
* sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
into pthread_spinlock_t. Change all uses.
* spinlock.c: Implement pthread_spin_lock.
Rename __pthread_unlock to __pthread_spin_unlock and define weak
alias for real name.
Define pthread_spin_trylock, pthread_spin_init, and
pthread_spin_destroy.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* condvar.c: Likewise.
* internals.h: Likewise.
* join.c: Likewise.
* manager.c: Likewise.
* mutex.c: Likewise.
* pthread.c: Likewise.
* rwlock.c: Likewise.
* semaphore.c: Likewise.
* signals.c: Likewise.
2000-04-13 07:57:21 +02:00
|
|
|
}
|
1998-06-25 21:36:00 +02:00
|
|
|
|
2000-05-25 08:15:25 +02:00
|
|
|
int __pthread_unlock(struct _pthread_fastlock * lock)
|
1998-06-25 21:36:00 +02:00
|
|
|
{
|
2000-07-04 02:22:32 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
1998-06-25 21:36:00 +02:00
|
|
|
long oldstatus;
|
|
|
|
pthread_descr thr, * ptr, * maxptr;
|
|
|
|
int maxprio;
|
2000-07-04 02:22:32 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
2000-07-12 22:06:44 +02:00
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
2000-07-04 02:22:32 +02:00
|
|
|
{
|
|
|
|
WRITE_MEMORY_BARRIER();
|
2001-01-28 17:39:07 +01:00
|
|
|
lock->__spinlock = __LT_SPINLOCK_INIT;
|
2000-07-04 02:22:32 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
1998-06-25 21:36:00 +02:00
|
|
|
|
2000-07-04 02:22:32 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
1998-06-25 21:36:00 +02:00
|
|
|
again:
|
1998-10-27 15:19:07 +01:00
|
|
|
oldstatus = lock->__status;
|
2000-07-04 02:22:32 +02:00
|
|
|
|
|
|
|
while ((oldstatus = lock->__status) == 1) {
|
2000-07-04 10:22:44 +02:00
|
|
|
if (__compare_and_swap_with_release_semantics(&lock->__status,
|
2000-07-04 02:22:32 +02:00
|
|
|
oldstatus, 0))
|
|
|
|
return 0;
|
1998-06-25 21:36:00 +02:00
|
|
|
}
|
2000-07-04 02:22:32 +02:00
|
|
|
|
1998-06-25 21:36:00 +02:00
|
|
|
/* Find thread in waiting queue with maximal priority */
|
1998-10-27 15:19:07 +01:00
|
|
|
ptr = (pthread_descr *) &lock->__status;
|
2000-07-04 02:22:32 +02:00
|
|
|
thr = (pthread_descr) (oldstatus & ~1L);
|
1998-06-25 21:36:00 +02:00
|
|
|
maxprio = 0;
|
|
|
|
maxptr = ptr;
|
2000-07-04 02:22:32 +02:00
|
|
|
while (thr != 0) {
|
1998-06-25 21:36:00 +02:00
|
|
|
if (thr->p_priority >= maxprio) {
|
|
|
|
maxptr = ptr;
|
|
|
|
maxprio = thr->p_priority;
|
|
|
|
}
|
1999-07-09 16:34:22 +02:00
|
|
|
ptr = &(thr->p_nextlock);
|
2000-04-11 19:03:03 +02:00
|
|
|
/* Prevent reordering of the load of lock->__status above and the
|
|
|
|
load of *ptr below, as well as reordering of *ptr between
|
|
|
|
several iterations of the while loop. Some processors (e.g.
|
|
|
|
multiprocessor Alphas) could perform such reordering even though
|
|
|
|
the loads are dependent. */
|
2000-04-18 09:56:20 +02:00
|
|
|
READ_MEMORY_BARRIER();
|
1998-06-25 21:36:00 +02:00
|
|
|
thr = *ptr;
|
|
|
|
}
|
2000-04-11 19:03:03 +02:00
|
|
|
/* Prevent reordering of the load of lock->__status above and
|
|
|
|
thr->p_nextlock below */
|
2000-04-18 09:56:20 +02:00
|
|
|
READ_MEMORY_BARRIER();
|
1998-06-25 21:36:00 +02:00
|
|
|
/* Remove max prio thread from waiting list. */
|
1998-10-27 15:19:07 +01:00
|
|
|
if (maxptr == (pthread_descr *) &lock->__status) {
|
1998-06-25 21:36:00 +02:00
|
|
|
/* If max prio thread is at head, remove it with compare-and-swap
|
2000-07-04 02:22:32 +02:00
|
|
|
to guard against concurrent lock operation. This removal
|
|
|
|
also has the side effect of marking the lock as released
|
|
|
|
because the new status comes from thr->p_nextlock whose
|
|
|
|
least significant bit is clear. */
|
|
|
|
thr = (pthread_descr) (oldstatus & ~1L);
|
|
|
|
if (! __compare_and_swap_with_release_semantics
|
|
|
|
(&lock->__status, oldstatus, (long)(thr->p_nextlock)))
|
1998-06-25 21:36:00 +02:00
|
|
|
goto again;
|
|
|
|
} else {
|
2000-07-04 02:22:32 +02:00
|
|
|
/* No risk of concurrent access, remove max prio thread normally.
|
|
|
|
But in this case we must also flip the least significant bit
|
|
|
|
of the status to mark the lock as released. */
|
1998-06-25 21:36:00 +02:00
|
|
|
thr = *maxptr;
|
1999-07-09 16:34:22 +02:00
|
|
|
*maxptr = thr->p_nextlock;
|
2000-07-04 02:22:32 +02:00
|
|
|
|
|
|
|
do {
|
|
|
|
oldstatus = lock->__status;
|
|
|
|
} while (!__compare_and_swap_with_release_semantics(&lock->__status,
|
|
|
|
oldstatus, oldstatus & ~1L));
|
1998-06-25 21:36:00 +02:00
|
|
|
}
|
2000-04-11 19:03:03 +02:00
|
|
|
/* Prevent reordering of store to *maxptr above and store to thr->p_nextlock
|
|
|
|
below */
|
2000-04-16 00:26:34 +02:00
|
|
|
WRITE_MEMORY_BARRIER();
|
1998-06-25 21:36:00 +02:00
|
|
|
/* Wake up the selected waiting thread */
|
1999-07-09 16:34:22 +02:00
|
|
|
thr->p_nextlock = NULL;
|
1998-06-25 21:36:00 +02:00
|
|
|
restart(thr);
|
Update.
* sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
into pthread_spinlock_t. Change all uses.
* spinlock.c: Implement pthread_spin_lock.
Rename __pthread_unlock to __pthread_spin_unlock and define weak
alias for real name.
Define pthread_spin_trylock, pthread_spin_init, and
pthread_spin_destroy.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* condvar.c: Likewise.
* internals.h: Likewise.
* join.c: Likewise.
* manager.c: Likewise.
* mutex.c: Likewise.
* pthread.c: Likewise.
* rwlock.c: Likewise.
* semaphore.c: Likewise.
* signals.c: Likewise.
2000-04-13 07:57:21 +02:00
|
|
|
|
|
|
|
return 0;
|
2000-07-04 02:22:32 +02:00
|
|
|
#endif
|
Update.
* sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
into pthread_spinlock_t. Change all uses.
* spinlock.c: Implement pthread_spin_lock.
Rename __pthread_unlock to __pthread_spin_unlock and define weak
alias for real name.
Define pthread_spin_trylock, pthread_spin_init, and
pthread_spin_destroy.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
and pthread_spin_unlock.
* cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
Change all uses of _pthread_fastlock to pthread_spinlock_t.
* condvar.c: Likewise.
* internals.h: Likewise.
* join.c: Likewise.
* manager.c: Likewise.
* mutex.c: Likewise.
* pthread.c: Likewise.
* rwlock.c: Likewise.
* semaphore.c: Likewise.
* signals.c: Likewise.
2000-04-13 07:57:21 +02:00
|
|
|
}
|
|
|
|
|
2000-06-26 10:01:33 +02:00
|
|
|
/*
|
2000-06-26 03:47:56 +02:00
|
|
|
* Alternate fastlocks do not queue threads directly. Instead, they queue
|
|
|
|
* these wait queue node structures. When a timed wait wakes up due to
|
|
|
|
* a timeout, it can leave its wait node in the queue (because there
|
|
|
|
* is no safe way to remove from the quue). Some other thread will
|
|
|
|
* deallocate the abandoned node.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
struct wait_node {
|
|
|
|
struct wait_node *next; /* Next node in null terminated linked list */
|
|
|
|
pthread_descr thr; /* The thread waiting with this node */
|
|
|
|
int abandoned; /* Atomic flag */
|
|
|
|
};
|
|
|
|
|
|
|
|
static long wait_node_free_list;
|
2000-07-12 22:06:44 +02:00
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
static int wait_node_free_list_spinlock;
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
|
|
|
|
/* Allocate a new node from the head of the free list using an atomic
|
|
|
|
operation, or else using malloc if that list is empty. A fundamental
|
|
|
|
assumption here is that we can safely access wait_node_free_list->next.
|
|
|
|
That's because we never free nodes once we allocate them, so a pointer to a
|
|
|
|
node remains valid indefinitely. */
|
|
|
|
|
|
|
|
static struct wait_node *wait_node_alloc(void)
|
|
|
|
{
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
long oldvalue, newvalue;
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
struct wait_node *new_node = 0;
|
2000-06-26 03:47:56 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
__pthread_acquire(&wait_node_free_list_spinlock);
|
|
|
|
if (wait_node_free_list != 0) {
|
|
|
|
new_node = (struct wait_node *) wait_node_free_list;
|
|
|
|
wait_node_free_list = (long) new_node->next;
|
|
|
|
}
|
|
|
|
WRITE_MEMORY_BARRIER();
|
|
|
|
wait_node_free_list_spinlock = 0;
|
|
|
|
|
|
|
|
if (new_node == 0)
|
|
|
|
return malloc(sizeof *wait_node_alloc());
|
|
|
|
|
|
|
|
return new_node;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
do {
|
|
|
|
oldvalue = wait_node_free_list;
|
|
|
|
|
|
|
|
if (oldvalue == 0)
|
|
|
|
return malloc(sizeof *wait_node_alloc());
|
|
|
|
|
|
|
|
newvalue = (long) ((struct wait_node *) oldvalue)->next;
|
|
|
|
WRITE_MEMORY_BARRIER();
|
2000-07-12 22:06:44 +02:00
|
|
|
} while (! __compare_and_swap(&wait_node_free_list, oldvalue, newvalue));
|
2000-06-26 03:47:56 +02:00
|
|
|
|
|
|
|
return (struct wait_node *) oldvalue;
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
|
|
|
|
2000-06-26 10:01:33 +02:00
|
|
|
/* Return a node to the head of the free list using an atomic
|
2000-06-26 03:47:56 +02:00
|
|
|
operation. */
|
|
|
|
|
|
|
|
static void wait_node_free(struct wait_node *wn)
|
|
|
|
{
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
long oldvalue, newvalue;
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
__pthread_acquire(&wait_node_free_list_spinlock);
|
|
|
|
wn->next = (struct wait_node *) wait_node_free_list;
|
|
|
|
wait_node_free_list = (long) wn;
|
|
|
|
WRITE_MEMORY_BARRIER();
|
|
|
|
wait_node_free_list_spinlock = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
do {
|
|
|
|
oldvalue = wait_node_free_list;
|
|
|
|
wn->next = (struct wait_node *) oldvalue;
|
|
|
|
newvalue = (long) wn;
|
|
|
|
WRITE_MEMORY_BARRIER();
|
2000-07-12 22:06:44 +02:00
|
|
|
} while (! __compare_and_swap(&wait_node_free_list, oldvalue, newvalue));
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
/* Remove a wait node from the specified queue. It is assumed
|
|
|
|
that the removal takes place concurrently with only atomic insertions at the
|
|
|
|
head of the queue. */
|
2000-06-26 10:01:33 +02:00
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
static void wait_node_dequeue(struct wait_node **pp_head,
|
|
|
|
struct wait_node **pp_node,
|
2000-07-12 22:06:44 +02:00
|
|
|
struct wait_node *p_node)
|
2000-06-26 03:47:56 +02:00
|
|
|
{
|
|
|
|
/* If the node is being deleted from the head of the
|
|
|
|
list, it must be deleted using atomic compare-and-swap.
|
|
|
|
Otherwise it can be deleted in the straightforward way. */
|
|
|
|
|
|
|
|
if (pp_node == pp_head) {
|
2000-07-12 22:06:44 +02:00
|
|
|
long oldvalue = (long) p_node;
|
|
|
|
long newvalue = (long) p_node->next;
|
2000-07-18 19:18:38 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
if (__compare_and_swap((long *) pp_node, oldvalue, newvalue))
|
2000-06-26 03:47:56 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Oops! Compare and swap failed, which means the node is
|
|
|
|
no longer first. We delete it using the ordinary method. But we don't
|
|
|
|
know the identity of the node which now holds the pointer to the node
|
|
|
|
being deleted, so we must search from the beginning. */
|
|
|
|
|
|
|
|
for (pp_node = pp_head; *pp_node != p_node; pp_node = &(*pp_node)->next)
|
|
|
|
; /* null body */
|
|
|
|
}
|
|
|
|
|
|
|
|
*pp_node = p_node->next;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
void __pthread_alt_lock(struct _pthread_fastlock * lock,
|
|
|
|
pthread_descr self)
|
|
|
|
{
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
long oldstatus, newstatus;
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
|
|
|
struct wait_node wait_node;
|
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
int suspend_needed = 0;
|
|
|
|
__pthread_acquire(&lock->__spinlock);
|
|
|
|
|
|
|
|
if (lock->__status == 0)
|
|
|
|
lock->__status = 1;
|
|
|
|
else {
|
|
|
|
if (self == NULL)
|
|
|
|
self = thread_self();
|
|
|
|
|
|
|
|
wait_node.abandoned = 0;
|
|
|
|
wait_node.next = (struct wait_node *) lock->__status;
|
2000-07-18 19:18:38 +02:00
|
|
|
wait_node.thr = self;
|
2000-07-19 20:58:05 +02:00
|
|
|
lock->__status = (long) &wait_node;
|
2000-07-12 22:06:44 +02:00
|
|
|
suspend_needed = 1;
|
|
|
|
}
|
2000-06-26 03:47:56 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
WRITE_MEMORY_BARRIER();
|
2001-01-28 17:39:07 +01:00
|
|
|
lock->__spinlock = __LT_SPINLOCK_INIT;
|
2000-07-12 22:06:44 +02:00
|
|
|
|
|
|
|
if (suspend_needed)
|
|
|
|
suspend (self);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
do {
|
|
|
|
oldstatus = lock->__status;
|
|
|
|
if (oldstatus == 0) {
|
|
|
|
newstatus = 1;
|
|
|
|
} else {
|
|
|
|
if (self == NULL)
|
2000-07-18 19:18:38 +02:00
|
|
|
self = thread_self();
|
|
|
|
wait_node.thr = self;
|
2000-06-26 03:47:56 +02:00
|
|
|
newstatus = (long) &wait_node;
|
|
|
|
}
|
|
|
|
wait_node.abandoned = 0;
|
|
|
|
wait_node.next = (struct wait_node *) oldstatus;
|
|
|
|
/* Make sure the store in wait_node.next completes before performing
|
|
|
|
the compare-and-swap */
|
|
|
|
MEMORY_BARRIER();
|
2000-07-18 19:20:58 +02:00
|
|
|
} while(! __compare_and_swap(&lock->__status, oldstatus, newstatus));
|
2000-06-26 03:47:56 +02:00
|
|
|
|
|
|
|
/* Suspend. Note that unlike in __pthread_lock, we don't worry
|
|
|
|
here about spurious wakeup. That's because this lock is not
|
|
|
|
used in situations where that can happen; the restart can
|
|
|
|
only come from the previous lock owner. */
|
|
|
|
|
|
|
|
if (oldstatus != 0)
|
|
|
|
suspend(self);
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Timed-out lock operation; returns 0 to indicate timeout. */
|
|
|
|
|
|
|
|
int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
|
|
|
pthread_descr self, const struct timespec *abstime)
|
|
|
|
{
|
2000-07-19 20:58:05 +02:00
|
|
|
long oldstatus = 0;
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
long newstatus;
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
struct wait_node *p_wait_node = wait_node_alloc();
|
2000-06-26 10:01:33 +02:00
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
/* Out of memory, just give up and do ordinary lock. */
|
|
|
|
if (p_wait_node == 0) {
|
|
|
|
__pthread_alt_lock(lock, self);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
__pthread_acquire(&lock->__spinlock);
|
|
|
|
|
|
|
|
if (lock->__status == 0)
|
|
|
|
lock->__status = 1;
|
|
|
|
else {
|
|
|
|
if (self == NULL)
|
|
|
|
self = thread_self();
|
|
|
|
|
|
|
|
p_wait_node->abandoned = 0;
|
|
|
|
p_wait_node->next = (struct wait_node *) lock->__status;
|
2000-07-18 19:18:38 +02:00
|
|
|
p_wait_node->thr = self;
|
2000-07-19 20:58:05 +02:00
|
|
|
lock->__status = (long) p_wait_node;
|
|
|
|
oldstatus = 1; /* force suspend */
|
2000-07-12 22:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
WRITE_MEMORY_BARRIER();
|
2001-01-28 17:39:07 +01:00
|
|
|
lock->__spinlock = __LT_SPINLOCK_INIT;
|
2000-07-12 22:06:44 +02:00
|
|
|
goto suspend;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
2000-06-26 03:47:56 +02:00
|
|
|
do {
|
|
|
|
oldstatus = lock->__status;
|
|
|
|
if (oldstatus == 0) {
|
|
|
|
newstatus = 1;
|
|
|
|
} else {
|
|
|
|
if (self == NULL)
|
2000-07-18 20:35:20 +02:00
|
|
|
self = thread_self();
|
|
|
|
p_wait_node->thr = self;
|
2000-06-26 03:47:56 +02:00
|
|
|
newstatus = (long) p_wait_node;
|
|
|
|
}
|
|
|
|
p_wait_node->abandoned = 0;
|
|
|
|
p_wait_node->next = (struct wait_node *) oldstatus;
|
|
|
|
/* Make sure the store in wait_node.next completes before performing
|
|
|
|
the compare-and-swap */
|
|
|
|
MEMORY_BARRIER();
|
2000-07-18 19:20:58 +02:00
|
|
|
} while(! __compare_and_swap(&lock->__status, oldstatus, newstatus));
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
suspend:
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
|
|
|
|
/* If we did not get the lock, do a timed suspend. If we wake up due
|
|
|
|
to a timeout, then there is a race; the old lock owner may try
|
|
|
|
to remove us from the queue. This race is resolved by us and the owner
|
|
|
|
doing an atomic testandset() to change the state of the wait node from 0
|
|
|
|
to 1. If we succeed, then it's a timeout and we abandon the node in the
|
|
|
|
queue. If we fail, it means the owner gave us the lock. */
|
|
|
|
|
|
|
|
if (oldstatus != 0) {
|
|
|
|
if (timedsuspend(self, abstime) == 0) {
|
|
|
|
if (!testandset(&p_wait_node->abandoned))
|
|
|
|
return 0; /* Timeout! */
|
|
|
|
|
|
|
|
/* Eat oustanding resume from owner, otherwise wait_node_free() below
|
|
|
|
will race with owner's wait_node_dequeue(). */
|
|
|
|
suspend(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wait_node_free(p_wait_node);
|
|
|
|
|
|
|
|
return 1; /* Got the lock! */
|
|
|
|
}
|
|
|
|
|
|
|
|
void __pthread_alt_unlock(struct _pthread_fastlock *lock)
|
|
|
|
{
|
|
|
|
struct wait_node *p_node, **pp_node, *p_max_prio, **pp_max_prio;
|
|
|
|
struct wait_node ** const pp_head = (struct wait_node **) &lock->__status;
|
|
|
|
int maxprio;
|
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
__pthread_acquire(&lock->__spinlock);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
while (1) {
|
|
|
|
|
|
|
|
/* If no threads are waiting for this lock, try to just
|
|
|
|
atomically release it. */
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
if (lock->__status == 0 || lock->__status == 1) {
|
|
|
|
lock->__status = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
long oldstatus = lock->__status;
|
|
|
|
if (oldstatus == 0 || oldstatus == 1) {
|
|
|
|
if (__compare_and_swap_with_release_semantics (&lock->__status, oldstatus, 0))
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
}
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
2000-07-12 22:06:44 +02:00
|
|
|
#endif
|
2000-06-26 10:01:33 +02:00
|
|
|
|
2000-06-26 03:47:56 +02:00
|
|
|
/* Process the entire queue of wait nodes. Remove all abandoned
|
|
|
|
wait nodes and put them into the global free queue, and
|
|
|
|
remember the one unabandoned node which refers to the thread
|
|
|
|
having the highest priority. */
|
|
|
|
|
|
|
|
pp_max_prio = pp_node = pp_head;
|
|
|
|
p_max_prio = p_node = *pp_head;
|
|
|
|
maxprio = INT_MIN;
|
|
|
|
|
|
|
|
while (p_node != (struct wait_node *) 1) {
|
|
|
|
int prio;
|
|
|
|
|
|
|
|
if (p_node->abandoned) {
|
|
|
|
/* Remove abandoned node. */
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
*pp_node = p_node->next;
|
|
|
|
#endif
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
wait_node_dequeue(pp_head, pp_node, p_node);
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
wait_node_free(p_node);
|
|
|
|
READ_MEMORY_BARRIER();
|
|
|
|
p_node = *pp_node;
|
|
|
|
continue;
|
|
|
|
} else if ((prio = p_node->thr->p_priority) >= maxprio) {
|
|
|
|
/* Otherwise remember it if its thread has a higher or equal priority
|
|
|
|
compared to that of any node seen thus far. */
|
|
|
|
maxprio = prio;
|
|
|
|
pp_max_prio = pp_node;
|
|
|
|
p_max_prio = p_node;
|
|
|
|
}
|
|
|
|
|
|
|
|
pp_node = &p_node->next;
|
|
|
|
READ_MEMORY_BARRIER();
|
|
|
|
p_node = *pp_node;
|
|
|
|
}
|
|
|
|
|
|
|
|
READ_MEMORY_BARRIER();
|
|
|
|
|
|
|
|
/* If all threads abandoned, go back to top */
|
|
|
|
if (maxprio == INT_MIN)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ASSERT (p_max_prio != (struct wait_node *) 1);
|
|
|
|
|
|
|
|
/* Now we want to to remove the max priority thread's wait node from
|
|
|
|
the list. Before we can do this, we must atomically try to change the
|
|
|
|
node's abandon state from zero to nonzero. If we succeed, that means we
|
|
|
|
have the node that we will wake up. If we failed, then it means the
|
|
|
|
thread timed out and abandoned the node in which case we repeat the
|
|
|
|
whole unlock operation. */
|
|
|
|
|
|
|
|
if (!testandset(&p_max_prio->abandoned)) {
|
2000-07-12 22:06:44 +02:00
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
*pp_max_prio = p_max_prio->next;
|
|
|
|
#endif
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
#if defined HAS_COMPARE_AND_SWAP
|
|
|
|
wait_node_dequeue(pp_head, pp_max_prio, p_max_prio);
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
WRITE_MEMORY_BARRIER();
|
|
|
|
restart(p_max_prio->thr);
|
2000-07-12 22:06:44 +02:00
|
|
|
break;
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
|
|
|
}
|
2000-07-12 22:06:44 +02:00
|
|
|
|
|
|
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
if (!__pthread_has_cas)
|
|
|
|
#endif
|
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
{
|
|
|
|
WRITE_MEMORY_BARRIER();
|
2001-01-28 17:39:07 +01:00
|
|
|
lock->__spinlock = __LT_SPINLOCK_INIT;
|
2000-07-12 22:06:44 +02:00
|
|
|
}
|
|
|
|
#endif
|
2000-06-26 03:47:56 +02:00
|
|
|
}
|
|
|
|
|
1998-06-25 21:36:00 +02:00
|
|
|
|
|
|
|
/* Compare-and-swap emulation with a spinlock */
|
|
|
|
|
|
|
|
#ifdef TEST_FOR_COMPARE_AND_SWAP
|
|
|
|
int __pthread_has_cas = 0;
|
|
|
|
#endif
|
|
|
|
|
1998-06-26 11:51:29 +02:00
|
|
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
1998-06-25 21:36:00 +02:00
|
|
|
|
|
|
|
int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
|
|
|
|
int * spinlock)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
if (testandset(spinlock)) __pthread_acquire(spinlock);
|
|
|
|
if (*ptr == oldval) {
|
|
|
|
*ptr = newval; res = 1;
|
|
|
|
} else {
|
|
|
|
res = 0;
|
|
|
|
}
|
2000-04-11 19:03:03 +02:00
|
|
|
/* Prevent reordering of store to *ptr above and store to *spinlock below */
|
Update.
2000-04-15 Ulrich Drepper <drepper@redhat.com>
* posix/Makefile (headers): Add spawn.h.
(distribute): Add spawn_int.h.
(routines): Add spawn_faction_init, spawn_faction_destroy,
spawn_faction_addclose, spawn_faction_addopen, spawn_faction_adddup2,
spawnattr_init, spawnattr_destroy, spawnattr_getdefault,
spawnattr_setdefault, spawnattr_getflags, spawnattr_setflags,
spawnattr_getpgroup, spawnattr_setpgroup, spawn, spawnp, and spawni.
* posix/Versions [libc] (GLIBC_2.2): Add posix_spawn_file_actions_init,
posix_spawn_file_actions_destroy, posix_spawn_file_actions_addclose,
posix_spawn_file_actions_addopen, posix_spawn_file_actions_adddup2,
posix_spawnattr_init, posix_spawnattr_destroy,
posix_spawnattr_getdefault, posix_spawnattr_setdefault,
posix_spawnattr_getflags, posix_spawnattr_setflags,
posix_spawnattr_getpgroup, posix_spawnattr_setpgroup, posix_spawn,
and posix_spawnp.
* posix/spawn.c: New file.
* posix/spawn.h: New file.
* posix/spawn_faction_addclose.c: New file.
* posix/spawn_faction_adddup2.c: New file.
* posix/spawn_faction_addopen.c: New file.
* posix/spawn_faction_destroy.c: New file.
* posix/spawn_faction_init.c: New file.
* posix/spawn_int.h: New file.
* posix/spawnattr_destroy.c: New file.
* posix/spawnattr_getdefault.c: New file.
* posix/spawnattr_getflags.c: New file.
* posix/spawnattr_getpgroup.c: New file.
* posix/spawnattr_getschedparam.c: New file.
* posix/spawnattr_getschedpolicy.c: New file.
* posix/spawnattr_getsigmask.c: New file.
* posix/spawnattr_init.c: New file.
* posix/spawnattr_setdefault.c: New file.
* posix/spawnattr_setflags.c: New file.
* posix/spawnattr_setpgroup.c: New file.
* posix/spawnattr_setschedparam.c: New file.
* posix/spawnattr_setschedpolicy.c: New file.
* posix/spawnattr_setsigmask.c: New file.
* posix/spawni.c: New file.
* posix/spawnp.c: New file.
* sysdeps/mach/hurd/bits/posix_opt.h: Add _POSIX_SPAWN.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
2000-04-15 18:51:16 +02:00
|
|
|
WRITE_MEMORY_BARRIER();
|
1998-06-25 21:36:00 +02:00
|
|
|
*spinlock = 0;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called if the inlined test-and-set
|
|
|
|
in __pthread_compare_and_swap() failed */
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
|
|
|
|
/* The retry strategy is as follows:
|
|
|
|
- We test and set the spinlock MAX_SPIN_COUNT times, calling
|
|
|
|
sched_yield() each time. This gives ample opportunity for other
|
|
|
|
threads with priority >= our priority to make progress and
|
|
|
|
release the spinlock.
|
|
|
|
- If a thread with priority < our priority owns the spinlock,
|
|
|
|
calling sched_yield() repeatedly is useless, since we're preventing
|
|
|
|
the owning thread from making progress and releasing the spinlock.
|
|
|
|
So, after MAX_SPIN_LOCK attemps, we suspend the calling thread
|
|
|
|
using nanosleep(). This again should give time to the owning thread
|
|
|
|
for releasing the spinlock.
|
|
|
|
Notice that the nanosleep() interval must not be too small,
|
|
|
|
since the kernel does busy-waiting for short intervals in a realtime
|
|
|
|
process (!). The smallest duration that guarantees thread
|
|
|
|
suspension is currently 2ms.
|
|
|
|
- When nanosleep() returns, we try again, doing MAX_SPIN_COUNT
|
|
|
|
sched_yield(), then sleeping again if needed. */
|
|
|
|
|
1998-06-25 21:36:00 +02:00
|
|
|
static void __pthread_acquire(int * spinlock)
|
Update.
1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com>
* libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and
__libc_siglongjmp to GLIBC_2.1.
* elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use
__strerror_r.
* iconv/Makefile: Don't run tests now.
* iconv/iconv_prog.c (process_block): If loop is repeated, call iconv
with correct output buffer.
Major rewrite of the low-level gconv functionality.
* iconv/gconv.c: Rewritten.
* iconv/gconv.h: Likewise.
* iconv/gconv_builtin.c: Likewise.
* iconv/gconv_builtin.h: Likewise.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.
* iconv/gconv_simple.c: Likewise.
* iconv/iconv.c: Likewise.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/Makefile: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/cns11643.c: Likewise.
* iconvdata/cns11643.h: Likewise.
* iconvdata/cns11643l1.c: Likewise.
* iconvdata/cns11643l1.h: Likewise.
* iconvdata/ebcdic-at-de-a.c: Likewise.
* iconvdata/ebcdic-at-de.c: Likewise.
* iconvdata/ebcdic-ca-fr.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/gb2312.c: Likewise.
* iconvdata/gb2312.h: Likewise.
* iconvdata/hp-roman8.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/iso8859-10.c: Likewise.
* iconvdata/iso8859-2.c: Likewise.
* iconvdata/iso8859-3.c: Likewise.
* iconvdata/iso8859-4.c: Likewise.
* iconvdata/iso8859-5.c: Likewise.
* iconvdata/iso8859-6.c: Likewise.
* iconvdata/iso8859-7.c: Likewise.
* iconvdata/iso8859-8.c: Likewise.
* iconvdata/iso8859-9.c: Likewise.
* iconvdata/jis0201.c: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.c: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.c: Likewise.
* iconvdata/jis0212.h: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/koi-8.c: Likewise.
* iconvdata/koi8-r.c: Likewise.
* iconvdata/ksc5601.c: Likewise.
* iconvdata/ksc5601.h: Likewise.
* iconvdata/latin-greek-1.c: Likewise.
* iconvdata/latin-greek.c: Likewise.
* iconvdata/run-iconv-test.sh: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* wcsmbs/btowc.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
* iconv/loop.c: New file.
* iconv/skeleton.c: New file.
* stdlib/mblen.c: Handle empty input string correctly.
* stdlib/mbtowc.c: Likewise.
* posix/getopt.c: Various cleanups.
* sysdeps/arm/bits/setjmp.h: Add copyright text.
* sysdeps/i386/bits/setjmp.h: Likewise.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/powerpc/bits/setjmp.h: Likewise.
* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
* sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp
and make longjmp weak alias.
1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com>
* iconv/Makefile (routines): Only include gconv_dl if building for
an ELF system - dynamic linking is not available on a.out.
(CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl
due to above check.
* iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call
routines from gconv_dl.
1998-04-17 Gordon Matzigkeit <gord@profitpress.com>
* csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that
we can compile without libio.
1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/Subdirs: Remove login.
1998-04-11 Gordon Matzigkeit <gord@profitpress.com>
* db2/compat.h: Include <errno.h>, to make sure we get the
definition of EFTYPE before we define it ourselves.
1998-04-10 Gordon Matzigkeit <gord@profitpress.com>
* sysdeps/generic/bits/socket.h: Protect against multiple inclusion.
* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
Fix typo to allow inclusion from sys/ioctl.h again.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconvdata/*.[ch]: Clean up namespace. Optimize character lookup.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Export __strerror_r. Remove _strerror_internal.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr.
Also undefine __strcasestr.
1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/regex.c: Rename __re_max_failures back to re_max_failures,
aliases do not work with global variables due to copy relocations.
1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com>
* manual/creature.texi: Fix type. Patch by Andreas Schwab.
1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com>
* signal/sighold.c: Include stddef.h for NULL definition.
* signal/sigrelse.c: Likewise.
* sysdeps/posix/sigignore.c: Likewise.
* sysdeps/posix/sigset.c: Likewise.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX.
Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1998-04-13 Mark Kettenis <kettenis@phys.uva.nl>
* login/Makefile (headers): Remove utmpx.h and bits/utmpx.h.
* login/getutent.c (getutxent): Remove alias.
* login/getutent_r.c (setutxent, pututxline, endutxent):
Remove aliases.
* login/getutid.c (getutxid): Remove alias.
* login/getutline.c (getutxline): Remove alias.
* login/utmp.h: Add prototypes for __updwtmp, __getutent,
__getutid, __getutline and __pututline.
* login/utmpx.h: Moved to ...
* sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE,
UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname
and updwtmpx.
* login/updwtmp.c: Moved to ...
* sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by
allowing file name transformation.
* sysdeps/gnu/updwtmp.c: New file. Use generic implementation with
additional file name transformation.
* sysdeps/unix/sysv/linux/updwtmp.c: Likewise.
* login/utmp_file.c: Moved to ...
* sysdeps/generic/utmp_file.c: ... here. (setutent_file):
Generalized by allowing file name transformation. Do not
print error message. Library functions should not print them.
Reported by Jim Meyering.
* sysdeps/gnu/utmp_file.c: New file. Use generic implementation
with additional file name transformation.
* sysdeps/unix/sysv/linux/utmp_file.c: Likewise.
* sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add
setutxent, getutxent, endutxent, getutxid, getutxid, getutxline,
pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h
and bits/utmpx.h.
* sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h.
(_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to
_PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING):
Define if __USE_GNU.
* sysdeps/gnu/setutxent.c: New file.
* sysdeps/gnu/getutxent.c: New file.
* sysdeps/gnu/endutxent.c: New file.
* sysdeps/gnu/getutxid.c: New file.
* sysdeps/gnu/getutxline.c: New file.
* sysdeps/gnu/pututxline.c: New file.
* sysdeps/gnu/utmpxname.c: New file.
* sysdeps/gnu/updwtmpx.c: New file.
* sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove.
* sysdeps/generic/bits/utmpx.h: Remove.
1998-04-20 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp-test.c (main): Initialize ifs element of ts for
~root test.
1998-04-17 07:53 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo.
1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com>
* libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st
variable using _G_stat64.
* libio/fileops.c: Remove macro definition of fstat, it is in the
global header.
Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-04-17 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox
<willy@odie.barnet.ac.uk>.
1998-04-16 Philip Blundell <Philip.Blundell@pobox.com>
* inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro,
required by IPv6 Basic API.
(IN6_IS_ADDR_MC_LINKLOCAL): Likewise.
(IN6_IS_ADDR_MC_SITELOCAL): Likewise.
(IN6_IS_ADDR_MC_ORGLOCAL): Likewise.
(IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
|
|
|
{
|
|
|
|
int cnt = 0;
|
|
|
|
struct timespec tm;
|
|
|
|
|
|
|
|
while (testandset(spinlock)) {
|
|
|
|
if (cnt < MAX_SPIN_COUNT) {
|
|
|
|
sched_yield();
|
|
|
|
cnt++;
|
|
|
|
} else {
|
|
|
|
tm.tv_sec = 0;
|
|
|
|
tm.tv_nsec = SPIN_SLEEP_DURATION;
|
|
|
|
nanosleep(&tm, NULL);
|
|
|
|
cnt = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-25 21:36:00 +02:00
|
|
|
|
|
|
|
#endif
|