rt-tests: pip - Use check_privs() from the rt-utils library.

Use check_privs() from the rt-utils library to make sure that the user is
running with real-time privileges for the pip test program.

Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
John Kacur 2009-12-23 16:41:12 +01:00
parent 3dec3c9e04
commit 20b8b253f3
3 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,7 @@ svsematest: svsematest.o rt-utils.o rt-get_cpu.o
sendme: sendme.o rt-utils.o rt-get_cpu.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
pip: pip.o error.o
pip: pip.o error.o rt-utils.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej rt-tests.spec

View File

@ -13,6 +13,7 @@
#include <sys/wait.h>
#include <signal.h>
#include <sched.h>
#include <rt-utils.h>
#include "error.h"
void low(pid_t pid); /* low priority process */

View File

@ -83,6 +83,9 @@ int main(void)
*minimum_priority = sched_get_priority_min(policy);
if (check_privs())
exit(-1);
mptr = mmap_page(); /* Get a page of shared memory */
resource = (pthread_mutex_t*)mptr; /* point our lock to it */
mptr += sizeof(pthread_mutex_t); /* advance the memory pointer */