From 1d00fc725ba26db40b2c792c75888c2ed777730d Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Mon, 29 Sep 2008 12:09:04 +0000 Subject: The automatic classification engine (cgexec, cgclassify, pam_cgroup) classify tasks. It is useful for an application to know where it has been classified. I propose to add a new API cgroup_get_current_controller_path() that returns the current classification directory for the specified controller. One can easily add on and build new API that will return paths of all mounted controllers, but I want to start with something simple and useful. I've also added a bunch of test cases for the same purpose. Test output # ./pathtest.sh Test FAIL, get path failed for controller cpuset Test PASS, controller cpu path /default Test PASS, controller cpuacct path /default Test PASS, controller memory path /default Test FAIL, get path failed for controller memrlimit I mounted just cpu, cpuacct and memory, thus the path for cpuset and memrlimit could not be found (as expected). Signed-off-by: Balbir Singh Reviewed-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@200 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/Makefile') diff --git a/tests/Makefile b/tests/Makefile index 7a38b7a..5c602cb 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -6,7 +6,8 @@ CFLAGS = -g -O2 -Wall -DDEBUG TARGET= libcgrouptest01 \ libcg_ba \ - setuid + setuid \ + pathtest all: $(TARGET) @@ -19,5 +20,8 @@ libcg_ba: libcg_ba.cpp setuid: setuid.c $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS) +pathtest: pathtest.c + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS) + clean: \rm -f $(TARGET) -- cgit