summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/fill_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/resctrl/fill_buf.c')
-rw-r--r--tools/testing/selftests/resctrl/fill_buf.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
index 56ccbeae0638..341cc93ca84c 100644
--- a/tools/testing/selftests/resctrl/fill_buf.c
+++ b/tools/testing/selftests/resctrl/fill_buf.c
@@ -14,7 +14,6 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <inttypes.h>
-#include <malloc.h>
#include <string.h>
#include "resctrl.h"
@@ -33,14 +32,6 @@ static void sb(void)
#endif
}
-static void ctrl_handler(int signo)
-{
- free(startptr);
- printf("\nEnding\n");
- sb();
- exit(EXIT_SUCCESS);
-}
-
static void cl_flush(void *p)
{
#if defined(__i386) || defined(__x86_64)
@@ -64,10 +55,14 @@ static void mem_flush(void *p, size_t s)
static void *malloc_and_init_memory(size_t s)
{
+ void *p = NULL;
uint64_t *p64;
size_t s64;
+ int ret;
- void *p = memalign(PAGE_SIZE, s);
+ ret = posix_memalign(&p, PAGE_SIZE, s);
+ if (ret < 0)
+ return NULL;
p64 = (uint64_t *)p;
s64 = s / sizeof(uint64_t);
@@ -198,12 +193,6 @@ int run_fill_buf(unsigned long span, int malloc_and_init_memory,
unsigned long long cache_size = span;
int ret;
- /* set up ctrl-c handler */
- if (signal(SIGINT, ctrl_handler) == SIG_ERR)
- printf("Failed to catch SIGINT!\n");
- if (signal(SIGHUP, ctrl_handler) == SIG_ERR)
- printf("Failed to catch SIGHUP!\n");
-
ret = fill_cache(cache_size, malloc_and_init_memory, memflush, op,
resctrl_val);
if (ret) {