aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Seiler <christian@iwakd.de>2012-02-23 09:57:14 +0100
committerDaniel Lezcano <daniel.lezcano@free.fr>2012-02-23 09:57:14 +0100
commit28f2ae839d00373d093234ffbc9bbb4ef5f9d10e (patch)
tree0699d0da892764cfe42e083d75476e5af418c878 /src
parentEnable get_cgroup_mount to search for mount points satisfying multiple subsys... (diff)
downloadlxc-28f2ae839d00373d093234ffbc9bbb4ef5f9d10e.tar.gz
lxc-28f2ae839d00373d093234ffbc9bbb4ef5f9d10e.tar.bz2
lxc-28f2ae839d00373d093234ffbc9bbb4ef5f9d10e.zip
cgroup: Make cgroup_attach a public function
lxc-attach needs to be able to attach a process to specific cgroup, so cgroup_attach is renamed to lxc_cgroup_attach and now also defined in the header file. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/lxc/cgroup.c4
-rw-r--r--src/lxc/cgroup.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index 2e04c79..a8e6c27 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -170,7 +170,7 @@ static int cgroup_enable_clone_children(const char *path)
return ret;
}
-static int cgroup_attach(const char *path, pid_t pid)
+int lxc_cgroup_attach(const char *path, pid_t pid)
{
FILE *f;
char tasks[MAXPATHLEN];
@@ -250,7 +250,7 @@ static int lxc_one_cgroup_create(const char *name,
}
/* Let's add the pid to the 'tasks' file */
- if (cgroup_attach(cgname, pid)) {
+ if (lxc_cgroup_attach(cgname, pid)) {
SYSERROR("failed to attach pid '%d' to '%s'", pid, cgname);
rmdir(cgname);
return -1;
diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h
index 31dd2de..611d9f4 100644
--- a/src/lxc/cgroup.h
+++ b/src/lxc/cgroup.h
@@ -30,5 +30,6 @@ extern int lxc_cgroup_create(const char *name, pid_t pid);
extern int lxc_cgroup_destroy(const char *name);
extern int lxc_cgroup_path_get(char **path, const char *subsystem, const char *name);
extern int lxc_cgroup_nrtasks(const char *name);
+extern int lxc_cgroup_attach(const char *path, pid_t pid);
extern int lxc_ns_is_mounted(void);
#endif