mips pipe.S cleanup
Joseph S. Myers
joseph at codesourcery.com
Thu Feb 23 16:54:43 UTC 2006
On Fri, 24 Feb 2006, Atsushi Nemoto wrote:
> Though I do not have enough time to test it for now, current pipe.S
> seems broken for error case. For example, "la t0, __syscall_error"
> should be "la t9, __syscall_error"? Jumping to __syscall_error
> without reverting sp is correct?
My patch at <http://www.uclibc.org/lists/uclibc/2006-January/013869.html>
was tested to work. I have not tested MIPS on trunk uClibc since it was
merged into trunk so do not know whether the trunk version is a correct
merge.
My testcase is:
#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int
main(void)
{
int i;
int p[2];
int ret;
struct rlimit r = { 10, 10 };
setrlimit(RLIMIT_NOFILE, &r);
for (i = 0; i < 5; i++) {
p[0] = -1;
p[1] = -1;
ret = pipe(p);
printf("%d [%d %d] %s\n", ret, p[0], p[1], strerror(errno));
}
return 0;
}
which tests both success and failure cases and should yield something
along the lines of
0 [3 4] Success
0 [5 6] Success
0 [7 8] Success
-1 [-1 -1] Too many open files
-1 [-1 -1] Too many open files
--
Joseph S. Myers
joseph at codesourcery.com
More information about the uClibc
mailing list