[LTP] [PATCH 1/4] lib/get_high_address.c: Add tst_get_high_address.h for new API

Cyril Hrubis chrubis@suse.cz
Mon Feb 12 17:22:58 CET 2018


Hi!
> Make sure get_high_address() can be used by new API.

I would he happier if we created better API for the new library. If
nothing else the function name is poorly choosen.

I would suggest naming it as tst_get_bad_addr() which better explains
what the return value.

Also looking at the code we seem to use several different ways of
triggering EFAULT:

* (void*)-1;

* get_high_address() which is sbrk(0) + 4 * PAGE_SIZE

* mmap() with PROT_NONE

I gueess that we may as well unify on one of these, all of them should
work but I suppose that mmap() with PROT_NONE would be safest bet here.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list