Modify tid and pid from int to pid_t