diff --git a/src/common/xcgroup.c b/src/common/xcgroup.c index 403cf51ddf4d1a62bbbb5cfaf0258af22faebf42..d2fb81afe3c673d7f42c99679da39ac715e032f1 100644 --- a/src/common/xcgroup.c +++ b/src/common/xcgroup.c @@ -563,18 +563,19 @@ static int cgroup_procs_writable (xcgroup_t *cg) return (rc); } -// This call is not intended to be used to move thread pids +/*This call is not intended to be used to move thread pids + */ int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids) { int fstatus = XCGROUP_ERROR; char* path = NULL; - + // If possible use cgroup.procs to add the processes atomically if (cgroup_procs_writable (cg)) xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs"); else xstrfmtcat (path, "%s/%s", cg->path, "tasks"); - + fstatus = _file_write_uint32s(path, (uint32_t*)pids, npids); if (fstatus != XCGROUP_SUCCESS) debug2("unable to add pids to '%s'", cg->path); @@ -583,20 +584,21 @@ int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids) return fstatus; } -// This call is not intended to be used to get thread pids +/* This call is not intended to be used to get thread pids + */ int xcgroup_get_pids(xcgroup_t* cg, pid_t **pids, int *npids) { int fstatus = XCGROUP_ERROR; char* path = NULL; - + if (pids == NULL || npids == NULL) return SLURM_ERROR; - + if (cgroup_procs_readable (cg)) xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs"); else xstrfmtcat (path, "%s/%s", cg->path, "tasks"); - + fstatus = _file_read_uint32s(path, (uint32_t**)pids, npids); if (fstatus != XCGROUP_SUCCESS) debug2("unable to get pids of '%s'", cg->path);