110c110
< obreakFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
---
> brkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
112,113d111
< Addr junk;
<
116c114,121
< if (new_brk != 0) {
---
>
> // in Linux at least, brk(0) returns the current break value
> // (note that the syscall and the glibc function have different behavior)
> if (new_brk == 0)
> return p->brk_point;
>
> if (new_brk > p->brk_point) {
> // might need to allocate some new pages
119c124
< if (!p->pTable->translate(gen.addr(), junk))
---
> if (!p->pTable->translate(gen.addr()))
123d127
< p->brk_point = new_brk;
124a129,130
>
> p->brk_point = new_brk;