aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libgomp/config/linux/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/libgomp/config/linux/proc.c')
-rw-r--r--gcc-4.4.3/libgomp/config/linux/proc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc-4.4.3/libgomp/config/linux/proc.c b/gcc-4.4.3/libgomp/config/linux/proc.c
index 2450d97c0..5cdb1864b 100644
--- a/gcc-4.4.3/libgomp/config/linux/proc.c
+++ b/gcc-4.4.3/libgomp/config/linux/proc.c
@@ -234,7 +234,7 @@ sc_nprocessors_actu ()
if (buffer_len < 0) /* should not happen */ {
fprintf(stderr,"Could not find %s: %s\n", file_name, strerror(errno));
- return;
+ return 1;
}
/* Count the CPU cores, the value may be 0 for single-core CPUs */
@@ -264,8 +264,10 @@ gomp_init_num_threads (void)
return;
}
#endif
-#ifdef _SC_NPROCESSORS_ONLN
+#if defined(__ANDROID__)
gomp_global_icv.nthreads_var = sc_nprocessors_actu ();
+#elif defined(_SC_NPROCESSORS_ONLN)
+ gomp_global_icv.nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
#endif
}
@@ -309,8 +311,10 @@ get_num_procs (void)
return affinity_cpus;
}
#endif
-#ifdef _SC_NPROCESSORS_ONLN
+#if defined(__ANDROID__)
return sc_nprocessors_actu ();
+#elif defined(_SC_NPROCESSORS_ONLN)
+ return sysconf (_SC_NPROCESSORS_ONLN);
#else
return gomp_icv (false)->nthreads_var;
#endif