public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [boehm-gc] Avoid unstructured procfs on Solaris
@ 2015-08-26 11:16 Rainer Orth
  0 siblings, 0 replies; only message in thread
From: Rainer Orth @ 2015-08-26 11:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: java-patches

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

boehm-gc doesn't currently build on Solaris 12 since that release
finally removed the old unstructured /proc, thus the PIOCOPENPD ioctl.
This is already mentioned in the Solaris 11 EOF list:

	http://www.oracle.com/technetwork/systems/end-of-notices/eonsolaris11-392732.html

Since the replacement (using /proc/<pid>/pagedata directly) has been
available since Solaris 2.6 in 1997, there's no need to retain the old
code, especially given that mainline only supports Solaris 10 and up.

Bootstrapped without regressions on i386-pc-solaris2.1[12] and
sparc-sun-solaris2.1[12], will install on mainline.  Will backport to
the gcc 5 branch after some soak time.

	Rainer


2015-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* os_dep.c [GC_SOLARIS_THREADS] (GC_dirty_init): Use
	/proc/<pid>/pagedata instead of PIOCOPENPD.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol12-boehm-gc-proc.patch --]
[-- Type: text/x-patch, Size: 784 bytes --]

# HG changeset patch
# Parent 819be80e1b9c7e840fe5d232d64cf106869a933d
Avoid unstructured procfs on Solaris 12+

diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
--- 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");

[-- Attachment #3: Type: text/plain, Size: 144 bytes --]



-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-26 11:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 11:16 [boehm-gc] Avoid unstructured procfs on Solaris Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).