]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroup: Make cgroup_attach a public function
authorChristian Seiler <christian@iwakd.de>
Thu, 23 Feb 2012 08:57:14 +0000 (09:57 +0100)
committerDaniel Lezcano <daniel.lezcano@free.fr>
Thu, 23 Feb 2012 08:57:14 +0000 (09:57 +0100)
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>
src/lxc/cgroup.c
src/lxc/cgroup.h

index 2e04c791059fd6adbe83b1600f14d83d2ff073e4..a8e6c270a6427890aaa86d064ae6af7a48fdb282 100644 (file)
@@ -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;
index 31dd2def785707581b95c0e90758878057f948dd..611d9f4a59b95b5d5d93b68bf7bcd9a34a576b00 100644 (file)
@@ -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