musl/src
Rich Felker 2cff36a84f work around a nasty bug in linux readv syscall
according to posix, readv "shall be equivalent to read(), except..."
that it places the data into the buffers specified by the iov array.
however on linux, when reading from a terminal, each iov element
behaves almost like a separate read. this means that if the first iov
exactly satisfied the request (e.g. a length-one read of '\n') and the
second iov is nonzero length, the syscall will block again after
getting the blank line from the terminal until another line is read.
simply put, entering a single blank line becomes impossible.

the solution, fortunately, is simple. whenever the buffer size is
nonzero, reduce the length of the requested read by one byte and let
the last byte go through the buffer. this way, readv will already be
in the second (and last) iov, and won't re-block on the second iov.
2011-04-09 01:17:55 -04:00
..
conf better fix sysconf pthread stack min 2011-04-08 12:16:24 -04:00
ctype more header fixes, minor warning fix 2011-02-14 19:33:11 -05:00
dirent global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
env add startup abi functions, dummy for now. eventually needed for c++ support. 2011-04-06 16:40:19 -04:00
errno change errno to static linkage (improves PIC code generation) 2011-02-21 23:00:52 -05:00
exit consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix 2011-04-06 20:32:53 -04:00
fcntl global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
internal move rsyscall out of pthread_create module 2011-04-06 20:27:07 -04:00
ipc consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix 2011-04-06 20:32:53 -04:00
ldso various changes in preparation for dynamic linking support 2011-02-24 16:37:21 -05:00
linux fix completely bogus loop condition in getmntent_r 2011-04-06 12:35:05 -04:00
locale fix breakage due to converting a return type to size_t in iconv... 2011-04-07 16:10:44 -04:00
malloc fix rare but nasty under-allocation bug in malloc with large requests 2011-04-04 17:26:41 -04:00
math Port musl to x86-64. One giant commit! 2011-02-15 07:32:09 -05:00
misc fix all implicit conversion between signed/unsigned pointers 2011-03-25 16:34:03 -04:00
mman consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix 2011-04-06 20:32:53 -04:00
multibyte fix all implicit conversion between signed/unsigned pointers 2011-03-25 16:34:03 -04:00
network workaround broken msghdr struct on 64bit linux 2011-04-08 09:24:19 -04:00
passwd guard against hard links to non-ordinary-files when reading tcb shadow 2011-02-14 21:15:07 -05:00
prng initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
process overhaul cancellation to fix resource leaks and dangerous behavior with signals 2011-03-24 14:18:00 -04:00
regex fix bug in TRE found by clang (typo && instead of &) 2011-04-07 23:13:47 -04:00
select overhaul cancellation to fix resource leaks and dangerous behavior with signals 2011-03-24 14:18:00 -04:00
setjmp Port musl to x86-64. One giant commit! 2011-02-15 07:32:09 -05:00
signal fix broken sigsetjmp on x86_64 2011-04-08 11:56:52 -04:00
stat fix (hopefully) statvfs breakage on x86_64 that resulted from fixing i386... 2011-04-05 23:58:36 -04:00
stdio work around a nasty bug in linux readv syscall 2011-04-09 01:17:55 -04:00
stdlib fix broken unsigned comparison in wcstoumax 2011-04-07 16:13:47 -04:00
string fix misplaced *'s in string functions (harmless) 2011-04-07 16:19:30 -04:00
stub various legacy and linux-specific stuff 2011-03-18 21:52:26 -04:00
temp make mktemp match the historic behavior, and update functions that use it 2011-02-19 09:40:07 -05:00
termios add (nonstandard) cfmakeraw function 2011-04-05 12:35:09 -04:00
thread fixed crash in new rsyscall (failure to set sa_flags for signal handler) 2011-04-06 20:43:39 -04:00
time consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix 2011-04-06 20:32:53 -04:00
unistd consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix 2011-04-06 20:32:53 -04:00