mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Remove __ASSUME_COMPLETE_READV_WRITEV.
This patch removes the __ASSUME_COMPLETE_READV_WRITEV kernel-features.h macro, now that it can be unconditionally assumed to be true. (The relevant kernel feature was added some time between 2.0 and 2.2, and this macro is only used in sysdeps/unix/sysv/linux/.) Tested x86_64 that the disassembly of installed shared libraries is unchanged by this patch. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_COMPLETE_READV_WRITEV): Remove macro. * sysdeps/unix/sysv/linux/readv.c: Do not include <kernel-features.h>. [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. [!UIO_FASTIOV] (UIO_FASTIOV): Remove macro. (__libc_readv) [__ASSUME_COMPLETE_READV_WRITEV]: Make code unconditional. (__libc_readv) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. * sysdeps/unix/sysv/linux/writev.c: Do not include <kernel-features.h>. [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. [!UIO_FASTIOV] (UIO_FASTIOV): Remove macro. (__libc_writev) [__ASSUME_COMPLETE_READV_WRITEV]: Make code unconditional. (__libc_writev) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
This commit is contained in:
@ -23,19 +23,9 @@
|
||||
|
||||
#include <sysdep-cancel.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <kernel-features.h>
|
||||
|
||||
#ifndef __ASSUME_COMPLETE_READV_WRITEV
|
||||
static ssize_t __atomic_writev_replacement (int, const struct iovec *,
|
||||
int) internal_function;
|
||||
#endif
|
||||
|
||||
|
||||
/* Not all versions of the kernel support the large number of records. */
|
||||
#ifndef UIO_FASTIOV
|
||||
# define UIO_FASTIOV 8 /* 8 is a safe number. */
|
||||
#endif
|
||||
|
||||
/* Consider moving to syscalls.list. */
|
||||
|
||||
ssize_t
|
||||
__libc_writev (fd, vector, count)
|
||||
@ -56,19 +46,7 @@ __libc_writev (fd, vector, count)
|
||||
LIBC_CANCEL_RESET (oldtype);
|
||||
}
|
||||
|
||||
#ifdef __ASSUME_COMPLETE_READV_WRITEV
|
||||
return result;
|
||||
#else
|
||||
if (result >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
|
||||
return result;
|
||||
|
||||
return __atomic_writev_replacement (fd, vector, count);
|
||||
#endif
|
||||
}
|
||||
strong_alias (__libc_writev, __writev)
|
||||
weak_alias (__libc_writev, writev)
|
||||
|
||||
#ifndef __ASSUME_COMPLETE_READV_WRITEV
|
||||
# define __libc_writev static internal_function __atomic_writev_replacement
|
||||
# include <sysdeps/posix/writev.c>
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user