JDK-7153343 : Dependency on non-POSIX header file causes portability problem
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2012-03-13
  • Updated: 2013-06-26
  • Resolved: 2012-03-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b32Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :


ADDITIONAL OS VERSION INFORMATION :
Ubuntu 11.10, AIX 7

A DESCRIPTION OF THE PROBLEM :
link.h is included in following source files from OpenJDK codebase

src/solaris/npt/npt_md.h
src/solaris/native/sun/security/pkcs11/j2secmod_md.c
src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c
src/solaris/native/sun/security/smartcardio/pcsc_md.c
src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c

But link.h is not part of POSIX standard, see http://en.wikipedia.org/wiki/C_POSIX_library, moreover this including causes portability problem for other Unix-like platforms, such as AIX. So far as I see, OpenJDK only uses POSIX.1-2001 compatible dlopen, dlclose, dlsym, dlerror functions, no special extensions involved, so here suggest to remove link.h and use dlfcn.h only.

This bug is created for commiting to tl repository while bug 7152519 is created for 2d repository.


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION link.h should be removed, as it is unnecessary. Changeset: c4e66dc3222d Author: littlee Date: 2012-03-16 10:47 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c4e66dc3222d 7153343: Dependency on non-POSIX header file<link.h> causes portability problem Summary: Remove the unneccessary link.h Reviewed-by: alanb, chegar Contributed-by: Jonathan Lu<###@###.###> ! src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c ! src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c ! src/solaris/native/sun/security/pkcs11/j2secmod_md.c ! src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c ! src/solaris/native/sun/security/smartcardio/pcsc_md.c ! src/solaris/npt/npt_md.h
17-03-2012