Lines Matching defs:appInfo

36 APPSPAWN_STATIC int GetCgroupPath(const AppSpawnedProcessInfo *appInfo, char *buffer, uint32_t buffLen)
38 const int userId = appInfo->uid / UID_BASE;
41 userId, appInfo->name, appInfo->pid);
43 int ret = snprintf_s(buffer, buffLen, buffLen - 1, "/dev/pids/%d/%s/app_%d/", userId, appInfo->name, appInfo->pid);
122 static void SetForkDenied(const AppSpawnedProcessInfo *appInfo)
125 int ret = GetCgroupPath(appInfo, pathForkDenied, sizeof(pathForkDenied));
131 APPSPAWN_LOGW("SetForkDenied %{public}d open failed ", appInfo->pid);
139 APPSPAWN_LOGI("SetForkDenied success, cgroup's owner:%{public}d", appInfo->pid);
144 static void KillProcessesByCGroup(const char *path, AppSpawnMgr *content, const AppSpawnedProcessInfo *appInfo)
146 SetForkDenied(appInfo);
152 if (pid == appInfo->pid) {
170 APPSPAWN_STATIC int ProcessMgrRemoveApp(const AppSpawnMgr *content, const AppSpawnedProcessInfo *appInfo)
173 APPSPAWN_CHECK_ONLY_EXPER(appInfo != NULL, return -1);
174 if (IsNWebSpawnMode(content) || strcmp(appInfo->name, NWEBSPAWN_SERVER_NAME) == 0) {
178 APPSPAWN_LOGV("ProcessMgrRemoveApp %{public}d %{public}d to cgroup ", appInfo->pid, appInfo->uid);
179 int ret = GetCgroupPath(appInfo, cgroupPath, sizeof(cgroupPath));
188 KillProcessesByCGroup(procPath, (AppSpawnMgr *)content, appInfo);
196 APPSPAWN_STATIC int ProcessMgrAddApp(const AppSpawnMgr *content, const AppSpawnedProcessInfo *appInfo)
199 APPSPAWN_CHECK_ONLY_EXPER(appInfo != NULL, return -1);
204 APPSPAWN_LOGV("ProcessMgrAddApp %{public}d %{public}d to cgroup ", appInfo->pid, appInfo->uid);
205 int ret = GetCgroupPath(appInfo, path, sizeof(path));
211 ret = WriteToFile(path, 0, (pid_t *)&appInfo->pid, 1);
213 if (appInfo->max != 0) {
217 ret = WritePidMax(path, appInfo->max);
220 APPSPAWN_LOGV("Add app %{public}d to cgroup %{public}s success", appInfo->pid, path);