[PATCH 15/30] nptl: Remove pread from libpthread

Florian Weimer fweimer@redhat.com
Wed Mar 17 19:33:15 GMT 2021


* Adhemerval Zanella via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c
> new file mode 100644
> index 0000000000..a40e4447e1
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/alpha/pread64.c
> @@ -0,0 +1,33 @@
> +/* Read from to a file descriptor at a given offset.  Linux/alpha version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   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/>.  */
> +
> +#define PREAD64_REQUIRE_PREAD_COMPAT
> +#include <sysdeps/unix/sysv/linux/pread64.c>
> +
> +/* libpthread compat symbols.  */
> +# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
> +strong_alias (__libc_pread64, __compat_pread)
> +compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);
> +
> +strong_alias (__libc_pread64, __default_pread)
> +versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);
> +
> +/* It is a libc_hidden_def (__pread), but with a redirection due the symbol
> +   versioning.  */
> +__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);
> +#endif

I believe this is libc_hidden_ver.  It took me a while to find it (see
the original dance around ___libc_once).

This applies else where in this patch and also the pwrite patch.

Thanks,
Florian



More information about the Libc-alpha mailing list