From: drakenclimber Date: Tue, 8 Feb 2022 16:15:54 +0000 (+0000) Subject: deploy: a80921af973609d6da9ee1063006440556de65c6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=102ebd57caf0c33eb5e9cda2d4e1a7f94dac4bd0;p=thirdparty%2Flibcgroup.git deploy: a80921af973609d6da9ee1063006440556de65c6 --- diff --git a/abstraction-common_8h_source.html b/abstraction-common_8h_source.html index d757566a..9c3b9c5d 100644 --- a/abstraction-common_8h_source.html +++ b/abstraction-common_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/abstraction-common.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
abstraction-common.h
+
abstraction-common.h
-
1 
-
8 /*
-
9  * This library is free software; you can redistribute it and/or modify it
-
10  * under the terms of version 2.1 of the GNU Lesser General Public License as
-
11  * published by the Free Software Foundation.
-
12  *
-
13  * This library is distributed in the hope that it will be useful, but WITHOUT
-
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
-
16  * for more details.
-
17  *
-
18  * You should have received a copy of the GNU Lesser General Public License
-
19  * along with this library; if not, see <http://www.gnu.org/licenses>.
-
20  */
-
21 #ifndef __ABSTRACTION_COMMON
-
22 #define __ABSTRACTION_COMMON
-
23 
-
24 #ifdef __cplusplus
-
25 extern "C" {
-
26 #endif
-
27 
-
28 #include "config.h"
-
29 #include <libcgroup.h>
-
30 #include "libcgroup-internal.h"
-
31 
-
43 int cgroup_strtol(const char * const in_str, int base,
-
44  long int * const out_value);
-
45 
-
55 int cgroup_convert_int(struct cgroup_controller * const dst_cgc,
-
56  const char * const in_value,
-
57  const char * const out_setting,
-
58  void *in_dflt, void *out_dflt);
-
59 
-
70 int cgroup_convert_name_only(struct cgroup_controller * const dst_cgc,
-
71  const char * const in_value,
-
72  const char * const out_setting,
-
73  void *in_dflt, void *out_dflt);
-
74 
-
84 int cgroup_convert_passthrough(struct cgroup_controller * const dst_cgc,
-
85  const char * const in_value,
-
86  const char * const out_setting,
-
87  void *in_dflt, void *out_dflt);
-
88 
-
99 int cgroup_convert_unmappable(struct cgroup_controller * const dst_cgc,
-
100  const char * const in_value,
-
101  const char * const out_setting,
-
102  void *in_dflt, void *out_dflt);
-
103 
-
104 /* cpu */
-
105 int cgroup_convert_cpu_nto1(struct cgroup_controller * const out_cgc,
-
106  struct cgroup_controller * const in_cgc);
-
107 
-
108 int cgroup_convert_cpu_quota_to_max(
-
109  struct cgroup_controller * const dst_cgc,
-
110  const char * const in_value,
-
111  const char * const out_setting,
-
112  void *in_dflt, void *out_dflt);
-
113 
-
114 int cgroup_convert_cpu_period_to_max(
-
115  struct cgroup_controller * const dst_cgc,
-
116  const char * const in_value,
-
117  const char * const out_setting,
-
118  void *in_dflt, void *out_dflt);
-
119 
-
120 int cgroup_convert_cpu_max_to_quota(
-
121  struct cgroup_controller * const dst_cgc,
-
122  const char * const in_value,
-
123  const char * const out_setting,
-
124  void *in_dflt, void *out_dflt);
-
125 
-
126 int cgroup_convert_cpu_max_to_period(
-
127  struct cgroup_controller * const dst_cgc,
-
128  const char * const in_value,
-
129  const char * const out_setting,
-
130  void *in_dflt, void *out_dflt);
-
131 
-
132 /* cpuset */
-
133 int cgroup_convert_cpuset_to_exclusive(
-
134  struct cgroup_controller * const dst_cgc,
-
135  const char * const in_value,
-
136  const char * const out_setting,
-
137  void *in_dflt, void *out_dflt);
-
138 
-
139 int cgroup_convert_cpuset_to_partition(
-
140  struct cgroup_controller * const dst_cgc,
-
141  const char * const in_value,
-
142  const char * const out_setting,
-
143  void *in_dflt, void *out_dflt);
-
144 
-
145 
-
146 #ifdef __cplusplus
-
147 } /* extern "C" */
-
148 #endif
-
149 
-
150 #endif /* __ABSTRACTION_COMMON */
+
1
+
8/*
+
9 * This library is free software; you can redistribute it and/or modify it
+
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
+
11 * published by the Free Software Foundation.
+
12 *
+
13 * This library is distributed in the hope that it will be useful, but WITHOUT
+
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+
16 * for more details.
+
17 *
+
18 * You should have received a copy of the GNU Lesser General Public License
+
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
+
20 */
+
21#ifndef __ABSTRACTION_COMMON
+
22#define __ABSTRACTION_COMMON
+
23
+
24#ifdef __cplusplus
+
25extern "C" {
+
26#endif
+
27
+
28#include "config.h"
+
29#include <libcgroup.h>
+
30#include "libcgroup-internal.h"
+
31
+
43int cgroup_strtol(const char * const in_str, int base,
+
44 long int * const out_value);
+
45
+
55int cgroup_convert_int(struct cgroup_controller * const dst_cgc,
+
56 const char * const in_value,
+
57 const char * const out_setting,
+
58 void *in_dflt, void *out_dflt);
+
59
+
70int cgroup_convert_name_only(struct cgroup_controller * const dst_cgc,
+
71 const char * const in_value,
+
72 const char * const out_setting,
+
73 void *in_dflt, void *out_dflt);
+
74
+
84int cgroup_convert_passthrough(struct cgroup_controller * const dst_cgc,
+
85 const char * const in_value,
+
86 const char * const out_setting,
+
87 void *in_dflt, void *out_dflt);
+
88
+
99int cgroup_convert_unmappable(struct cgroup_controller * const dst_cgc,
+
100 const char * const in_value,
+
101 const char * const out_setting,
+
102 void *in_dflt, void *out_dflt);
+
103
+
104/* cpu */
+
105int cgroup_convert_cpu_nto1(struct cgroup_controller * const out_cgc,
+
106 struct cgroup_controller * const in_cgc);
+
107
+
108int cgroup_convert_cpu_quota_to_max(
+
109 struct cgroup_controller * const dst_cgc,
+
110 const char * const in_value,
+
111 const char * const out_setting,
+
112 void *in_dflt, void *out_dflt);
+
113
+
114int cgroup_convert_cpu_period_to_max(
+
115 struct cgroup_controller * const dst_cgc,
+
116 const char * const in_value,
+
117 const char * const out_setting,
+
118 void *in_dflt, void *out_dflt);
+
119
+
120int cgroup_convert_cpu_max_to_quota(
+
121 struct cgroup_controller * const dst_cgc,
+
122 const char * const in_value,
+
123 const char * const out_setting,
+
124 void *in_dflt, void *out_dflt);
+
125
+
126int cgroup_convert_cpu_max_to_period(
+
127 struct cgroup_controller * const dst_cgc,
+
128 const char * const in_value,
+
129 const char * const out_setting,
+
130 void *in_dflt, void *out_dflt);
+
131
+
132/* cpuset */
+
133int cgroup_convert_cpuset_to_exclusive(
+
134 struct cgroup_controller * const dst_cgc,
+
135 const char * const in_value,
+
136 const char * const out_setting,
+
137 void *in_dflt, void *out_dflt);
+
138
+
139int cgroup_convert_cpuset_to_partition(
+
140 struct cgroup_controller * const dst_cgc,
+
141 const char * const in_value,
+
142 const char * const out_setting,
+
143 void *in_dflt, void *out_dflt);
+
144
+
145
+
146#ifdef __cplusplus
+
147} /* extern "C" */
+
148#endif
+
149
+
150#endif /* __ABSTRACTION_COMMON */
Definition: libcgroup-internal.h:106
diff --git a/abstraction-map_8h_source.html b/abstraction-map_8h_source.html index 95a166a5..f56b598d 100644 --- a/abstraction-map_8h_source.html +++ b/abstraction-map_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/abstraction-map.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
abstraction-map.h
+
abstraction-map.h
-
1 
-
8 /*
-
9  * This library is free software; you can redistribute it and/or modify it
-
10  * under the terms of version 2.1 of the GNU Lesser General Public License as
-
11  * published by the Free Software Foundation.
-
12  *
-
13  * This library is distributed in the hope that it will be useful, but WITHOUT
-
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
-
16  * for more details.
-
17  *
-
18  * You should have received a copy of the GNU Lesser General Public License
-
19  * along with this library; if not, see <http://www.gnu.org/licenses>.
-
20  */
-
21 #ifndef __ABSTRACTION_MAP
-
22 #define __ABSTRACTION_MAP
-
23 
-
24 #ifdef __cplusplus
-
25 extern "C" {
-
26 #endif
-
27 
- -
29  /* if the conversion isn't a one-to-one mapping or the mathematical
-
30  * conversion is unique, create a custom conversion function.
-
31  */
-
32  int (*cgroup_convert)(struct cgroup_controller * const dst_cgc,
-
33  const char * const in_value,
-
34  const char * const out_setting,
-
35  void *in_dflt, void *out_dflt);
-
36  char *in_setting;
-
37  void *in_dflt;
-
38  char *out_setting;
-
39  void *out_dflt;
-
40 };
-
41 
-
42 extern const struct cgroup_abstraction_map cgroup_v1_to_v2_map[];
-
43 extern const int cgroup_v1_to_v2_map_sz;
-
44 
-
45 extern const struct cgroup_abstraction_map cgroup_v2_to_v1_map[];
-
46 extern const int cgroup_v2_to_v1_map_sz;
-
47 
-
48 #ifdef __cplusplus
-
49 } /* extern "C" */
-
50 #endif
-
51 
-
52 #endif /* __ABSTRACTION_MAP */
+
1
+
8/*
+
9 * This library is free software; you can redistribute it and/or modify it
+
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
+
11 * published by the Free Software Foundation.
+
12 *
+
13 * This library is distributed in the hope that it will be useful, but WITHOUT
+
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+
16 * for more details.
+
17 *
+
18 * You should have received a copy of the GNU Lesser General Public License
+
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
+
20 */
+
21#ifndef __ABSTRACTION_MAP
+
22#define __ABSTRACTION_MAP
+
23
+
24#ifdef __cplusplus
+
25extern "C" {
+
26#endif
+
27
+ +
29 /* if the conversion isn't a one-to-one mapping or the mathematical
+
30 * conversion is unique, create a custom conversion function.
+
31 */
+
32 int (*cgroup_convert)(struct cgroup_controller * const dst_cgc,
+
33 const char * const in_value,
+
34 const char * const out_setting,
+
35 void *in_dflt, void *out_dflt);
+
36 char *in_setting;
+
37 void *in_dflt;
+
38 char *out_setting;
+
39 void *out_dflt;
+
40};
+
41
+
42extern const struct cgroup_abstraction_map cgroup_v1_to_v2_map[];
+
43extern const int cgroup_v1_to_v2_map_sz;
+
44
+
45extern const struct cgroup_abstraction_map cgroup_v2_to_v1_map[];
+
46extern const int cgroup_v2_to_v1_map_sz;
+
47
+
48#ifdef __cplusplus
+
49} /* extern "C" */
+
50#endif
+
51
+
52#endif /* __ABSTRACTION_MAP */
Definition: abstraction-map.h:28
Definition: libcgroup-internal.h:106
diff --git a/annotated.html b/annotated.html index c25f8cdd..0196446f 100644 --- a/annotated.html +++ b/annotated.html @@ -2,8 +2,8 @@ - - + + libcgroup: Data Structures @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -61,8 +62,7 @@ $(function() {
-
-
Data Structures
+
Data Structures
Here are the data structures with brief descriptions:
@@ -97,7 +97,7 @@ $(function() {
diff --git a/cgrulesengd_8h_source.html b/cgrulesengd_8h_source.html index ec150f61..0e45fee2 100644 --- a/cgrulesengd_8h_source.html +++ b/cgrulesengd_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/daemon/cgrulesengd.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
cgrulesengd.h
+
cgrulesengd.h
-
1 /*
-
2  * Copyright Red Hat Inc. 2008
-
3  *
-
4  * Author: Steve Olivieri <sjo@redhat.com>
-
5  *
-
6  * This program is free software; you can redistribute it and/or modify it
-
7  * under the terms of version 2.1 of the GNU Lesser General Public License
-
8  * as published by the Free Software Foundation.
-
9  *
-
10  * This program is distributed in the hope that it would be useful, but
-
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
-
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
13  */
-
14 
-
15 #ifndef _CGRULESENGD_H
-
16 #define _CGRULESENGD_H
-
17 
-
18 #include <features.h>
-
19 
-
20 #ifdef __cplusplus
-
21 extern "C" {
-
22 #endif
-
23 
-
24 #include "config.h"
-
25 #include "libcgroup.h"
-
26 #include <linux/connector.h>
-
27 #include <linux/cn_proc.h>
-
28 
-
29 #ifndef _GNU_SOURCE
-
30 #define _GNU_SOURCE
-
31 #endif
-
32 
-
33 #ifndef __USE_GNU
-
34 #define __USE_GNU
-
35 #endif
-
36 
-
37 /* The following ten macros are all for the Netlink code. */
-
38 #define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
-
39  sizeof(enum proc_cn_mcast_op)))
-
40 #define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
-
41  sizeof(struct proc_event)))
-
42 
-
43 #define SEND_MESSAGE_SIZE (NLMSG_SPACE(SEND_MESSAGE_LEN))
-
44 #define RECV_MESSAGE_SIZE (NLMSG_SPACE(RECV_MESSAGE_LEN))
-
45 
-
46 #define BUFF_SIZE (max(max(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE), 1024))
-
47 #define MIN_RECV_SIZE (min(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE))
-
48 
-
49 #define PROC_CN_MCAST_LISTEN (1)
-
50 #define PROC_CN_MCAST_IGNORE (2)
-
51 
-
59 void cgre_usage(FILE *fd, const char *msg, ...);
-
60 
-
69 void flog(int level, const char *msg, ...);
-
70 
-
79 int cgre_process_event(const struct proc_event *ev, const int type);
-
80 
-
88 int cgre_handle_message(struct cn_msg *cn_hdr);
-
89 
-
100 int cgre_start_daemon(const char *logp, const int logf,
-
101  const unsigned char daemon, const int logv);
-
102 
-
108 void cgre_flash_rules(int signum);
-
109 
-
115 void cgre_flash_templates(int signum);
-
116 
-
122 void cgre_catch_term(int signum);
-
123 
-
124 #ifdef __cplusplus
-
125 } /* extern "C" */
-
126 #endif
-
127 
-
128 #endif /* _CGRULESENGD_H */
-
129 
+
1/*
+
2 * Copyright Red Hat Inc. 2008
+
3 *
+
4 * Author: Steve Olivieri <sjo@redhat.com>
+
5 *
+
6 * This program is free software; you can redistribute it and/or modify it
+
7 * under the terms of version 2.1 of the GNU Lesser General Public License
+
8 * as published by the Free Software Foundation.
+
9 *
+
10 * This program is distributed in the hope that it would be useful, but
+
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
+
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
13 */
+
14
+
15#ifndef _CGRULESENGD_H
+
16#define _CGRULESENGD_H
+
17
+
18#include <features.h>
+
19
+
20#ifdef __cplusplus
+
21extern "C" {
+
22#endif
+
23
+
24#include "config.h"
+
25#include "libcgroup.h"
+
26#include <linux/connector.h>
+
27#include <linux/cn_proc.h>
+
28
+
29#ifndef _GNU_SOURCE
+
30#define _GNU_SOURCE
+
31#endif
+
32
+
33#ifndef __USE_GNU
+
34#define __USE_GNU
+
35#endif
+
36
+
37/* The following ten macros are all for the Netlink code. */
+
38#define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
+
39 sizeof(enum proc_cn_mcast_op)))
+
40#define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
+
41 sizeof(struct proc_event)))
+
42
+
43#define SEND_MESSAGE_SIZE (NLMSG_SPACE(SEND_MESSAGE_LEN))
+
44#define RECV_MESSAGE_SIZE (NLMSG_SPACE(RECV_MESSAGE_LEN))
+
45
+
46#define BUFF_SIZE (max(max(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE), 1024))
+
47#define MIN_RECV_SIZE (min(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE))
+
48
+
49#define PROC_CN_MCAST_LISTEN (1)
+
50#define PROC_CN_MCAST_IGNORE (2)
+
51
+
59void cgre_usage(FILE *fd, const char *msg, ...);
+
60
+
69void flog(int level, const char *msg, ...);
+
70
+
79int cgre_process_event(const struct proc_event *ev, const int type);
+
80
+
88int cgre_handle_message(struct cn_msg *cn_hdr);
+
89
+
100int cgre_start_daemon(const char *logp, const int logf,
+
101 const unsigned char daemon, const int logv);
+
102
+
108void cgre_flash_rules(int signum);
+
109
+
115void cgre_flash_templates(int signum);
+
116
+
122void cgre_catch_term(int signum);
+
123
+
124#ifdef __cplusplus
+
125} /* extern "C" */
+
126#endif
+
127
+
128#endif /* _CGRULESENGD_H */
+
129
diff --git a/classes.html b/classes.html index 9360f560..47cfb8fe 100644 --- a/classes.html +++ b/classes.html @@ -2,8 +2,8 @@ - - + + libcgroup: Data Structure Index @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -61,35 +62,34 @@ $(function() {
-
-
Data Structure Index
+
Data Structure Index
A | B | C | E | P | U
diff --git a/config_8h_source.html b/config_8h_source.html index 6ba64fc7..bac67fab 100644 --- a/config_8h_source.html +++ b/config_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/config.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
config.h
+
config.h
-
1 #ifndef _LIBCGROUP_CONFIG_H
-
2 #define _LIBCGROUP_CONFIG_H
-
3 
-
4 #ifndef _LIBCGROUP_H_INSIDE
-
5 #error "Only <libcgroup.h> should be included directly."
-
6 #endif
-
7 
-
8 #ifndef SWIG
-
9 #include <features.h>
-
10 #endif
-
11 
-
12 #ifdef __cplusplus
-
13 extern "C" {
-
14 #endif
-
15 
-
36 int cgroup_config_load_config(const char *pathname);
-
37 
-
41 int cgroup_unload_cgroups(void);
-
42 
-
58 int cgroup_config_unload_config(const char *pathname, int flags);
-
59 
-
76 int cgroup_config_set_default(struct cgroup *new_default);
-
77 
-
81 int cgroup_init_templates_cache(char *pathname);
-
82 
-
86 int cgroup_reload_cached_templates(char *pathname);
-
87 
-
94 int cgroup_load_templates_cache_from_files(int *file_index);
-
95 
-
101 struct cgroup_string_list;
- -
103  struct cgroup_string_list *tmpl_files);
-
104 
- -
126  struct cgroup *cgroup, char *template_name,
-
127  int flags);
-
128 
-
133 #ifdef __cplusplus
-
134 } /* extern "C" */
-
135 #endif
-
136 
-
137 #endif /*_LIBCGROUP_CONFIG_H*/
+
1#ifndef _LIBCGROUP_CONFIG_H
+
2#define _LIBCGROUP_CONFIG_H
+
3
+
4#ifndef _LIBCGROUP_H_INSIDE
+
5#error "Only <libcgroup.h> should be included directly."
+
6#endif
+
7
+
8#ifndef SWIG
+
9#include <features.h>
+
10#endif
+
11
+
12#ifdef __cplusplus
+
13extern "C" {
+
14#endif
+
15
+
36int cgroup_config_load_config(const char *pathname);
+
37
+
41int cgroup_unload_cgroups(void);
+
42
+
58int cgroup_config_unload_config(const char *pathname, int flags);
+
59
+
76int cgroup_config_set_default(struct cgroup *new_default);
+
77
+
81int cgroup_init_templates_cache(char *pathname);
+
82
+
86int cgroup_reload_cached_templates(char *pathname);
+
87
+ +
95
+
101struct cgroup_string_list;
+ +
103 struct cgroup_string_list *tmpl_files);
+
104
+ +
126 struct cgroup *cgroup, char *template_name,
+
127 int flags);
+
128
+
133#ifdef __cplusplus
+
134} /* extern "C" */
+
135#endif
+
136
+
137#endif /*_LIBCGROUP_CONFIG_H*/
int cgroup_config_set_default(struct cgroup *new_default)
Definition: config.c:1470
int cgroup_init_templates_cache(char *pathname)
Definition: config.c:1557
int cgroup_config_create_template_group(struct cgroup *cgroup, char *template_name, int flags)
Definition: config.c:1778
@@ -125,7 +125,7 @@ $(function() {
diff --git a/dir_1563a38af0d3a5e4a6330d6d45e9792a.html b/dir_1563a38af0d3a5e4a6330d6d45e9792a.html index f464e92c..426d5e9e 100644 --- a/dir_1563a38af0d3a5e4a6330d6d45e9792a.html +++ b/dir_1563a38af0d3a5e4a6330d6d45e9792a.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/tools Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
tools Directory Reference
+
tools Directory Reference
+ + + + +

+Files

file  tools-common.h [code]
 
diff --git a/dir_2d094300ae4f2c55dd459b9ec7dd0ad3.html b/dir_2d094300ae4f2c55dd459b9ec7dd0ad3.html index b7a5d732..e74b248f 100644 --- a/dir_2d094300ae4f2c55dd459b9ec7dd0ad3.html +++ b/dir_2d094300ae4f2c55dd459b9ec7dd0ad3.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/daemon Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
daemon Directory Reference
+
daemon Directory Reference
+ + + + +

+Files

file  cgrulesengd.h [code]
 
diff --git a/dir_501cbd49daf77f17c121ad0979f93200.html b/dir_501cbd49daf77f17c121ad0979f93200.html index 5a11dce6..5a5c3e40 100644 --- a/dir_501cbd49daf77f17c121ad0979f93200.html +++ b/dir_501cbd49daf77f17c121ad0979f93200.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/pam Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
pam Directory Reference
+
pam Directory Reference
diff --git a/dir_5c0d64f70903e893b1efe571a4b8de29.html b/dir_5c0d64f70903e893b1efe571a4b8de29.html index b83e22d0..b5562eb2 100644 --- a/dir_5c0d64f70903e893b1efe571a4b8de29.html +++ b/dir_5c0d64f70903e893b1efe571a4b8de29.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/python Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
python Directory Reference
+
python Directory Reference
diff --git a/dir_66a7763e2a9b96033a682558820d533e.html b/dir_66a7763e2a9b96033a682558820d533e.html index c551cacb..d90cd9d2 100644 --- a/dir_66a7763e2a9b96033a682558820d533e.html +++ b/dir_66a7763e2a9b96033a682558820d533e.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
libcgroup Directory Reference
+
libcgroup Directory Reference
+ + + + + + + + + + + + + + + + +

+Files

file  config.h [code]
 
file  error.h [code]
 
file  groups.h [code]
 
file  iterators.h [code]
 
file  log.h [code]
 
file  tasks.h [code]
 
file  tools.h [code]
 
diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html index aefbd560..f89e0994 100644 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -2,8 +2,8 @@ - - + + libcgroup: src Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
src Directory Reference
+
src Directory Reference
- + + + + + + + + +

+

Directories

directory  daemon
 
directory  pam
 
directory  python
 
directory  tools
 
+ + + + + + +

+Files

file  abstraction-common.h [code]
 
file  abstraction-map.h [code]
 
file  libcgroup-internal.h [code]
 
diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index 0e915887..4a81e787 100644 --- a/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -2,8 +2,8 @@ - - + + libcgroup: include Directory Reference @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
include Directory Reference
+
include Directory Reference
- + + +

+

Directories

directory  libcgroup
 
+ + +

+Files

file  libcgroup.h [code]
 
diff --git a/doxygen.css b/doxygen.css index ffbff022..90367372 100644 --- a/doxygen.css +++ b/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.9.1 */ +/* The standard CSS for doxygen 1.9.3 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; @@ -228,6 +228,33 @@ a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + /* @end */ dl.el { @@ -235,7 +262,7 @@ dl.el { } ul { - overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ + overflow: visible; } #side-nav ul { @@ -313,6 +340,7 @@ div.line.glow { span.lineno { padding-right: 4px; + margin-right: 9px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; @@ -439,6 +467,12 @@ img.footer { vertical-align: middle; } +.compoundTemplParams { + color: #4665A2; + font-size: 80%; + line-height: 120%; +} + /* @group Code Colorization */ span.keyword { @@ -1322,6 +1356,11 @@ dl.section dd { } +#projectrow +{ + height: 56px; +} + #projectlogo { text-align: center; @@ -1337,18 +1376,19 @@ dl.section dd { #projectalign { vertical-align: middle; + padding-left: 0.5em; } #projectname { - font: 300% Tahoma, Arial,sans-serif; + font: 200% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { - font: 120% Tahoma, Arial,sans-serif; + font: 90% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } @@ -1487,6 +1527,10 @@ span.emoji { */ } +span.obfuscator { + display: none; +} + .PageDocRTL-title div.toc li.level1 { margin-left: 0 !important; margin-right: 0; @@ -1541,7 +1585,7 @@ tr.heading h2 { #powerTip { cursor: default; - white-space: nowrap; + /*white-space: nowrap;*/ background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; @@ -1780,6 +1824,10 @@ table.DocNodeLTR { margin-left: 0; } +code.JavaDocCode + direction:ltr; +} + tt, code, kbd, samp { display: inline-block; diff --git a/error_8h_source.html b/error_8h_source.html index cda31fb2..a9829021 100644 --- a/error_8h_source.html +++ b/error_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/error.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
error.h
+
error.h
-
1 #ifndef _LIBCGROUP_ERROR_H
-
2 #define _LIBCGROUP_ERROR_H
-
3 
-
4 #ifndef _LIBCGROUP_H_INSIDE
-
5 #error "Only <libcgroup.h> should be included directly."
-
6 #endif
-
7 
-
8 #ifndef SWIG
-
9 #include <features.h>
-
10 #endif
-
11 
-
12 #ifdef __cplusplus
-
13 extern "C" {
-
14 #endif
-
15 
-
31 enum {
-
32  ECGROUPNOTCOMPILED = 50000,
-
33  ECGROUPNOTMOUNTED,
-
34  ECGROUPNOTEXIST,
-
35  ECGROUPNOTCREATED,
-
36  ECGROUPSUBSYSNOTMOUNTED,
-
37  ECGROUPNOTOWNER,
- -
40  /* This is the stock error. Default error. @todo really? */
-
41  ECGROUPNOTALLOWED,
-
42  ECGMAXVALUESEXCEEDED,
-
43  ECGCONTROLLEREXISTS,
-
44  ECGVALUEEXISTS,
-
45  ECGINVAL,
-
46  ECGCONTROLLERCREATEFAILED,
-
47  ECGFAIL,
-
48  ECGROUPNOTINITIALIZED,
-
49  ECGROUPVALUENOTEXIST,
- -
56  ECGROUPNOTEQUAL,
-
57  ECGCONTROLLERNOTEQUAL,
- - -
62  ECGMOUNTFAIL,
-
67  ECGEOF = 50023,
- -
70  ECGNAMESPACEPATHS,
-
71  ECGNAMESPACECONTROLLER,
-
72  ECGMOUNTNAMESPACE,
-
73  ECGROUPUNSUPP,
-
74  ECGCANTSETVALUE,
- - -
79 };
-
80 
-
84 #define ECGRULESPARSEFAIL ECGROUPPARSEFAIL
-
85 
-
95 const char *cgroup_strerror(int code);
-
96 
-
100 int cgroup_get_last_errno(void);
-
101 
-
106 #ifdef __cplusplus
-
107 } /* extern "C" */
-
108 #endif
-
109 
-
110 #endif /* _LIBCGROUP_INIT_H */
+
1#ifndef _LIBCGROUP_ERROR_H
+
2#define _LIBCGROUP_ERROR_H
+
3
+
4#ifndef _LIBCGROUP_H_INSIDE
+
5#error "Only <libcgroup.h> should be included directly."
+
6#endif
+
7
+
8#ifndef SWIG
+
9#include <features.h>
+
10#endif
+
11
+
12#ifdef __cplusplus
+
13extern "C" {
+
14#endif
+
15
+
31enum {
+
32 ECGROUPNOTCOMPILED = 50000,
+
33 ECGROUPNOTMOUNTED, /* 50001 */
+
34 ECGROUPNOTEXIST, /* 50002 */
+
35 ECGROUPNOTCREATED, /* 50003 */
+
36 ECGROUPSUBSYSNOTMOUNTED, /* 50004 */
+
37 ECGROUPNOTOWNER, /* 50005 */
+ +
40 /* This is the stock error. Default error. @todo really? */
+
41 ECGROUPNOTALLOWED, /* 50007 */
+
42 ECGMAXVALUESEXCEEDED, /* 50008 */
+
43 ECGCONTROLLEREXISTS, /* 50009 */
+
44 ECGVALUEEXISTS, /* 50010 */
+
45 ECGINVAL, /* 50011 */
+
46 ECGCONTROLLERCREATEFAILED, /* 50012 */
+
47 ECGFAIL, /* 50013 */
+
48 ECGROUPNOTINITIALIZED, /* 50014 */
+
49 ECGROUPVALUENOTEXIST, /* 50015 */
+
55 ECGOTHER, /* 50016 */
+
56 ECGROUPNOTEQUAL, /* 50017 */
+
57 ECGCONTROLLERNOTEQUAL, /* 50018 */
+
59 ECGROUPPARSEFAIL, /* 50019 */
+
61 ECGROUPNORULES, /* 50020 */
+
62 ECGMOUNTFAIL, /* 50021 */
+
67 ECGEOF = 50023,
+
69 ECGCONFIGPARSEFAIL, /* 50024 */
+
70 ECGNAMESPACEPATHS, /* 50025 */
+
71 ECGNAMESPACECONTROLLER, /* 50026 */
+
72 ECGMOUNTNAMESPACE, /* 50027 */
+
73 ECGROUPUNSUPP, /* 50028 */
+
74 ECGCANTSETVALUE, /* 50029 */
+
76 ECGNONEMPTY, /* 50030 */
+ +
79};
+
80
+
84#define ECGRULESPARSEFAIL ECGROUPPARSEFAIL
+
85
+
95const char *cgroup_strerror(int code);
+
96
+
100int cgroup_get_last_errno(void);
+
101
+
106#ifdef __cplusplus
+
107} /* extern "C" */
+
108#endif
+
109
+
110#endif /* _LIBCGROUP_INIT_H */
int cgroup_get_last_errno(void)
Definition: api.c:4484
-
const char * cgroup_strerror(int code)
Definition: api.c:4473
+
const char * cgroup_strerror(int code)
Definition: api.c:4473
@ ECGROUPMULTIMOUNTED
Definition: error.h:39
@ ECGEOF
Definition: error.h:67
@ ECGNOVERSIONCONVERT
Definition: error.h:78
@@ -143,7 +143,7 @@ $(function() {
diff --git a/files.html b/files.html index 00b591aa..4d77a9fd 100644 --- a/files.html +++ b/files.html @@ -2,8 +2,8 @@ - - + + libcgroup: File List @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -61,8 +62,7 @@ $(function() {
-
-
File List
+
File List
Here is a list of all documented files with brief descriptions:
@@ -90,7 +90,7 @@ $(function() {
diff --git a/functions.html b/functions.html index 2ba5fc7c..7cd15324 100644 --- a/functions.html +++ b/functions.html @@ -2,8 +2,8 @@ - - + + libcgroup: Data Fields @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -62,44 +63,21 @@ $(function() {
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
diff --git a/functions_vars.html b/functions_vars.html index 8c856dbc..74a3b74d 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -2,8 +2,8 @@ - - + + libcgroup: Data Fields - Variables @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -62,44 +63,21 @@ $(function() {
 
diff --git a/group__group__config.html b/group__group__config.html index bcade428..515488ab 100644 --- a/group__group__config.html +++ b/group__group__config.html @@ -2,8 +2,8 @@ - - + + libcgroup: 5. Configuration @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -61,13 +62,12 @@ $(function() {
-
-
5. Configuration
+
5. Configuration
- @@ -91,7 +91,7 @@ $(function() {

Configuration file

libcgroup can mount and create control groups and set their parameters as specified in a configuration file.

+

libcgroup can mount and create control groups and set their parameters as specified in a configuration file.

Todo:
add this description?: These functions are mostly intended to be used by internal libcgroup tools, however they are fully supported and applications can benefit from them.
int cgroup_config_load_config (const char *pathname)

Detailed Description

Function Documentation

- +

◆ cgroup_config_create_template_group()

@@ -122,9 +122,9 @@ $(function() {
-

Physically create a new control group in kernel, based on given control group template and configuration file. If given template is not set in configuration file, then the procedure works create the control group using cgroup_create_cgroup() function

-

Templates are loaded using cgroup_load_templates_cache_from_files function, which must be preceded by cgroup_templates_cache_set_source_files call.

-

The flags can alter the behavior of this function: CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of parsing the config file

+

Physically create a new control group in kernel, based on given control group template and configuration file. If given template is not set in configuration file, then the procedure works create the control group using cgroup_create_cgroup() function

+

Templates are loaded using cgroup_load_templates_cache_from_files function, which must be preceded by cgroup_templates_cache_set_source_files call.

+

The flags can alter the behavior of this function: CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of parsing the config file

Parameters
@@ -137,7 +137,7 @@ $(function() { - +

◆ cgroup_config_load_config()

@@ -152,7 +152,7 @@ $(function() {
pathnameName of the configuration file with template definitions
-

Load configuration file and mount and create control groups described there. See cgconfig.conf man page for format of the file.

Parameters
+

Load configuration file and mount and create control groups described there. See cgconfig.conf man page for format of the file.

Parameters
pathnameName of the configuration file to load.
@@ -161,7 +161,7 @@ $(function() {
- +

◆ cgroup_config_set_default()

@@ -176,8 +176,8 @@ $(function() {
-

Sets default permissions of groups created by subsequent cgroup_config_load_config() calls. If a config file contains a 'default {}' section, the default permissions from the config file is then used.

-

Use cgroup_new_cgroup() to create a dummy group and cgroup_set_uid_gid() and cgroup_set_permissions() to set its permissions. Use NO_UID_GID instead of GID/UID and NO_PERMS instead of file/directory permissions to let kernel decide the default permissions where you don't want specific user and/or permissions. Kernel then uses current user/group and permissions from umask then.

+

Sets default permissions of groups created by subsequent cgroup_config_load_config() calls. If a config file contains a 'default {}' section, the default permissions from the config file is then used.

+

Use cgroup_new_cgroup() to create a dummy group and cgroup_set_uid_gid() and cgroup_set_permissions() to set its permissions. Use NO_UID_GID instead of GID/UID and NO_PERMS instead of file/directory permissions to let kernel decide the default permissions where you don't want specific user and/or permissions. Kernel then uses current user/group and permissions from umask then.

Parameters
@@ -187,7 +187,7 @@ $(function() { - +

◆ cgroup_config_unload_config()

@@ -212,9 +212,9 @@ $(function() {
new_defaultNew default permissions from this group are copied to libcgroup internal structures. I.e., this group can be freed immediatelly after this function returns.
-

Delete all cgroups and unmount all mount points defined in specified config file.

-

The groups are either removed recursively or only the empty ones, based on given flags. Mount point are always umounted only if they are empty, regardless of any flags.

-

The groups are sorted before they are removed, so the removal of empty ones actually works (i.e. subgroups are removed first).

+

Delete all cgroups and unmount all mount points defined in specified config file.

+

The groups are either removed recursively or only the empty ones, based on given flags. Mount point are always umounted only if they are empty, regardless of any flags.

+

The groups are sorted before they are removed, so the removal of empty ones actually works (i.e. subgroups are removed first).

Parameters
@@ -225,7 +225,7 @@ $(function() { - +

◆ cgroup_init_templates_cache()

@@ -240,12 +240,12 @@ $(function() {
pathnameName of the configuration file to unload.
-

Initializes the templates cache and load it from file pathname.

-

Initializes the templates cache.

Returns
0 on success, > 0 on error
+

Initializes the templates cache and load it from file pathname.

+

Initializes the templates cache.

Returns
0 on success, > 0 on error
- +

◆ cgroup_load_templates_cache_from_files()

@@ -260,7 +260,7 @@ $(function() {
-

Load the templates cache from files. Before calling this function, cgroup_templates_cache_set_source_files has to be called first.

Parameters
+

Load the templates cache from files. Before calling this function, cgroup_templates_cache_set_source_files has to be called first.

Parameters
file_indexindex of file which was unable to be parsed
@@ -270,7 +270,7 @@ $(function() {
- +

◆ cgroup_reload_cached_templates()

@@ -285,12 +285,12 @@ $(function() {
-

Reloads the templates list from file pathname.

-

Reloads the templates list, using the given configuration file.

Returns
0 on success, > 0 on failure
+

Reloads the templates list from file pathname.

+

Reloads the templates list, using the given configuration file.

Returns
0 on success, > 0 on failure
- +

◆ cgroup_templates_cache_set_source_files()

@@ -305,7 +305,7 @@ $(function() {
-

Setting source files of templates. This function has to be called before any call of cgroup_load_templates_cache_from_files.

Parameters
+

Setting source files of templates. This function has to be called before any call of cgroup_load_templates_cache_from_files.

Parameters
tmpl_files
@@ -314,7 +314,7 @@ $(function() {
- +

◆ cgroup_unload_cgroups()

@@ -329,14 +329,14 @@ $(function() {
-

Delete all control groups and unmount all hierarchies.

+

Delete all control groups and unmount all hierarchies.

diff --git a/group__group__errors.html b/group__group__errors.html index 543dcddc..e25f67f0 100644 --- a/group__group__errors.html +++ b/group__group__errors.html @@ -2,8 +2,8 @@ - - + + libcgroup: 6. Error handling @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -61,14 +62,13 @@ $(function() {
-
-
6. Error handling
+
6. Error handling
- - - + + @@ -121,7 +121,7 @@ $(function() {

Error handling

Unless states otherwise in documentation of a function, all functions return int, which is zero (0) when the function succeeds, and positive number if the function fails.

-

The returned integer is one of the ECG* values described below. Value ECGOTHER means that the error was caused by underlying OS and the real cause can be found by calling cgroup_get_last_errno().

+

Unless states otherwise in documentation of a function, all functions return int, which is zero (0) when the function succeeds, and positive number if the function fails.

+

The returned integer is one of the ECG* values described below. Value ECGOTHER means that the error was caused by underlying OS and the real cause can be found by calling cgroup_get_last_errno().

enum  {
  ECGROUPNOTCOMPILED = 50000 @@ -112,8 +112,8 @@ $(function() {
}
 
const char * cgroup_strerror (int code)
 
const char * cgroup_strerror (int code)
 
int cgroup_get_last_errno (void)
 
#define ECGRULESPARSEFAIL   ECGROUPPARSEFAIL

Detailed Description

Macro Definition Documentation

- +

◆ ECGRULESPARSEFAIL

@@ -132,12 +132,12 @@ $(function() {
-

Legacy definition of ECGRULESPARSEFAIL error code.

+

Legacy definition of ECGRULESPARSEFAIL error code.

Enumeration Type Documentation

- +

◆ anonymous enum

@@ -149,28 +149,28 @@ $(function() {
- - - - - - - -
Enumerator
ECGROUPMULTIMOUNTED 

Controllers bound to different mount points

+
Enumerator
ECGROUPMULTIMOUNTED 

Controllers bound to different mount points

ECGOTHER 

Represents error coming from other libraries like glibc. libcgroup users need to check cgroup_get_last_errno() upon encountering this error.

+
ECGOTHER 

Represents error coming from other libraries like glibc. libcgroup users need to check cgroup_get_last_errno() upon encountering this error.

ECGROUPPARSEFAIL 

Failed to parse rules configuration file.

+
ECGROUPPARSEFAIL 

Failed to parse rules configuration file.

ECGROUPNORULES 

Rules list does not exist.

+
ECGROUPNORULES 

Rules list does not exist.

ECGEOF 

Not an real error, it just indicates that iterator has come to end of sequence and no more items are left.

+
ECGEOF 

Not an real error, it just indicates that iterator has come to end of sequence and no more items are left.

ECGCONFIGPARSEFAIL 

Failed to parse config file (cgconfig.conf).

+
ECGCONFIGPARSEFAIL 

Failed to parse config file (cgconfig.conf).

ECGNONEMPTY 

Removing of a group failed because it was not empty.

+
ECGNONEMPTY 

Removing of a group failed because it was not empty.

ECGNOVERSIONCONVERT 

Failed to convert from cgroup v1 to/from cgroup v2

+
ECGNOVERSIONCONVERT 

Failed to convert from cgroup v1 to/from cgroup v2

Function Documentation

- +

◆ cgroup_get_last_errno()

@@ -185,18 +185,18 @@ $(function() {
-

Return last errno, which caused ECGOTHER error.

+

Return last errno, which caused ECGOTHER error.

- -

◆ cgroup_strerror()

+ +

◆ cgroup_strerror()

- + @@ -204,7 +204,7 @@ $(function() {
const char* cgroup_strerror const char * cgroup_strerror ( int  code)
-

Format error code to a human-readable English string. No internationalization is currently done. Returned pointer leads to libcgroup memory and must not be freed nor modified. The memory is rewritten by subsequent call to this function.

Parameters
+

Format error code to a human-readable English string. No internationalization is currently done. Returned pointer leads to libcgroup memory and must not be freed nor modified. The memory is rewritten by subsequent call to this function.

Parameters
codeError code for which the corresponding error string is returned. When ECGOTHER is used, text with glibc's description of cgroup_get_last_errno() value is returned.
@@ -216,7 +216,7 @@ $(function() {
diff --git a/group__group__groups.html b/group__group__groups.html index e2dcf4ad..029f29a8 100644 --- a/group__group__groups.html +++ b/group__group__groups.html @@ -2,8 +2,8 @@ - - + + libcgroup: 2. Group manipulation API @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -63,12 +64,11 @@ $(function() {
-
-
2. Group manipulation API
+
2. Group manipulation API
- @@ -76,36 +76,36 @@ Data Structures

+

Data Structures

struct  cgroup
 
 
- - - - - + + + + - - + + @@ -116,7 +116,7 @@ Data Structures

Basic infrastructure

struct cgroup* is the heart of libcgroup API. The structure is opaque to applications, all access to the structure is through appropriate functions.

-

The most important information is that one struct cgroup* can represent zero, one or more real control groups in kernel. The struct cgroup* is identified by name of the group, which must be set by cgroup_new_cgroup(). Multiple controllers (aka subsystems) can be attached to one struct cgroup* using cgroup_add_controller(). These controllers can belong to different hierarchies.

-

This approach is different to the one in the Linux kernel - a control group must be part of exactly one hierarchy there. In libcgroup, a group can be part of multiple hierarchies, as long as the group name is the same.

+

struct cgroup* is the heart of libcgroup API. The structure is opaque to applications, all access to the structure is through appropriate functions.

+

The most important information is that one struct cgroup* can represent zero, one or more real control groups in kernel. The struct cgroup* is identified by name of the group, which must be set by cgroup_new_cgroup(). Multiple controllers (aka subsystems) can be attached to one struct cgroup* using cgroup_add_controller(). These controllers can belong to different hierarchies.

+

This approach is different to the one in the Linux kernel - a control group must be part of exactly one hierarchy there. In libcgroup, a group can be part of multiple hierarchies, as long as the group name is the same.

Example:
Let there be following control groups:
cpu,cpuacct:/
cpu,cpuacct:/foo
cpu,cpuacct:/bar
freezer:/
freezer:/foo
I.e. there is cpu and cpuacct controller mounted together in one hierarchy, with foo and bar groups. In addition, freezer is mounted as separate hierarchy, with only one foo group.
-
Following code creates struct cgroup* structure, which represents one group cpu,cpuacct:/foo:
struct cgroup *foo = cgroup_new_cgroup("foo");
- -
struct cgroup * cgroup_new_cgroup(const char *name)
Definition: wrapper.c:44
-
struct cgroup_controller * cgroup_add_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:56
+
Following code creates struct cgroup* structure, which represents one group cpu,cpuacct:/foo:
struct cgroup *foo = cgroup_new_cgroup("foo");
+ +
struct cgroup_controller * cgroup_add_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:56
+
struct cgroup * cgroup_new_cgroup(const char *name)
Definition: wrapper.c:44
Definition: libcgroup-internal.h:114
Now, you can call e.g. cgroup_delete_cgroup() and the group is deleted from the hierarchy. You can note that it's enough to add only one controller to the group to fully identify a group in cpu,cpuacct hierarchy.
-
Following code creates struct cgroup* structure, which represents two groups, cpu,cpuacct:/foo and freezer:/foo:
struct cgroup *foo = cgroup_new_cgroup("foo");
- -
cgroup_add_controller(foo, "freezer");
+
Following code creates struct cgroup* structure, which represents two groups, cpu,cpuacct:/foo and freezer:/foo:
struct cgroup *foo = cgroup_new_cgroup("foo");
+ +
cgroup_add_controller(foo, "freezer");
Now, if you call e.g. cgroup_delete_cgroup(), the group gets deleted from both hierarchies.
Todo:
add some propaganda what's so great on this approach... I personally think it is broken and confusing (see TODOs below).
-

Following functions are provided to create/destroy various libcgroup structures. Please note that none of these functions actually create or delete a cgroup in kernel!

+

Following functions are provided to create/destroy various libcgroup structures. Please note that none of these functions actually create or delete a cgroup in kernel!

struct cgroupcgroup_new_cgroup (const char *name)
 
struct cgroup_controllercgroup_add_controller (struct cgroup *cgroup, const char *name)
 
struct cgroupcgroup_new_cgroup (const char *name)
 
struct cgroup_controllercgroup_add_controller (struct cgroup *cgroup, const char *name)
 
int cgroup_add_all_controllers (struct cgroup *cgroup)
 
struct cgroup_controllercgroup_get_controller (struct cgroup *cgroup, const char *name)
 
struct cgroup_controllercgroup_get_controller (struct cgroup *cgroup, const char *name)
 
void cgroup_free (struct cgroup **cgroup)
 
void cgroup_free_controllers (struct cgroup *cgroup)
 
- @@ -130,7 +130,7 @@ Data Structures

Group manipulation API

Using following functions you can create and remove control groups and change their parameters.

Note
All access to kernel is through previously mounted cgroup filesystems. libcgroup does not mount/unmount anything for you.
+

Using following functions you can create and remove control groups and change their parameters.

Note
All access to kernel is through previously mounted cgroup filesystems. libcgroup does not mount/unmount anything for you.
int cgroup_create_cgroup (struct cgroup *cgroup, int ignore_ownership)
 
 
- @@ -148,7 +148,7 @@ Data Structures

Other functions

Helper functions to manipulate with control groups.

+

Helper functions to manipulate with control groups.

int cgroup_get_cgroup (struct cgroup *cgroup)
 
 
- @@ -176,15 +176,15 @@ Data Structures - - + + - - - + + @@ -192,7 +192,7 @@ int 

Group parameters

These are functions can read or modify parameter of a group.

Note
All these functions read/write parameters to libcgorup internal structures. Use cgroup_get_cgroup() to load parameters from kernel to these internal structures and cgroup_modify_cgroup() or cgroup_create_cgroup() to write changes to kernel.
+

These are functions can read or modify parameter of a group.

Note
All these functions read/write parameters to libcgorup internal structures. Use cgroup_get_cgroup() to load parameters from kernel to these internal structures and cgroup_modify_cgroup() or cgroup_create_cgroup() to write changes to kernel.
int cgroup_add_value_string (struct cgroup_controller *controller, const char *name, const char *value)
 
 
int cgroup_get_value_name_count (struct cgroup_controller *controller)
 
char * cgroup_get_value_name (struct cgroup_controller *controller, int index)
 
char * cgroup_get_value_name (struct cgroup_controller *controller, int index)
 
int cgroup_get_procs (char *name, char *controller, pid_t **pids, int *size)
 
int cg_chmod_recursive (struct cgroup *cgroup, mode_t dir_mode, int dirm_change, mode_t file_mode, int filem_change)
 
char * cgroup_get_cgroup_name (struct cgroup *cgroup)
 
+
char * cgroup_get_cgroup_name (struct cgroup *cgroup)
 
int cgroup_convert_cgroup (struct cgroup *const out_cgroup, enum cg_version_t out_version, const struct cgroup *const in_cgroup, enum cg_version_t in_version)
 
int cgroup_get_controller_version (const char *const controller, enum cg_version_t *const version)
cgroup_convert_cgroup<

Detailed Description

Macro Definition Documentation

- +

◆ NO_PERMS

@@ -203,11 +203,11 @@ int cgroup_convert_cgroup<
-

Uninitialized file/directory permissions used for task/control files.

+

Uninitialized file/directory permissions used for task/control files.

- +

◆ NO_UID_GID

@@ -218,12 +218,12 @@ int cgroup_convert_cgroup<
-

Uninitialized UID/GID used for task/control files.

+

Uninitialized UID/GID used for task/control files.

Function Documentation

- +

◆ cg_chmod_recursive()

@@ -266,7 +266,7 @@ int cgroup_convert_cgroup<
-

Change permission of files and directories of given group

Parameters
+

Change permission of files and directories of given group

Parameters
@@ -279,7 +279,7 @@ int 
cgroupThe cgroup which permissions should be changed
dir_modeThe permission mode of group directory
cgroup_convert_cgroup< - +

◆ cgroup_add_all_controllers()

@@ -294,7 +294,7 @@ int 
cgroup_convert_cgroup<
-

Attach all mounted controllers to given cgroup. This function just modifies internal libcgroup structure, not the kernel control group.

+

Attach all mounted controllers to given cgroup. This function just modifies internal libcgroup structure, not the kernel control group.

Parameters
@@ -305,14 +305,14 @@ int 
cgroup
cgroup_convert_cgroup< - -

◆ cgroup_add_controller()

+ +

◆ cgroup_add_controller()

- + @@ -330,7 +330,7 @@ int 
struct cgroup_controller* cgroup_add_controller struct cgroup_controller * cgroup_add_controller ( struct cgroup cgroup, cgroup_convert_cgroup<
-

Attach new controller to cgroup. This function just modifies internal libcgroup structure, not the kernel control group.

+

Attach new controller to cgroup. This function just modifies internal libcgroup structure, not the kernel control group.

Parameters
@@ -342,7 +342,7 @@ int 
cgroup
cgroup_convert_cgroup< - +

◆ cgroup_add_value_bool()

@@ -373,7 +373,7 @@ int 
cgroup_convert_cgroup<
-

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -385,7 +385,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_add_value_int64()

@@ -416,7 +416,7 @@ int 
cgroup_convert_cgroup<
-

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. Content of the value is copied to internal structures and is not needed after return from the function.

+

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. Content of the value is copied to internal structures and is not needed after return from the function.

Parameters
@@ -428,7 +428,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_add_value_string()

@@ -459,7 +459,7 @@ int 
cgroup_convert_cgroup<
-

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -471,7 +471,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_add_value_uint64()

@@ -502,7 +502,7 @@ int 
cgroup_convert_cgroup<
-

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Add parameter and its value to internal libcgroup structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -514,7 +514,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_compare_cgroup()

@@ -539,7 +539,7 @@ int 
cgroup_convert_cgroup<
-

Compare names, owners, controllers, parameters and values of two groups.

+

Compare names, owners, controllers, parameters and values of two groups.

Parameters
@@ -558,7 +558,7 @@ int 
cgroup_a
cgroup_convert_cgroup< - +

◆ cgroup_compare_controllers()

@@ -583,7 +583,7 @@ int 
cgroup_convert_cgroup<
-

Compare names, parameters and values of two controllers.

+

Compare names, parameters and values of two controllers.

Parameters
@@ -601,7 +601,7 @@ int 
cgca
cgroup_convert_cgroup< - +

◆ cgroup_copy_cgroup()

@@ -626,7 +626,7 @@ int 
cgroup_convert_cgroup<
-

Copy all controllers, their parameters and values. Group name, permissions and ownerships are not coppied. All existing controllers in the source group are discarded.

+

Copy all controllers, their parameters and values. Group name, permissions and ownerships are not coppied. All existing controllers in the source group are discarded.

Parameters
@@ -635,11 +635,11 @@ int 
dstDestination group.
cgroup_convert_cgroup<

@dst: Destination control group @src: Source from which values will be copied to dst

-

Create a duplicate copy of src in dst. This will be useful for those who that intend to create new instances based on an existing control group

+

Create a duplicate copy of src in dst. This will be useful for those who that intend to create new instances based on an existing control group

- +

◆ cgroup_create_cgroup()

@@ -664,7 +664,7 @@ int 
cgroup_convert_cgroup<
-

Physically create a control group in kernel. The group is created in all hierarchies, which cover controllers added by cgroup_add_controller(). All parameters set by cgroup_add_value_* functions are written. The created groups has owner which was set by cgroup_set_uid_gid() and permissions set by cgroup_set_permissions.

Parameters
+

Physically create a control group in kernel. The group is created in all hierarchies, which cover controllers added by cgroup_add_controller(). All parameters set by cgroup_add_value_* functions are written. The created groups has owner which was set by cgroup_set_uid_gid() and permissions set by cgroup_set_permissions.

Parameters
@@ -679,11 +679,11 @@ int 
cgroup
ignore_ownershipWhen nozero, all errors are ignored when setting owner of the group and/or its tasks file.
cgroup_convert_cgroup<

cgroup_create_cgroup creates a new control group. struct cgroup *cgroup: The control group to be created

-

returns 0 on success. We recommend calling cg_delete_cgroup if this routine fails. That should do the cleanup operation. If ECGCANTSETVALUE is returned, the group was created successfully but not all controller parameters were successfully set.

+

returns 0 on success. We recommend calling cg_delete_cgroup if this routine fails. That should do the cleanup operation. If ECGCANTSETVALUE is returned, the group was created successfully but not all controller parameters were successfully set.

- +

◆ cgroup_create_cgroup_from_parent()

@@ -708,10 +708,10 @@ int 
cgroup_convert_cgroup<
-

Physically create new control group in kernel, with all parameters and values copied from its parent group. The group is created in all hierarchies, where the parent group exists. I.e. following code creates subgroup in all hierarchies, because all of them have root (=parent) group.

struct cgroup *foo = cgroup_new_cgroup("foo");
- +

Physically create new control group in kernel, with all parameters and values copied from its parent group. The group is created in all hierarchies, where the parent group exists. I.e. following code creates subgroup in all hierarchies, because all of them have root (=parent) group.

struct cgroup *foo = cgroup_new_cgroup("foo");
+
int cgroup_create_cgroup_from_parent(struct cgroup *cgroup, int ignore_ownership)
Definition: api.c:2669
-
Todo:
what is this good for? Why the list of controllers added by cgroup_add_controller() is not used, like in cgroup_create_cgroup()? I can't crate subgroup of root group in just one hierarchy with this function!
+
Todo:
what is this good for? Why the list of controllers added by cgroup_add_controller() is not used, like in cgroup_create_cgroup()? I can't crate subgroup of root group in just one hierarchy with this function!
Parameters
@@ -730,7 +730,7 @@ int 
cgroupThe cgroup to create. Only it's name is used, everything else is discarded.
cgroup_convert_cgroup< - +

◆ cgroup_delete_cgroup()

@@ -755,8 +755,8 @@ int 
cgroup_convert_cgroup<
-

Physically remove a control group from kernel. The group is removed from all hierarchies, which cover controllers added by cgroup_add_controller() or cgroup_get_cgroup(). All tasks inside the group are automatically moved to parent group.

-

The group being removed must be empty, i.e. without subgroups. Use cgroup_delete_cgroup_ext() for recursive delete.

+

Physically remove a control group from kernel. The group is removed from all hierarchies, which cover controllers added by cgroup_add_controller() or cgroup_get_cgroup(). All tasks inside the group are automatically moved to parent group.

+

The group being removed must be empty, i.e. without subgroups. Use cgroup_delete_cgroup_ext() for recursive delete.

Parameters
@@ -765,12 +765,12 @@ int 
cgroup
cgroup_convert_cgroup<
Todo:
what is ignore_migration good for? rmdir() will fail if tasks were not moved.
-

cgroup_delete cgroup deletes a control group. struct cgroup *cgroup takes the group which is to be deleted.

-

returns 0 on success.

+

cgroup_delete cgroup deletes a control group. struct cgroup *cgroup takes the group which is to be deleted.

+

returns 0 on success.

- +

◆ cgroup_delete_cgroup_ext()

@@ -795,7 +795,7 @@ int 
cgroup_convert_cgroup<
-

Physically remove a control group from kernel. All tasks are automatically moved to parent group. If #CGFLAG_DELETE_IGNORE_MIGRATION flag is used, the errors that occurred during the task movement are ignored. #CGFLAG_DELETE_RECURSIVE flag specifies that all subgroups should be removed too. If root group is being removed with this flag specified, all subgroups are removed but the root group itself is left undeleted.

See also
cgroup_delete_flag.
+

Physically remove a control group from kernel. All tasks are automatically moved to parent group. If #CGFLAG_DELETE_IGNORE_MIGRATION flag is used, the errors that occurred during the task movement are ignored. #CGFLAG_DELETE_RECURSIVE flag specifies that all subgroups should be removed too. If root group is being removed with this flag specified, all subgroups are removed but the root group itself is left undeleted.

See also
cgroup_delete_flag.
Parameters
@@ -806,7 +806,7 @@ int 
cgroup
cgroup_convert_cgroup< - +

◆ cgroup_free()

@@ -821,7 +821,7 @@ int 
cgroup_convert_cgroup<
-

Free internal cgroup structure. This function frees also all controllers attached to the cgroup, including all parameters and their values.

Parameters
+

Free internal cgroup structure. This function frees also all controllers attached to the cgroup, including all parameters and their values.

Parameters
cgroup
@@ -830,7 +830,7 @@ int 
cgroup_convert_cgroup< - +

◆ cgroup_free_controllers()

@@ -845,7 +845,7 @@ int 
cgroup_convert_cgroup<
-

Free internal list of controllers from the group.

Todo:
should this function be public???
+

Free internal list of controllers from the group.

Todo:
should this function be public???
Parameters
@@ -855,7 +855,7 @@ int 
cgroup
cgroup_convert_cgroup< - +

◆ cgroup_get_cgroup()

@@ -870,10 +870,10 @@ int 
cgroup_convert_cgroup<
-

Read all information regarding the group from kernel. Based on name of the group, list of controllers and all parameters and their values are read from all hierarchies, where a group with given name exists. All existing controllers are replaced. I.e. following code will fill root with controllers from all hierarchies, because the root group is available in all of them.

struct cgroup *root = cgroup_new_cgroup("/");
- +

Read all information regarding the group from kernel. Based on name of the group, list of controllers and all parameters and their values are read from all hierarchies, where a group with given name exists. All existing controllers are replaced. I.e. following code will fill root with controllers from all hierarchies, because the root group is available in all of them.

struct cgroup *root = cgroup_new_cgroup("/");
+
int cgroup_get_cgroup(struct cgroup *cgroup)
Definition: api.c:3222
-
Todo:
what is this function good for? Why is not considered only the list of controllers attached by cgroup_add_controller()? What owners will return cgroup_get_uid_gid() if the group is in multiple hierarchies, each with different owner of tasks file?
+
Todo:
what is this function good for? Why is not considered only the list of controllers attached by cgroup_add_controller()? What owners will return cgroup_get_uid_gid() if the group is in multiple hierarchies, each with different owner of tasks file?
Parameters
@@ -883,14 +883,14 @@ int 
cgroupThe cgroup to load. Only it's name is used, everything else is replaced.
cgroup_convert_cgroup< - -

◆ cgroup_get_cgroup_name()

+ +

◆ cgroup_get_cgroup_name()

- + @@ -898,7 +898,7 @@ int 
char* cgroup_get_cgroup_name char * cgroup_get_cgroup_name ( struct cgroup cgroup)cgroup_convert_cgroup<
-

Get the name of the cgroup from a given cgroup

Parameters
+

Get the name of the cgroup from a given cgroup

Parameters
cgroupThe cgroup whose name is needed
@@ -907,14 +907,14 @@ int 
cgroup_convert_cgroup< - -

◆ cgroup_get_controller()

+ +

◆ cgroup_get_controller()

- + @@ -932,7 +932,7 @@ int 
struct cgroup_controller* cgroup_get_controller struct cgroup_controller * cgroup_get_controller ( struct cgroup cgroup, cgroup_convert_cgroup<
-

Return appropriate controller from given group. The controller must be added before using cgroup_add_controller() or loaded from kernel using cgroup_get_cgroup().

Parameters
+

Return appropriate controller from given group. The controller must be added before using cgroup_add_controller() or loaded from kernel using cgroup_get_cgroup().

Parameters
@@ -942,7 +942,7 @@ int 
cgroup
nameName of the controller, e.g. "freezer".
cgroup_convert_cgroup< - +

◆ cgroup_get_controller_version()

@@ -967,7 +967,7 @@ int 
cgroup_convert_cgroup<
-

Get the cgroup version of a controller. Version is set to CGROUP_UNK if the version cannot be determined.

+

Get the cgroup version of a controller. Version is set to CGROUP_UNK if the version cannot be determined.

Parameters
@@ -978,7 +978,7 @@ int 
controllerThe controller of interest
cgroup_convert_cgroup< - +

◆ cgroup_get_procs()

@@ -1015,7 +1015,7 @@ int 
cgroup_convert_cgroup<
-

Get the list of process in a cgroup. This list is guaranteed to be sorted. It is not necessary that it is unique.

Parameters
+

Get the list of process in a cgroup. This list is guaranteed to be sorted. It is not necessary that it is unique.

Parameters
@@ -1027,7 +1027,7 @@ int 
nameThe name of the cgroup
controllerThe name of the controller
cgroup_convert_cgroup< - +

◆ cgroup_get_uid_gid()

@@ -1070,11 +1070,11 @@ int 
cgroup_convert_cgroup<
-

Return owners of the group's tasks file and control files. The data is read from libcgroup internal cgroup structure, use cgroup_set_uid_gid() or cgroup_get_cgroup() to fill it.

+

Return owners of the group's tasks file and control files. The data is read from libcgroup internal cgroup structure, use cgroup_set_uid_gid() or cgroup_get_cgroup() to fill it.

- +

◆ cgroup_get_value_bool()

@@ -1105,7 +1105,7 @@ int 
cgroup_convert_cgroup<
-

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

+

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

Parameters
@@ -1117,7 +1117,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_get_value_int64()

@@ -1148,7 +1148,7 @@ int 
cgroup_convert_cgroup<
-

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

+

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

Parameters
@@ -1160,14 +1160,14 @@ int 
controller
cgroup_convert_cgroup< - -

◆ cgroup_get_value_name()

+ +

◆ cgroup_get_value_name()

- + @@ -1185,7 +1185,7 @@ int 
char* cgroup_get_value_name char * cgroup_get_value_name ( struct cgroup_controller controller, cgroup_convert_cgroup<
-

Return the name of parameter of controller at given index. The index goes from 0 to cgroup_get_value_name_count()-1. Use this function to list all parameter of the controller.

+

Return the name of parameter of controller at given index. The index goes from 0 to cgroup_get_value_name_count()-1. Use this function to list all parameter of the controller.

Note
The returned value is pointer to internal libcgroup structure, do not free it.
Parameters
@@ -1198,7 +1198,7 @@ int 
cgroup_convert_cgroup< - +

◆ cgroup_get_value_name_count()

@@ -1213,7 +1213,7 @@ int 
cgroup_convert_cgroup<
-

Return the number of variables for the specified controller in libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel. Use this function together with cgroup_get_value_name() to list all parameters of a group.

+

Return the number of variables for the specified controller in libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel. Use this function together with cgroup_get_value_name() to list all parameters of a group.

Parameters
@@ -1224,7 +1224,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_get_value_string()

@@ -1255,8 +1255,8 @@ int 
cgroup_convert_cgroup<
-

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel. It's up to the caller to free returned value.

-

This function works only for 'short' parameters. Use cgroup_read_stats_begin(), cgroup_read_stats_next() and cgroup_read_stats_end() to read stats parameter, which can be longer than libcgroup's internal buffers.

Todo:
rephrase, it's too vague... How big is the buffer actually?
+

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel. It's up to the caller to free returned value.

+

This function works only for 'short' parameters. Use cgroup_read_stats_begin(), cgroup_read_stats_next() and cgroup_read_stats_end() to read stats parameter, which can be longer than libcgroup's internal buffers.

Todo:
rephrase, it's too vague... How big is the buffer actually?
Parameters
@@ -1268,7 +1268,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_get_value_uint64()

@@ -1299,7 +1299,7 @@ int 
cgroup_convert_cgroup<
-

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

+

Read a parameter value from libcgroup internal structures. Use cgroup_get_cgroup() to fill these structures with data from kernel.

Parameters
@@ -1311,7 +1311,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_modify_cgroup()

@@ -1326,26 +1326,27 @@ int 
cgroup_convert_cgroup<
-

Physically modify a control group in kernel. All parameters added by cgroup_add_value_ or cgroup_set_value_ are written. Currently it's not possible to change and owner of a group.

+

Physically modify a control group in kernel. All parameters added by cgroup_add_value_ or cgroup_set_value_ are written. Currently it's not possible to change and owner of a group.

Parameters
- +
cgroupcgroup_modify_cgroup modifies the cgroup control files. struct cgroup *cgroup: The name will be the cgroup to be modified. The values will be the values to be modified, those not mentioned in the structure will not be modified.
cgroup
-

The uids cannot be modified yet.

-

returns 0 on success.

+

cgroup_modify_cgroup modifies the cgroup control files. struct cgroup *cgroup: The name will be the cgroup to be modified. The values will be the values to be modified, those not mentioned in the structure will not be modified.

+

The uids cannot be modified yet.

+

returns 0 on success.

- -

◆ cgroup_new_cgroup()

+ +

◆ cgroup_new_cgroup()

- + @@ -1353,7 +1354,7 @@ int 
struct cgroup* cgroup_new_cgroup struct cgroup * cgroup_new_cgroup ( const char *  name)cgroup_convert_cgroup<
-

Allocate new cgroup structure. This function itself does not create new control group in kernel, only new struct cgroup inside libcgroup!

+

Allocate new cgroup structure. This function itself does not create new control group in kernel, only new struct cgroup inside libcgroup!

Parameters
@@ -1365,7 +1366,7 @@ int 
namePath to the group, relative from root group. Use "/" or "." for the root group itself and "/foo/bar/baz" or "foo/bar/baz" for subgroups.
cgroup_convert_cgroup< - +

◆ cgroup_set_permissions()

@@ -1402,7 +1403,7 @@ int 
cgroup_convert_cgroup<
-

Stores given file permissions of the group's control and tasks files into the cgroup data structure. Use NO_PERMS if permissions shouldn't be changed or a value which applicable to chmod(2). Please note that the given permissions are masked with the file owner's permissions. For example if a control file has permissions 640 and control_fperm is 471 the result will be 460.

Parameters
+

Stores given file permissions of the group's control and tasks files into the cgroup data structure. Use NO_PERMS if permissions shouldn't be changed or a value which applicable to chmod(2). Please note that the given permissions are masked with the file owner's permissions. For example if a control file has permissions 640 and control_fperm is 471 the result will be 460.

Parameters
@@ -1414,7 +1415,7 @@ int 
cgroup
control_dpermDirectory permission for the group.
cgroup_convert_cgroup< - +

◆ cgroup_set_uid_gid()

@@ -1457,7 +1458,7 @@ int 
cgroup_convert_cgroup<
-

Set owner of the group control files and the tasks file. This function modifies only libcgroup internal cgroup structure, use cgroup_create_cgroup() afterwards to create the group with given owners.

+

Set owner of the group control files and the tasks file. This function modifies only libcgroup internal cgroup structure, use cgroup_create_cgroup() afterwards to create the group with given owners.

Parameters
@@ -1471,7 +1472,7 @@ int 
cgroup
cgroup_convert_cgroup< - +

◆ cgroup_set_value_bool()

@@ -1502,7 +1503,7 @@ int 
cgroup_convert_cgroup<
-

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -1514,7 +1515,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_set_value_int64()

@@ -1545,7 +1546,7 @@ int 
cgroup_convert_cgroup<
-

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. Content of the value is copied to internal structures and is not needed after return from the function.

+

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. Content of the value is copied to internal structures and is not needed after return from the function.

Parameters
@@ -1557,7 +1558,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_set_value_string()

@@ -1588,7 +1589,7 @@ int 
cgroup_convert_cgroup<
-

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -1600,7 +1601,7 @@ int 
controller
cgroup_convert_cgroup< - +

◆ cgroup_set_value_uint64()

@@ -1631,7 +1632,7 @@ int 
cgroup_convert_cgroup<
-

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

+

Set a parameter value in libcgroup internal structures. Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel.

Parameters
@@ -1646,7 +1647,7 @@ int 
// process the item here
ret = iterator_name_begin(&handle, &item);
}
-
if (ret != ECGEOF) {
+
if (ret != ECGEOF) {
// process the error here
}
iterator_name_end(&handle);
@@ -196,7 +196,7 @@ Data Structures

Macro Definition Documentation

- +

◆ CG_VALUE_MAX

@@ -207,12 +207,12 @@ Data Structures
controller
cgroup_convert_cgroup< diff --git a/group__group__iterators.html b/group__group__iterators.html index 89387530..92c5fe9b 100644 --- a/group__group__iterators.html +++ b/group__group__iterators.html @@ -2,8 +2,8 @@ - - + + libcgroup: 3. Iterators @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -63,12 +64,11 @@ $(function() {
-
-
3. Iterators
+
3. Iterators
- @@ -80,7 +80,7 @@ Data Structures

+

Data Structures

struct  cgroup_file_info
 
 
-

Walk through control group filesystem

This iterator returns all subgroups of given control group. It can be used to return all groups in given hierarchy, when root control group is provided.

+

This iterator returns all subgroups of given control group. It can be used to return all groups in given hierarchy, when root control group is provided.

enum  cgroup_walk_type { CGROUP_WALK_TYPE_PRE_DIR = 0x1 , CGROUP_WALK_TYPE_POST_DIR = 0x2 @@ -107,7 +107,7 @@ Data Structures
 
- @@ -119,7 +119,7 @@ Data Structures

Read group stats

libcgroup's cgroup_get_value_string() reads only relatively short parametrs of a group. Use following functions to read stats parameter, which can be quite long.

+

libcgroup's cgroup_get_value_string() reads only relatively short parametrs of a group. Use following functions to read stats parameter, which can be quite long.

int cgroup_read_stats_begin (const char *controller, const char *path, void **handle, struct cgroup_stat *stat)
 
 
- @@ -129,7 +129,7 @@ Data Structures

List all tasks in a group

Use following functions to read tasks file of a group.

+

Use following functions to read tasks file of a group.

int cgroup_get_task_begin (const char *cgroup, const char *controller, void **handle, pid_t *pid)
 
 
- @@ -139,7 +139,7 @@ Data Structures

List mounted controllers

Use following function to list mounted controllers and to see, how they are mounted together in hierarchies. Use cgroup_get_all_controller_begin() (see later) to list all controllers, including those which are not mounted.

+

Use following function to list mounted controllers and to see, how they are mounted together in hierarchies. Use cgroup_get_all_controller_begin() (see later) to list all controllers, including those which are not mounted.

int cgroup_get_controller_begin (void **handle, struct cgroup_mount_point *info)
 
 
- @@ -149,7 +149,7 @@ Data Structures

List all controllers

Use following functions to list all controllers, including those which are not mounted. The controllers are returned in the same order as in /proc/cgroups file, i.e. mostly random.

+

Use following functions to list all controllers, including those which are not mounted. The controllers are returned in the same order as in /proc/cgroups file, i.e. mostly random.

int cgroup_get_all_controller_begin (void **handle, struct controller_data *info)
 
 
- @@ -159,7 +159,7 @@ Data Structures

List all mount points of a controller.

Use following functions to list all mount points of a hierarchy with given controller.

+

Use following functions to list all mount points of a hierarchy with given controller.

int cgroup_get_subsys_mount_point_begin (const char *controller, void **handle, char *path)
 
 

Detailed Description

-

So-called iterators are a code pattern to retrieve various data from libcgroup in distinct chunks, for example when an application needs to read list of groups in a hierarchy, it uses iterator to get one group at a time. Iterator is opaque to the application, the application sees only void* handle pointer, which is managed internally by libcgroup. Each iterator provides at least these functions:

    +

    So-called iterators are a code pattern to retrieve various data from libcgroup in distinct chunks, for example when an application needs to read list of groups in a hierarchy, it uses iterator to get one group at a time. Iterator is opaque to the application, the application sees only void* handle pointer, which is managed internally by libcgroup. Each iterator provides at least these functions:

    • int iterator_name_begin(void **handle, my_type *item)
      • Initialize the iterator, store pointer to it into the handle.
      • Return the first element in the iterator, let's say it's my_type.
      • @@ -187,7 +187,7 @@ Data Structures
-

Maximum length of a value in stats file.

+

Maximum length of a value in stats file.

Enumeration Type Documentation

- +

◆ cgroup_file_type

@@ -223,19 +223,19 @@ Data Structures
-

Type of returned entity.

+

Type of returned entity.

- - -
Enumerator
CGROUP_FILE_TYPE_FILE 

File.

+
Enumerator
CGROUP_FILE_TYPE_FILE 

File.

CGROUP_FILE_TYPE_DIR 

Directory.

+
CGROUP_FILE_TYPE_DIR 

Directory.

CGROUP_FILE_TYPE_OTHER 

Directory.

Todo:
really?
+
CGROUP_FILE_TYPE_OTHER 

Directory.

Todo:
really?
- +

◆ cgroup_walk_type

@@ -246,15 +246,15 @@ Data Structures
-

Type of the walk.

+

Type of the walk.

- -

Function Documentation

- +

◆ cgroup_get_all_controller_begin()

@@ -290,7 +290,7 @@ Data Structures
Enumerator
CGROUP_WALK_TYPE_PRE_DIR 

Pre-order directory walk, return a directory first and then its subdirectories. E.g. directories would be returned in this order:

/
+
Enumerator
CGROUP_WALK_TYPE_PRE_DIR 

Pre-order directory walk, return a directory first and then its subdirectories. E.g. directories would be returned in this order:

/
/group
/group/subgroup1
/group/subgroup1/subsubgroup
/group/subgroup2
CGROUP_WALK_TYPE_POST_DIR 

Post-order directory walk, return subdirectories of a directory first and then the directory itself. E.g. directories would be returned in this order:

/group/subgroup1/subsubgroup
+
CGROUP_WALK_TYPE_POST_DIR 

Post-order directory walk, return subdirectories of a directory first and then the directory itself. E.g. directories would be returned in this order:

/group/subgroup1/subsubgroup
/group/subgroup1
/group/subgroup2
/group
@@ -265,7 +265,7 @@ Data Structures
-

Read the first of controllers from /proc/cgroups.

Parameters
+

Read the first of controllers from /proc/cgroups.

Parameters
@@ -300,7 +300,7 @@ Data Structures - +

◆ cgroup_get_all_controller_end()

@@ -315,11 +315,11 @@ Data Structures
handleHandle to be used for iteration.
infoThe structure which will be filled with controller data.
-

Release the iterator

+

Release the iterator

- +

◆ cgroup_get_all_controller_next()

@@ -344,7 +344,7 @@ Data Structures
-

Read next controllers from /proc/cgroups.

Parameters
+

Read next controllers from /proc/cgroups.

Parameters
@@ -354,7 +354,7 @@ Data Structures - +

◆ cgroup_get_controller_begin()

@@ -379,7 +379,7 @@ Data Structures
handleHandle to be used for iteration.
infoThe structure which will be filled with controller data.
-

Read the mount table to give a list where each controller is mounted.

Parameters
+

Read the mount table to give a list where each controller is mounted.

Parameters
@@ -390,7 +390,7 @@ Data Structures - +

◆ cgroup_get_controller_end()

@@ -405,11 +405,11 @@ Data Structures
handleHandle to be used for iteration.
infoThe variable where the path to the controller is stored.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_get_controller_next()

@@ -434,7 +434,7 @@ Data Structures
-

Read the next mounted controller. While walking through the mount table, the controllers are returned in order of their mount points, i.e. controllers mounted together in one hierarchy are returned next to each other.

Parameters
+

Read the next mounted controller. While walking through the mount table, the controllers are returned in order of their mount points, i.e. controllers mounted together in one hierarchy are returned next to each other.

Parameters
@@ -445,7 +445,7 @@ Data Structures - +

◆ cgroup_get_subsys_mount_point_begin()

@@ -476,7 +476,7 @@ Data Structures
handleHandle to be used for iteration.
infoThe variable where the path to the controller is stored.
-

Read the first mount point of the hierarchy with given controller. The first is the same as the mount point returned by cgroup_get_subsys_mount_point().

Parameters
+

Read the first mount point of the hierarchy with given controller. The first is the same as the mount point returned by cgroup_get_subsys_mount_point().

Parameters
@@ -487,7 +487,7 @@ Data Structures - +

◆ cgroup_get_subsys_mount_point_end()

@@ -502,11 +502,11 @@ Data Structures
handleHandle to be used for iteration.
controllerController name.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_get_subsys_mount_point_next()

@@ -531,7 +531,7 @@ Data Structures
-

Read next mount point of the hierarchy with given controller.

Parameters
+

Read next mount point of the hierarchy with given controller.

Parameters
@@ -541,7 +541,7 @@ Data Structures - +

◆ cgroup_get_task_begin()

@@ -578,7 +578,7 @@ Data Structures
handleHandle to be used for iteration.
pathBuffer to fill the path into. The buffer must be at least FILENAME_MAX characters long.
-

Read the tasks file to get the list of tasks in a cgroup.

Parameters
+

Read the tasks file to get the list of tasks in a cgroup.

Parameters
@@ -591,7 +591,7 @@ Data Structures - +

◆ cgroup_get_task_end()

@@ -606,11 +606,11 @@ Data Structures
cgroupName of the cgroup.
controllerName of the cgroup subsystem.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_get_task_next()

@@ -635,7 +635,7 @@ Data Structures
-

Read the next task value.

Parameters
+

Read the next task value.

Parameters
@@ -646,7 +646,7 @@ Data Structures - +

◆ cgroup_read_stats_begin()

@@ -683,7 +683,7 @@ Data Structures
handleThe handle used for iterating.
pidThe variable where the value will be stored.
-

Read the statistics values (= stats parameter) for the specified controller and control group. One line is returned per cgroup_read_stats_begin() and cgroup_read_stats_next() call.

Parameters
+

Read the statistics values (= stats parameter) for the specified controller and control group. One line is returned per cgroup_read_stats_begin() and cgroup_read_stats_next() call.

Parameters
@@ -696,7 +696,7 @@ Data Structures - +

◆ cgroup_read_stats_end()

@@ -711,11 +711,11 @@ Data Structures
controllerName of the controller for which stats are requested.
pathPath to control group, relative to hierarchy root.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_read_stats_next()

@@ -740,7 +740,7 @@ Data Structures
-

Read the next stat value.

Parameters
+

Read the next stat value.

Parameters
@@ -751,7 +751,7 @@ Data Structures - +

◆ cgroup_read_value_begin()

@@ -800,7 +800,7 @@ Data Structures
handleHandle to be used during iteration.
statReturned next item in the stats file.
-

Read the value of the given variable for the specified controller and control group. The value is read up to newline character or at most max-1 characters, whichever comes first (i.e. similar to fgets()).

Parameters
+

Read the value of the given variable for the specified controller and control group. The value is read up to newline character or at most max-1 characters, whichever comes first (i.e. similar to fgets()).

Parameters
@@ -815,7 +815,7 @@ Data Structures - +

◆ cgroup_read_value_end()

@@ -830,11 +830,11 @@ Data Structures
controllerName of the controller for which stats are requested.
pathPath to control group, relative to hierarchy root.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_read_value_next()

@@ -865,7 +865,7 @@ Data Structures
-

Read the next string from the given variable handle which is generated by cgroup_read_stats_begin() function. the value is read up to newline character or at most max-1 characters, whichever comes first (i.e. similar to fgets()) per cgroup_read_stats_next() call

Parameters
+

Read the next string from the given variable handle which is generated by cgroup_read_stats_begin() function. the value is read up to newline character or at most max-1 characters, whichever comes first (i.e. similar to fgets()) per cgroup_read_stats_next() call

Parameters
@@ -878,7 +878,7 @@ Data Structures - +

◆ cgroup_walk_tree_begin()

@@ -927,7 +927,7 @@ Data Structures
handleHandle to be used during iteration.
datareturned the string.
-

Walk through the directory tree for the specified controller. The directory representing base_path is returned in info. Use cgroup_walk_tree_set_flags() to specify, in which order should be next directories returned.

Parameters
+

Walk through the directory tree for the specified controller. The directory representing base_path is returned in info. Use cgroup_walk_tree_set_flags() to specify, in which order should be next directories returned.

Parameters
@@ -943,7 +943,7 @@ Data Structures - +

◆ cgroup_walk_tree_end()

@@ -958,11 +958,11 @@ Data Structures
controllerName of the controller, for which we want to walk the directory tree.
base_pathBegin walking from this path. Use "/" to walk through full hierarchy.
-

Release the iterator.

+

Release the iterator.

- +

◆ cgroup_walk_tree_next()

@@ -999,7 +999,7 @@ Data Structures
-

Get the next directory in the walk.

Parameters
+

Get the next directory in the walk.

Parameters
@@ -1012,7 +1012,7 @@ Data Structures - +

◆ cgroup_walk_tree_set_flags()

@@ -1037,7 +1037,7 @@ Data Structures
depthThe maximum depth to which the function should walk, 0 implies all the way down.
handleHandle to be used during iteration.
-

Set the flags for walk_tree. Currently available flags are in cgroup_walk_type enum.

Parameters
+

Set the flags for walk_tree. Currently available flags are in cgroup_walk_type enum.

Parameters
@@ -1050,7 +1050,7 @@ Data Structures diff --git a/group__group__log.html b/group__group__log.html index 964c77ab..47053fca 100644 --- a/group__group__log.html +++ b/group__group__log.html @@ -2,8 +2,8 @@ - - + +libcgroup: 7. Logging @@ -19,8 +19,8 @@
handleHandle of the iterator.
flags
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -61,13 +62,12 @@ $(function() {
-
-
7. Logging
+
7. Logging
- - @@ -110,7 +110,7 @@ typedef void(* 

Logging

Libcgroup allows applications to register a callback function which libcgroup will call when it wants to log something. Each log message has associated a log level. As described in previous chapter, most libcgroup functions return an error code, which described root cause of the failure and log messages might provide further details about these failures and other notable events.

+

Libcgroup allows applications to register a callback function which libcgroup will call when it wants to log something. Each log message has associated a log level. As described in previous chapter, most libcgroup functions return an error code, which described root cause of the failure and log messages might provide further details about these failures and other notable events.

The logging callback can be set at any time, but setting the callback before any other libcgroup function (including cgroup_init()) is highly recommended. If no logger is set before cgroup_init() is called, default logger is automatically set, logging CGROUP_LOG_ERROR messages to stdout.
Setting log level
Some of the functions below set the log level as integer. Application can set directly a value of enum cgroup_log_level or use value -1 to set the log level automatically. In this case, libcgroup inspects environment variable CGROUP_LOGLEVEL if it is set and contains any of these values: ERROR, WARNING, INFO, DEBUG or integer number representing value from enum cgroup_log_level. If CGROUP_LOGLEVEL is not set or its value is not valid, CGROUP_LOG_ERROR is set as default log level.
Example:
Following short example shows custom libcgroup logger sending all log messages to stderr:
static void my_logger(void *userdata, int level, const char *fmt, va_list ap)
@@ -79,7 +79,7 @@ $(function() {
{
int ret;
-
cgroup_set_logger(my_logger, -1, NULL);
+
cgroup_set_logger(my_logger, -1, NULL);
ret = cgroup_init();
if (ret) {
...
@@ -94,7 +94,7 @@ $(function() { , CGROUP_LOG_DEBUG }
 
+
typedef void(* cgroup_logger_callback) (void *userdata, int level, const char *fmt, va_list ap)
 
void cgroup_set_logger (cgroup_logger_callback logger, int loglevel, void *userdata)
cgroup_logg

Detailed Description

Enumeration Type Documentation

- +

◆ cgroup_log_level

@@ -121,22 +121,22 @@ typedef void(* cgroup_logg
-

Level of importance of a log message.

+

Level of importance of a log message.

- - - -
Enumerator
CGROUP_LOG_ERROR 

Something serious happened and libcgroup failed to perform requested operation.

+
Enumerator
CGROUP_LOG_ERROR 

Something serious happened and libcgroup failed to perform requested operation.

CGROUP_LOG_WARNING 

Something bad happened but libcgroup recovered from the error.

+
CGROUP_LOG_WARNING 

Something bad happened but libcgroup recovered from the error.

CGROUP_LOG_INFO 

Something interesting happened and the message might be useful to the user.

+
CGROUP_LOG_INFO 

Something interesting happened and the message might be useful to the user.

CGROUP_LOG_DEBUG 

Debugging messages useful to libcgroup developers.

+
CGROUP_LOG_DEBUG 

Debugging messages useful to libcgroup developers.

Function Documentation

- +

◆ cgroup_log()

@@ -167,11 +167,11 @@ typedef void(* cgroup_logg
-

Libcgroup log function. This is for applications which are too lazy to set up their own complex logging and miss-use libcgroup for that purpose. I.e. this function should be used only by simple command-line tools. This logging automatically benefits from CGROUP_LOGLEVEL env. variable.

+

Libcgroup log function. This is for applications which are too lazy to set up their own complex logging and miss-use libcgroup for that purpose. I.e. this function should be used only by simple command-line tools. This logging automatically benefits from CGROUP_LOGLEVEL env. variable.

- +

◆ cgroup_parse_log_level_str()

@@ -186,7 +186,7 @@ typedef void(* cgroup_logg
-

Parse levelstr string for information about desired loglevel. The levelstr is usually a value of the CGROUP_LOGLEVEL environment variable.

Parameters
+

Parse levelstr string for information about desired loglevel. The levelstr is usually a value of the CGROUP_LOGLEVEL environment variable.

Parameters
levelstrString containing desired loglevel.
@@ -195,7 +195,7 @@ typedef void(* cgroup_logg
- +

◆ cgroup_set_default_logger()

@@ -210,7 +210,7 @@ typedef void(* cgroup_logg
-

Set libcgroup logging to stdout. All messages with the given loglevel or below will be sent to standard output. Previous logger set by cgroup_set_logger() is replaced.

+

Set libcgroup logging to stdout. All messages with the given loglevel or below will be sent to standard output. Previous logger set by cgroup_set_logger() is replaced.

Parameters
@@ -220,7 +220,7 @@ typedef void(* 
loglevelThe log level. Use value -1 to automatically discover the level from CGROUP_LOGLEVEL environment variable.
cgroup_logg - +

◆ cgroup_set_logger()

@@ -251,7 +251,7 @@ typedef void(* 
cgroup_logg
-

Set libcgroup logging callback. All log messages with equal or lower log level will be sent to the application's callback. There can be only one callback logger set, the previous callback is replaced with the new one by calling this function. Use NULL as the logger callback to completely disable libcgroup logging.

+

Set libcgroup logging callback. All log messages with equal or lower log level will be sent to the application's callback. There can be only one callback logger set, the previous callback is replaced with the new one by calling this function. Use NULL as the logger callback to completely disable libcgroup logging.

Parameters
@@ -263,7 +263,7 @@ typedef void(* 
loggerThe callback.
cgroup_logg - +

◆ cgroup_set_loglevel()

@@ -278,7 +278,7 @@ typedef void(* 
cgroup_logg
-

Change current loglevel.

Parameters
+

Change current loglevel.

Parameters
loglevelThe log level. Use value -1 to automatically discover the level from CGROUP_LOGLEVEL environment variable.
@@ -290,7 +290,7 @@ typedef void(* cgroup_logg
diff --git a/group__group__tasks.html b/group__group__tasks.html index 7a91ea69..294f60a8 100644 --- a/group__group__tasks.html +++ b/group__group__tasks.html @@ -2,8 +2,8 @@ - - + + libcgroup: 4. Manipulation with tasks @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ + @@ -61,13 +62,12 @@ $(function() {
-
-
4. Manipulation with tasks
+
4. Manipulation with tasks
- @@ -79,7 +79,7 @@ $(function() {

Simple task assignment

Applications can use following functions to simply put a task into given control group and find a groups where given tasks is.

+

Applications can use following functions to simply put a task into given control group and find a groups where given tasks is.

int cgroup_attach_task (struct cgroup *cgroup)
 
 
- @@ -89,7 +89,7 @@ $(function() {

Rules

libcgroup can move tasks to control groups using simple rules, loaded from configuration file. See cgrules.conf man page to see format of the file. Following functions can be used to load these rules from a file.

+

libcgroup can move tasks to control groups using simple rules, loaded from configuration file. See cgrules.conf man page to see format of the file. Following functions can be used to load these rules from a file.

int cgroup_init_rules_cache (void)
 
 
- @@ -101,14 +101,14 @@ $(function() {

Rule based task assignment

libcgroup can move tasks to control groups using simple rules, loaded from configuration file. See cgrules.conf man page to see format of the file. Applications can move tasks to control groups based on these rules using following functions.

+

libcgroup can move tasks to control groups using simple rules, loaded from configuration file. See cgrules.conf man page to see format of the file. Applications can move tasks to control groups based on these rules using following functions.

int cgroup_change_all_cgroups (void)
 
 
-

Communication with cgrulesengd daemon

Users can use cgrulesengd daemon to move tasks to groups based on the rules automatically when they change their UID, GID or executable name. The daemon allows tasks to be 'sticky', i.e. all rules are ignored for these tasks and the daemon never moves them.

+

Users can use cgrulesengd daemon to move tasks to groups based on the rules automatically when they change their UID, GID or executable name. The daemon allows tasks to be 'sticky', i.e. all rules are ignored for these tasks and the daemon never moves them.

int cgroup_register_unchanged_process (pid_t pid, int flags)
 

Detailed Description

Function Documentation

- +

◆ cgroup_attach_task()

@@ -123,18 +123,18 @@ $(function() {
-

Move current task (=thread) to given control group.

Parameters
+

Move current task (=thread) to given control group.

Parameters
cgroupDestination control group.

cgroup_attach_task is used to attach the current thread to a cgroup. struct cgroup *cgroup: The cgroup to assign the current thread to.

-

See cg_attach_task_pid for return values.

+

See cg_attach_task_pid for return values.

- +

◆ cgroup_attach_task_pid()

@@ -159,7 +159,7 @@ $(function() {
-

Move given task (=thread) to to given control group.

Parameters
+

Move given task (=thread) to to given control group.

Parameters
@@ -167,11 +167,11 @@ $(function() {

cgroup_attach_task_pid is used to assign tasks to a cgroup. struct cgroup *cgroup: The cgroup to assign the thread to. pid_t tid: The thread to be assigned to the cgroup.

-

returns 0 on success. returns ECGROUPNOTOWNER if the caller does not have access to the cgroup. returns ECGROUPNOTALLOWED for other causes of failure.

+

returns 0 on success. returns ECGROUPNOTOWNER if the caller does not have access to the cgroup. returns ECGROUPNOTALLOWED for other causes of failure.

- +

◆ cgroup_change_all_cgroups()

@@ -186,12 +186,12 @@ $(function() {
cgroupDestination control group.
tidThe task to move.
-

Changes the cgroup of all running PIDs based on the rules in the config file. If a rules exists for a PID, then the PID is placed in the correct group.

-

This function may be called after creating new control groups to move running PIDs into the newly created control groups.

Returns
0 on success, < 0 on error
+

Changes the cgroup of all running PIDs based on the rules in the config file. If a rules exists for a PID, then the PID is placed in the correct group.

+

This function may be called after creating new control groups to move running PIDs into the newly created control groups.

Returns
0 on success, < 0 on error
- +

◆ cgroup_change_cgroup_flags()

@@ -234,9 +234,9 @@ $(function() {
-

Changes the cgroup of a program based on the rules in the config file. If a rule exists for the given UID, GID or PROCESS NAME, then the given PID is placed into the correct group. By default, this function parses the configuration file each time it is called.

-

The flags can alter the behavior of this function: CGFLAG_USECACHE: Use cached rules instead of parsing the config file CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of parsing the config file

-

This function may NOT be thread safe.

Parameters
+

Changes the cgroup of a program based on the rules in the config file. If a rule exists for the given UID, GID or PROCESS NAME, then the given PID is placed into the correct group. By default, this function parses the configuration file each time it is called.

+

The flags can alter the behavior of this function: CGFLAG_USECACHE: Use cached rules instead of parsing the config file CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of parsing the config file

+

This function may NOT be thread safe.

Parameters
@@ -250,7 +250,7 @@ $(function() { - +

◆ cgroup_change_cgroup_path()

@@ -281,7 +281,7 @@ $(function() {
uidThe UID to match.
gidThe GID to match.
-

Changes the cgroup of a task based on the path provided. In this case, the user must already know into which cgroup the task should be placed and no rules will be parsed.

+

Changes the cgroup of a task based on the path provided. In this case, the user must already know into which cgroup the task should be placed and no rules will be parsed.

Parameters
@@ -291,12 +291,12 @@ $(function() {
Todo:
should this function be really public?
-

Changes the cgroup of a program based on the path provided. In this case, the user must already know into which cgroup the task should be placed and no rules will be parsed.

-

returns 0 on success.

+

Changes the cgroup of a program based on the path provided. In this case, the user must already know into which cgroup the task should be placed and no rules will be parsed.

+

returns 0 on success.

- +

◆ cgroup_change_cgroup_uid_gid()

@@ -327,7 +327,7 @@ $(function() {
pathName of the destination group.
-

Provides backwards-compatibility with older versions of the API. This function is deprecated, and cgroup_change_cgroup_uid_gid_flags() should be used instead. In fact, this function simply calls the newer one with flags set to 0 (none).

Parameters
+

Provides backwards-compatibility with older versions of the API. This function is deprecated, and cgroup_change_cgroup_uid_gid_flags() should be used instead. In fact, this function simply calls the newer one with flags set to 0 (none).

Parameters
@@ -347,7 +347,7 @@ $(function() { - +

◆ cgroup_change_cgroup_uid_gid_flags()

@@ -384,8 +384,8 @@ $(function() {
uidThe UID to match.
gidThe GID to match.
-

Changes the cgroup of a program based on the rules in the config file. If a rule exists for the given UID or GID, then the given PID is placed into the correct group. By default, this function parses the configuration file each time it is called.

-

This function may NOT be thread safe.

Parameters
+

Changes the cgroup of a program based on the rules in the config file. If a rule exists for the given UID or GID, then the given PID is placed into the correct group. By default, this function parses the configuration file each time it is called.

+

This function may NOT be thread safe.

Parameters
@@ -398,7 +398,7 @@ $(function() { - +

◆ cgroup_get_current_controller_path()

@@ -429,7 +429,7 @@ $(function() {
uidThe UID to match.
gidThe GID to match.
-

Get the current control group path where the given task is.

Parameters
+

Get the current control group path where the given task is.

Parameters
@@ -441,7 +441,7 @@ $(function() { - +

◆ cgroup_init_rules_cache()

@@ -456,12 +456,12 @@ $(function() {
pidThe task to find.
controllerThe controller (hierarchy), where to find the task.
-

Initializes the rules cache and load it from /etc/cgrules.conf.

Todo:
add parameter with the filename?
-

Initializes the rules cache.

Returns
0 on success, > 0 on error
+

Initializes the rules cache and load it from /etc/cgrules.conf.

Todo:
add parameter with the filename?
+

Initializes the rules cache.

Returns
0 on success, > 0 on error
- +

◆ cgroup_print_rules_config()

@@ -476,7 +476,7 @@ $(function() {
-

Print the cached rules table. This function should be called only after first calling cgroup_parse_config(), but it will work with an empty rule list.

Parameters
+

Print the cached rules table. This function should be called only after first calling cgroup_parse_config(), but it will work with an empty rule list.

Parameters
fpDestination file, where the rules will be printed.
@@ -491,7 +491,7 @@ $(function() {
- +

◆ cgroup_register_unchanged_process()

@@ -516,7 +516,7 @@ $(function() {
-

Register the unchanged process to a cgrulesengd daemon. This process is never moved to another control group by the daemon. If the daemon does not work, this function returns 0 as success.

Parameters
+

Register the unchanged process to a cgrulesengd daemon. This process is never moved to another control group by the daemon. If the daemon does not work, this function returns 0 as success.

Parameters
@@ -526,7 +526,7 @@ $(function() { - +

◆ cgroup_reload_cached_rules()

@@ -541,15 +541,15 @@ $(function() {
pidThe task id.
flagsBit flags to change the behavior, as defined in #cgroup_daemon_type
-

Reloads the rules list from /etc/cgrules.conf. This function is probably NOT thread safe (calls cgroup_parse_rules_config()).

-

Reloads the rules list, using the given configuration file. This function is probably NOT thread safe (calls cgroup_parse_rules()).

Returns
0 on success, > 0 on failure
+

Reloads the rules list from /etc/cgrules.conf. This function is probably NOT thread safe (calls cgroup_parse_rules_config()).

+

Reloads the rules list, using the given configuration file. This function is probably NOT thread safe (calls cgroup_parse_rules()).

Returns
0 on success, > 0 on failure
diff --git a/groups_8h_source.html b/groups_8h_source.html index 77ad1947..c8be6f2d 100644 --- a/groups_8h_source.html +++ b/groups_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/groups.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
groups.h
+
groups.h
-
1 #ifndef _LIBCGROUP_GROUPS_H
-
2 #define _LIBCGROUP_GROUPS_H
-
3 
-
4 #ifndef _LIBCGROUP_H_INSIDE
-
5 #error "Only <libcgroup.h> should be included directly."
-
6 #endif
-
7 
-
8 #ifndef SWIG
-
9 #include <features.h>
-
10 #include <sys/types.h>
-
11 #include <stdbool.h>
-
12 #endif
-
13 
-
14 #ifdef __cplusplus
-
15 extern "C" {
-
16 #endif
-
17 
-
18 enum cg_version_t {
-
19  CGROUP_UNK = 0,
-
20  CGROUP_V1,
-
21  CGROUP_V2,
-
22  CGROUP_DISK = 0xFF,
-
23 };
-
24 
-
28 enum cgroup_delete_flag {
-
32  CGFLAG_DELETE_IGNORE_MIGRATION = 1,
-
33 
-
37  CGFLAG_DELETE_RECURSIVE = 2,
-
38 
-
44  CGFLAG_DELETE_EMPTY_ONLY = 4,
-
45 };
-
46 
-
117 struct cgroup;
-
118 
-
126 struct cgroup_controller;
-
127 
-
131 #define NO_PERMS (-1U)
-
132 
-
136 #define NO_UID_GID (-1U)
-
137 
-
148 struct cgroup *cgroup_new_cgroup(const char *name);
-
149 
- -
159  const char *name);
-
160 
- -
169 
-
170 
- -
179  const char *name);
-
180 
-
186 void cgroup_free(struct cgroup **cgroup);
-
187 
- -
194 
-
195 
-
219 int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership);
-
220 
- -
243  int ignore_ownership);
-
244 
-
252 int cgroup_modify_cgroup(struct cgroup *cgroup);
-
253 
-
268 int cgroup_delete_cgroup(struct cgroup *cgroup, int ignore_migration);
-
269 
-
284 int cgroup_delete_cgroup_ext(struct cgroup *cgroup, int flags);
-
285 
-
286 
-
314 int cgroup_get_cgroup(struct cgroup *cgroup);
-
315 
-
324 int cgroup_copy_cgroup(struct cgroup *dst, struct cgroup *src);
-
325 
-
337 int cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b);
-
338 
-
339 
- -
350  struct cgroup_controller *cgcb);
-
351 
-
365 int cgroup_set_uid_gid(struct cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid,
-
366  uid_t control_uid, gid_t control_gid);
-
367 
-
373 int cgroup_get_uid_gid(struct cgroup *cgroup, uid_t *tasks_uid,
-
374  gid_t *tasks_gid, uid_t *control_uid, gid_t *control_gid);
-
375 
- -
389  mode_t control_dperm, mode_t control_fperm,
-
390  mode_t task_fperm);
-
391 
-
412 int cgroup_add_value_string(struct cgroup_controller *controller,
-
413  const char *name, const char *value);
-
425 int cgroup_add_value_int64(struct cgroup_controller *controller,
-
426  const char *name, int64_t value);
-
436 int cgroup_add_value_uint64(struct cgroup_controller *controller,
-
437  const char *name, u_int64_t value);
-
447 int cgroup_add_value_bool(struct cgroup_controller *controller,
-
448  const char *name, bool value);
-
449 
-
465 int cgroup_get_value_string(struct cgroup_controller *controller,
-
466  const char *name, char **value);
-
475 int cgroup_get_value_int64(struct cgroup_controller *controller,
-
476  const char *name, int64_t *value);
-
485 int cgroup_get_value_uint64(struct cgroup_controller *controller,
-
486  const char *name, u_int64_t *value);
-
495 int cgroup_get_value_bool(struct cgroup_controller *controller,
-
496  const char *name, bool *value);
-
497 
-
506 int cgroup_set_value_string(struct cgroup_controller *controller,
-
507  const char *name, const char *value);
-
518 int cgroup_set_value_int64(struct cgroup_controller *controller,
-
519  const char *name, int64_t value);
-
528 int cgroup_set_value_uint64(struct cgroup_controller *controller,
-
529  const char *name, u_int64_t value);
-
538 int cgroup_set_value_bool(struct cgroup_controller *controller,
-
539  const char *name, bool value);
-
549 int cgroup_get_value_name_count(struct cgroup_controller *controller);
-
550 
-
563 char *cgroup_get_value_name(struct cgroup_controller *controller, int index);
-
564 
-
574 int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size);
-
575 
-
584 int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode,
-
585  int dirm_change, mode_t file_mode, int filem_change);
-
586 
-
591 char *cgroup_get_cgroup_name(struct cgroup *cgroup);
-
592 
-
593 /*
-
594  * Convert from one cgroup version to another version
-
595  *
-
596  * @param out_cgroup Destination cgroup
-
597  * @param out_version Destination cgroup version
-
598  * @param in_cgroup Source cgroup
-
599  * @param in_version Source cgroup version, only used if set to v1 or v2
-
600  *
-
601  * @return 0 on success
-
602  * ECGFAIL conversion failed
-
603  * ECGCONTROLLERNOTEQUAL incorrect controller version provided
-
604  */
-
605 int cgroup_convert_cgroup(struct cgroup * const out_cgroup,
-
606  enum cg_version_t out_version,
-
607  const struct cgroup * const in_cgroup,
-
608  enum cg_version_t in_version);
-
609 
-
617 int cgroup_get_controller_version(const char * const controller,
-
618  enum cg_version_t * const version);
-
619 
-
626 #ifdef __cplusplus
-
627 } /* extern "C" */
-
628 #endif
-
629 
-
630 #endif /* _LIBCGROUP_GROUPS_H */
+
1#ifndef _LIBCGROUP_GROUPS_H
+
2#define _LIBCGROUP_GROUPS_H
+
3
+
4#ifndef _LIBCGROUP_H_INSIDE
+
5#error "Only <libcgroup.h> should be included directly."
+
6#endif
+
7
+
8#ifndef SWIG
+
9#include <features.h>
+
10#include <sys/types.h>
+
11#include <stdbool.h>
+
12#endif
+
13
+
14#ifdef __cplusplus
+
15extern "C" {
+
16#endif
+
17
+
18enum cg_version_t {
+
19 CGROUP_UNK = 0,
+
20 CGROUP_V1,
+
21 CGROUP_V2,
+
22 CGROUP_DISK = 0xFF,
+
23};
+
24
+
28enum cgroup_delete_flag {
+
32 CGFLAG_DELETE_IGNORE_MIGRATION = 1,
+
33
+
37 CGFLAG_DELETE_RECURSIVE = 2,
+
38
+
44 CGFLAG_DELETE_EMPTY_ONLY = 4,
+
45};
+
46
+
117struct cgroup;
+
118
+
126struct cgroup_controller;
+
127
+
131#define NO_PERMS (-1U)
+
132
+
136#define NO_UID_GID (-1U)
+
137
+
148struct cgroup *cgroup_new_cgroup(const char *name);
+
149
+ +
159 const char *name);
+
160
+ +
169
+
170
+ +
179 const char *name);
+
180
+
186void cgroup_free(struct cgroup **cgroup);
+
187
+ +
194
+
195
+
219int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership);
+
220
+ +
243 int ignore_ownership);
+
244
+ +
253
+
268int cgroup_delete_cgroup(struct cgroup *cgroup, int ignore_migration);
+
269
+
284int cgroup_delete_cgroup_ext(struct cgroup *cgroup, int flags);
+
285
+
286
+
314int cgroup_get_cgroup(struct cgroup *cgroup);
+
315
+
324int cgroup_copy_cgroup(struct cgroup *dst, struct cgroup *src);
+
325
+
337int cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b);
+
338
+
339
+ +
350 struct cgroup_controller *cgcb);
+
351
+
365int cgroup_set_uid_gid(struct cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid,
+
366 uid_t control_uid, gid_t control_gid);
+
367
+
373int cgroup_get_uid_gid(struct cgroup *cgroup, uid_t *tasks_uid,
+
374 gid_t *tasks_gid, uid_t *control_uid, gid_t *control_gid);
+
375
+ +
389 mode_t control_dperm, mode_t control_fperm,
+
390 mode_t task_fperm);
+
391
+
412int cgroup_add_value_string(struct cgroup_controller *controller,
+
413 const char *name, const char *value);
+
425int cgroup_add_value_int64(struct cgroup_controller *controller,
+
426 const char *name, int64_t value);
+
436int cgroup_add_value_uint64(struct cgroup_controller *controller,
+
437 const char *name, u_int64_t value);
+
447int cgroup_add_value_bool(struct cgroup_controller *controller,
+
448 const char *name, bool value);
+
449
+
465int cgroup_get_value_string(struct cgroup_controller *controller,
+
466 const char *name, char **value);
+
475int cgroup_get_value_int64(struct cgroup_controller *controller,
+
476 const char *name, int64_t *value);
+
485int cgroup_get_value_uint64(struct cgroup_controller *controller,
+
486 const char *name, u_int64_t *value);
+
495int cgroup_get_value_bool(struct cgroup_controller *controller,
+
496 const char *name, bool *value);
+
497
+
506int cgroup_set_value_string(struct cgroup_controller *controller,
+
507 const char *name, const char *value);
+
518int cgroup_set_value_int64(struct cgroup_controller *controller,
+
519 const char *name, int64_t value);
+
528int cgroup_set_value_uint64(struct cgroup_controller *controller,
+
529 const char *name, u_int64_t value);
+
538int cgroup_set_value_bool(struct cgroup_controller *controller,
+
539 const char *name, bool value);
+
549int cgroup_get_value_name_count(struct cgroup_controller *controller);
+
550
+
563char *cgroup_get_value_name(struct cgroup_controller *controller, int index);
+
564
+
574int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size);
+
575
+
584int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode,
+
585 int dirm_change, mode_t file_mode, int filem_change);
+
586
+ +
592
+
593/*
+
594 * Convert from one cgroup version to another version
+
595 *
+
596 * @param out_cgroup Destination cgroup
+
597 * @param out_version Destination cgroup version
+
598 * @param in_cgroup Source cgroup
+
599 * @param in_version Source cgroup version, only used if set to v1 or v2
+
600 *
+
601 * @return 0 on success
+
602 * ECGFAIL conversion failed
+
603 * ECGCONTROLLERNOTEQUAL incorrect controller version provided
+
604 */
+
605int cgroup_convert_cgroup(struct cgroup * const out_cgroup,
+
606 enum cg_version_t out_version,
+
607 const struct cgroup * const in_cgroup,
+
608 enum cg_version_t in_version);
+
609
+
617int cgroup_get_controller_version(const char * const controller,
+
618 enum cg_version_t * const version);
+
619
+
626#ifdef __cplusplus
+
627} /* extern "C" */
+
628#endif
+
629
+
630#endif /* _LIBCGROUP_GROUPS_H */
int cgroup_get_uid_gid(struct cgroup *cgroup, uid_t *tasks_uid, gid_t *tasks_gid, uid_t *control_uid, gid_t *control_gid)
Definition: wrapper.c:417
int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size)
Definition: api.c:5517
int cgroup_get_value_int64(struct cgroup_controller *controller, const char *name, int64_t *value)
Definition: wrapper.c:496
-
char * cgroup_get_value_name(struct cgroup_controller *controller, int index)
Definition: wrapper.c:725
int cgroup_delete_cgroup(struct cgroup *cgroup, int ignore_migration)
Definition: api.c:2923
int cgroup_get_value_name_count(struct cgroup_controller *controller)
Definition: wrapper.c:716
int cgroup_modify_cgroup(struct cgroup *cgroup)
Definition: api.c:2234
+
struct cgroup_controller * cgroup_add_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:56
int cgroup_get_controller_version(const char *const controller, enum cg_version_t *const version)
Definition: api.c:5766
int cgroup_add_value_string(struct cgroup_controller *controller, const char *name, const char *value)
Definition: wrapper.c:211
int cgroup_add_value_bool(struct cgroup_controller *controller, const char *name, bool value)
Definition: wrapper.c:291
int cgroup_set_uid_gid(struct cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid, uid_t control_uid, gid_t control_gid)
Definition: wrapper.c:403
+
struct cgroup_controller * cgroup_get_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:431
int cgroup_add_value_int64(struct cgroup_controller *controller, const char *name, int64_t value)
Definition: wrapper.c:255
-
struct cgroup * cgroup_new_cgroup(const char *name)
Definition: wrapper.c:44
-
struct cgroup_controller * cgroup_get_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:431
int cgroup_delete_cgroup_ext(struct cgroup *cgroup, int flags)
Definition: api.c:2929
int cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b)
Definition: wrapper.c:368
int cgroup_create_cgroup_from_parent(struct cgroup *cgroup, int ignore_ownership)
Definition: api.c:2669
void cgroup_free_controllers(struct cgroup *cgroup)
Definition: wrapper.c:183
int cgroup_set_value_string(struct cgroup_controller *controller, const char *name, const char *value)
Definition: wrapper.c:475
int cgroup_get_value_uint64(struct cgroup_controller *controller, const char *name, u_int64_t *value)
Definition: wrapper.c:546
+
char * cgroup_get_value_name(struct cgroup_controller *controller, int index)
Definition: wrapper.c:725
void cgroup_set_permissions(struct cgroup *cgroup, mode_t control_dperm, mode_t control_fperm, mode_t task_fperm)
Definition: api.c:367
-
struct cgroup_controller * cgroup_add_controller(struct cgroup *cgroup, const char *name)
Definition: wrapper.c:56
int cgroup_set_value_int64(struct cgroup_controller *controller, const char *name, int64_t value)
Definition: wrapper.c:519
int cgroup_copy_cgroup(struct cgroup *dst, struct cgroup *src)
Definition: api.c:2346
int cgroup_compare_controllers(struct cgroup_controller *cgca, struct cgroup_controller *cgcb)
Definition: wrapper.c:341
void cgroup_free(struct cgroup **cgroup)
Definition: wrapper.c:196
+
char * cgroup_get_cgroup_name(struct cgroup *cgroup)
Definition: wrapper.c:737
int cgroup_get_value_bool(struct cgroup_controller *controller, const char *name, bool *value)
Definition: wrapper.c:595
-
char * cgroup_get_cgroup_name(struct cgroup *cgroup)
Definition: wrapper.c:737
+
struct cgroup * cgroup_new_cgroup(const char *name)
Definition: wrapper.c:44
int cgroup_get_cgroup(struct cgroup *cgroup)
Definition: api.c:3222
int cgroup_add_value_uint64(struct cgroup_controller *controller, const char *name, u_int64_t value)
Definition: wrapper.c:273
int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership)
Definition: api.c:2429
@@ -260,7 +260,7 @@ $(function() {
diff --git a/index.html b/index.html index b0793481..8d081b83 100644 --- a/index.html +++ b/index.html @@ -2,8 +2,8 @@ - - + + libcgroup: libcgroup @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
@@ -60,15 +61,14 @@ $(function() { -
-
-
libcgroup
+
+
libcgroup

Introduction

-

libcgroup is a library that abstracts the control group file system in Linux. It comes with various command-line tools and configuration files, see their man pages for details.

-

This documentation provides description of libcgroup API. Read following sections, preferably in this order:

    +

    libcgroup is a library that abstracts the control group file system in Linux. It comes with various command-line tools and configuration files, see their man pages for details.

    +

    This documentation provides description of libcgroup API. Read following sections, preferably in this order:

    1. Initialization
    2. Control Groups
    3. Iterators
    4. @@ -80,7 +80,7 @@ Introduction
diff --git a/iterators_8h_source.html b/iterators_8h_source.html index dbaacd33..a1d065e3 100644 --- a/iterators_8h_source.html +++ b/iterators_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/iterators.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
iterators.h
+
iterators.h
-
1 #ifndef _LIBCGROUP_ITERATORS_H
-
2 #define _LIBCGROUP_ITERATORS_H
-
3 
-
4 #ifndef _LIBCGROUP_H_INSIDE
-
5 #error "Only <libcgroup.h> should be included directly."
-
6 #endif
-
7 
-
8 #ifndef SWIG
-
9 #include <sys/types.h>
-
10 #include <stdio.h>
-
11 #include <features.h>
-
12 #endif
-
13 
-
14 #ifdef __cplusplus
-
15 extern "C" {
-
16 #endif
-
17 
- - - -
100 };
-
101 
- - - - -
109 };
-
110 
- -
116  enum cgroup_file_type type;
-
118  const char *path;
-
120  const char *parent;
-
126  const char *full_path;
-
131  short depth;
-
132 };
-
133 
-
152 int cgroup_walk_tree_begin(const char *controller, const char *base_path, int depth,
-
153  void **handle, struct cgroup_file_info *info,
-
154  int *base_level);
-
164 int cgroup_walk_tree_next(int depth, void **handle,
-
165  struct cgroup_file_info *info, int base_level);
-
166 
-
170 int cgroup_walk_tree_end(void **handle);
-
171 
-
178 int cgroup_walk_tree_set_flags(void **handle, int flags);
-
179 
-
195 int cgroup_read_value_begin(const char * const controller, const char *path,
-
196  const char * const name, void **handle, char *buffer, int max);
-
197 
-
211 int cgroup_read_value_next(void **handle, char *buffer, int max);
-
212 
-
216 int cgroup_read_value_end(void **handle);
-
217 
-
230 #define CG_VALUE_MAX 100
-
234 struct cgroup_stat {
-
235  char name[FILENAME_MAX];
-
236  char value[CG_VALUE_MAX];
-
237 };
-
238 
-
249 int cgroup_read_stats_begin(const char *controller, const char *path, void **handle,
-
250  struct cgroup_stat *stat);
-
251 
-
258 int cgroup_read_stats_next(void **handle, struct cgroup_stat *stat);
-
259 
-
263 int cgroup_read_stats_end(void **handle);
-
264 
-
281 int cgroup_get_task_begin(const char *cgroup, const char *controller, void **handle,
-
282  pid_t *pid);
-
283 
-
291 int cgroup_get_task_next(void **handle, pid_t *pid);
-
292 
-
296 int cgroup_get_task_end(void **handle);
-
297 
- -
314  char name[FILENAME_MAX];
-
316  char path[FILENAME_MAX];
-
317 };
-
318 
-
326 int cgroup_get_controller_begin(void **handle, struct cgroup_mount_point *info);
-
327 
-
337 int cgroup_get_controller_next(void **handle, struct cgroup_mount_point *info);
-
338 
-
342 int cgroup_get_controller_end(void **handle);
-
343 
- -
358  char name[FILENAME_MAX];
- - -
368  int enabled;
-
369 };
-
370 
-
376 int cgroup_get_all_controller_begin(void **handle,
-
377  struct controller_data *info);
-
383 int cgroup_get_all_controller_next(void **handle, struct controller_data *info);
-
384 
-
388 int cgroup_get_all_controller_end(void **handle);
-
389 
-
407 int cgroup_get_subsys_mount_point_begin(const char *controller, void **handle,
-
408  char *path);
-
415 int cgroup_get_subsys_mount_point_next(void **handle,
-
416  char *path);
-
417 
- -
422 
-
428 #ifdef __cplusplus
-
429 } /* extern "C" */
-
430 #endif
-
431 
-
432 #endif /* _LIBCGROUP_ITERATORS_H */
+
1#ifndef _LIBCGROUP_ITERATORS_H
+
2#define _LIBCGROUP_ITERATORS_H
+
3
+
4#ifndef _LIBCGROUP_H_INSIDE
+
5#error "Only <libcgroup.h> should be included directly."
+
6#endif
+
7
+
8#ifndef SWIG
+
9#include <sys/types.h>
+
10#include <stdio.h>
+
11#include <features.h>
+
12#endif
+
13
+
14#ifdef __cplusplus
+
15extern "C" {
+
16#endif
+
17
+ + + +
100};
+
101
+ + + + +
109};
+
110
+ + +
118 const char *path;
+
120 const char *parent;
+
126 const char *full_path;
+
131 short depth;
+
132};
+
133
+
152int cgroup_walk_tree_begin(const char *controller, const char *base_path, int depth,
+
153 void **handle, struct cgroup_file_info *info,
+
154 int *base_level);
+
164int cgroup_walk_tree_next(int depth, void **handle,
+
165 struct cgroup_file_info *info, int base_level);
+
166
+
170int cgroup_walk_tree_end(void **handle);
+
171
+
178int cgroup_walk_tree_set_flags(void **handle, int flags);
+
179
+
195int cgroup_read_value_begin(const char * const controller, const char *path,
+
196 const char * const name, void **handle, char *buffer, int max);
+
197
+
211int cgroup_read_value_next(void **handle, char *buffer, int max);
+
212
+
216int cgroup_read_value_end(void **handle);
+
217
+
230#define CG_VALUE_MAX 100
+ +
235 char name[FILENAME_MAX];
+
236 char value[CG_VALUE_MAX];
+
237};
+
238
+
249int cgroup_read_stats_begin(const char *controller, const char *path, void **handle,
+
250 struct cgroup_stat *stat);
+
251
+
258int cgroup_read_stats_next(void **handle, struct cgroup_stat *stat);
+
259
+
263int cgroup_read_stats_end(void **handle);
+
264
+
281int cgroup_get_task_begin(const char *cgroup, const char *controller, void **handle,
+
282 pid_t *pid);
+
283
+
291int cgroup_get_task_next(void **handle, pid_t *pid);
+
292
+
296int cgroup_get_task_end(void **handle);
+
297
+ +
314 char name[FILENAME_MAX];
+
316 char path[FILENAME_MAX];
+
317};
+
318
+
326int cgroup_get_controller_begin(void **handle, struct cgroup_mount_point *info);
+
327
+
337int cgroup_get_controller_next(void **handle, struct cgroup_mount_point *info);
+
338
+
342int cgroup_get_controller_end(void **handle);
+
343
+ +
358 char name[FILENAME_MAX];
+ + + +
369};
+
370
+
376int cgroup_get_all_controller_begin(void **handle,
+
377 struct controller_data *info);
+
383int cgroup_get_all_controller_next(void **handle, struct controller_data *info);
+
384
+
388int cgroup_get_all_controller_end(void **handle);
+
389
+
407int cgroup_get_subsys_mount_point_begin(const char *controller, void **handle,
+
408 char *path);
+
415int cgroup_get_subsys_mount_point_next(void **handle,
+
416 char *path);
+
417
+
421int cgroup_get_subsys_mount_point_end(void **handle);
+
422
+
428#ifdef __cplusplus
+
429} /* extern "C" */
+
430#endif
+
431
+
432#endif /* _LIBCGROUP_ITERATORS_H */
int cgroup_walk_tree_end(void **handle)
Definition: api.c:4561
int cgroup_get_all_controller_end(void **handle)
Definition: api.c:5428
int cgroup_read_stats_begin(const char *controller, const char *path, void **handle, struct cgroup_stat *stat)
Definition: api.c:4819
@@ -227,7 +227,7 @@ $(function() {
diff --git a/jquery.js b/jquery.js index 103c32d7..c9ed3d99 100644 --- a/jquery.js +++ b/jquery.js @@ -1,5 +1,5 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 - - + + libcgroup: src/libcgroup-internal.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
libcgroup-internal.h
+
libcgroup-internal.h
-
1 /*
-
2  * Copyright IBM Corporation. 2008
-
3  *
-
4  * Author: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-
5  *
-
6  * This program is free software; you can redistribute it and/or modify it
-
7  * under the terms of version 2.1 of the GNU Lesser General Public License
-
8  * as published by the Free Software Foundation.
-
9  *
-
10  * This program is distributed in the hope that it would be useful, but
-
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
-
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
13  *
-
14  */
-
15 #ifndef __LIBCG_INTERNAL
-
16 
-
17 #define __LIBCG_INTERNAL
-
18 
-
19 #ifdef __cplusplus
-
20 extern "C" {
-
21 #endif
-
22 
-
23 #include "config.h"
-
24 #include <dirent.h>
-
25 #include <fts.h>
-
26 #include <libcgroup.h>
-
27 #include <limits.h>
-
28 #include <mntent.h>
-
29 #include <pthread.h>
-
30 #include <sys/stat.h>
-
31 #include <sys/types.h>
-
32 #include <setjmp.h>
-
33 
-
34 /* Maximum number of mount points/controllers */
-
35 #define MAX_MNT_ELEMENTS 16
-
36 /* Estimated number of groups created */
-
37 #define MAX_GROUP_ELEMENTS 128
-
38 
-
39 /* Maximum length of a value */
-
40 #define CG_CONTROL_VALUE_MAX 4096
-
41 
-
42 #define CG_NV_MAX 100
-
43 #define CG_CONTROLLER_MAX 100
-
44 #define CG_OPTIONS_MAX 100
-
45 /* Max number of mounted hierarchies. Event if one controller is mounted per
-
46  * hier, it can not exceed CG_CONTROLLER_MAX
-
47  */
-
48 #define CG_HIER_MAX CG_CONTROLLER_MAX
-
49 
-
50 /* Definitions for the uid and gid members of a cgroup_rules */
-
51 /* FIXME: These really should not be negative values */
-
52 #define CGRULE_INVALID ((uid_t) -1)
-
53 #define CGRULE_WILD ((uid_t) -2)
-
54 
-
55 #define CGRULE_SUCCESS_STORE_PID "SUCCESS_STORE_PID"
-
56 
-
57 /* Definitions for the cgrules options field */
-
58 #define CGRULE_OPTION_IGNORE "ignore"
-
59 
-
60 #define CGCONFIG_CONF_FILE "/etc/cgconfig.conf"
-
61 /* Minimum number of file in template file list for cgrulesengd */
-
62 #define CGCONFIG_CONF_FILES_LIST_MINIMUM_SIZE 4
-
63 #define CGCONFIG_CONF_DIR "/etc/cgconfig.d"
-
64 
-
65 #define CGRULES_CONF_FILE "/etc/cgrules.conf"
-
66 #define CGRULES_CONF_DIR "/etc/cgrules.d"
-
67 #define CGRULES_MAX_FIELDS_PER_LINE 3
-
68 
-
69 #define CGROUP_BUFFER_LEN (5 * FILENAME_MAX)
-
70 
-
71 /* Maximum length of a key(<user>:<process name>) in the daemon config file */
-
72 #define CGROUP_RULE_MAXKEY (LOGIN_NAME_MAX + FILENAME_MAX + 1)
-
73 
-
74 /* Maximum length of a line in the daemon config file */
-
75 #define CGROUP_RULE_MAXLINE (FILENAME_MAX + CGROUP_RULE_MAXKEY + \
-
76  CG_CONTROLLER_MAX + 3)
-
77 
-
78 #define CGROUP_FILE_PREFIX "cgroup"
-
79 
-
80 #define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, x)
-
81 #define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, x)
-
82 #define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, x)
-
83 #define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x)
-
84 
-
85 #define CGROUP_DEFAULT_LOGLEVEL CGROUP_LOG_ERROR
-
86 
-
87 #define max(x,y) ((y)<(x)?(x):(y))
-
88 #define min(x,y) ((y)>(x)?(x):(y))
-
89 
-
90 struct control_value {
-
91  char name[FILENAME_MAX];
-
92  char value[CG_CONTROL_VALUE_MAX];
-
93 
-
94  /* cgget uses this field for values that span multiple lines */
-
95  char *multiline_value;
-
96 
-
97  /*
-
98  * The abstraction layer uses prev_name when there's an N->1 or
-
99  * 1->N relationship between cgroup v1 and v2 settings.
-
100  */
-
101  char *prev_name;
-
102 
-
103  bool dirty;
-
104 };
-
105 
- -
107  char name[FILENAME_MAX];
-
108  struct control_value *values[CG_NV_MAX];
-
109  struct cgroup *cgroup;
-
110  int index;
-
111  enum cg_version_t version;
-
112 };
-
113 
-
114 struct cgroup {
-
115  char name[FILENAME_MAX];
-
116  struct cgroup_controller *controller[CG_CONTROLLER_MAX];
-
117  int index;
-
118  uid_t tasks_uid;
-
119  gid_t tasks_gid;
-
120  mode_t task_fperm;
-
121  uid_t control_uid;
-
122  gid_t control_gid;
-
123  mode_t control_fperm;
-
124  mode_t control_dperm;
-
125 };
-
126 
- -
128  char path[FILENAME_MAX];
-
129  struct cg_mount_point *next;
-
130 };
-
131 
- -
134  char name[FILENAME_MAX];
-
138  struct cg_mount_point mount;
-
139  int index;
-
140  enum cg_version_t version;
-
141 };
-
142 
- -
144  pid_t pid; /* pid of the process which needs to change group */
-
145 
-
146  /* Details of user under consideration for destination cgroup */
-
147  struct passwd *pw;
-
148  /* Gid of the process */
-
149  gid_t gid;
-
150 };
-
151 
-
152 /* A rule that maps UID/GID to a cgroup */
-
153 struct cgroup_rule {
-
154  uid_t uid;
-
155  gid_t gid;
-
156  bool is_ignore;
-
157  char *procname;
-
158  char username[LOGIN_NAME_MAX];
-
159  char destination[FILENAME_MAX];
-
160  char *controllers[MAX_MNT_ELEMENTS];
-
161  struct cgroup_rule *next;
-
162 };
-
163 
-
164 /* Container for a list of rules */
- -
166  struct cgroup_rule *head;
-
167  struct cgroup_rule *tail;
-
168  int len;
-
169 };
-
170 
-
171 /*The walk_tree handle */
- -
173  FTS *fts;
-
174  int flags;
-
175 };
-
176 
- -
185  const char *name;
-
186  const char *value;
-
187  struct cgroup_dictionary_item *next;
-
188 };
-
189 
-
190 /* Flags for cgroup_dictionary_create */
-
197 #define CG_DICT_DONT_FREE_ITEMS 1
-
198 
- -
208  struct cgroup_dictionary_item *head;
-
209  struct cgroup_dictionary_item *tail;
-
210  int flags;
-
211 };
-
212 
- -
215  struct cgroup_dictionary_item *item;
-
216 };
-
217 
-
221 extern __thread int last_errno;
-
222 
-
226 extern jmp_buf parser_error_env;
-
227 
-
228 /* Internal API */
-
229 char *cg_build_path(const char *name, char *path, const char *type);
-
230 int cgroup_get_uid_gid_from_procfs(pid_t pid, uid_t *euid, gid_t *egid);
-
231 int cgroup_get_procname_from_procfs(pid_t pid, char **procname);
-
232 int cg_mkdir_p(const char *path);
-
233 struct cgroup *create_cgroup_from_name_value_pairs(const char *name,
-
234  struct control_value *name_value, int nv_number);
-
235 void init_cgroup_table(struct cgroup *cgroups, size_t count);
-
236 
-
237 /*
-
238  * Main mounting structures
-
239  */
-
240 extern struct cg_mount_table_s cg_mount_table[CG_CONTROLLER_MAX];
-
241 extern pthread_rwlock_t cg_mount_table_lock;
-
242 
-
243 /*
-
244  * config related structures
-
245  */
-
246 
-
247 extern __thread char *cg_namespace_table[CG_CONTROLLER_MAX];
-
248 
-
249 /*
-
250  * config related API
-
251  */
-
252 int cgroup_config_insert_cgroup(char *cg_name);
-
253 int cgroup_config_parse_controller_options(char *controller,
-
254  struct cgroup_dictionary *values);
-
255 int template_config_insert_cgroup(char *cg_name);
-
256 int template_config_parse_controller_options(char *controller,
-
257  struct cgroup_dictionary *values);
-
258 int template_config_group_task_perm(char *perm_type, char *value);
-
259 int template_config_group_admin_perm(char *perm_type, char *value);
-
260 int cgroup_config_group_task_perm(char *perm_type, char *value);
-
261 int cgroup_config_group_admin_perm(char *perm_type, char *value);
-
262 int cgroup_config_insert_into_mount_table(char *name, char *mount_point);
-
263 int cgroup_config_insert_into_namespace_table(char *name, char *mount_point);
-
264 void cgroup_config_cleanup_mount_table(void);
-
265 void cgroup_config_cleanup_namespace_table(void);
-
266 int cgroup_config_define_default(void);
-
267 
-
271 extern int cgroup_dictionary_create(struct cgroup_dictionary **dict,
-
272  int flags);
-
276 extern int cgroup_dictionary_add(struct cgroup_dictionary *dict,
-
277  const char *name, const char *value);
-
282 extern int cgroup_dictionary_free(struct cgroup_dictionary *dict);
-
283 
-
288 extern int cgroup_dictionary_iterator_begin(struct cgroup_dictionary *dict,
-
289  void **handle, const char **name, const char **value);
-
293 extern int cgroup_dictionary_iterator_next(void **handle,
-
294  const char **name, const char **value);
-
298 extern void cgroup_dictionary_iterator_end(void **handle);
-
299 
-
309 int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
-
310 
-
320 int cgroup_build_tasks_procs_path(char * const path,
-
321  size_t path_sz, const char * const cg_name,
-
322  const char * const ctrl_name);
-
323 
-
335 char *cg_build_path_locked(const char *setting, char *path,
-
336  const char *controller);
-
337 
-
349 int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup,
-
350  struct cgroup_controller *cgc, int cg_index);
-
351 
-
358 int cgroup_test_subsys_mounted(const char *ctrl_name);
-
359 
-
368 int cgroup_copy_controller_values(struct cgroup_controller * const dst,
-
369  const struct cgroup_controller * const src);
-
370 
-
378 int cgroup_remove_value(struct cgroup_controller * const controller,
-
379  const char * const name);
-
380 
-
387 void cgroup_free_controller(struct cgroup_controller *ctrl);
-
388 
-
394 #ifdef UNIT_TEST
-
395 
-
396 #define TEST_PROC_PID_CGROUP_FILE "test-procpidcgroup"
-
397 
-
398 int cgroup_parse_rules_options(char *options,
-
399  struct cgroup_rule * const rule);
-
400 
-
401 int cg_get_cgroups_from_proc_cgroups(pid_t pid, char *cgroup_list[],
-
402  char *controller_list[],
-
403  int list_len);
-
404 
-
405 bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule,
-
406  pid_t pid, const char * const procname);
-
407 
-
408 bool cgroup_compare_wildcard_procname(const char * const rule_procname,
-
409  const char * const procname);
-
410 
-
411 int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent,
-
412  int *mnt_tbl_idx);
-
413 
-
414 int cgroup_process_v2_mnt(struct mntent *ent, int *mnt_tbl_idx);
-
415 
-
416 int cgroup_set_values_recursive(const char * const base,
-
417  const struct cgroup_controller * const controller,
-
418  bool ignore_non_dirty_failures);
-
419 
-
420 int cgroup_chown_chmod_tasks(const char * const cg_path,
-
421  uid_t uid, gid_t gid, mode_t fperm);
-
422 
-
423 int cgroupv2_subtree_control(const char *path, const char *ctrl_name,
-
424  bool enable);
-
425 
-
426 int cgroupv2_get_subtree_control(const char *path,
-
427  const char *ctrl_name,
-
428  bool * const enabled);
-
429 
-
430 int cgroupv2_controller_enabled(const char * const cg_name,
-
431  const char * const ctrl_name);
-
432 
-
433 #endif /* UNIT_TEST */
-
434 
-
435 #ifdef __cplusplus
-
436 } /* extern "C" */
-
437 #endif
-
438 
-
439 #endif
+
1/*
+
2 * Copyright IBM Corporation. 2008
+
3 *
+
4 * Author: Dhaval Giani <dhaval@linux.vnet.ibm.com>
+
5 *
+
6 * This program is free software; you can redistribute it and/or modify it
+
7 * under the terms of version 2.1 of the GNU Lesser General Public License
+
8 * as published by the Free Software Foundation.
+
9 *
+
10 * This program is distributed in the hope that it would be useful, but
+
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
+
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
13 *
+
14 */
+
15#ifndef __LIBCG_INTERNAL
+
16
+
17#define __LIBCG_INTERNAL
+
18
+
19#ifdef __cplusplus
+
20extern "C" {
+
21#endif
+
22
+
23#include "config.h"
+
24#include <dirent.h>
+
25#include <fts.h>
+
26#include <libcgroup.h>
+
27#include <limits.h>
+
28#include <mntent.h>
+
29#include <pthread.h>
+
30#include <sys/stat.h>
+
31#include <sys/types.h>
+
32#include <setjmp.h>
+
33
+
34/* Maximum number of mount points/controllers */
+
35#define MAX_MNT_ELEMENTS 16
+
36/* Estimated number of groups created */
+
37#define MAX_GROUP_ELEMENTS 128
+
38
+
39/* Maximum length of a value */
+
40#define CG_CONTROL_VALUE_MAX 4096
+
41
+
42#define CG_NV_MAX 100
+
43#define CG_CONTROLLER_MAX 100
+
44#define CG_OPTIONS_MAX 100
+
45/* Max number of mounted hierarchies. Event if one controller is mounted per
+
46 * hier, it can not exceed CG_CONTROLLER_MAX
+
47 */
+
48#define CG_HIER_MAX CG_CONTROLLER_MAX
+
49
+
50/* Definitions for the uid and gid members of a cgroup_rules */
+
51/* FIXME: These really should not be negative values */
+
52#define CGRULE_INVALID ((uid_t) -1)
+
53#define CGRULE_WILD ((uid_t) -2)
+
54
+
55#define CGRULE_SUCCESS_STORE_PID "SUCCESS_STORE_PID"
+
56
+
57/* Definitions for the cgrules options field */
+
58#define CGRULE_OPTION_IGNORE "ignore"
+
59
+
60#define CGCONFIG_CONF_FILE "/etc/cgconfig.conf"
+
61/* Minimum number of file in template file list for cgrulesengd */
+
62#define CGCONFIG_CONF_FILES_LIST_MINIMUM_SIZE 4
+
63#define CGCONFIG_CONF_DIR "/etc/cgconfig.d"
+
64
+
65#define CGRULES_CONF_FILE "/etc/cgrules.conf"
+
66#define CGRULES_CONF_DIR "/etc/cgrules.d"
+
67#define CGRULES_MAX_FIELDS_PER_LINE 3
+
68
+
69#define CGROUP_BUFFER_LEN (5 * FILENAME_MAX)
+
70
+
71/* Maximum length of a key(<user>:<process name>) in the daemon config file */
+
72#define CGROUP_RULE_MAXKEY (LOGIN_NAME_MAX + FILENAME_MAX + 1)
+
73
+
74/* Maximum length of a line in the daemon config file */
+
75#define CGROUP_RULE_MAXLINE (FILENAME_MAX + CGROUP_RULE_MAXKEY + \
+
76 CG_CONTROLLER_MAX + 3)
+
77
+
78#define CGROUP_FILE_PREFIX "cgroup"
+
79
+
80#define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, x)
+
81#define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, x)
+
82#define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, x)
+
83#define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x)
+
84
+
85#define CGROUP_DEFAULT_LOGLEVEL CGROUP_LOG_ERROR
+
86
+
87#define max(x,y) ((y)<(x)?(x):(y))
+
88#define min(x,y) ((y)>(x)?(x):(y))
+
89
+ +
91 char name[FILENAME_MAX];
+
92 char value[CG_CONTROL_VALUE_MAX];
+
93
+
94 /* cgget uses this field for values that span multiple lines */
+
95 char *multiline_value;
+
96
+
97 /*
+
98 * The abstraction layer uses prev_name when there's an N->1 or
+
99 * 1->N relationship between cgroup v1 and v2 settings.
+
100 */
+
101 char *prev_name;
+
102
+
103 bool dirty;
+
104};
+
105
+ +
107 char name[FILENAME_MAX];
+
108 struct control_value *values[CG_NV_MAX];
+
109 struct cgroup *cgroup;
+
110 int index;
+
111 enum cg_version_t version;
+
112};
+
113
+
114struct cgroup {
+
115 char name[FILENAME_MAX];
+
116 struct cgroup_controller *controller[CG_CONTROLLER_MAX];
+
117 int index;
+
118 uid_t tasks_uid;
+
119 gid_t tasks_gid;
+
120 mode_t task_fperm;
+
121 uid_t control_uid;
+
122 gid_t control_gid;
+
123 mode_t control_fperm;
+
124 mode_t control_dperm;
+
125};
+
126
+ +
128 char path[FILENAME_MAX];
+
129 struct cg_mount_point *next;
+
130};
+
131
+ +
134 char name[FILENAME_MAX];
+ +
139 int index;
+
140 enum cg_version_t version;
+
141};
+
142
+ +
144 pid_t pid; /* pid of the process which needs to change group */
+
145
+
146 /* Details of user under consideration for destination cgroup */
+
147 struct passwd *pw;
+
148 /* Gid of the process */
+
149 gid_t gid;
+
150};
+
151
+
152/* A rule that maps UID/GID to a cgroup */
+ +
154 uid_t uid;
+
155 gid_t gid;
+
156 bool is_ignore;
+
157 char *procname;
+
158 char username[LOGIN_NAME_MAX];
+
159 char destination[FILENAME_MAX];
+
160 char *controllers[MAX_MNT_ELEMENTS];
+
161 struct cgroup_rule *next;
+
162};
+
163
+
164/* Container for a list of rules */
+ +
166 struct cgroup_rule *head;
+
167 struct cgroup_rule *tail;
+
168 int len;
+
169};
+
170
+
171/*The walk_tree handle */
+ +
173 FTS *fts;
+
174 int flags;
+
175};
+
176
+ +
185 const char *name;
+
186 const char *value;
+
187 struct cgroup_dictionary_item *next;
+
188};
+
189
+
190/* Flags for cgroup_dictionary_create */
+
197#define CG_DICT_DONT_FREE_ITEMS 1
+
198
+ +
208 struct cgroup_dictionary_item *head;
+
209 struct cgroup_dictionary_item *tail;
+
210 int flags;
+
211};
+
212
+ +
215 struct cgroup_dictionary_item *item;
+
216};
+
217
+
221extern __thread int last_errno;
+
222
+
226extern jmp_buf parser_error_env;
+
227
+
228/* Internal API */
+
229char *cg_build_path(const char *name, char *path, const char *type);
+
230int cgroup_get_uid_gid_from_procfs(pid_t pid, uid_t *euid, gid_t *egid);
+
231int cgroup_get_procname_from_procfs(pid_t pid, char **procname);
+
232int cg_mkdir_p(const char *path);
+
233struct cgroup *create_cgroup_from_name_value_pairs(const char *name,
+
234 struct control_value *name_value, int nv_number);
+
235void init_cgroup_table(struct cgroup *cgroups, size_t count);
+
236
+
237/*
+
238 * Main mounting structures
+
239 */
+
240extern struct cg_mount_table_s cg_mount_table[CG_CONTROLLER_MAX];
+
241extern pthread_rwlock_t cg_mount_table_lock;
+
242
+
243/*
+
244 * config related structures
+
245 */
+
246
+
247extern __thread char *cg_namespace_table[CG_CONTROLLER_MAX];
+
248
+
249/*
+
250 * config related API
+
251 */
+
252int cgroup_config_insert_cgroup(char *cg_name);
+
253int cgroup_config_parse_controller_options(char *controller,
+
254 struct cgroup_dictionary *values);
+
255int template_config_insert_cgroup(char *cg_name);
+
256int template_config_parse_controller_options(char *controller,
+
257 struct cgroup_dictionary *values);
+
258int template_config_group_task_perm(char *perm_type, char *value);
+
259int template_config_group_admin_perm(char *perm_type, char *value);
+
260int cgroup_config_group_task_perm(char *perm_type, char *value);
+
261int cgroup_config_group_admin_perm(char *perm_type, char *value);
+
262int cgroup_config_insert_into_mount_table(char *name, char *mount_point);
+
263int cgroup_config_insert_into_namespace_table(char *name, char *mount_point);
+
264void cgroup_config_cleanup_mount_table(void);
+
265void cgroup_config_cleanup_namespace_table(void);
+
266int cgroup_config_define_default(void);
+
267
+
271extern int cgroup_dictionary_create(struct cgroup_dictionary **dict,
+
272 int flags);
+
276extern int cgroup_dictionary_add(struct cgroup_dictionary *dict,
+
277 const char *name, const char *value);
+
282extern int cgroup_dictionary_free(struct cgroup_dictionary *dict);
+
283
+
288extern int cgroup_dictionary_iterator_begin(struct cgroup_dictionary *dict,
+
289 void **handle, const char **name, const char **value);
+
293extern int cgroup_dictionary_iterator_next(void **handle,
+
294 const char **name, const char **value);
+
298extern void cgroup_dictionary_iterator_end(void **handle);
+
299
+
309int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+
310
+
320int cgroup_build_tasks_procs_path(char * const path,
+
321 size_t path_sz, const char * const cg_name,
+
322 const char * const ctrl_name);
+
323
+
335char *cg_build_path_locked(const char *setting, char *path,
+
336 const char *controller);
+
337
+
349int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup,
+
350 struct cgroup_controller *cgc, int cg_index);
+
351
+
358int cgroup_test_subsys_mounted(const char *ctrl_name);
+
359
+
368int cgroup_copy_controller_values(struct cgroup_controller * const dst,
+
369 const struct cgroup_controller * const src);
+
370
+
378int cgroup_remove_value(struct cgroup_controller * const controller,
+
379 const char * const name);
+
380
+
387void cgroup_free_controller(struct cgroup_controller *ctrl);
+
388
+
394#ifdef UNIT_TEST
+
395
+
396#define TEST_PROC_PID_CGROUP_FILE "test-procpidcgroup"
+
397
+
398int cgroup_parse_rules_options(char *options,
+
399 struct cgroup_rule * const rule);
+
400
+
401int cg_get_cgroups_from_proc_cgroups(pid_t pid, char *cgroup_list[],
+
402 char *controller_list[],
+
403 int list_len);
+
404
+
405bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule,
+
406 pid_t pid, const char * const procname);
+
407
+
408bool cgroup_compare_wildcard_procname(const char * const rule_procname,
+
409 const char * const procname);
+
410
+
411int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent,
+
412 int *mnt_tbl_idx);
+
413
+
414int cgroup_process_v2_mnt(struct mntent *ent, int *mnt_tbl_idx);
+
415
+
416int cgroup_set_values_recursive(const char * const base,
+
417 const struct cgroup_controller * const controller,
+
418 bool ignore_non_dirty_failures);
+
419
+
420int cgroup_chown_chmod_tasks(const char * const cg_path,
+
421 uid_t uid, gid_t gid, mode_t fperm);
+
422
+
423int cgroupv2_subtree_control(const char *path, const char *ctrl_name,
+
424 bool enable);
+
425
+
426int cgroupv2_get_subtree_control(const char *path,
+
427 const char *ctrl_name,
+
428 bool * const enabled);
+
429
+
430int cgroupv2_controller_enabled(const char * const cg_name,
+
431 const char * const ctrl_name);
+
432
+
433#endif /* UNIT_TEST */
+
434
+
435#ifdef __cplusplus
+
436} /* extern "C" */
+
437#endif
+
438
+
439#endif
Definition: libcgroup-internal.h:127
Definition: libcgroup-internal.h:132
struct cg_mount_point mount
Definition: libcgroup-internal.h:138
@@ -401,7 +401,7 @@ $(function() {
diff --git a/libcgroup_8h_source.html b/libcgroup_8h_source.html index 69922125..08da9361 100644 --- a/libcgroup_8h_source.html +++ b/libcgroup_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
libcgroup.h
+
libcgroup.h
-
1 /*
-
2  * Copyright IBM Corporation. 2007
-
3  *
-
4  * Author: Balbir Singh <balbir@linux.vnet.ibm.com>
-
5  *
-
6  * This program is free software; you can redistribute it and/or modify it
-
7  * under the terms of version 2.1 of the GNU Lesser General Public License
-
8  * as published by the Free Software Foundation.
-
9  *
-
10  * This program is distributed in the hope that it would be useful, but
-
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
-
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
13  *
-
14  */
-
15 
-
16 #ifndef _LIBCGROUP_H
-
17 #define _LIBCGROUP_H
-
18 
-
19 #define _LIBCGROUP_H_INSIDE
-
20 
-
21 #include <libcgroup/error.h>
-
22 #include <libcgroup/init.h>
-
23 #include <libcgroup/iterators.h>
-
24 #include <libcgroup/groups.h>
-
25 #include <libcgroup/tasks.h>
-
26 #include <libcgroup/config.h>
-
27 #include <libcgroup/log.h>
-
28 #include <libcgroup/tools.h>
-
29 
-
30 #undef _LIBCGROUP_H_INSIDE
-
31 
-
50 #endif /* _LIBCGROUP_H */
+
1/*
+
2 * Copyright IBM Corporation. 2007
+
3 *
+
4 * Author: Balbir Singh <balbir@linux.vnet.ibm.com>
+
5 *
+
6 * This program is free software; you can redistribute it and/or modify it
+
7 * under the terms of version 2.1 of the GNU Lesser General Public License
+
8 * as published by the Free Software Foundation.
+
9 *
+
10 * This program is distributed in the hope that it would be useful, but
+
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
+
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
13 *
+
14 */
+
15
+
16#ifndef _LIBCGROUP_H
+
17#define _LIBCGROUP_H
+
18
+
19#define _LIBCGROUP_H_INSIDE
+
20
+
21#include <libcgroup/error.h>
+
22#include <libcgroup/init.h>
+
23#include <libcgroup/iterators.h>
+
24#include <libcgroup/groups.h>
+
25#include <libcgroup/tasks.h>
+
26#include <libcgroup/config.h>
+
27#include <libcgroup/log.h>
+
28#include <libcgroup/tools.h>
+
29
+
30#undef _LIBCGROUP_H_INSIDE
+
31
+
50#endif /* _LIBCGROUP_H */
diff --git a/log_8h_source.html b/log_8h_source.html index a419c587..aebdd33b 100644 --- a/log_8h_source.html +++ b/log_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/log.h Source File @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
log.h
+
log.h
-
1 #ifndef _LIBCGROUP_LOG_H
-
2 #define _LIBCGROUP_LOG_H
-
3 
-
4 #ifndef _LIBCGROUP_H_INSIDE
-
5 #error "Only <libcgroup.h> should be included directly."
-
6 #endif
-
7 
-
8 #ifndef SWIG
-
9 #include <features.h>
-
10 #endif
-
11 
-
12 #include <stdarg.h>
-
13 
-
14 #ifdef __cplusplus
-
15 extern "C" {
-
16 #endif
-
17 
- - - - - -
91 };
-
92 
-
93 typedef void (*cgroup_logger_callback)(void *userdata, int level,
-
94  const char *fmt, va_list ap);
-
95 
-
109 extern void cgroup_set_logger(cgroup_logger_callback logger, int loglevel,
-
110  void *userdata);
-
111 
-
120 extern void cgroup_set_default_logger(int loglevel);
-
121 
-
127 extern void cgroup_set_loglevel(int loglevel);
-
128 
-
135 extern void cgroup_log(int loglevel, const char *fmt, ...);
-
136 
-
142 extern int cgroup_parse_log_level_str(const char *levelstr);
-
147 #ifdef __cplusplus
-
148 } /* extern "C" */
-
149 #endif
-
150 
-
151 #endif /* _LIBCGROUP_LOG_H */
+
1#ifndef _LIBCGROUP_LOG_H
+
2#define _LIBCGROUP_LOG_H
+
3
+
4#ifndef _LIBCGROUP_H_INSIDE
+
5#error "Only <libcgroup.h> should be included directly."
+
6#endif
+
7
+
8#ifndef SWIG
+
9#include <features.h>
+
10#endif
+
11
+
12#include <stdarg.h>
+
13
+
14#ifdef __cplusplus
+
15extern "C" {
+
16#endif
+
17
+ + + + + +
91};
+
92
+
93typedef void (*cgroup_logger_callback)(void *userdata, int level,
+
94 const char *fmt, va_list ap);
+
95
+
109extern void cgroup_set_logger(cgroup_logger_callback logger, int loglevel,
+
110 void *userdata);
+
111
+
120extern void cgroup_set_default_logger(int loglevel);
+
121
+
127extern void cgroup_set_loglevel(int loglevel);
+
128
+
135extern void cgroup_log(int loglevel, const char *fmt, ...);
+
136
+
142extern int cgroup_parse_log_level_str(const char *levelstr);
+
147#ifdef __cplusplus
+
148} /* extern "C" */
+
149#endif
+
150
+
151#endif /* _LIBCGROUP_LOG_H */
void cgroup_set_logger(cgroup_logger_callback logger, int loglevel, void *userdata)
Definition: log.c:48
cgroup_log_level
Definition: log.h:72
int cgroup_parse_log_level_str(const char *levelstr)
Definition: log.c:62
@@ -124,7 +124,7 @@ $(function() {
diff --git a/md_CONTRIBUTING.html b/md_CONTRIBUTING.html index a518332b..c04b2419 100644 --- a/md_CONTRIBUTING.html +++ b/md_CONTRIBUTING.html @@ -2,8 +2,8 @@ - - + + libcgroup: How to Contribute to the libcgroup Project @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
-
How to Contribute to the libcgroup Project
+
+
How to Contribute to the libcgroup Project
-

https://github.com/libcgroup/libcgroup

-

This document outlines the steps to help you contribute to the libcgroup project. As with the libcgroup code itself, the process is a work in progress. Improvements and suggestions are welcome and encouraged.

+

https://github.com/libcgroup/libcgroup

+

This document outlines the steps to help you contribute to the libcgroup project. As with the libcgroup code itself, the process is a work in progress. Improvements and suggestions are welcome and encouraged.

Interacting with the Community

-

"When you are kind to others, it not only changes you, it changes the +

‍"When you are kind to others, it not only changes you, it changes the world." - Harold Kushner

The libcgroup project strives to be an inclusive and welcoming place. If you interact with the libcgroup project, we request that you treat others with dignity and respect. Failure to do so will result in a warning. In extreme cases, we reserve the right to block the individual from the project.

-

Examples of inappropriate behavior includes: profane, abusive, or prejudicial language directed at another person, vandalism (e.g. GitHub issue/PR "litter"), or spam.

+

Examples of inappropriate behavior includes: profane, abusive, or prejudicial language directed at another person, vandalism (e.g. GitHub issue/PR "litter"), or spam.

Test Your Code Using Existing Tests

-

The libcgroup project utilizes unit and functional tests. These tests must successfully pass prior to a commit being merged.

-

You can run both the unit and functional tests with the following command:

# make check
+

The libcgroup project utilizes unit and functional tests. These tests must successfully pass prior to a commit being merged.

+

You can run both the unit and functional tests with the following command:

# make check
 

You can invoke only the unit tests with the following commands:

# cd tests/gunit
 # make check
 

If there are unit test failures, running the unit tests outside of the automake framework will provide more information.

# cd tests/gunit
@@ -86,23 +86,23 @@ Test Your Code Using Existing Tests
 

You can invoke only the functional tests with the following commands:

# cd tests/ftests
 # make check
 

Note that the functional tests can be run within a container or directly on your system. For the containerized tests, libcgroup utilizes LXC/LXD containers. If your system or distro doesn't support LXC/LXD, you can utilize the continuous integration infrastructure to test your changes. A successful continuous integration run is required for each pull request.

-

Many tests can also be run outside of a container. Use caution with these tests though, as they will modify your host's cgroup hierarchy. This could significantly and negatively affect your system.

-

We encourage utilizing a VM for libcgroup development work. The continuous integration suite utilizes the latest Ubuntu LTS.

-

To run the containerized tests only:

# cd tests/ftests
+

Many tests can also be run outside of a container. Use caution with these tests though, as they will modify your host's cgroup hierarchy. This could significantly and negatively affect your system.

+

We encourage utilizing a VM for libcgroup development work. The continuous integration suite utilizes the latest Ubuntu LTS.

+

To run the containerized tests only:

# cd tests/ftests
 # ./ftests.sh
 

To run the non-containerized tests only:

# cd tests/ftests
 # ./ftests-nocontainer.sh
 

After the run is complete, the ftests.sh.log and ftests-nocontainer.sh.log contain the full debug log for each run.

Add New Tests for New Functionality

-

The libcgroup project utilizes automated tests, code coverage, and continuous integration to maintain a high level of code quality. Any pull requests that add functionality or significantly change existing code should include additional tests to verify the proper operation of the proposed changes. Note that functional tests are preferred over unit tests.

-

The continuous integration tools run the automated tests and automatically gather code coverage numbers. Pull requests that cause the code coverage numbers to decrease are strongly discouraged.

+

The libcgroup project utilizes automated tests, code coverage, and continuous integration to maintain a high level of code quality. Any pull requests that add functionality or significantly change existing code should include additional tests to verify the proper operation of the proposed changes. Note that functional tests are preferred over unit tests.

+

The continuous integration tools run the automated tests and automatically gather code coverage numbers. Pull requests that cause the code coverage numbers to decrease are strongly discouraged.

Explain Your Work

-

At the top of every patch you should include a description of the problem you are trying to solve, how you solved it, and why you chose the solution you implemented. If you are submitting a bug fix, it is also incredibly helpful if you can describe/include a reproducer for the problem in the description as well as instructions on how to test for the bug and verify that it has been fixed.

+

At the top of every patch you should include a description of the problem you are trying to solve, how you solved it, and why you chose the solution you implemented. If you are submitting a bug fix, it is also incredibly helpful if you can describe/include a reproducer for the problem in the description as well as instructions on how to test for the bug and verify that it has been fixed.

Sign Your Work

-

The sign-off is a simple line at the end of the patch description, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The "Developer's Certificate of Origin" pledge is taken from the Linux Kernel and the rules are pretty simple:

Developer's Certificate of Origin 1.1
+

The sign-off is a simple line at the end of the patch description, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The "Developer's Certificate of Origin" pledge is taken from the Linux Kernel and the rules are pretty simple:

Developer's Certificate of Origin 1.1
 
 By making a contribution to this project, I certify that:
 
@@ -131,24 +131,24 @@ By making a contribution to this project, I certify that:
 

You can add this to your commit description in git with git commit -s

Submitting Patches

-

libcgroup was initially hosted on Sourceforge and at that time only accepted patches via the mailing list. In 2018, libcgroup was moved to github and now accepts patches via email or github pull request. Over time the libcgroup project will likely fully transition to gitub pull requests and issues.

+

libcgroup was initially hosted on Sourceforge and at that time only accepted patches via the mailing list. In 2018, libcgroup was moved to github and now accepts patches via email or github pull request. Over time the libcgroup project will likely fully transition to gitub pull requests and issues.

Post Your Patches Upstream

-

The sections below explain how to contribute via either method. Please read each step and perform all steps that apply to your chosen contribution method.

+

The sections below explain how to contribute via either method. Please read each step and perform all steps that apply to your chosen contribution method.

Submitting via Email

-

Depending on how you decided to work with the libcgroup code base and what tools you are using there are different ways to generate your patch(es). However, regardless of what tools you use, you should always generate your patches using the "unified" diff/patch format and the patches should always apply to the libcgroup source tree using the following command from the top directory of the libcgroup sources:

# patch -p1 < changes.patch
+

Depending on how you decided to work with the libcgroup code base and what tools you are using there are different ways to generate your patch(es). However, regardless of what tools you use, you should always generate your patches using the "unified" diff/patch format and the patches should always apply to the libcgroup source tree using the following command from the top directory of the libcgroup sources:

# patch -p1 < changes.patch
 

If you are not using git, stacked git (stgit), or some other tool which can generate patch files for you automatically, you may find the following command helpful in generating patches, where "libcgroup.orig/" is the unmodified source code directory and "libcgroup/" is the source code directory with your changes:

# diff -purN libcgroup.orig/ libcgroup/
 

When in doubt please generate your patch and try applying it to an unmodified copy of the libcgroup sources; if it fails for you, it will fail for the rest of us.

-

Finally, you will need to email your patches to the mailing list so they can be reviewed and potentially merged into the main libcgroup repository. When sending patches to the mailing list it is important to send your email in text form, no HTML mail please, and ensure that your email client does not mangle your patches. It should be possible to save your raw email to disk and apply it directly to the libcgroup source code; if that fails then you likely have a problem with your email client. When in doubt try a test first by sending yourself an email with your patch and attempting to apply the emailed patch to the libcgrup repository; if it fails for you, it will fail for the rest of us trying to test your patch and include it in the main libcgroup repository.

+

Finally, you will need to email your patches to the mailing list so they can be reviewed and potentially merged into the main libcgroup repository. When sending patches to the mailing list it is important to send your email in text form, no HTML mail please, and ensure that your email client does not mangle your patches. It should be possible to save your raw email to disk and apply it directly to the libcgroup source code; if that fails then you likely have a problem with your email client. When in doubt try a test first by sending yourself an email with your patch and attempting to apply the emailed patch to the libcgrup repository; if it fails for you, it will fail for the rest of us trying to test your patch and include it in the main libcgroup repository.

Submitting via GitHub Pull Requests

-

See this guide if you've never done this before.

+

See this guide if you've never done this before.

diff --git a/md_README.html b/md_README.html index 77a02aef..5239f39f 100644 --- a/md_README.html +++ b/md_README.html @@ -2,8 +2,8 @@ - - + + libcgroup: README @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
-
README
+
+
README
-

Build Status Coverage Status Doxygen Documentation Language grade: C/C++

-

The entire libcgroup README is available [here](README).

+

Build Status Coverage Status Doxygen Documentation Language grade: C/C++

+

The entire libcgroup README is available [here](README).

diff --git a/md_SECURITY.html b/md_SECURITY.html index 9a669a72..5d352c48 100644 --- a/md_SECURITY.html +++ b/md_SECURITY.html @@ -2,8 +2,8 @@ - - + + libcgroup: The libcgroup Security Vulnerability Handling Process @@ -19,8 +19,8 @@
- - + @@ -29,21 +29,22 @@
+
libcgroup
- + +/* @license-end */ +
-
-
-
The libcgroup Security Vulnerability Handling Process
+
+
The libcgroup Security Vulnerability Handling Process
-

https://github.com/libcgroup/libcgroup

-

This document describes the processes through which sensitive security relevant bugs can be responsibly disclosed to the libcgroup project and how the project maintainers should handle these reports. Just like the other libcgroup process documents, this document should be treated as a guiding document and not a hard, unyielding set of regulations; the bug reporters and project maintainers are encouraged to work together to address the issues as best they can, in a manner which works best for all parties involved.

+

https://github.com/libcgroup/libcgroup

+

This document describes the processes through which sensitive security relevant bugs can be responsibly disclosed to the libcgroup project and how the project maintainers should handle these reports. Just like the other libcgroup process documents, this document should be treated as a guiding document and not a hard, unyielding set of regulations; the bug reporters and project maintainers are encouraged to work together to address the issues as best they can, in a manner which works best for all parties involved.

Reporting Problems

-

Problems with the libcgroup library that are not suitable for immediate public disclosure should be emailed to the current libcgroup maintainers; see below. We typically request at most a 90 day time period to address the issue before it is made public, but we will make every effort to address the issue as quickly as possible and shorten the disclosure window.

+

Problems with the libcgroup library that are not suitable for immediate public disclosure should be emailed to the current libcgroup maintainers; see below. We typically request at most a 90 day time period to address the issue before it is made public, but we will make every effort to address the issue as quickly as possible and shorten the disclosure window.

Resolving Sensitive Security Issues

-

Upon disclosure of a bug, the maintainers should work together to investigate the problem and decide on a solution. In order to prevent an early disclosure of the problem, those working on the solution should do so privately and outside of the traditional libcgroup development practices. One possible solution to this is to leverage the GitHub "Security" functionality to create a private development fork that can be shared among the maintainers, and optionally the reporter. A placeholder GitHub issue may be created, but details should remain extremely limited until such time as the problem has been fixed and responsibly disclosed. If a CVE, or other tag, has been assigned to the problem, the GitHub issue title should include the vulnerability tag once the problem has been disclosed.

+

Upon disclosure of a bug, the maintainers should work together to investigate the problem and decide on a solution. In order to prevent an early disclosure of the problem, those working on the solution should do so privately and outside of the traditional libcgroup development practices. One possible solution to this is to leverage the GitHub "Security" functionality to create a private development fork that can be shared among the maintainers, and optionally the reporter. A placeholder GitHub issue may be created, but details should remain extremely limited until such time as the problem has been fixed and responsibly disclosed. If a CVE, or other tag, has been assigned to the problem, the GitHub issue title should include the vulnerability tag once the problem has been disclosed.

Public Disclosure

-

Whenever possible, responsible reporting and patching practices should be followed, including notification to the linux-distros and oss-security mailing lists.

+

Whenever possible, responsible reporting and patching practices should be followed, including notification to the linux-distros and oss-security mailing lists.

diff --git a/menu.js b/menu.js index 2fe2214f..54e81cf1 100644 --- a/menu.js +++ b/menu.js @@ -36,15 +36,91 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + var searchBox; if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
  • '); + searchBox='
    '+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '
    '+ + '
    '; } else { - $('#main-menu').append('
  • '); + searchBox='
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '' + '' + '
    '; + } + } + + $('#main-nav').before('
    '+ + ''+ + ''+ + '
    '); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBox) { + $('#main-menu').append('
  • '); + } + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; + if ($mainMenuState.length) { + function initResizableIfExists() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = function() { $menu.css('display', 'block') }; + $menu.hide().slideDown(options); + } else { + options['complete'] = function() { $menu.css('display', 'none') }; + $menu.show().slideUp(options); + } + }); + // set default menu visibility + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBox); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBox); + $('#searchBoxPos2').show(); + } + prevWidth = newWidth; + } } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); } $('#main-menu').smartmenus(); } diff --git a/modules.html b/modules.html index 225960bd..513f0583 100644 --- a/modules.html +++ b/modules.html @@ -2,8 +2,8 @@ - - + + libcgroup: Modules @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    @@ -61,8 +62,7 @@ $(function() {
    -
    -
    Modules
    +
    Modules
    Here is a list of all modules:
    @@ -78,7 +78,7 @@ $(function() {
    diff --git a/pages.html b/pages.html index 763067e2..acbeaf31 100644 --- a/pages.html +++ b/pages.html @@ -2,8 +2,8 @@ - - + + libcgroup: Related Pages @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    @@ -61,8 +62,7 @@ $(function() {
    -
    -
    Related Pages
    +
    Related Pages
    Here is a list of all related documentation pages:
    @@ -76,7 +76,7 @@ $(function() {
    diff --git a/search/all_0.html b/search/all_0.html index 1ec5b2d5..c36c9af5 100644 --- a/search/all_0.html +++ b/search/all_0.html @@ -2,7 +2,7 @@ - + @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    +/* @license-end */ +
    -
    -
    array_parent_info Struct Reference
    +
    array_parent_info Struct Reference
    - - - -

    +

    Data Fields

    +
    int index
     
    +
    int num_allocation
     
    +
    struct parent_info ** parent_info
     
    @@ -86,7 +86,7 @@ struct parent_info **  diff --git a/structarray__unchanged.html b/structarray__unchanged.html index 78e9902b..c1270f16 100644 --- a/structarray__unchanged.html +++ b/structarray__unchanged.html @@ -2,8 +2,8 @@ - - + + libcgroup: array_unchanged Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    array_unchanged Struct Reference
    +
    array_unchanged Struct Reference
    - - - -

    +

    Data Fields

    +
    int index
     
    +
    int num_allocation
     
    +
    struct unchanged_pidproc
     
    @@ -86,7 +86,7 @@ struct unchanged_pid * <
    diff --git a/structblack__list__type.html b/structblack__list__type.html index ec577b6e..41e24caa 100644 --- a/structblack__list__type.html +++ b/structblack__list__type.html @@ -2,8 +2,8 @@ - - + + libcgroup: black_list_type Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    black_list_type Struct Reference
    +
    black_list_type Struct Reference
    - - -

    +

    Data Fields

    +
    char * name
     
    +
    struct black_list_typenext
     
    @@ -83,7 +83,7 @@ struct black_list_type *&#
    diff --git a/structcg__mount__point.html b/structcg__mount__point.html index af1f52bf..366913cb 100644 --- a/structcg__mount__point.html +++ b/structcg__mount__point.html @@ -2,8 +2,8 @@ - - + + libcgroup: cg_mount_point Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cg_mount_point Struct Reference
    +
    cg_mount_point Struct Reference
    - - -

    +

    Data Fields

    +
    char path [FILENAME_MAX]
     
    +
    struct cg_mount_pointnext
     
    @@ -83,7 +83,7 @@ struct cg_mount_point *
    diff --git a/structcg__mount__table__s.html b/structcg__mount__table__s.html index 11a8c5e5..3584359a 100644 --- a/structcg__mount__table__s.html +++ b/structcg__mount__table__s.html @@ -2,8 +2,8 @@ - - + + libcgroup: cg_mount_table_s Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cg_mount_table_s Struct Reference
    +
    cg_mount_table_s Struct Reference
    - - -

    +

    Data Fields

    char name [FILENAME_MAX]
     
    struct cg_mount_point mount
     
    +
    int index
     
    +
    enum cg_version_t version
     

    Field Documentation

    - +

    ◆ mount

    @@ -93,11 +93,11 @@ enum cg_version_t version<
    -

    List of mount points, at least one mount point is there for sure.

    +

    List of mount points, at least one mount point is there for sure.

    - +

    ◆ name

    @@ -108,7 +108,7 @@ enum cg_version_t version<
    -

    Controller name.

    +

    Controller name.

    @@ -118,7 +118,7 @@ enum cg_version_t version<
    diff --git a/structcgroup.html b/structcgroup.html index dc6deef4..0a1d315f 100644 --- a/structcgroup.html +++ b/structcgroup.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup Struct Reference
    +
    cgroup Struct Reference

    #include <groups.h>

    - - - - - - - - - - -

    +

    Data Fields

    +
    char name [FILENAME_MAX]
     
    +
    struct cgroup_controllercontroller [CG_CONTROLLER_MAX]
     
    +
    int index
     
    +
    uid_t tasks_uid
     
    +
    gid_t tasks_gid
     
    +
    mode_t task_fperm
     
    +
    uid_t control_uid
     
    +
    gid_t control_gid
     
    +
    mode_t control_fperm
     
    +
    mode_t control_dperm
     

    Detailed Description

    -

    Structure describing one or more control groups. The structure is opaque to applications.

    +

    Structure describing one or more control groups. The structure is opaque to applications.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__abstraction__map.html b/structcgroup__abstraction__map.html index 8acf2bd6..4c75d83d 100644 --- a/structcgroup__abstraction__map.html +++ b/structcgroup__abstraction__map.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_abstraction_map Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_abstraction_map Struct Reference
    +
    cgroup_abstraction_map Struct Reference

    #include <abstraction-map.h>

    - - - - - -

    +

    Data Fields

    +
    int(* cgroup_convert )(struct cgroup_controller *const dst_cgc, const char *const in_value, const char *const out_setting, void *in_dflt, void *out_dflt)
     
    +
    char * in_setting
     
    +
    void * in_dflt
     
    +
    char * out_setting
     
    +
    void * out_dflt
     

    Detailed Description

    -

    Libcgroup abstraction layer mappings

    -

    Copyright (c) 2021-2022 Oracle and/or its affiliates. Author: Tom Hromatka tom.h.nosp@m.roma.nosp@m.tka@o.nosp@m.racl.nosp@m.e.com

    +

    Libcgroup abstraction layer mappings

    +

    Copyright (c) 2021-2022 Oracle and/or its affiliates. Author: Tom Hromatka tom.h.nosp@m.roma.nosp@m.tka@o.nosp@m.racl.nosp@m.e.com


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__controller.html b/structcgroup__controller.html index 26fcdb06..17bbf4a3 100644 --- a/structcgroup__controller.html +++ b/structcgroup__controller.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_controller Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_controller Struct Reference
    +
    cgroup_controller Struct Reference

    #include <groups.h>

    - - - - - -

    +

    Data Fields

    +
    char name [FILENAME_MAX]
     
    +
    struct control_valuevalues [CG_NV_MAX]
     
    +
    struct cgroupcgroup
     
    +
    int index
     
    +
    enum cg_version_t version
     

    Detailed Description

    -

    Structure describing a controller attached to one struct cgroup, including parameters of the group and their values. The structure is opaque to applications.

    See also
    groups
    +

    Structure describing a controller attached to one struct cgroup, including parameters of the group and their values. The structure is opaque to applications.

    See also
    groups

    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__dictionary.html b/structcgroup__dictionary.html index 59f3572d..3f7c4735 100644 --- a/structcgroup__dictionary.html +++ b/structcgroup__dictionary.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_dictionary Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_dictionary Struct Reference
    +
    cgroup_dictionary Struct Reference

    #include <libcgroup-internal.h>

    - - - -

    +

    Data Fields

    +
    struct cgroup_dictionary_itemhead
     
    +
    struct cgroup_dictionary_itemtail
     
    +
    int flags
     

    Detailed Description

    -

    Dictionary of (name, value) items. The dictionary keeps its order, iterator iterates in the same order as the items were added there. It is not hash-style structure, it does not provide random access to its items nor quick search. This structure should be opaque to users of the dictionary, underlying data structure might change anytime and without warnings.

    +

    Dictionary of (name, value) items. The dictionary keeps its order, iterator iterates in the same order as the items were added there. It is not hash-style structure, it does not provide random access to its items nor quick search. This structure should be opaque to users of the dictionary, underlying data structure might change anytime and without warnings.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__dictionary__item.html b/structcgroup__dictionary__item.html index 0b44f5f5..2d3510c5 100644 --- a/structcgroup__dictionary__item.html +++ b/structcgroup__dictionary__item.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_dictionary_item Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_dictionary_item Struct Reference
    +
    cgroup_dictionary_item Struct Reference

    #include <libcgroup-internal.h>

    - - - -

    +

    Data Fields

    +
    const char * name
     
    +
    const char * value
     
    +
    struct cgroup_dictionary_itemnext
     

    Detailed Description

    -

    Internal item of dictionary. Linked list is sufficient for now - we need only 'add' operation and simple iterator. In future, this might be easily rewritten to dynamic array when random access is needed, just keep in mind that the order is important and the iterator should return the items in the order they were added there.

    +

    Internal item of dictionary. Linked list is sufficient for now - we need only 'add' operation and simple iterator. In future, this might be easily rewritten to dynamic array when random access is needed, just keep in mind that the order is important and the iterator should return the items in the order they were added there.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__dictionary__iterator.html b/structcgroup__dictionary__iterator.html index fee79a65..5f91e49a 100644 --- a/structcgroup__dictionary__iterator.html +++ b/structcgroup__dictionary__iterator.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_dictionary_iterator Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_dictionary_iterator Struct Reference
    +
    cgroup_dictionary_iterator Struct Reference

    #include <libcgroup-internal.h>

    - -

    +

    Data Fields

    +
    struct cgroup_dictionary_itemitem
     

    Detailed Description

    -

    Opaque iterator of an dictionary.

    +

    Opaque iterator of an dictionary.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__file__info.html b/structcgroup__file__info.html index 87619d3b..c3b931cf 100644 --- a/structcgroup__file__info.html +++ b/structcgroup__file__info.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_file_info Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_file_info Struct Reference
    +
    cgroup_file_info Struct Reference

    #include <iterators.h>

    - @@ -84,9 +84,9 @@ Data Fields

    +

    Data Fields

    enum cgroup_file_type type
     
     

    Detailed Description

    -

    Information about found directory (= a control group).

    +

    Information about found directory (= a control group).

    Field Documentation

    - +

    ◆ depth

    @@ -97,11 +97,11 @@ Data Fields
    -

    Depth of the entity, how many directories below the root of walk it is.

    +

    Depth of the entity, how many directories below the root of walk it is.

    - +

    ◆ full_path

    @@ -112,11 +112,11 @@ Data Fields
    -

    Full path to the entity. To get path relative to the root of the walk, you must store its full_path (or its length) and calculate the relative path by yourself.

    +

    Full path to the entity. To get path relative to the root of the walk, you must store its full_path (or its length) and calculate the relative path by yourself.

    - +

    ◆ parent

    @@ -127,11 +127,11 @@ Data Fields
    -

    Name of its parent.

    +

    Name of its parent.

    - +

    ◆ path

    @@ -142,11 +142,11 @@ Data Fields
    -

    Name of the entity.

    +

    Name of the entity.

    - +

    ◆ type

    @@ -157,7 +157,7 @@ Data Fields
    -

    Type of the entity.

    +

    Type of the entity.

    @@ -167,7 +167,7 @@ Data Fields
    diff --git a/structcgroup__group__spec.html b/structcgroup__group__spec.html index ea9747ba..cc59d1b3 100644 --- a/structcgroup__group__spec.html +++ b/structcgroup__group__spec.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_group_spec Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_group_spec Struct Reference
    +
    cgroup_group_spec Struct Reference

    #include <tools-common.h>

    - - -

    +

    Data Fields

    +
    char path [FILENAME_MAX]
     
    +
    char * controllers [CG_CONTROLLER_MAX]
     

    Detailed Description

    -

    Auxiliary specifier of group, used to store parsed command line options.

    +

    Auxiliary specifier of group, used to store parsed command line options.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__mount__point.html b/structcgroup__mount__point.html index 69e60bfb..aad080f5 100644 --- a/structcgroup__mount__point.html +++ b/structcgroup__mount__point.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_mount_point Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_mount_point Struct Reference
    +
    cgroup_mount_point Struct Reference

    #include <iterators.h>

    - @@ -78,9 +78,9 @@ Data Fields

    +

    Data Fields

    char name [FILENAME_MAX]
     
     

    Detailed Description

    -

    Information about mounted controller.

    +

    Information about mounted controller.

    Field Documentation

    - +

    ◆ name

    @@ -91,11 +91,11 @@ Data Fields
    -

    Name of the controller.

    +

    Name of the controller.

    - +

    ◆ path

    @@ -106,7 +106,7 @@ Data Fields
    -

    Mount point of the controller.

    +

    Mount point of the controller.

    @@ -116,7 +116,7 @@ Data Fields
    diff --git a/structcgroup__rule.html b/structcgroup__rule.html index fa9cd13a..7fdff086 100644 --- a/structcgroup__rule.html +++ b/structcgroup__rule.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_rule Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_rule Struct Reference
    +
    cgroup_rule Struct Reference
    - - - - - - - - -

    +

    Data Fields

    +
    uid_t uid
     
    +
    gid_t gid
     
    +
    bool is_ignore
     
    +
    char * procname
     
    +
    char username [LOGIN_NAME_MAX]
     
    +
    char destination [FILENAME_MAX]
     
    +
    char * controllers [MAX_MNT_ELEMENTS]
     
    +
    struct cgroup_rulenext
     
    @@ -101,7 +101,7 @@ struct cgroup_rule
    diff --git a/structcgroup__rule__list.html b/structcgroup__rule__list.html index 8c268de2..c1483c01 100644 --- a/structcgroup__rule__list.html +++ b/structcgroup__rule__list.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_rule_list Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_rule_list Struct Reference
    +
    cgroup_rule_list Struct Reference
    - - - -

    +

    Data Fields

    +
    struct cgroup_rulehead
     
    +
    struct cgroup_ruletail
     
    +
    int len
     
    @@ -86,7 +86,7 @@ int len
    diff --git a/structcgroup__rules__data.html b/structcgroup__rules__data.html index 03f0e703..6b51937f 100644 --- a/structcgroup__rules__data.html +++ b/structcgroup__rules__data.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_rules_data Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_rules_data Struct Reference
    +
    cgroup_rules_data Struct Reference
    - - - -

    +

    Data Fields

    +
    pid_t pid
     
    +
    struct passwd * pw
     
    +
    gid_t gid
     
    @@ -86,7 +86,7 @@ gid_t gid
    diff --git a/structcgroup__stat.html b/structcgroup__stat.html index 1888f641..44fe9a6f 100644 --- a/structcgroup__stat.html +++ b/structcgroup__stat.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_stat Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_stat Struct Reference
    +
    cgroup_stat Struct Reference

    #include <iterators.h>

    - - -

    +

    Data Fields

    +
    char name [FILENAME_MAX]
     
    +
    char value [CG_VALUE_MAX]
     

    Detailed Description

    -

    One item in stats file.

    +

    One item in stats file.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__string__list.html b/structcgroup__string__list.html index d74f9d32..7ae8faac 100644 --- a/structcgroup__string__list.html +++ b/structcgroup__string__list.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_string_list Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_string_list Struct Reference
    +
    cgroup_string_list Struct Reference

    #include <tools-common.h>

    - - - -

    +

    Data Fields

    +
    char ** items
     
    +
    int size
     
    +
    int count
     

    Detailed Description

    -

    Simple dynamic array of strings.

    +

    Simple dynamic array of strings.


    The documentation for this struct was generated from the following file:
    diff --git a/structcgroup__tree__handle.html b/structcgroup__tree__handle.html index 0823bc7d..12bf457d 100644 --- a/structcgroup__tree__handle.html +++ b/structcgroup__tree__handle.html @@ -2,8 +2,8 @@ - - + + libcgroup: cgroup_tree_handle Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    cgroup_tree_handle Struct Reference
    +
    cgroup_tree_handle Struct Reference
    - - -

    +

    Data Fields

    +
    FTS * fts
     
    +
    int flags
     
    @@ -83,7 +83,7 @@ int flags
    diff --git a/structcontrol__value.html b/structcontrol__value.html index cf8c680f..833227b2 100644 --- a/structcontrol__value.html +++ b/structcontrol__value.html @@ -2,8 +2,8 @@ - - + + libcgroup: control_value Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    control_value Struct Reference
    +
    control_value Struct Reference
    - - - - - -

    +

    Data Fields

    +
    char name [FILENAME_MAX]
     
    +
    char value [CG_CONTROL_VALUE_MAX]
     
    +
    char * multiline_value
     
    +
    char * prev_name
     
    +
    bool dirty
     
    @@ -92,7 +92,7 @@ bool dirty
    diff --git a/structcontroller__data.html b/structcontroller__data.html index c1e574f9..08d2cfba 100644 --- a/structcontroller__data.html +++ b/structcontroller__data.html @@ -2,8 +2,8 @@ - - + + libcgroup: controller_data Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    controller_data Struct Reference
    +
    controller_data Struct Reference

    #include <iterators.h>

    - @@ -82,9 +82,9 @@ Data Fields

    +

    Data Fields

    char name [FILENAME_MAX]
     
     

    Detailed Description

    -

    Detailed information about available controller.

    +

    Detailed information about available controller.

    Field Documentation

    - +

    ◆ enabled

    @@ -95,11 +95,11 @@ Data Fields
    -

    Enabled flag.

    +

    Enabled flag.

    - +

    ◆ hierarchy

    @@ -110,11 +110,11 @@ Data Fields
    -

    Hierarchy ID. Controllers with the same hierarchy ID are mounted together as one hierarchy. Controllers with ID 0 are not currently mounted anywhere.

    +

    Hierarchy ID. Controllers with the same hierarchy ID are mounted together as one hierarchy. Controllers with ID 0 are not currently mounted anywhere.

    - +

    ◆ name

    @@ -125,11 +125,11 @@ Data Fields
    -

    Controller name.

    +

    Controller name.

    - +

    ◆ num_cgroups

    @@ -140,7 +140,7 @@ Data Fields
    -

    Number of groups.

    +

    Number of groups.

    @@ -150,7 +150,7 @@ Data Fields
    diff --git a/structext__cgroup__record.html b/structext__cgroup__record.html index 51dd5503..0c27b4b5 100644 --- a/structext__cgroup__record.html +++ b/structext__cgroup__record.html @@ -2,8 +2,8 @@ - - + + libcgroup: ext_cgroup_record Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    ext_cgroup_record Struct Reference
    +
    ext_cgroup_record Struct Reference
    - - - -

    +

    Data Fields

    +
    char name [FILENAME_MAX]
     
    +
    char controller [FILENAME_MAX]
     
    +
    int h_number
     
    @@ -86,7 +86,7 @@ int h_number
    diff --git a/structparent__info.html b/structparent__info.html index 401b691e..9b1b947e 100644 --- a/structparent__info.html +++ b/structparent__info.html @@ -2,8 +2,8 @@ - - + + libcgroup: parent_info Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    parent_info Struct Reference
    +
    parent_info Struct Reference
    - - -

    +

    Data Fields

    +
    __u64 timestamp
     
    +
    pid_t pid
     
    @@ -83,7 +83,7 @@ pid_t pid
    diff --git a/structunchanged__pid.html b/structunchanged__pid.html index df206f9f..5126a15c 100644 --- a/structunchanged__pid.html +++ b/structunchanged__pid.html @@ -2,8 +2,8 @@ - - + + libcgroup: unchanged_pid Struct Reference @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    unchanged_pid Struct Reference
    +
    unchanged_pid Struct Reference
    - - -

    +

    Data Fields

    +
    pid_t pid
     
    +
    int flags
     
    @@ -83,7 +83,7 @@ int flags
    diff --git a/tabs.css b/tabs.css index 85a0cd5b..00d1c602 100644 --- a/tabs.css +++ b/tabs.css @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:#666;-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file diff --git a/tasks_8h_source.html b/tasks_8h_source.html index c9140034..454dc049 100644 --- a/tasks_8h_source.html +++ b/tasks_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/tasks.h Source File @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    tasks.h
    +
    tasks.h
    -
    1 #ifndef _LIBCGROUP_TASKS_H
    -
    2 #define _LIBCGROUP_TASKS_H
    -
    3 
    -
    4 #ifndef _LIBCGROUP_H_INSIDE
    -
    5 #error "Only <libcgroup.h> should be included directly."
    -
    6 #endif
    -
    7 
    -
    8 #include <libcgroup/groups.h>
    -
    9 
    -
    10 #ifndef SWIG
    -
    11 #include <features.h>
    -
    12 #include <stdbool.h>
    -
    13 #endif
    -
    14 
    -
    15 #ifdef __cplusplus
    -
    16 extern "C" {
    -
    17 #endif
    -
    18 
    -
    20 enum cgflags {
    -
    22  CGFLAG_USECACHE = 0x01,
    -
    24  CGFLAG_USE_TEMPLATE_CACHE = 0x02,
    -
    25 };
    -
    26 
    -
    28 enum cgroup_daemon_type {
    -
    33  CGROUP_DAEMON_UNCHANGE_CHILDREN = 0x1,
    -
    34  CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS = 0x2,
    -
    35 };
    -
    36 
    -
    51 int cgroup_attach_task(struct cgroup *cgroup);
    -
    52 
    -
    58 int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid);
    -
    59 
    -
    71 int cgroup_change_cgroup_path(const char *path, pid_t pid,
    -
    72  const char * const controllers[]);
    -
    73 
    -
    82 int cgroup_get_current_controller_path(pid_t pid, const char *controller,
    -
    83  char **current_path);
    -
    84 
    -
    99 int cgroup_init_rules_cache(void);
    -
    100 
    - -
    106 
    -
    113 void cgroup_print_rules_config(FILE *fp);
    -
    114 
    -
    134 int cgroup_change_all_cgroups(void);
    -
    135 
    -
    155 int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
    -
    156  const char *procname, pid_t pid, int flags);
    -
    157 
    -
    171 int cgroup_change_cgroup_uid_gid_flags(uid_t uid, gid_t gid,
    -
    172  pid_t pid, int flags);
    -
    173 
    -
    183 int cgroup_change_cgroup_uid_gid(uid_t uid, gid_t gid, pid_t pid);
    -
    184 
    -
    203 int cgroup_register_unchanged_process(pid_t pid, int flags);
    -
    204 
    -
    209 #ifdef __cplusplus
    -
    210 } /* extern "C" */
    -
    211 #endif
    -
    212 
    -
    213 #endif /* _LIBCGROUP_TASKS_H */
    +
    1#ifndef _LIBCGROUP_TASKS_H
    +
    2#define _LIBCGROUP_TASKS_H
    +
    3
    +
    4#ifndef _LIBCGROUP_H_INSIDE
    +
    5#error "Only <libcgroup.h> should be included directly."
    +
    6#endif
    +
    7
    +
    8#include <libcgroup/groups.h>
    +
    9
    +
    10#ifndef SWIG
    +
    11#include <features.h>
    +
    12#include <stdbool.h>
    +
    13#endif
    +
    14
    +
    15#ifdef __cplusplus
    +
    16extern "C" {
    +
    17#endif
    +
    18
    +
    20enum cgflags {
    +
    22 CGFLAG_USECACHE = 0x01,
    +
    24 CGFLAG_USE_TEMPLATE_CACHE = 0x02,
    +
    25};
    +
    26
    +
    28enum cgroup_daemon_type {
    +
    33 CGROUP_DAEMON_UNCHANGE_CHILDREN = 0x1,
    +
    34 CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS = 0x2,
    +
    35};
    +
    36
    + +
    52
    +
    58int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid);
    +
    59
    +
    71int cgroup_change_cgroup_path(const char *path, pid_t pid,
    +
    72 const char * const controllers[]);
    +
    73
    +
    82int cgroup_get_current_controller_path(pid_t pid, const char *controller,
    +
    83 char **current_path);
    +
    84
    + +
    100
    + +
    106
    +
    113void cgroup_print_rules_config(FILE *fp);
    +
    114
    + +
    135
    +
    155int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
    +
    156 const char *procname, pid_t pid, int flags);
    +
    157
    +
    171int cgroup_change_cgroup_uid_gid_flags(uid_t uid, gid_t gid,
    +
    172 pid_t pid, int flags);
    +
    173
    +
    183int cgroup_change_cgroup_uid_gid(uid_t uid, gid_t gid, pid_t pid);
    +
    184
    +
    203int cgroup_register_unchanged_process(pid_t pid, int flags);
    +
    204
    +
    209#ifdef __cplusplus
    +
    210} /* extern "C" */
    +
    211#endif
    +
    212
    +
    213#endif /* _LIBCGROUP_TASKS_H */
    int cgroup_change_cgroup_path(const char *path, pid_t pid, const char *const controllers[])
    Definition: api.c:4166
    int cgroup_change_cgroup_flags(uid_t uid, gid_t gid, const char *procname, pid_t pid, int flags)
    Definition: api.c:3936
    int cgroup_attach_task(struct cgroup *cgroup)
    Definition: api.c:1805
    @@ -146,7 +146,7 @@ $(function() {
    diff --git a/todo.html b/todo.html index 17812089..37446c3c 100644 --- a/todo.html +++ b/todo.html @@ -2,8 +2,8 @@ - - + + libcgroup: Todo List @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    -
    Todo List
    +
    +
    Todo List
    @@ -77,7 +77,7 @@ $(function() {
    Global cgroup_create_cgroup (struct cgroup *cgroup, int ignore_ownership)
    what is ignore_ownership good for?
    Global cgroup_create_cgroup_from_parent (struct cgroup *cgroup, int ignore_ownership)
    -

    what is this good for? Why the list of controllers added by cgroup_add_controller() is not used, like in cgroup_create_cgroup()? I can't crate subgroup of root group in just one hierarchy with this function!

    +

    what is this good for? Why the list of controllers added by cgroup_add_controller() is not used, like in cgroup_create_cgroup()? I can't crate subgroup of root group in just one hierarchy with this function!

    what is ignore_ownership good for?

    Global cgroup_delete_cgroup (struct cgroup *cgroup, int ignore_migration)
    @@ -87,12 +87,12 @@ $(function() {
    Global cgroup_free_controllers (struct cgroup *cgroup)
    should this function be public???
    Global cgroup_get_cgroup (struct cgroup *cgroup)
    -
    what is this function good for? Why is not considered only the list of controllers attached by cgroup_add_controller()? What owners will return cgroup_get_uid_gid() if the group is in multiple hierarchies, each with different owner of tasks file?
    +
    what is this function good for? Why is not considered only the list of controllers attached by cgroup_add_controller()? What owners will return cgroup_get_uid_gid() if the group is in multiple hierarchies, each with different owner of tasks file?
    Global cgroup_get_value_string (struct cgroup_controller *controller, const char *name, char **value)
    rephrase, it's too vague... How big is the buffer actually?
    Global cgroup_init_rules_cache (void)
    add parameter with the filename?
    -
    Global cgroup_new_cgroup (const char *name)
    +
    Global cgroup_new_cgroup (const char *name)
    suggest one preferred way, either "/foo" or "foo".
    Global cgroup_walk_tree_begin (const char *controller, const char *base_path, int depth, void **handle, struct cgroup_file_info *info, int *base_level)
    why base_level is not hidden in **handle?
    @@ -105,7 +105,7 @@ $(function() {
    diff --git a/tools-common_8h_source.html b/tools-common_8h_source.html index 3058dcbb..3625317f 100644 --- a/tools-common_8h_source.html +++ b/tools-common_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: src/tools/tools-common.h Source File @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    tools-common.h
    +
    tools-common.h
    -
    1 /*
    -
    2  * Copyright Red Hat, Inc. 2009
    -
    3  *
    -
    4  * Author: Vivek Goyal <vgoyal@redhat.com>
    -
    5  * Jan Safranek <jsafrane@redhat.com>
    -
    6  *
    -
    7  * This program is free software; you can redistribute it and/or modify it
    -
    8  * under the terms of version 2.1 of the GNU Lesser General Public License
    -
    9  * as published by the Free Software Foundation.
    -
    10  *
    -
    11  * This program is distributed in the hope that it would be useful, but
    -
    12  * WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -
    14  *
    -
    15  */
    -
    16 
    -
    17 #ifndef __TOOLS_COMMON
    -
    18 
    -
    19 #define __TOOLS_COMMON
    -
    20 
    -
    21 #ifdef __cplusplus
    -
    22 extern "C" {
    -
    23 #endif
    -
    24 #include "config.h"
    -
    25 #include <libcgroup.h>
    -
    26 #include "../libcgroup-internal.h"
    -
    27 
    -
    28 #define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, x)
    -
    29 #define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, x)
    -
    30 #define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, x)
    -
    31 #define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x)
    -
    32 
    - -
    37  char path[FILENAME_MAX];
    -
    38  char *controllers[CG_CONTROLLER_MAX];
    -
    39 };
    -
    40 
    -
    41 
    - -
    46  char **items;
    -
    47  int size;
    -
    48  int count;
    -
    49 };
    -
    50 
    -
    64 int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg,
    -
    65  int capacity);
    -
    66 
    -
    71 void cgroup_free_group_spec(struct cgroup_group_spec *cl);
    -
    72 
    -
    73 
    -
    79 int cgroup_string_list_init(struct cgroup_string_list *list,
    -
    80  int initial_size);
    -
    81 
    -
    86 void cgroup_string_list_free(struct cgroup_string_list *list);
    -
    87 
    -
    94 int cgroup_string_list_add_item(struct cgroup_string_list *list,
    -
    95  const char *item);
    -
    96 
    -
    106 int cgroup_string_list_add_directory(struct cgroup_string_list *list,
    -
    107  char *dirname, char *program_name);
    -
    108 
    -
    109 
    -
    116 int parse_mode(char *string, mode_t *pmode, const char *program_name);
    -
    117 
    -
    125 int parse_uid_gid(char *string, uid_t *uid, gid_t *gid,
    -
    126  const char *program_name);
    -
    127 
    -
    133 #ifdef UNIT_TEST
    -
    134 
    -
    135 int parse_r_flag(const char * const program_name,
    -
    136  const char * const name_value_str,
    -
    137  struct control_value * const name_value);
    -
    138 
    -
    139 #endif /* UNIT_TEST */
    -
    140 
    -
    141 #ifdef __cplusplus
    -
    142 } /* extern "C" */
    -
    143 #endif
    -
    144 
    -
    145 #endif /* TOOLS_COMMON */
    +
    1/*
    +
    2 * Copyright Red Hat, Inc. 2009
    +
    3 *
    +
    4 * Author: Vivek Goyal <vgoyal@redhat.com>
    +
    5 * Jan Safranek <jsafrane@redhat.com>
    +
    6 *
    +
    7 * This program is free software; you can redistribute it and/or modify it
    +
    8 * under the terms of version 2.1 of the GNU Lesser General Public License
    +
    9 * as published by the Free Software Foundation.
    +
    10 *
    +
    11 * This program is distributed in the hope that it would be useful, but
    +
    12 * WITHOUT ANY WARRANTY; without even the implied warranty of
    +
    13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    +
    14 *
    +
    15 */
    +
    16
    +
    17#ifndef __TOOLS_COMMON
    +
    18
    +
    19#define __TOOLS_COMMON
    +
    20
    +
    21#ifdef __cplusplus
    +
    22extern "C" {
    +
    23#endif
    +
    24#include "config.h"
    +
    25#include <libcgroup.h>
    +
    26#include "../libcgroup-internal.h"
    +
    27
    +
    28#define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, x)
    +
    29#define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, x)
    +
    30#define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, x)
    +
    31#define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x)
    +
    32
    + +
    37 char path[FILENAME_MAX];
    +
    38 char *controllers[CG_CONTROLLER_MAX];
    +
    39};
    +
    40
    +
    41
    + +
    46 char **items;
    +
    47 int size;
    +
    48 int count;
    +
    49};
    +
    50
    +
    64int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg,
    +
    65 int capacity);
    +
    66
    +
    71void cgroup_free_group_spec(struct cgroup_group_spec *cl);
    +
    72
    +
    73
    +
    79int cgroup_string_list_init(struct cgroup_string_list *list,
    +
    80 int initial_size);
    +
    81
    +
    86void cgroup_string_list_free(struct cgroup_string_list *list);
    +
    87
    +
    94int cgroup_string_list_add_item(struct cgroup_string_list *list,
    +
    95 const char *item);
    +
    96
    +
    106int cgroup_string_list_add_directory(struct cgroup_string_list *list,
    +
    107 char *dirname, char *program_name);
    +
    108
    +
    109
    +
    116int parse_mode(char *string, mode_t *pmode, const char *program_name);
    +
    117
    +
    125int parse_uid_gid(char *string, uid_t *uid, gid_t *gid,
    +
    126 const char *program_name);
    +
    127
    +
    133#ifdef UNIT_TEST
    +
    134
    +
    135int parse_r_flag(const char * const program_name,
    +
    136 const char * const name_value_str,
    +
    137 struct control_value * const name_value);
    +
    138
    +
    139#endif /* UNIT_TEST */
    +
    140
    +
    141#ifdef __cplusplus
    +
    142} /* extern "C" */
    +
    143#endif
    +
    144
    +
    145#endif /* TOOLS_COMMON */
    Definition: tools-common.h:36
    Definition: tools-common.h:45
    Definition: libcgroup-internal.h:90
    diff --git a/tools_8h_source.html b/tools_8h_source.html index 8d1638c2..95942463 100644 --- a/tools_8h_source.html +++ b/tools_8h_source.html @@ -2,8 +2,8 @@ - - + + libcgroup: include/libcgroup/tools.h Source File @@ -19,8 +19,8 @@
    - - + @@ -29,21 +29,22 @@
    +
    libcgroup
    - + +/* @license-end */ +
    -
    -
    tools.h
    +
    tools.h
    -
    1 
    -
    8 /*
    -
    9  * This library is free software; you can redistribute it and/or modify it
    -
    10  * under the terms of version 2.1 of the GNU Lesser General Public License as
    -
    11  * published by the Free Software Foundation.
    -
    12  *
    -
    13  * This library is distributed in the hope that it will be useful, but WITHOUT
    -
    14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    -
    15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
    -
    16  * for more details.
    -
    17  *
    -
    18  * You should have received a copy of the GNU Lesser General Public License
    -
    19  * along with this library; if not, see <http://www.gnu.org/licenses>.
    -
    20  */
    -
    21 #ifndef _LIBCGROUP_TOOLS_H
    -
    22 #define _LIBCGROUP_TOOLS_H
    -
    23 
    -
    24 #ifndef _LIBCGROUP_H_INSIDE
    -
    25 #error "Only <libcgroup.h> should be included directly."
    -
    26 #endif
    -
    27 
    -
    28 #ifndef SWIG
    -
    29 #include <features.h>
    -
    30 #include <sys/types.h>
    -
    31 #include <stdbool.h>
    -
    32 #endif
    -
    33 
    -
    34 #ifdef __cplusplus
    -
    35 extern "C" {
    -
    36 #endif
    -
    37 
    -
    53 int cgroup_cgxget(struct cgroup ** cg,
    -
    54  enum cg_version_t version, bool ignore_unmappable);
    -
    55 
    -
    66 int cgroup_cgxset(const struct cgroup * const cg,
    -
    67  enum cg_version_t version, bool ignore_unmappable);
    -
    68 
    -
    69 #ifdef __cplusplus
    -
    70 } /* extern "C" */
    -
    71 #endif
    -
    72 
    -
    73 #endif /* _LIBCGROUP_TOOLS_H */
    +
    1
    +
    8/*
    +
    9 * This library is free software; you can redistribute it and/or modify it
    +
    10 * under the terms of version 2.1 of the GNU Lesser General Public License as
    +
    11 * published by the Free Software Foundation.
    +
    12 *
    +
    13 * This library is distributed in the hope that it will be useful, but WITHOUT
    +
    14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    +
    15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
    +
    16 * for more details.
    +
    17 *
    +
    18 * You should have received a copy of the GNU Lesser General Public License
    +
    19 * along with this library; if not, see <http://www.gnu.org/licenses>.
    +
    20 */
    +
    21#ifndef _LIBCGROUP_TOOLS_H
    +
    22#define _LIBCGROUP_TOOLS_H
    +
    23
    +
    24#ifndef _LIBCGROUP_H_INSIDE
    +
    25#error "Only <libcgroup.h> should be included directly."
    +
    26#endif
    +
    27
    +
    28#ifndef SWIG
    +
    29#include <features.h>
    +
    30#include <sys/types.h>
    +
    31#include <stdbool.h>
    +
    32#endif
    +
    33
    +
    34#ifdef __cplusplus
    +
    35extern "C" {
    +
    36#endif
    +
    37
    +
    53int cgroup_cgxget(struct cgroup ** cg,
    +
    54 enum cg_version_t version, bool ignore_unmappable);
    +
    55
    +
    66int cgroup_cgxset(const struct cgroup * const cg,
    +
    67 enum cg_version_t version, bool ignore_unmappable);
    +
    68
    +
    69#ifdef __cplusplus
    +
    70} /* extern "C" */
    +
    71#endif
    +
    72
    +
    73#endif /* _LIBCGROUP_TOOLS_H */
    Definition: libcgroup-internal.h:114