diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2015-09-10 14:11:16 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2015-09-10 14:11:16 +0000 |
commit | 2e2eb387910ffa04af0ff91b6bfa23586fc6d65a (patch) | |
tree | 437984e9eac405dd640e124bff5c148a4a13a64b | |
parent | afaad14561c1c0b9a1ddceb1f1c49401bf540c22 (diff) | |
download | gcc-2e2eb387910ffa04af0ff91b6bfa23586fc6d65a.tar.gz |
Avoid unstructured procfs on Solaris
Backport from mainline
2015-08-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* os_dep.c [GC_SOLARIS_THREADS] (GC_dirty_init): Use
/proc/<pid>/pagedata instead of PIOCOPENPD.
From-SVN: r227638
-rw-r--r-- | boehm-gc/ChangeLog | 8 | ||||
-rw-r--r-- | boehm-gc/os_dep.c | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index b2e98e417ab..4cc45d51289 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,11 @@ +2015-09-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + Backport from mainline + 2015-08-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * os_dep.c [GC_SOLARIS_THREADS] (GC_dirty_init): Use + /proc/<pid>/pagedata instead of PIOCOPENPD. + 2015-07-16 Release Manager * GCC 5.2.0 released. diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 470d4fc14dd..60cbc2b2976 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -3184,13 +3184,11 @@ void GC_dirty_init() (GC_words_allocd + GC_words_allocd_before_gc)); # endif } - sprintf(buf, "/proc/%d", getpid()); - fd = open(buf, O_RDONLY); - if (fd < 0) { + sprintf(buf, "/proc/%d/pagedata", getpid()); + GC_proc_fd = open(buf, O_RDONLY); + if (GC_proc_fd < 0) { ABORT("/proc open failed"); } - GC_proc_fd = syscall(SYS_ioctl, fd, PIOCOPENPD, 0); - close(fd); syscall(SYS_fcntl, GC_proc_fd, F_SETFD, FD_CLOEXEC); if (GC_proc_fd < 0) { ABORT("/proc ioctl failed"); |