diff options
author | Milosz Wasilewski <milosz.wasilewski@hackbox.linaro.org> | 2015-11-01 23:02:07 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@hackbox.linaro.org> | 2015-11-01 23:02:07 +0000 |
commit | 3bec060acae04c0b799822e813c62b94cffbe3f7 (patch) | |
tree | d4f7884c8282aed5ac71c8b297589d94dddc4b8a /powerpc/pmu/lib.c | |
parent | 751dc08e504621a230a1b556abdd2c660953708d (diff) |
Update to commit: 32b88194f71d6ae7768a29f87fbba454728273ee32b88194f71d6ae7768a29f87fbba454728273ee
from repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
branch: master
Diffstat (limited to 'powerpc/pmu/lib.c')
-rw-r--r-- | powerpc/pmu/lib.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/powerpc/pmu/lib.c b/powerpc/pmu/lib.c index 9768dea..a07104c 100644 --- a/powerpc/pmu/lib.c +++ b/powerpc/pmu/lib.c @@ -5,15 +5,10 @@ #define _GNU_SOURCE /* For CPU_ZERO etc. */ -#include <elf.h> #include <errno.h> -#include <fcntl.h> -#include <link.h> #include <sched.h> #include <setjmp.h> #include <stdlib.h> -#include <sys/stat.h> -#include <sys/types.h> #include <sys/wait.h> #include "utils.h" @@ -256,45 +251,3 @@ out: return rc; } -static char auxv[4096]; - -void *get_auxv_entry(int type) -{ - ElfW(auxv_t) *p; - void *result; - ssize_t num; - int fd; - - fd = open("/proc/self/auxv", O_RDONLY); - if (fd == -1) { - perror("open"); - return NULL; - } - - result = NULL; - - num = read(fd, auxv, sizeof(auxv)); - if (num < 0) { - perror("read"); - goto out; - } - - if (num > sizeof(auxv)) { - printf("Overflowed auxv buffer\n"); - goto out; - } - - p = (ElfW(auxv_t) *)auxv; - - while (p->a_type != AT_NULL) { - if (p->a_type == type) { - result = (void *)p->a_un.a_val; - break; - } - - p++; - } -out: - close(fd); - return result; -} |