public inbox for
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Subject: [boehm-gc] Avoid unstructured procfs on Solaris
Date: Wed, 26 Aug 2015 11:16:00 -0000	[thread overview]
Message-ID: <yddr3mq5mg5.fsf@lokon.CeBiTec.Uni-Bielefeld.DE> (raw)

[-- 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:

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.


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

                 reply	other threads:[~2015-08-26 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddr3mq5mg5.fsf@lokon.CeBiTec.Uni-Bielefeld.DE \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).