1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-02 20:42:29 +03:00
Files
aout
argp
assert
bare
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
gmon
gnulib
grp
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libio
linuxthreads
linuxthreads_db
locale
localedata
login
mach
malloc
manual
math
misc
nis
nscd
nss
po
posix
pwd
resolv
resource
rpm
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
alpha
am29k
arm
cris
generic
gnu
hppa
i386
i860
i960
ia64
ieee754
m68k
m88k
mach
mips
posix
powerpc
pthread
rs6000
s390
sh
sparc
standalone
tahoe
unix
alpha
arm
bsd
common
i386
inet
mips
mman
powerpc
sh
sparc
sysv
aix
bits
hpux
i386
irix4
isc2.2
linux
alpha
arm
bits
cris
hppa
i386
ia64
m68k
mips
net
netash
netatalk
netax25
neteconet
netinet
netipx
netpacket
netrom
netrose
nfs
powerpc
s390
scsi
sh
sparc
sys
x86_64
Dist
Implies
Makefile
Versions
a.out.h
accept.S
adjtime.c
aio_sigqueue.c
bind.S
clock.c
cmsg_nxthdr.c
configure
configure.in
connect.S
device-nrs.h
dl-brk.c
dl-librecon.h
dl-origin.c
dl-osinfo.h
dl-sbrk.c
dl-sysdep.c
errlist.c
errlist.h
errqueue.h
execve.c
fd_to_filename.h
fpathconf.c
fstatfs64.c
fstatvfs.c
fstatvfs64.c
ftime.c
ftruncate64.c
fxstat.c
fxstat64.c
gai_sigqueue.c
getclktck.c
getcwd.c
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
gethostid.c
getloadavg.c
getpagesize.c
getpeername.S
getpriority.c
getpt.c
getsockname.S
getsockopt.S
getsysstats.c
grantpt.c
if_index.c
ifreq.h
init-first.c
internal_statvfs.c
ipc_priv.h
kernel-features.h
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
ldd-rewrite.sed
lddlibc4.c
ldsodefs.h
linux_fsinfo.h
listen.S
llseek.c
lseek64.c
lxstat.c
lxstat64.c
mmap64.c
msgctl.c
msgget.c
msgrcv.c
msgsnd.c
nice.c
ntp_gettime.c
opendir.c
opensock.c
pathconf.c
paths.h
poll.c
pread.c
pread64.c
profil.c
ptrace.c
ptsname.c
pwrite.c
pwrite64.c
readahead.c
readdir64.c
readdir64_r.c
readv.c
reboot.c
recv.S
recvfrom.S
recvmsg.S
rt_sigaction.c
rt_sigpending.c
rt_sigprocmask.c
rt_sigqueueinfo.c
rt_sigreturn.c
rt_sigsuspend.c
rt_sigtimedwait.c
s_pread64.c
s_pwrite64.c
sa_len.c
semctl.c
semget.c
semop.c
send.S
sendmsg.S
sendto.S
setegid.c
seteuid.c
sethostid.c
setsockopt.S
shm_open.c
shm_unlink.c
shmat.c
shmctl.c
shmdt.c
shmget.c
shutdown.S
sigaction.c
siglist.h
signal.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h
sigstack.c
sigsuspend.c
sigtimedwait.c
sigwaitinfo.c
sizes.h
sleep.c
socketcall.h
socketpair.S
speed.c
statfs64.c
statvfs.c
statvfs64.c
syscalls.list
sysctl.c
system.c
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsetattr.c
tcsetpgrp.c
termio.h
testrtsig.h
truncate64.c
ttyname.c
ttyname_r.c
ualarm.c
ulimit.c
umount.S
umount2.S
unlockpt.c
updwtmp.c
usleep.c
ustat.c
utmp_file.c
vfork.c
wait.c
wait3.c
waitpid.c
writev.c
xmknod.c
xstat.c
xstat64.c
xstatconv.c
minix
sco3.2
sco3.2.4
sysv4
Dist
Makefile
Versions
direct.h
getdents.c
gethostname.c
setrlimit.c
settimeofday.c
sigaction.c
syscalls.list
sysv_termio.h
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
x86_64
Dist
Implies
Makefile
Subdirs
_exit.S
alarm.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
closedir.c
configure
configure.in
confstr.h
dirfd.c
dirstream.h
errnos-tmpl.c
errnos.awk
execve.S
fork.S
fxstat.c
getdents.c
getegid.S
geteuid.S
getlogin.c
getlogin_r.c
getpagesize.c
getppid.S
grantpt.c
ioctls-tmpl.c
ioctls.awk
make-syscalls.sh
make_errlist.c
mk-local_lim.c
mkdir.c
mkfifo.c
nice.c
opendir.c
readdir.c
readdir_r.c
rewinddir.c
rmdir.c
s-proto.S
seekdir.c
siglist.c
snarf-ioctls
sockatmark.c
start.c
stime.c
syscall.S
syscalls.list
sysdep.h
system.c
telldir.c
time.c
utime.c
xmknod.c
xstat.c
vax
wordsize-32
wordsize-64
x86_64
z8000
sysvipc
termios
time
timezone
wcsmbs
wctype
.cvsignore
BUGS
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
FAQ
FAQ.in
INSTALL
INTERFACE
Make-dist
MakeTAGS
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
NOTES
PROJECTS
README
README-alpha
README.libm
README.template
Rules
Versions.def
abi-tags
aclocal.m4
config-name.in
config.h.in
config.make.in
configure
configure.in
cppflags-iterator.mk
extra-lib.mk
glibcbug.in
o-iterator.mk
shlib-versions
test-skeleton.c
version.h
glibc/sysdeps/unix/sysv/linux/readv.c
Ulrich Drepper 739d440d2a Update.
2002-07-19  Ulrich Drepper  <drepper@redhat.com>

	* configure.in: Add test for __thread support in compiler.
	* config.h.in: Add HAVE___THREAD.
	* Makefile (headers): Remove errno.h, sys/errno.h, and bits/errno.h.
	* include/sys/errno.h: Moved to...
	* stdlib/sys/errno.h: ...here.  New file.
	* stdlib/errno.h: New file.  Moved from...
	* include/errno.h: ...here.  Changed into an internal header defining
	libc-local things like __set_errno.
	* stdlib/Makefile (headers): Add errno.h, sys/errno.h, and
	bits/errno.h.
	* elf/dl-minimal.c: Include <tls.h>.  Define errno as thread-local
	variable if USE_TLS && HAVE___THREAD.  Don't define __errno_location
	either.
	* elf/rtld.c (_dl_start): Add code to initialize TLS for ld.so
	from...
	(_dl_start_final): ...here.  Add code to initialize tls elements from
	bootstrap_map.
	* sysdeps/generic/errno-loc.c: Define errno as thread-local variable
	if USE_TLS && HAVE___THREAD.
	* sysdeps/generic/bits/errno.h: Remove __set_errno definition.
	* sysdeps/mach/hurd/bits/errno.h: Likewise.
	* sysdeps/standalone/arm/bits/errno.h: Likewise.
	* sysdeps/standalone/bits/errno.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/aix/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/hpux/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/errno.h: Likewise.
	* sysdeps/unix/sysv/sysv4/solaris2/bits/errno.h: Likewise.
	* sysdeps/i386/dl-machine.c (elf_machine_rel) [RTLD_BOOTSTRAP]: Don't
	use GL(dl_rtld_map), use map parameter.
	* sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.S: Define errno in .tbss if
	USE_TLS && HAVE___THREAD.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Unify SETUP_PIC_REG
	definitions.  If USE_TLS && HAVE___THREAD store errooor value using
	TLS code sequence.
	* sysdeps/unix/sysv/linux/i386/i686/sysdep.h: Likewise.

	* sysdeps/unix/sysv/linux/getcwd.c: No real need to restore errno.
	* sysdeps/unix/sysv/linux/grantpt.c: Likewise.
	* sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise.
	* sysdeps/unix/sysv/linux/msgctl.c: Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
2002-07-20 01:14:41 +00:00

61 lines
1.9 KiB
C

/* readv supports all Linux kernels >= 2.0.
Copyright (C) 1997, 1998, 2000, 2002 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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <stddef.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <bp-checks.h>
extern ssize_t __syscall_readv (int, __const struct iovec *__unbounded, int);
static ssize_t __atomic_readv_replacement (int, __const struct iovec *,
int) internal_function;
/* 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
/* We should deal with kernel which have a smaller UIO_FASTIOV as well
as a very big count. */
ssize_t
__readv (fd, vector, count)
int fd;
const struct iovec *vector;
int count;
{
ssize_t bytes_read;
bytes_read = INLINE_SYSCALL (readv, 3, fd, CHECK_N (vector, count), count);
if (bytes_read >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
return bytes_read;
return __atomic_readv_replacement (fd, vector, count);
}
weak_alias (__readv, readv)
#define __readv static internal_function __atomic_readv_replacement
#include <sysdeps/posix/readv.c>