Fixed wrong pid bug

The issue was that the thread ID wasn't factored in. A presumption was,
that FUSE already returned the PID, not TID. The issue was fixed by
implementing a function that translates the TID to PID.
This commit is contained in:
2025-05-14 20:37:32 +02:00
parent 33f55384bc
commit e4dbc5becc
5 changed files with 56 additions and 3 deletions

View File

@@ -22,4 +22,13 @@ char *get_process_name_by_pid(const int pid);
*/
pid_t get_parent_pid(pid_t pid);
/**
* @brief Returns the PID of the main thread (i.e., the process ID) of the
* process that the given thread ID (tid) belongs to.
*
* @param tid The thread ID (TID) of any thread in the process.
* @return pid_t The process ID (main thread's PID), or -1 on error.
*/
pid_t get_main_thread_pid(pid_t tid);
#endif // !PROC_OPERATIONS