summaryrefslogtreecommitdiffstats
path: root/include/libcgroup/tasks.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-03-24 19:06:49 +0100
committerDhaval Giani <dhaval.giani@gmail.com>2010-03-26 12:56:43 +0100
commit127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7 (patch)
treec06b98c7ddd7bd922cd049e4431872e6b6023f2e /include/libcgroup/tasks.h
parentbdc36c15b77dd7db3720540efbd164899bee53c0 (diff)
downloadlibcg-127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7.tar.gz
libcg-127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7.tar.xz
libcg-127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7.zip
add const where applicable, drop const where unnecessary
This patch adds the const qualifier to a number of function arguments (mostly string arguments) so that client libraries can pass their own const strings to the library without having to cast their const'ness away. This also drops a couple of consts where call-by-value is done anyway, and which hence has no effect and just misleads the users and adds unnecessary noise to the signal. After all this is C, not C++. Signed-off-by: Lennart Poettering <lennart@poettering.net> Acked-by: Dhaval Giani <dhaval.giani@gmail.com> Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Diffstat (limited to 'include/libcgroup/tasks.h')
-rw-r--r--include/libcgroup/tasks.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h
index 665f993..913251c 100644
--- a/include/libcgroup/tasks.h
+++ b/include/libcgroup/tasks.h
@@ -42,8 +42,8 @@ int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid);
* @return 0 on success, > 0 on error
* TODO: Determine thread-safeness and fix of not safe.
*/
-int cgroup_change_cgroup_flags(const uid_t uid, const gid_t gid,
- char *procname, const pid_t pid, const int flags);
+int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
+ const char *procname, pid_t pid, int flags);
/**
* Changes the cgroup of a program based on the rules in the config file. If a
@@ -62,8 +62,8 @@ int cgroup_change_cgroup_flags(const uid_t uid, const gid_t gid,
* @return 0 on success, > 0 on error
* TODO: Determine thread-safeness and fix if not safe.
*/
-int cgroup_change_cgroup_uid_gid_flags(const uid_t uid, const gid_t gid,
- const pid_t pid, const int flags);
+int cgroup_change_cgroup_uid_gid_flags(uid_t uid, gid_t gid,
+ pid_t pid, int flags);
/**
* Provides backwards-compatibility with older versions of the API. This
@@ -84,7 +84,7 @@ int cgroup_change_cgroup_uid_gid(uid_t uid, gid_t gid, pid_t pid);
*
* returns 0 on success.
*/
-int cgroup_change_cgroup_path(char *path, pid_t pid, char *controllers[]);
+int cgroup_change_cgroup_path(const char *path, pid_t pid, const char * const controllers[]);
/**
* Print the cached rules table. This function should be called only after