1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-26 11:21:44 +02:00

Use mincore instead of msync when available

This commit is contained in:
Konstantin Belousov 2010-04-20 17:45:18 +03:00
parent 75b76d1f45
commit ee99dbec87
4 changed files with 21 additions and 1 deletions

View file

@ -76,7 +76,7 @@ dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
ttrace)
ttrace mincore)
is_gcc_m64() {
if test `echo $CFLAGS | grep "\-m64" -c` -eq 1 ; then echo ppc64;
else

View file

@ -24,6 +24,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
@ -83,6 +87,9 @@ static int
validate_mem (unw_word_t addr)
{
int i, victim;
#ifdef HAVE_MINCORE
char mvec[1];
#endif
addr = PAGE_START(addr);
@ -95,7 +102,11 @@ validate_mem (unw_word_t addr)
return 0;
}
#ifdef HAVE_MINCORE
if (mincore ((void *) addr, 1, mvec) == -1)
#else
if (msync ((void *) addr, 1, MS_ASYNC) == -1)
#endif
return -1;
victim = lga_victim;

View file

@ -86,6 +86,9 @@ static int
validate_mem (unw_word_t addr)
{
int i, victim;
#ifdef HAVE_MINCORE
char mvec[1];
#endif
addr = PAGE_START(addr);
@ -98,7 +101,11 @@ validate_mem (unw_word_t addr)
return 0;
}
#ifdef HAVE_MINCORE
if (mincore ((void *) addr, 1, mvec) == -1)
#else
if (msync ((void *) addr, 1, MS_ASYNC) == -1)
#endif
return -1;
victim = lga_victim;

View file

@ -39,6 +39,7 @@ endif #ARCH_IA64
Gtest-concurrent Ltest-concurrent \
Gtest-resume-sig Ltest-resume-sig \
Gtest-dyn1 Ltest-dyn1 \
Gtest-simple \
test-async-sig test-flush-cache test-init-remote \
test-mem test-setjmp test-ptrace \
Ltest-nomalloc rs-race
@ -89,6 +90,7 @@ Ltest_cxx_exceptions_SOURCES = Ltest-cxx-exceptions.cxx
Gtest_dyn1_SOURCES = Gtest-dyn1.c flush-cache.S
Ltest_dyn1_SOURCES = Ltest-dyn1.c flush-cache.S
Gtest_simple_SOURCES = Gtest-simple.cxx
test_static_link_SOURCES = test-static-link-loc.c test-static-link-gen.c
test_static_link_LDFLAGS = -static
forker_LDFLAGS = -static