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:
@@ -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
|
||||
|
Reference in New Issue
Block a user