void muse_core_log_process_opened_fds(int pid)
{
- char cmd[MUSE_MSG_LEN_MAX];
+ char dir_path[MUSE_MSG_LEN_MAX];
+ struct dirent *de = NULL;
+ DIR *dr = NULL;
- snprintf(cmd, sizeof(cmd), "/bin/ls -alt /proc/%d/fd", pid);
- muse_core_log_cmd_info(cmd);
+ snprintf(dir_path, sizeof(dir_path), "/proc/%d/fd", pid); /* /proc/%d/fd is directory */
+ dr = opendir(dir_path);
+ muse_return_if_fail(dr)
+
+ LOGI("directory path : %s", dir_path);
+
+ while ((de = readdir(dr)) != NULL)
+ LOGW("%s\n", de->d_name);
+
+ closedir(dr);
}
void muse_core_log_process_cpu_memory(int pid)