aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/os_dep.c
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2015-08-27 11:26:18 +0000
committerRainer Orth <ro@gcc.gnu.org>2015-08-27 11:26:18 +0000
commit58f51f50697f170937598b357cb4c51112960d5d (patch)
treed8bf934164a740887ab40d2283a0a0dc1d6f0953 /boehm-gc/os_dep.c
parent973d2e01cbba2c89bbdf62d004833facc3d95637 (diff)
downloadgcc-58f51f50697f170937598b357cb4c51112960d5d.zip
gcc-58f51f50697f170937598b357cb4c51112960d5d.tar.gz
gcc-58f51f50697f170937598b357cb4c51112960d5d.tar.bz2
Avoid unstructured procfs on Solaris
* os_dep.c [GC_SOLARIS_THREADS] (GC_dirty_init): Use /proc/<pid>/pagedata instead of PIOCOPENPD. From-SVN: r227254
Diffstat (limited to 'boehm-gc/os_dep.c')
-rw-r--r--boehm-gc/os_dep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 470d4fc..60cbc2b 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");