diff options
author | Loren J. Rittle <ljrittle@acm.org> | 2001-08-10 17:37:41 +0000 |
---|---|---|
committer | Loren J. Rittle <ljrittle@gcc.gnu.org> | 2001-08-10 17:37:41 +0000 |
commit | cc3835e6519606345a2e9c1cc960e0af1253cab6 (patch) | |
tree | 5cbb1246c09f517e97bb53d6fce9ff90311d0c99 /libjava | |
parent | d67c7dd8552aca887093d6adcf67b1e7e67e68fe (diff) | |
download | gcc-cc3835e6519606345a2e9c1cc960e0af1253cab6.zip gcc-cc3835e6519606345a2e9c1cc960e0af1253cab6.tar.gz gcc-cc3835e6519606345a2e9c1cc960e0af1253cab6.tar.bz2 |
* java/lang/natObject.cc (is_mp): Protect use of _SC_NPROCESSORS_ONLN.
From-SVN: r44771
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/java/lang/natObject.cc | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 270500d..fa6381a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2001-08-10 Loren J. Rittle <ljrittle@acm.org> + + * java/lang/natObject.cc (is_mp): Protect use of _SC_NPROCESSORS_ONLN. + 2001-08-06 Tom Tromey <tromey@redhat.com> * java/io/InputStreamReader.java (refill): Only call refill on diff --git a/libjava/java/lang/natObject.cc b/libjava/java/lang/natObject.cc index adb487a..0404d2d 100644 --- a/libjava/java/lang/natObject.cc +++ b/libjava/java/lang/natObject.cc @@ -436,8 +436,12 @@ typedef size_t obj_addr_t; /* Integer type big enough for object */ static bool is_mp() { +#ifdef _SC_NPROCESSORS_ONLN long nprocs = sysconf(_SC_NPROCESSORS_ONLN); return (nprocs > 1); +#else + return false; +#endif } // A call to keep_live(p) forces p to be accessible to the GC |