This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: testrun.sh broken
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 8 Jan 2016 09:41:47 -0200
- Subject: Re: testrun.sh broken
- Authentication-results: sourceware.org; auth=none
- References: <20160108022150 dot GD4698 at two dot firstfloor dot org>
On 08-01-2016 00:21, Andi Kleen wrote:
>
> In recent glibc versions testrun.sh doesn't actually use the libc
> in the build directory anymore, which makes it fairly useless.
> Is that expected?
>
> -Andi
>
Are you sure? I just tested:
$ cat test.c
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int CopyFdToFd(int in_fd, int out_fd) {
#define kBufSize 0x10000
static char buf[kBufSize];
while (1) {
ssize_t got = read(in_fd, buf, kBufSize);
if (got > 0) {
write(out_fd, buf, got);
} else if (got == 0) {
break;
} else if (errno != EAGAIN || errno != EWOULDBLOCK || errno != EINTR) {
fprintf(stderr, "error reading file, errno %d\n", errno);
return -1;
}
}
return 0;
}
int main ()
{
int fd = open("/proc/self/maps", O_RDONLY);
int res = CopyFdToFd(fd, STDOUT_FILENO);
close(fd);
return res;
}
$ gcc test.c -o test
$ ./testrun.sh ./test | grep libc.so
7fa9b9d75000-7fa9b9f33000 r-xp 00000000 fc:00 7997401 /home/azanella/Projects/glibc/glibc-git-build-m64/libc.so
7fa9b9f33000-7fa9ba132000 ---p 001be000 fc:00 7997401 /home/azanella/Projects/glibc/glibc-git-build-m64/libc.so
7fa9ba132000-7fa9ba136000 r--p 001bd000 fc:00 7997401 /home/azanella/Projects/glibc/glibc-git-build-m64/libc.so
7fa9ba136000-7fa9ba138000 rw-p 001c1000 fc:00 7997401 /home/azanella/Projects/glibc/glibc-git-build-m64/libc.so