linux: Move funlockfile/_IO_funlockfile into libc

The nptl version is used as default, since now with symbol always
present the single-thread optimization is tricky.

Hurd is not change, it is used it own lock scheme (which call
_cthreads_funlockfile).

Checked on x86_64-linux-gnu.
This commit is contained in:
Adhemerval Zanella 2021-05-06 16:10:28 -03:00
parent e874d3d189
commit 1abc2fba55
32 changed files with 3 additions and 92 deletions

View File

@ -179,7 +179,6 @@ libpthread-routines = \
cleanup \
cleanup_defer \
events \
funlockfile \
libpthread-compat \
nptl-init \
nptlfreeres \

View File

@ -17,13 +17,13 @@
<https://www.gnu.org/licenses/>. */
#include <stdio.h>
#undef _IO_funlockfile
#include <stdio-lock.h>
#include <sys/single_threaded.h>
void
__funlockfile (FILE *stream)
{
/* Do nothing. Using this version does not do any locking. */
_IO_lock_unlock (*stream->_lock);
}
weak_alias (__funlockfile, _IO_funlockfile)
weak_alias (__funlockfile, funlockfile);

View File

@ -1,30 +0,0 @@
/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdio.h>
#include <stdio-lock.h>
void
__funlockfile (FILE *stream)
{
_IO_lock_unlock (*stream->_lock);
}
strong_alias (__funlockfile, _IO_funlockfile)
weak_alias (__funlockfile, funlockfile)

View File

@ -1,10 +1,8 @@
GLIBC_2.17 _IO_funlockfile F
GLIBC_2.17 __errno_location F
GLIBC_2.17 __pthread_register_cancel F
GLIBC_2.17 __pthread_register_cancel_defer F
GLIBC_2.17 __pthread_unregister_cancel F
GLIBC_2.17 __pthread_unregister_cancel_restore F
GLIBC_2.17 funlockfile F
GLIBC_2.17 pthread_attr_getaffinity_np F
GLIBC_2.17 pthread_attr_getguardsize F
GLIBC_2.17 pthread_attr_getstack F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -1,10 +1,8 @@
GLIBC_2.32 _IO_funlockfile F
GLIBC_2.32 __errno_location F
GLIBC_2.32 __pthread_register_cancel F
GLIBC_2.32 __pthread_register_cancel_defer F
GLIBC_2.32 __pthread_unregister_cancel F
GLIBC_2.32 __pthread_unregister_cancel_restore F
GLIBC_2.32 funlockfile F
GLIBC_2.32 pthread_attr_getaffinity_np F
GLIBC_2.32 pthread_attr_getguardsize F
GLIBC_2.32 pthread_attr_getstack F

View File

@ -8,14 +8,12 @@ GLIBC_2.28 thrd_detach F
GLIBC_2.28 thrd_join F
GLIBC_2.30 __libpthread_version_placeholder F
GLIBC_2.31 pthread_clockjoin_np F
GLIBC_2.4 _IO_funlockfile F
GLIBC_2.4 __errno_location F
GLIBC_2.4 __libpthread_version_placeholder F
GLIBC_2.4 __pthread_register_cancel F
GLIBC_2.4 __pthread_register_cancel_defer F
GLIBC_2.4 __pthread_unregister_cancel F
GLIBC_2.4 __pthread_unregister_cancel_restore F
GLIBC_2.4 funlockfile F
GLIBC_2.4 pthread_attr_getaffinity_np F
GLIBC_2.4 pthread_attr_getguardsize F
GLIBC_2.4 pthread_attr_getstack F

View File

