提交 41f6fab5 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

make sbrktest work again

上级 cde83c25
......@@ -1249,7 +1249,7 @@ forktest(void)
void
sbrktest(void)
{
int fds[2], pid, pids[32], ppid;
int fds[2], pid, pids[32];
char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch;
uptr amt;
......@@ -1292,15 +1292,17 @@ sbrktest(void)
fprintf(stdout, "sbrk test failed 632K test, p %x a %x\n", p, a);
exit();
}
lastaddr = (char*)(632 * 1024 - 1);
lastaddr = p - 1;
*lastaddr = 99;
#if 0
// is one forbidden from allocating more than 632K?
c = sbrk(4096);
if(c != (char*)0xffffffff){
fprintf(stdout, "sbrk allocated more than 632K, c %x\n", c);
exit();
}
#endif
// can one de-allocate?
a = sbrk(0);
......@@ -1330,12 +1332,15 @@ sbrktest(void)
}
#endif
#if 0
c = sbrk(4096);
if(c != (char*)0xffffffff){
fprintf(stdout, "sbrk was able to re-allocate beyond 632K, c %x\n", c);
exit();
}
#endif
#if 0
// can we read the kernel's memory?
for(a = (char*)(640*1024); a < (char*)2000000; a += 50000){
ppid = getpid();
......@@ -1351,6 +1356,7 @@ sbrktest(void)
}
wait();
}
#endif
// if we run the system out of memory, does it clean up the last
// failed allocation?
......@@ -1602,7 +1608,7 @@ main(int argc, char *argv[])
unopentest();
bigargtest();
bsstest();
// sbrktest(); // XXX memory layout has changed. tests needs to be changed
sbrktest();
// we should be able to grow a user process to consume all phys mem
validatetest();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论