Commit 949a7717 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

Merge branch 'fix_tuto_map_anonymous' into 'staging'

[fix] Tutorial with map anonymous

See merge request !169
parents ff3cd379 7b3fe6c2
Pipeline #12139 passed with stages
in 10 minutes and 6 seconds
......@@ -92,16 +92,13 @@ int main(void)
return 77;
const size_t size = (2 << 16); // 16 pages
void *host_buf = mmap(NULL, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
0, 0);
void *host_buf = malloc(size);
if (host_buf == NULL)
return 1;
test_default_area(size, host_buf);
test_custom_area(size, host_buf);
munmap(host_buf, size);
free(host_buf);
return 0;
}
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