Juan Lang juan.lang@gmail.com writes:
+static void get_process_affinity( struct process *process ) +{
- affinity_t affinity = ~0;
+#ifdef HAVE_SCHED_H
- if (process->unix_pid != -1)
- {
cpu_set_t set;
CPU_ZERO( &set );
if (!sched_getaffinity( process->unix_pid, sizeof(set), &set ))
You should add a configure check for sched_getaffinity, having sched.h is not enough.
@@ -403,6 +432,7 @@ data_size_t init_process( struct thread *thread ) struct process *process = thread->process; struct startup_info *info = process->startup_info;
- get_process_affinity( process );
You should retrieve it as needed. Most apps don't have any need for that information so we don't want to incur the cost of fetching it for every started process.