mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-18 06:03:42 +03:00
cgroup-util: add new cg_remove_xattr() for removing xattr from cgroup
This commit is contained in:
parent
59a49b1bcd
commit
bf25f1657f
@ -605,6 +605,23 @@ int cg_get_xattr(const char *controller, const char *path, const char *name, voi
|
||||
return (int) n;
|
||||
}
|
||||
|
||||
int cg_remove_xattr(const char *controller, const char *path, const char *name) {
|
||||
_cleanup_free_ char *fs = NULL;
|
||||
int r;
|
||||
|
||||
assert(path);
|
||||
assert(name);
|
||||
|
||||
r = cg_get_path(controller, path, NULL, &fs);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (removexattr(fs, name) < 0)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
const char *fs, *controller_str;
|
||||
|
@ -188,6 +188,7 @@ int cg_set_access(const char *controller, const char *path, uid_t uid, gid_t gid
|
||||
|
||||
int cg_set_xattr(const char *controller, const char *path, const char *name, const void *value, size_t size, int flags);
|
||||
int cg_get_xattr(const char *controller, const char *path, const char *name, void *value, size_t size);
|
||||
int cg_remove_xattr(const char *controller, const char *path, const char *name);
|
||||
|
||||
int cg_install_release_agent(const char *controller, const char *agent);
|
||||
int cg_uninstall_release_agent(const char *controller);
|
||||
|
Loading…
x
Reference in New Issue
Block a user