summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--libcg.h12
2 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ec2142b..9c175fa 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,7 @@ INC=-I.
CFLAGS=-g -O2 -Wextra $(DEBUG) $(INC)
LIBS= -lcg
LDFLAGS= -L .
+INSTALLPREFIX=
all: cgconfig libcg.so
@@ -31,5 +32,13 @@ lex.yy.c: lex.l
libcg.so: api.c libcg.h
$(CXX) $(CFLAGS) -shared -fPIC -o $@ api.c
+install: libcg.so
+ \cp libcg.h $(INSTALLPREFIX)/usr/include
+ \cp libcg.so $(INSTALLPREFIX)/usr/lib
+
+uninstall: libcg.so
+ \rm $(INSTALLPREFIX)/usr/include/libcg.h
+ \rm $(INSTALLPREFIX)/usr/lib/libcg.so
+
clean:
\rm -f y.tab.c y.tab.h lex.yy.c y.output cgconfig libcg.so
diff --git a/libcg.h b/libcg.h
index b600a28..3c4db67 100644
--- a/libcg.h
+++ b/libcg.h
@@ -148,12 +148,14 @@ struct control_value {
char *value;
};
-struct cgroup{
+struct controller {
char *name;
- struct {
- char *name;
- struct control_value *values[CG_NV_MAX];
- } *controller[CG_CONTROLLER_MAX];
+ struct control_value *values[CG_NV_MAX];
+};
+
+struct cgroup {
+ char *name;
+ struct controller *controller[CG_CONTROLLER_MAX];
uid_t tasks_uid;
gid_t tasks_gid;
uid_t control_uid;