mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Fix fread() with 2gb+ sizes
This commit is contained in:
parent
5f61d273e4
commit
ed93fc3dd7
8 changed files with 254 additions and 119 deletions
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/fmt/internal.h"
|
||||
#include "libc/limits.h"
|
||||
|
@ -42,7 +42,7 @@ static int vdprintf_putc(const char *s, struct VdprintfState *t, size_t n) {
|
|||
iov[0].iov_len = t->n;
|
||||
iov[1].iov_base = (void *)s;
|
||||
iov[1].iov_len = n;
|
||||
if (__robust_writev(t->fd, iov, 2) == -1) {
|
||||
if (writev(t->fd, iov, 2) == -1) {
|
||||
return -1;
|
||||
}
|
||||
t->t += t->n;
|
||||
|
@ -68,7 +68,7 @@ int vdprintf(int fd, const char *fmt, va_list va) {
|
|||
if (t.n) {
|
||||
iov[0].iov_base = t.b;
|
||||
iov[0].iov_len = t.n;
|
||||
if (__robust_writev(t.fd, iov, 1) == -1) {
|
||||
if (writev(t.fd, iov, 1) == -1) {
|
||||
return -1;
|
||||
}
|
||||
t.t += t.n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue