Commit 9f5c378f authored by Pavel Emelyanov's avatar Pavel Emelyanov

check: Call sbrk to get current brk

According to man, glibc brk reports 0 on success, but we need current brk
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Cc: Saied Kazemi <saied@google.com>
parent 8c6062e8
......@@ -194,7 +194,7 @@ static int check_prctl(void)
} else
pr_warn("Skipping unssuported PR_SET_MM_MAP: %m\n");
ret = prctl(PR_SET_MM, PR_SET_MM_BRK, brk(0), 0, 0);
ret = prctl(PR_SET_MM, PR_SET_MM_BRK, (unsigned long)sbrk(0), 0, 0);
if (ret < 0) {
if (errno == EPERM)
pr_msg("prctl: One needs CAP_SYS_RESOURCE capability to perform testing\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment