summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Emde <carsten.emde@osadl.org>2009-12-14 14:58:52 +0100
committerJohn Kacur <jkacur@redhat.com>2009-12-14 14:58:52 +0100
commitda4e86522577ac413395dfb32d0b7411028e8dd8 (patch)
treec66ae155a859de3880a089a109252a6050dad86c
parentc51afec7fda2c43e760d43c5d76f4bfe4880c7f4 (diff)
downloadrt-tests-da4e86522577ac413395dfb32d0b7411028e8dd8.tar.gz
Make use of the new library functions in signaltest.
Signed-off-by: Carsten Emde <carsten.emde@osadl.org> Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--Makefile2
-rw-r--r--src/signaltest/signaltest.c27
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, &param)) {
- 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;