return ret;
}
-/**
- * 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.
- */
-int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid)
+static int cgroup_attach_task_tid(struct cgroup *cgroup, pid_t tid)
{
char path[FILENAME_MAX] = {0};
char *controller_name;
return 0;
}
+/**
+ * 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.
+ */
+int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid)
+{
+ return cgroup_attach_task_tid(cgroup, tid);
+}
+
/**
* cgroup_attach_task is used to attach the current thread to a cgroup.
* struct cgroup *cgroup: The cgroup to assign the current thread to.
int cgroup_attach_task(struct cgroup *cgroup)
{
pid_t tid = cg_gettid();
- int error;
-
- error = cgroup_attach_task_pid(cgroup, tid);
- return error;
+ return cgroup_attach_task_tid(cgroup, tid);
}
/**