From: Jan Safranek Date: Fri, 12 Mar 2010 15:50:10 +0000 (+0100) Subject: Move private definitions to private header X-Git-Tag: v0.36.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f6e409bad2dfa94a4245f7ea612b91a9baed2b7;p=thirdparty%2Flibcgroup.git Move private definitions to private header Most of the macro definitions in licgroup.h are internal, let's move them to private header. Applications should not depend on them. The only one really needed is CG_VALUE_MAX, which is used in struct cgroup_stat. Signed-off-by: Jan Safranek Signed-off-by: Dhaval Giani --- diff --git a/include/libcgroup.h b/include/libcgroup.h index b5d7a429..b7d997b5 100644 --- a/include/libcgroup.h +++ b/include/libcgroup.h @@ -26,22 +26,11 @@ __BEGIN_DECLS #include #include -/* Maximum number of mount points/controllers */ -#define MAX_MNT_ELEMENTS 8 -/* Estimated number of groups created */ -#define MAX_GROUP_ELEMENTS 128 - /* * NOTE: Wide characters are not supported at the moment. Wide character support * would require us to use a scanner/parser that can parse beyond ASCII */ -/* Definitions for the uid and gid members of a cgroup_rules */ -#define CGRULE_INVALID (-1) -#define CGRULE_WILD (-2) - -#define CGRULE_SUCCESS_STORE_PID "SUCCESS_STORE_PID" - /* Flags for cgroup_change_cgroup_uid_gid() */ enum cgflags { CGFLAG_USECACHE = 0x01, @@ -126,15 +115,7 @@ struct cgroup_file_info { short depth; }; -#define CG_NV_MAX 100 -#define CG_CONTROLLER_MAX 100 -/* this is NOT ENOUGH for stat variables */ #define CG_VALUE_MAX 100 -/* Max number of mounted hierarchies. Event if one controller is mounted per - * hier, it can not exceed CG_CONTROLLER_MAX - */ -#define CG_HIER_MAX CG_CONTROLLER_MAX - struct cgroup_stat { char name[FILENAME_MAX]; char value[CG_VALUE_MAX]; diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index 8c5cc2fd..55fa9fdc 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -26,6 +26,25 @@ __BEGIN_DECLS #include #include +/* Maximum number of mount points/controllers */ +#define MAX_MNT_ELEMENTS 8 +/* Estimated number of groups created */ +#define MAX_GROUP_ELEMENTS 128 + +#define CG_NV_MAX 100 +#define CG_CONTROLLER_MAX 100 +/* Max number of mounted hierarchies. Event if one controller is mounted per + * hier, it can not exceed CG_CONTROLLER_MAX + */ +#define CG_HIER_MAX CG_CONTROLLER_MAX + +/* Definitions for the uid and gid members of a cgroup_rules */ +#define CGRULE_INVALID (-1) +#define CGRULE_WILD (-2) + +#define CGRULE_SUCCESS_STORE_PID "SUCCESS_STORE_PID" + + #define CGRULES_CONF_FILE "/etc/cgrules.conf" #define CGRULES_MAX_FIELDS_PER_LINE 3 diff --git a/src/tools/lssubsys.c b/src/tools/lssubsys.c index cdb82842..ebb59b16 100644 --- a/src/tools/lssubsys.c +++ b/src/tools/lssubsys.c @@ -17,6 +17,7 @@ #include #include +#include enum flag{ FL_MOUNT = 1, /* show the mount points */ diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h index 752eb57b..b261dc32 100644 --- a/src/tools/tools-common.h +++ b/src/tools/tools-common.h @@ -20,6 +20,7 @@ #include "config.h" #include +#include #ifdef CGROUP_DEBUG #define cgroup_dbg(x...) printf(x)