Lines Matching defs:path

46     APPSPAWN_LOGV("Cgroup path %{public}s ", buffer);
51 APPSPAWN_STATIC int WriteToFile(const char *path, int truncated, pid_t pids[], uint32_t count)
54 int fd = open(path, O_RDWR | (truncated ? O_TRUNC : O_APPEND));
56 "Failed to open file errno: %{public}d path: %{public}s", errno, path);
64 "Failed to write file errno: %{public}d path: %{public}s %{public}s", errno, path, pidName);
80 static int WritePidMax(const char *path, uint32_t max)
105 int fd = open(path, O_RDWR | O_TRUNC);
107 "Failed to open file errno: %{public}d path: %{public}s", errno, path);
114 "Failed to write file errno: %{public}d path: %{public}s %{public}s %{public}d", errno, path, value, ret);
126 APPSPAWN_CHECK(ret == 0, return, "Failed to get cgroup path errno: %{public}d", errno);
128 APPSPAWN_CHECK(ret == 0, return, "Failed to strcat_s fork_denied path errno: %{public}d", errno);
137 "Failed to write file errno: %{public}d path: %{public}s %{public}d", errno, pathForkDenied, ret);
144 static void KillProcessesByCGroup(const char *path, AppSpawnMgr *content, const AppSpawnedProcessInfo *appInfo)
147 FILE *file = fopen(path, "r");
148 APPSPAWN_CHECK(file != NULL, return, "Open file fail %{public}s errno: %{public}d", path, errno);
180 APPSPAWN_CHECK(ret == 0, return -1, "Failed to get real path errno: %{public}d", errno);
203 char path[PATH_MAX] = {};
205 int ret = GetCgroupPath(appInfo, path, sizeof(path));
206 APPSPAWN_CHECK(ret == 0, return -1, "Failed to get real path errno: %{public}d", errno);
207 (void)CreateSandboxDir(path, 0750); // 0750 default mode
208 uint32_t pathLen = strlen(path);
209 ret = strcat_s(path, sizeof(path), "cgroup.procs");
211 ret = WriteToFile(path, 0, (pid_t *)&appInfo->pid, 1);
212 APPSPAWN_CHECK(ret == 0, return ret, "write pid to cgroup.procs fail %{public}s", path);
214 path[pathLen] = '\0';
215 ret = strcat_s(path, sizeof(path), "pids.max");
217 ret = WritePidMax(path, appInfo->max);
218 APPSPAWN_CHECK(ret == 0, return ret, "write max to pids.max fail %{public}s", path);
220 APPSPAWN_LOGV("Add app %{public}d to cgroup %{public}s success", appInfo->pid, path);