United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7022473 JDK7 still runs /etc/prtconf to find memory size
JDK-7022473 : JDK7 still runs /etc/prtconf to find memory size

Details
Type:
Bug
Submit Date:
2011-02-25
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
infrastructure
OS:
solaris_nevada
Sub-Component:
build
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
(If I've filed this in the wrong sub-category, please adjust accordingly).

CR #7019375 will cleanup a load of old binary exectable sym links
that are in /etc for the Solaris 11 GA release.

Alan Coopersmith sent me the following comment:

  "Noticed someone on openindiana IRC complaining about openjdk failing to build
   in a zone because it couldn't run /etc/prtconf:

   http://www.google.com/codesearch?as_q=%2Fetc%2Fprtconf&as_package=openjdk

   Looks like a bug will need to be filed if you're really nuking all the bins in
   /etc."

Here is that bug.

                                    

Comments
SUGGESTED FIX

Adjust the JDK7 code to use /usr/sbin/prtconf instead.
                                     
2011-02-25
EVALUATION

This seems to be more of a build issue than an install issue.
                                     
2011-02-25
SUGGESTED FIX

prtconf has been in /usr/sbin since at least Solaris 8, don't need to code up support for /etc/prtconf.   Dependancy introduced in JDK 6 b82 (6412469)

jdk/make/common/shared/Platform.gmk

151c151
<   MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
---
> >   MB_OF_MEMORY=$(shell /usr/sbin/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
                                     
2011-02-25
PUBLIC COMMENTS

Note also that prtconf output is not intended for parsing.  A better interface for retrieving this information should be found or created.
                                     
2011-03-02
PUBLIC COMMENTS

It looks like the right interface is
sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES)
                                     
2011-03-02
EVALUATION

While I would agree the function calls to sysconf() is the correct method for a dynamic query within a program, from the standpoint of a makefile, prtconf is still acceptable for what is needed.
                                     
2011-03-16



Hardware and Software, Engineered to Work Together