if (nbytes > buflen)
__chk_fail ();
- return __libc_pread64 (fd, buf, nbytes, offset);
+ return __pread64 (fd, buf, nbytes, offset);
}
new socket's descriptor, or -1 for errors. */
extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
- __THROW attribute_hidden;
+ __THROW;
libc_hidden_proto (accept)
extern int __libc_accept4 (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len, int __flags)
- __THROW attribute_hidden;
+ __THROW;
/* Return the length of a `sockaddr' structure. */
#ifdef _HAVE_SA_LEN
__off64_t __offset);
libc_hidden_proto (__pread64);
extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes,
- __off64_t __offset) attribute_hidden;
+ __off64_t __offset);
extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n,
__off_t __offset);
libc_hidden_proto (__pwrite)
__off64_t __offset);
libc_hidden_proto (__pwrite64)
extern ssize_t __libc_pwrite64 (int __fd, const void *__buf, size_t __n,
- __off64_t __offset) attribute_hidden;
+ __off64_t __offset);
extern ssize_t __libc_read (int __fd, void *__buf, size_t __n);
libc_hidden_proto (__libc_read)
libc_hidden_proto (read)
GLIBC_2.27 {
copy_file_range;
}
+ GLIBC_PRIVATE {
+ # called from libpthread
+ __libc_close;
+ __libc_fcntl;
+ __libc_lseek; __libc_lseek64;
+ __libc_open; __libc_open64;
+ __libc_read;
+ __libc_write;
+ __write_nocancel;
+ }
}
if (pinoff == NULL)
read_count = read (infd, buf, to_read);
else
- read_count = __libc_pread64 (infd, buf, to_read, *pinoff);
+ read_count = __pread64 (infd, buf, to_read, *pinoff);
if (read_count == 0)
/* End of file reached prematurely. */
return copied;
if (poutoff == NULL)
write_count = write (outfd, p, end - p);
else
- write_count = __libc_pwrite64 (outfd, p, end - p, *poutoff);
+ write_count = __pwrite64 (outfd, p, end - p, *poutoff);
if (write_count < 0)
{
/* Adjust the input read position to match what we have
/* We are on an error recovery path, so we
cannot deal with failure here. */
int save_errno = errno;
- (void) __libc_lseek64 (infd, -overread, SEEK_CUR);
+ (void) __lseek64 (infd, -overread, SEEK_CUR);
__set_errno (save_errno);
}
}
__madvise;
__mktemp;
__libc_ifunc_impl_list;
+ __libc_fsync; __libc_msync;
__tdelete; __tfind; __tsearch; __twalk;
__mmap; __munmap; __mprotect;
__sched_get_priority_min; __sched_get_priority_max;
/* Make all changes done to FD actually appear on disk. */
int
-fsync (int fd)
+__libc_fsync (int fd)
{
__set_errno (ENOSYS);
return -1;
}
-
-
+weak_alias (__libc_fsync, fsync)
+libc_hidden_weak (fsync)
stub_warning (fsync)
unpredictable before this is done. */
int
-msync (void *addr, size_t len, int flags)
+__libc_msync (void *addr, size_t len, int flags)
{
__set_errno (ENOSYS);
return -1;
}
-
+weak_alias (__libc_msync, msync)
+libc_hidden_weak (msync)
stub_warning (msync)
shared-only-routines = forward
static-only-routines = pthread_atfork
-# We need to provide certain routines for compatibility with existing
-# binaries.
-pthread-compat-wrappers = \
- write read close fcntl accept \
- connect recv recvfrom send \
- sendto fsync lseek lseek64 \
- msync nanosleep open open64 pause \
- pread pread64 pwrite pwrite64 \
- tcdrain wait waitpid msgrcv msgsnd \
- sigwait sigsuspend \
- recvmsg sendmsg
-
libpthread-routines = nptl-init vars events version pt-interp \
pthread_create pthread_exit pthread_detach \
pthread_join pthread_tryjoin pthread_timedjoin \
sem_wait sem_timedwait sem_post \
cleanup cleanup_defer cleanup_compat \
cleanup_defer_compat unwind \
- pt-longjmp pt-cleanup\
+ pt-cleanup \
cancellation \
lowlevellock \
lll_timedlock_wait lll_timedwait_tid \
- pt-fork \
- $(pthread-compat-wrappers) \
- pt-raise pt-system \
+ pt-raise \
pt-compat-stubs \
flockfile ftrylockfile funlockfile \
sigaction \
CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables
-# These are the function wrappers we have to duplicate here.
-CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf.c += -fexceptions
-CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-waitpid.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgsnd.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-tcdrain.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sigsuspend.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
-
-CFLAGS-pt-system.c += -fexceptions
-
LDLIBS-tst-once5 = -lstdc++
CFLAGS-tst-thread_local1.o = -std=gnu++11
LDLIBS-tst-thread_local1 = -lstdc++
+++ /dev/null
-/* ABI compatibility for 'fork' symbol in libpthread ABI.
- Copyright (C) 2002-2018 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
- <http://www.gnu.org/licenses/>. */
-
-#include <unistd.h>
-#include <shlib-compat.h>
-
-/* libpthread once had its own fork, though there was no apparent reason
- for it. There is no use in having a separate symbol in libpthread, but
- the historical ABI requires it. For static linking, there is no need to
- provide anything here--the libc version will be linked in. For shared
- library ABI compatibility, there must be __fork and fork symbols in
- libpthread.so.
-
- With an IFUNC resolver, it would be possible to avoid the
- indirection, but the IFUNC resolver might run before the
- __libc_fork symbol has been relocated, in which case the IFUNC
- resolver would not be able to provide the correct address. */
-
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-static pid_t __attribute__ ((used))
-fork_compat (void)
-{
- return __libc_fork ();
-}
-
-strong_alias (fork_compat, fork_alias)
-compat_symbol (libpthread, fork_alias, fork, GLIBC_2_0);
-
-strong_alias (fork_compat, __fork_alias)
-compat_symbol (libpthread, __fork_alias, __fork, GLIBC_2_0);
-
-#endif
+++ /dev/null
-/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI.
- Copyright (C) 2002-2018 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
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <shlib-compat.h>
-
-/* libpthread once had its own longjmp (and siglongjmp alias), though there
- was no apparent reason for it. There is no use in having a separate
- symbol in libpthread, but the historical ABI requires it. For static
- linking, there is no need to provide anything here--the libc version
- will be linked in. For shared library ABI compatibility, there must be
- longjmp and siglongjmp symbols in libpthread.so.
-
- With an IFUNC resolver, it would be possible to avoid the indirection,
- but the IFUNC resolver might run before the __libc_longjmp symbol has
- been relocated, in which case the IFUNC resolver would not be able to
- provide the correct address. */
-
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-static void __attribute__ ((noreturn, used))
-longjmp_compat (jmp_buf env, int val)
-{
- __libc_longjmp (env, val);
-}
-
-strong_alias (longjmp_compat, longjmp_alias)
-compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0);
-
-strong_alias (longjmp_alias, siglongjmp_alias)
-compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0);
-
-#endif
+++ /dev/null
-/* ABI compatibility for 'system' symbol in libpthread ABI.
- Copyright (C) 2002-2018 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
- <http://www.gnu.org/licenses/>. */
-
-#include <stdlib.h>
-#include <shlib-compat.h>
-
-/* libpthread once had its own 'system', though there was no apparent
- reason for it. There is no use in having a separate symbol in
- libpthread, but the historical ABI requires it. For static linking,
- there is no need to provide anything here--the libc version will be
- linked in. For shared library ABI compatibility, there must be a
- 'system' symbol in libpthread.so.
-
- With an IFUNC resolver, it would be possible to avoid the indirection,
- but the IFUNC resolver might run before the __libc_system symbol has
- been relocated, in which case the IFUNC resolver would not be able to
- provide the correct address. */
-
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-static int __attribute__ ((used))
-system_compat (const char *line)
-{
- return __libc_system (line);
-}
-strong_alias (system_compat, system_alias)
-compat_symbol (libpthread, system_alias, system, GLIBC_2_0);
-
-#endif
glob; glob64;
}
GLIBC_PRIVATE {
- __libc_fork; __libc_pread; __libc_pwrite;
+ __libc_fork;
+ __libc_nanosleep;
+ __libc_pause;
+ __libc_pread; __libc_pread64;
+ __libc_pwrite; __libc_pwrite64;
+ __libc_wait; __libc_waitpid;
+ __pause_nocancel; __nanosleep_nocancel;
}
}
stub_warning (nanosleep)
hidden_def (__nanosleep)
+strong_alias (__nanosleep, __libc_nanosleep)
weak_alias (__nanosleep, nanosleep)
return (pid_t) -1;
}
libc_hidden_def (__waitpid)
+strong_alias (__waitpid, __libc_waitpid)
weak_alias (__waitpid, waitpid)
stub_warning (waitpid)
}
GLIBC_2.21 {
}
+ GLIBC_PRIVATE {
+ # called from libpthread
+ __libc_sigwait;
+ }
}
GLIBC_PRIVATE {
__sendmmsg;
__recv; __socket;
+ __libc_accept;
+ __libc_connect;
+ __libc_recv; __libc_recvfrom; __libc_recvmsg;
+ __libc_send; __libc_sendto; __libc_sendmsg;
}
}
peer and *ADDR_LEN to the address's actual length, and return the
new socket's descriptor, or -1 for errors. */
int
-accept (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len)
+__libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len)
{
__set_errno (ENOSYS);
return -1;
}
-libc_hidden_def (accept)
-
+weak_alias (__libc_accept, accept)
+libc_hidden_weak (accept)
stub_warning (accept)
-/* Compatibility stubs for functions formerly exposed by libpthread.
+/* ABI compatibility stubs for libpthread.
Copyright (C) 2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
#include <shlib-compat.h>
#include <sysdep.h>
+/* We need __OFF_T_MATCHES_OFF64_T, but sys/types.h cannot be included
+ from assembly language. */
+#define _BITS_TYPES_H 1
+#include <bits/typesizes.h>
+
compat_text_section
#ifndef SIBCALL_ENTRY
# define SIBCALL_ENTRY(name) ENTRY(name)
#endif
+#ifndef LONGJMP_2_0_DEST
+# define LONGJMP_2_0_DEST __libc_longjmp
+#endif
+#ifndef LONGJMP_2_0_UNTIL_VER
+# define LONGJMP_2_0_UNTIL_VER GLIBC_2_22
+#endif
#define define_stub(name) \
define_stub_1(__pstub_##name, __libc_##name)
+#define define_stub_with_dest(name, dest) \
+ define_stub_1(__pstub_##name, dest)
#define define_stub_1(pstub_name, libc_name) \
SIBCALL_ENTRY(pstub_name) ASM_LINE_SEP \
SIBCALL(libc_name) ASM_LINE_SEP \
# if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
compat_stub(vfork, __vfork, GLIBC_2_1_2)
# endif
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+
+ define_stub(fork)
+ compat_stub(fork, fork, GLIBC_2_0)
+ compat_stub(fork, __fork, GLIBC_2_0)
+
+ define_stub(system)
+ compat_stub(system, system, GLIBC_2_0)
+
+#endif
+
+/* Some architectures need special treatment for longjmp. */
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, LONGJMP_2_0_UNTIL_VER)
+
+ define_stub_with_dest(longjmp, LONGJMP_2_0_DEST)
+ compat_stub(longjmp, longjmp, GLIBC_2_0)
+ compat_stub(longjmp, siglongjmp, GLIBC_2_0)
+
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_28)
+
+ define_stub(accept)
+ compat_stub(accept, accept, GLIBC_2_0)
+
+ define_stub(close)
+ compat_stub(close, close, GLIBC_2_0)
+ compat_stub(close, __close, GLIBC_2_0)
+
+ define_stub(connect)
+ compat_stub(connect, connect, GLIBC_2_0)
+ compat_stub(connect, __connect, GLIBC_2_0)
+
+ define_stub(fcntl)
+ compat_stub(fcntl, fcntl, GLIBC_2_0)
+ compat_stub(fcntl, __fcntl, GLIBC_2_0)
+
+ define_stub(fsync)
+ compat_stub(fsync, fsync, GLIBC_2_0)
+
+ define_stub(msync)
+ compat_stub(msync, msync, GLIBC_2_0)
+
+ define_stub(nanosleep)
+ compat_stub(nanosleep, nanosleep, GLIBC_2_0)
+#if SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_28)
+ compat_stub(nanosleep, __nanosleep, GLIBC_2_2_6)
+#endif
+
+ define_stub(pause)
+ compat_stub(pause, pause, GLIBC_2_0)
+
+ define_stub(read)
+ compat_stub(read, read, GLIBC_2_0)
+ compat_stub(read, __read, GLIBC_2_0)
+
+ define_stub(recv)
+ compat_stub(recv, recv, GLIBC_2_0)
+
+ define_stub(recvfrom)
+ compat_stub(recvfrom, recvfrom, GLIBC_2_0)
+
+ define_stub(recvmsg)
+ compat_stub(recvmsg, recvmsg, GLIBC_2_0)
+
+ define_stub(send)
+ compat_stub(send, send, GLIBC_2_0)
+ compat_stub(send, __send, GLIBC_2_0)
+
+ define_stub(sendmsg)
+ compat_stub(sendmsg, sendmsg, GLIBC_2_0)
+
+ define_stub(sendto)
+ compat_stub(sendto, sendto, GLIBC_2_0)
+
+ define_stub(sigwait)
+ compat_stub(sigwait, sigwait, GLIBC_2_0)
+
+ define_stub(tcdrain)
+ compat_stub(tcdrain, tcdrain, GLIBC_2_0)
+
+ define_stub(wait)
+ compat_stub(wait, wait, GLIBC_2_0)
+ compat_stub(wait, __wait, GLIBC_2_0)
+
+ define_stub(waitpid)
+ compat_stub(waitpid, waitpid, GLIBC_2_0)
+
+ define_stub(write)
+ compat_stub(write, write, GLIBC_2_0)
+ compat_stub(write, __write, GLIBC_2_0)
+
+#endif
+
+/* The off64_t functions were added in glibc 2.2, but some architectures
+ had 64-bit off_t before that. On those architectures, the unsuffixed
+ lseek, open, etc should be additional aliases for the suffixed ones. */
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_28) \
+ || (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_28) \
+ && defined __OFF_T_MATCHES_OFF64_T)
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+ define_stub(lseek)
+ compat_stub(lseek, lseek, GLIBC_2_0)
+ compat_stub(lseek, __lseek, GLIBC_2_0)
+
+ define_stub(open)
+ compat_stub(open, open, GLIBC_2_0)
+ compat_stub(open, __open, GLIBC_2_0)
+#endif
+
+ define_stub(lseek64)
+ compat_stub(lseek64, lseek64, GLIBC_2_2)
+# ifdef __OFF_T_MATCHES_OFF64_T
+ compat_stub(lseek64, lseek, GLIBC_2_0)
+ compat_stub(lseek64, __lseek, GLIBC_2_0)
+# endif
+
+ define_stub(open64)
+ compat_stub(open64, open64, GLIBC_2_2)
+ compat_stub(open64, __open64, GLIBC_2_2)
+# ifdef __OFF_T_MATCHES_OFF64_T
+ compat_stub(open64, open, GLIBC_2_0)
+ compat_stub(open64, __open, GLIBC_2_0)
+# endif
+
+#endif
+
+/* pread and pwrite were added in the same release as pread64 and pwrite64,
+ and do not have exposed __ variants. */
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_28)
+
+# ifndef __OFF_T_MATCHES_OFF64_T
+ define_stub(pread)
+ compat_stub(pread, pread, GLIBC_2_2)
+
+ define_stub(pwrite)
+ compat_stub(pwrite, pwrite, GLIBC_2_2)
+# endif
+
+ define_stub(pread64)
+ compat_stub(pread64, pread64, GLIBC_2_2)
+ compat_stub(pread64, __pread64, GLIBC_2_2)
+#ifdef __OFF_T_MATCHES_OFF64_T
+ compat_stub(pread64, pread, GLIBC_2_2)
+#endif
+
+ define_stub(pwrite64)
+ compat_stub(pwrite64, pwrite64, GLIBC_2_2)
+ compat_stub(pwrite64, __pwrite64, GLIBC_2_2)
+#ifdef __OFF_T_MATCHES_OFF64_T
+ compat_stub(pwrite64, pwrite, GLIBC_2_2)
+#endif
#endif
peer and *ADDR_LEN to the address's actual length, and return the
new socket's descriptor, or -1 for errors. */
int
-accept (int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len)
+__libc_accept (int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len)
{
- return __libc_accept4 (fd, addrarg, addr_len, 0);
+ return __accept4 (fd, addrarg, addr_len, 0);
}
-libc_hidden_def (accept)
+weak_alias (__libc_accept, accept)
+libc_hidden_weak (accept)
/* Make all changes done to FD actually appear on disk. */
int
-fsync (int fd)
+__libc_fsync (int fd)
{
error_t err = HURD_DPORT_USE (fd, __file_sync (port, 1, 0));
if (err)
}
return 0;
}
+weak_alias (__libc_fsync, fsync)
ssize_t
__libc_pread (int fd, void *buf, size_t nbytes, off_t offset)
{
- return __libc_pread64 (fd, buf, nbytes, (off64_t) offset);
+ return __pread64 (fd, buf, nbytes, (off64_t) offset);
}
#ifndef __libc_pread
ssize_t
__libc_pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
{
- return __libc_pwrite64 (fd, buf, nbytes, (off64_t) offset);
+ return __pwrite64 (fd, buf, nbytes, (off64_t) offset);
}
#ifndef __libc_pwrite
unpredictable before this is done. */
int
-msync (void *addr, size_t len, int flags)
+__libc_msync (void *addr, size_t len, int flags)
{
vm_sync_t sync_flags = 0;
kern_return_t err;
}
return 0;
}
+weak_alias (__libc_msync, msync)
#endif
if (offset < st.st_size)
{
unsigned char c;
- ssize_t rsize = __libc_pread64 (fd, &c, 1, offset);
+ ssize_t rsize = __pread64 (fd, &c, 1, offset);
if (rsize < 0)
return errno;
continue;
}
- if (__libc_pwrite64 (fd, "", 1, offset) != 1)
+ if (__pwrite64 (fd, "", 1, offset) != 1)
return errno;
}
}
libc_hidden_def (__waitpid)
+strong_alias (__waitpid, __libc_waitpid)
weak_alias (__waitpid, waitpid)
/* Make all changes done to FD actually appear on disk. */
int
-fsync (int fd)
+__libc_fsync (int fd)
{
return SYSCALL_CANCEL (fsync, fd);
}
+weak_alias (__libc_fsync, fsync)
libc.so: _IO_funlockfile
libc.so: __errno_location
libm.so: matherr
-libpthread.so: __errno_location
# The main malloc is interposed into the dynamic linker, for
# allocations after the initial link (when dlopen is used).
ld.so: malloc
#include <sysdep-cancel.h>
int
-msync (void *addr, size_t length, int flags)
+__libc_msync (void *addr, size_t length, int flags)
{
return SYSCALL_CANCEL (msync, addr, length, flags);
}
+weak_alias (__libc_msync, msync)
return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
}
hidden_def (__nanosleep)
+strong_alias (__nanosleep, __libc_nanosleep)
weak_alias (__nanosleep, nanosleep)
int
/* Uncancelable nanosleep. */
__typeof (__nanosleep) __nanosleep_nocancel;
-hidden_proto (__nanosleep_nocancel)
+libc_hidden_proto (__nanosleep_nocancel)
/* Uncancelable fcntl. */
__typeof (__fcntl) __fcntl_nocancel;
#ifdef __OFF_T_MATCHES_OFF64_T
strong_alias (__libc_open64, __libc_open)
+libc_hidden_def (__libc_open)
strong_alias (__libc_open64, __open)
libc_hidden_weak (__open)
weak_alias (__libc_open64, open)
--- /dev/null
+/* ABI compatibility stubs for libpthread. PowerPC/Linux version.
+ Copyright (C) 2018 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
+ <http://www.gnu.org/licenses/>. */
+
+/* AltiVec support was added to setjmp/longjmp in 2.3.4,
+ requiring a new symbol version. */
+#define LONGJMP_2_0_DEST __novmx__libc_siglongjmp
+#define LONGJMP_2_0_UNTIL_VER GLIBC_2_3_4
+
+#include <sysdeps/generic/pt-compat-stubs.S>
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_4, GLIBC_2_28)
+
+ define_stub_with_dest(vmx_longjmp, __libc_longjmp)
+ compat_stub(vmx_longjmp, longjmp, GLIBC_2_3_4)
+ compat_stub(vmx_longjmp, siglongjmp, GLIBC_2_3_4)
+
+#endif
+++ /dev/null
-/* Copyright (C) 2002-2018 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
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdlib.h>
-#include <bits/wordsize.h>
-#include "pthreadP.h"
-#include <shlib-compat.h>
-#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4)
-
-/* These functions are not declared anywhere since they shouldn't be
- used at another place but here. */
-extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-extern void __novmx__libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-
-
-void __novmx_siglongjmp (sigjmp_buf env, int val)
-{
- __novmx__libc_siglongjmp (env, val);
-}
-
-void __novmx_longjmp (jmp_buf env, int val)
-{
- __novmx__libc_longjmp (env, val);
-}
-
-compat_symbol (libpthread, __novmx_longjmp, longjmp, GLIBC_2_0);
-compat_symbol (libpthread, __novmx_siglongjmp, siglongjmp, GLIBC_2_0);
-#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */
-
-void
-__vmx_longjmp (jmp_buf env, int val)
-{
- __libc_longjmp (env, val);
-}
-
-void
-__vmx_siglongjmp (jmp_buf env, int val)
-{
- __libc_siglongjmp (env, val);
-}
-
-versioned_symbol (libpthread, __vmx_longjmp, longjmp, GLIBC_2_3_4);
-versioned_symbol (libpthread, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4);
-/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
+/* ABI compatibility stubs for libpthread. S/390/Linux version.
+ Copyright (C) 2018 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
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>.
+ <http://www.gnu.org/licenses/>. */
- Versioned copy of nptl/pt-longjmp.c modified for versioning
- the reverted jmpbuf extension. */
-
-#include <shlib-compat.h>
-
-#include <nptl/pt-longjmp.c>
+#include <sysdeps/generic/pt-compat-stubs.S>
#if SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)
/* In glibc release 2.19 new versions of longjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */
-strong_alias (longjmp_alias, __v2longjmp)
-compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
-strong_alias (siglongjmp_alias, __v2siglongjmp)
-compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19);
-#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */
+ compat_stub(longjmp, longjmp, GLIBC_2_19)
+ compat_stub(longjmp, siglongjmp, GLIBC_2_19)
+
+#endif
#endif
}
libc_hidden_def (__waitpid)
+strong_alias (__waitpid, __libc_waitpid)
weak_alias (__waitpid, waitpid)
__pid_t
# t*
tcgetsid;
}
+ GLIBC_PRIVATE {
+ # called from libpthread
+ __libc_tcdrain;
+ }
}