pwritev() doesn't work anymore on i386
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I just upgraded to Trusty, and the following programs fails on x86:
#include <stdio.h>
#include <stdint.h>
#include <sys/uio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
char *str0 = "hello ";
char *str1 = "world\n";
struct iovec iov[2];
ssize_t nwritten;
int fd = open("test.txt", O_CREAT | O_WRONLY);
iov[0].iov_base = str0;
iov[0].iov_len = strlen(str0);
iov[1].iov_base = str1;
iov[1].iov_len = strlen(str1);
nwritten = pwritev(fd, iov, 2, 0);
if(nwritten < 0)
perror(
return 0;
}
Compiled without any flags, I see:
$ ./test
pwritev: File too large
And, from strace, I can see the offset parameter is handled wrongly by (presumably) libc:
...
pwritev(3, [{"hello ", 6}, {"world\n", 6}], 2, 577730142772658176) = -1 EFBIG (File too large)
...
If I compile with -D_FILE_
I reported this here because it doesn't seem to happen on Debian sid, but let me know if I have to report it upstream.
$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04
$ apt-cache policy libc6
libc6:
Installed: 2.19-0ubuntu6
Candidate: 2.19-0ubuntu6
Any update on this?