@@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file
5
5
in the source distribution for its full text.
6
6
*/
7
7
8
+ #include "config.h" // IWYU pragma: keep
9
+
8
10
#include "darwin/DarwinProcess.h"
9
11
10
12
#include <libproc.h>
@@ -476,6 +478,7 @@ void DarwinProcess_scanThreads(DarwinProcess* dp, DarwinProcessTable* dpt) {
476
478
tprocess -> st_uid = proc -> st_uid ;
477
479
tprocess -> user = proc -> user ;
478
480
481
+ #ifdef HAVE_THREAD_EXTENDED_INFO_DATA_T
479
482
thread_extended_info_data_t extended_info ;
480
483
mach_msg_type_number_t extended_info_count = THREAD_EXTENDED_INFO_COUNT ;
481
484
ret = thread_info (thread_list [i ], THREAD_EXTENDED_INFO , (thread_info_t ) & extended_info , & extended_info_count );
@@ -495,9 +498,15 @@ void DarwinProcess_scanThreads(DarwinProcess* dp, DarwinProcessTable* dpt) {
495
498
isProcessStuck |= true;
496
499
tdproc -> super .state = UNINTERRUPTIBLE_WAIT ;
497
500
}
501
+ #endif
498
502
499
503
// TODO: depend on setting
504
+ #ifdef HAVE_THREAD_EXTENDED_INFO_DATA_T
500
505
const char * name = extended_info .pth_name [0 ] != '\0' ? extended_info .pth_name : proc -> procComm ;
506
+ #else
507
+ // Not provided in thread_basic_info_data_t; fall back to the process name
508
+ const char * name = proc -> procComm ;
509
+ #endif
501
510
Process_updateCmdline (tprocess , name , 0 , name ? strlen (name ) : 0 );
502
511
503
512
if (!preExisting )
0 commit comments