@ -8,14 +8,12 @@ GLIBC_2.28 thrd_detach F
GLIBC_2.28 thrd_join F
GLIBC_2.30 __libpthread_version_placeholder F
GLIBC_2.31 pthread_clockjoin_np F
GLIBC_2.4 _IO_funlockfile F
GLIBC_2.4 __errno_location F
GLIBC_2.4 __libpthread_version_placeholder F
GLIBC_2.4 __pthread_register_cancel F
GLIBC_2.4 __pthread_register_cancel_defer F
GLIBC_2.4 __pthread_unregister_cancel F
GLIBC_2.4 __pthread_unregister_cancel_restore F
GLIBC_2.4 funlockfile F
GLIBC_2.4 pthread_attr_getaffinity_np F
GLIBC_2.4 pthread_attr_getguardsize F
GLIBC_2.4 pthread_attr_getstack F

View File

@ -1,10 +1,8 @@
GLIBC_2.29 _IO_funlockfile F
GLIBC_2.29 __errno_location F
GLIBC_2.29 __pthread_register_cancel F
GLIBC_2.29 __pthread_register_cancel_defer F
GLIBC_2.29 __pthread_unregister_cancel F
GLIBC_2.29 __pthread_unregister_cancel_restore F
GLIBC_2.29 funlockfile F
GLIBC_2.29 pthread_attr_getaffinity_np F
GLIBC_2.29 pthread_attr_getguardsize F
GLIBC_2.29 pthread_attr_getstack F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -8,14 +8,12 @@ GLIBC_2.28 thrd_detach F
GLIBC_2.28 thrd_join F
GLIBC_2.30 __libpthread_version_placeholder F
GLIBC_2.31 pthread_clockjoin_np F
GLIBC_2.4 _IO_funlockfile F
GLIBC_2.4 __errno_location F
GLIBC_2.4 __libpthread_version_placeholder F
GLIBC_2.4 __pthread_register_cancel F
GLIBC_2.4 __pthread_register_cancel_defer F
GLIBC_2.4 __pthread_unregister_cancel F
GLIBC_2.4 __pthread_unregister_cancel_restore F
GLIBC_2.4 funlockfile F
GLIBC_2.4 pthread_attr_getaffinity_np F
GLIBC_2.4 pthread_attr_getguardsize F
GLIBC_2.4 pthread_attr_getstack F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -1,10 +1,8 @@
GLIBC_2.18 _IO_funlockfile F
GLIBC_2.18 __errno_location F
GLIBC_2.18 __pthread_register_cancel F
GLIBC_2.18 __pthread_register_cancel_defer F
GLIBC_2.18 __pthread_unregister_cancel F
GLIBC_2.18 __pthread_unregister_cancel_restore F
GLIBC_2.18 funlockfile F
GLIBC_2.18 pthread_attr_getaffinity_np F
GLIBC_2.18 pthread_attr_getguardsize F
GLIBC_2.18 pthread_attr_getstack F

View File

@ -1,10 +1,8 @@
GLIBC_2.18 _IO_funlockfile F
GLIBC_2.18 __errno_location F
GLIBC_2.18 __pthread_register_cancel F
GLIBC_2.18 __pthread_register_cancel_defer F
GLIBC_2.18 __pthread_unregister_cancel F
GLIBC_2.18 __pthread_unregister_cancel_restore F
GLIBC_2.18 funlockfile F
GLIBC_2.18 pthread_attr_getaffinity_np F
GLIBC_2.18 pthread_attr_getguardsize F
GLIBC_2.18 pthread_attr_getstack F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -1,10 +1,8 @@
GLIBC_2.21 _IO_funlockfile F
GLIBC_2.21 __errno_location F
GLIBC_2.21 __pthread_register_cancel F
GLIBC_2.21 __pthread_register_cancel_defer F
GLIBC_2.21 __pthread_unregister_cancel F
GLIBC_2.21 __pthread_unregister_cancel_restore F
GLIBC_2.21 funlockfile F
GLIBC_2.21 pthread_attr_getaffinity_np F
GLIBC_2.21 pthread_attr_getguardsize F
GLIBC_2.21 pthread_attr_getstack F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -6,9 +6,7 @@ GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.28 thrd_create F
GLIBC_2.28 thrd_detach F
GLIBC_2.28 thrd_join F
GLIBC_2.3 _IO_funlockfile F
GLIBC_2.3 __errno_location F
GLIBC_2.3 funlockfile F
GLIBC_2.3 pthread_attr_getguardsize F
GLIBC_2.3 pthread_attr_getstack F
GLIBC_2.3 pthread_attr_getstackaddr F

