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
This commit is contained in:
Rainer Orth 2015-09-10 14:11:16 +00:00 committed by Rainer Orth
parent afaad14561
commit 2e2eb38791
2 changed files with 11 additions and 5 deletions

View File

@ -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 2015-07-16 Release Manager
* GCC 5.2.0 released. * GCC 5.2.0 released.

View File

@ -3184,13 +3184,11 @@ void GC_dirty_init()
(GC_words_allocd + GC_words_allocd_before_gc)); (GC_words_allocd + GC_words_allocd_before_gc));
# endif # endif
} }
sprintf(buf, "/proc/%d", getpid()); sprintf(buf, "/proc/%d/pagedata", getpid());
fd = open(buf, O_RDONLY); GC_proc_fd = open(buf, O_RDONLY);
if (fd < 0) { if (GC_proc_fd < 0) {
ABORT("/proc open failed"); 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); syscall(SYS_fcntl, GC_proc_fd, F_SETFD, FD_CLOEXEC);
if (GC_proc_fd < 0) { if (GC_proc_fd < 0) {
ABORT("/proc ioctl failed"); ABORT("/proc ioctl failed");