From: Carsten Emde <carsten.emde@xxxxxxxxx> Signed-off-by: Carsten Emde <carsten.emde@xxxxxxxxx> Signed-off-by: John Kacur <jkacur@xxxxxxxxxx> --- Makefile | 2 +- src/signaltest/signaltest.c | 27 ++------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 2bb0009..2507a1f 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ all: $(TARGETS) cyclictest: src/cyclictest/cyclictest.c $(UTILS) $(CC) $(CFLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS) -signaltest: src/signaltest/signaltest.c +signaltest: src/signaltest/signaltest.c $(UTILS) $(CC) $(CFLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS) classic_pi: src/pi_tests/classic_pi.c diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c index b637aae..e6016c9 100644 --- a/src/signaltest/signaltest.c +++ b/src/signaltest/signaltest.c @@ -27,6 +27,8 @@ #include <sys/time.h> #include <sys/mman.h> +#include "rt-utils.h" + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* Ugly, but .... */ @@ -306,31 +308,6 @@ static void print_stat(struct thread_param *par, int index, int verbose) } } -static int -check_privs(void) -{ - int policy = sched_getscheduler(0); - struct sched_param param; - - /* if we're already running a realtime scheduler - * then we *should* be able to change things later - */ - if (policy == SCHED_FIFO || policy == SCHED_RR) - return 0; - - /* try to change to SCHED_FIFO */ - param.sched_priority = 1; - if (sched_setscheduler(0, SCHED_FIFO, ¶m)) { - fprintf(stderr, "Unable to change scheduling policy!\n"); - fprintf(stderr, "either run as root or join realtime group\n"); - return 1; - } - - /* we're good; change back and return success */ - sched_setscheduler(0, policy, NULL); - return 0; -} - int main(int argc, char **argv) { sigset_t sigset; -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html