/* ICFS: Interactively Controlled File System Copyright (C) 2024-2025 Fedir Kovalov This program can be distributed under the terms of the GNU GPLv2. See the file LICENSE. */ #ifndef PROCESS_INFO_H #define PROCESS_INFO_H #include "proc_operations.h" #include #include #include #include #include struct process_info { pid_t PID; char *name; }; static inline struct process_info get_process_info(pid_t pid) { struct process_info pi; pi.PID = get_main_thread_pid(pid); pi.name = get_process_name_by_pid(pi.PID); if (pi.name == NULL) { pi.PID = 0; } return pi; } #endif // PROCESS_INFO_H