View File

@ -1,10 +1,8 @@
GLIBC_2.17 _IO_funlockfile F
GLIBC_2.17 __errno_location F
GLIBC_2.17 __pthread_register_cancel F
GLIBC_2.17 __pthread_register_cancel_defer F
GLIBC_2.17 __pthread_unregister_cancel F
GLIBC_2.17 __pthread_unregister_cancel_restore F
GLIBC_2.17 funlockfile F
GLIBC_2.17 pthread_attr_getaffinity_np F
GLIBC_2.17 pthread_attr_getguardsize F
GLIBC_2.17 pthread_attr_getstack F

View File

@ -1,10 +1,8 @@
GLIBC_2.33 _IO_funlockfile F
GLIBC_2.33 __errno_location F
GLIBC_2.33 __pthread_register_cancel F
GLIBC_2.33 __pthread_register_cancel_defer F
GLIBC_2.33 __pthread_unregister_cancel F
GLIBC_2.33 __pthread_unregister_cancel_restore F
GLIBC_2.33 funlockfile F
GLIBC_2.33 pthread_attr_getaffinity_np F
GLIBC_2.33 pthread_attr_getguardsize F
GLIBC_2.33 pthread_attr_getstack F

View File

@ -1,10 +1,8 @@
GLIBC_2.27 _IO_funlockfile F
GLIBC_2.27 __errno_location F
GLIBC_2.27 __pthread_register_cancel F
GLIBC_2.27 __pthread_register_cancel_defer F
GLIBC_2.27 __pthread_unregister_cancel F
GLIBC_2.27 __pthread_unregister_cancel_restore F
GLIBC_2.27 funlockfile F
GLIBC_2.27 pthread_attr_getaffinity_np F
GLIBC_2.27 pthread_attr_getguardsize F
GLIBC_2.27 pthread_attr_getstack F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -4,9 +4,7 @@ GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.19 __libpthread_version_placeholder F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -1,6 +1,4 @@
GLIBC_2.0 _IO_funlockfile F
GLIBC_2.0 __errno_location F
GLIBC_2.0 funlockfile F
GLIBC_2.0 pthread_cancel F
GLIBC_2.0 pthread_create F
GLIBC_2.0 pthread_detach F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2 _IO_funlockfile F
GLIBC_2.2 __errno_location F
GLIBC_2.2 funlockfile F
GLIBC_2.2 pthread_attr_getguardsize F
GLIBC_2.2 pthread_attr_getstack F
GLIBC_2.2 pthread_attr_getstackaddr F

View File

@ -3,9 +3,7 @@ GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_setname_np F
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
GLIBC_2.2.5 _IO_funlockfile F
GLIBC_2.2.5 __errno_location F
GLIBC_2.2.5 funlockfile F
GLIBC_2.2.5 pthread_attr_getguardsize F
GLIBC_2.2.5 pthread_attr_getstack F
GLIBC_2.2.5 pthread_attr_getstackaddr F

View File

@ -1,10 +1,8 @@
GLIBC_2.16 _IO_funlockfile F
GLIBC_2.16 __errno_location F
GLIBC_2.16 __pthread_register_cancel F
GLIBC_2.16 __pthread_register_cancel_defer F
GLIBC_2.16 __pthread_unregister_cancel F
GLIBC_2.16 __pthread_unregister_cancel_restore F
GLIBC_2.16 funlockfile F
GLIBC_2.16 pthread_attr_getaffinity_np F
GLIBC_2.16 pthread_attr_getguardsize F
GLIBC_2.16 pthread_attr_getstack F