diff --git a/.hgtags b/.hgtags index 2dac3306a5edd3a6ab2deb678143afc8bacafaa3..80d4f5f700b5f1ea73d96d21f1fbe70f9a372688 100644 --- a/.hgtags +++ b/.hgtags @@ -278,3 +278,4 @@ e291ac47c9a90366c3c0787a6f7ce547a2bda308 jdk8-b131 43cb25339b5500871f41388a5197f1b01c4b57b8 jdk8-b132 1ecfc0fac3e7b931f09728b7594384ea5b5f9f0f jdk8u20-b06 db30cb9eb18dacea39c35daf15a3ee5fea41fd86 jdk8u20-b07 +0e717bd55bc9e3f3fa3432e545944d81ed887ab0 jdk8u20-b08 diff --git a/make/CompileDemos.gmk b/make/CompileDemos.gmk index c0b1b713ac639e2a3752976f2becb01721e059f2..3b1839102a7654880712e2282fe33ee257f6b1eb 100644 --- a/make/CompileDemos.gmk +++ b/make/CompileDemos.gmk @@ -214,9 +214,12 @@ define SetupJVMTIDemo # Param 5 = libs for posix # Param 6 = libs for windows # Param 7 = libs for solaris + # Param 8 = libs for linux + # Param 9 = extra directories with required sources BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \ $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \ - $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) + $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) \ + $9 BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \ $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/README.txt) \ $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/sample.makefile.txt) @@ -308,9 +311,19 @@ $(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util)) $(eval $(call SetupJVMTIDemo,gctest, agent_util)) $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,heapViewer, agent_util)) + +# On AIX, hprof requires 'dladdr' from src/aix/porting/porting_aix.cpp +BUILD_LIBHPROF_AIX_EXTRA_SRC := +BUILD_LIBHPROF_AIX_EXTRA_CFLAGS := +ifeq ($(OPENJDK_TARGET_OS), aix) + BUILD_LIBHPROF_AIX_EXTRA_SRC += $(JDK_TOPDIR)/src/aix/porting + BUILD_LIBHPROF_AIX_EXTRA_CFLAGS += -I$(JDK_TOPDIR)/src/aix/porting +endif + $(eval $(call SetupJVMTIDemo,hprof, java_crw_demo, \ - -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, C, \ - -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread)) + -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ + $(BUILD_LIBHPROF_AIX_EXTRA_CFLAGS), C, \ + -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread, $(BUILD_LIBHPROF_AIX_EXTRA_SRC))) $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo)) $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo)) diff --git a/make/CompileJavaClasses.gmk b/make/CompileJavaClasses.gmk index bfde273e7299c7657a1bb5967dd85703a7e4fa71..e4c7b3aea1c8f4526d3166db526d43c50064bfee 100644 --- a/make/CompileJavaClasses.gmk +++ b/make/CompileJavaClasses.gmk @@ -146,6 +146,17 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) sun/tools/attach/BsdVirtualMachine.java endif +ifneq ($(OPENJDK_TARGET_OS),aix) + EXFILES+=sun/nio/ch/AixAsynchronousChannelProvider.java \ + sun/nio/ch/AixPollPort.java \ + sun/nio/fs/AixFileStore.java \ + sun/nio/fs/AixFileSystem.java \ + sun/nio/fs/AixFileSystemProvider.java \ + sun/nio/fs/AixNativeDispatcher.java \ + sun/tools/attach/AixAttachProvider.java \ + sun/tools/attach/AixVirtualMachine.java +endif + # Exclude BreakIterator classes that are just used in compile process to generate # data files and shouldn't go in the product EXFILES += sun/text/resources/BreakIteratorRules.java \ @@ -217,9 +228,9 @@ endif # Exclude another implicitly not included file. EXFILES += sun/util/locale/AsciiUtil.java -ifeq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx)) +ifeq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx aix)) # - # only solaris and macosx + # only solaris, macosx and aix # EXFILES += sun/nio/fs/PollingWatchService.java endif @@ -289,6 +300,16 @@ SECURITY_PKGS := \ sun/security/pkcs11 \ # +AIX_SRC_DIRS := +ifeq ($(OPENJDK_TARGET_OS),aix) + AIX_SRC_DIRS += $(JDK_TOPDIR)/src/aix/classes + + # these files are duplicated in AIX_SRC_DIRS + EXFILES += $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \ + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java +endif + # The exception handling of swing beaninfo # These resources violates the convention of having code and resources together under # $(JDK_TOPDIR)/src/.../classes directories @@ -313,6 +334,7 @@ $(eval $(call SetupJavaCompilation,BUILD_JDK,\ SRC:=$(JDK_TOPDIR)/src/share/classes \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \ $(MACOSX_SRC_DIRS) \ + $(AIX_SRC_DIRS) \ $(JDK_OUTPUTDIR)/gensrc \ $(JDK_OUTPUTDIR)/gensrc_no_srczip \ $(CLOSED_SRC_DIRS),\ diff --git a/make/CompileLaunchers.gmk b/make/CompileLaunchers.gmk index 766e15657148e6deea55d3912a7918e480c4812d..d1c870e1fe136822181c386df209d9c9fec677c7 100644 --- a/make/CompileLaunchers.gmk +++ b/make/CompileLaunchers.gmk @@ -104,6 +104,10 @@ define SetupLauncher $1_LDFLAGS_SUFFIX += -pthread endif + ifeq ($(OPENJDK_TARGET_OS), aix) + $1_LDFLAGS_SUFFIX += -L$(JDK_OUTPUTDIR)/objs -ljli_static + endif + ifeq ($(USE_EXTERNAL_LIBZ), true) $1_LDFLAGS_SUFFIX += -lz endif @@ -126,10 +130,21 @@ define SetupLauncher $1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE)) endif - ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), ) - $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU) + # The linker on older SuSE distros (e.g. on SLES 10) complains with: + # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." + # if feeded with a version script which contains named tags. + ifeq ($(USING_BROKEN_SUSE_LD),yes) + ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), ) + $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous + else + $1_MAPFILE := + endif else - $1_MAPFILE := + ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), ) + $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU) + else + $1_MAPFILE := + endif endif $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \ @@ -180,7 +195,7 @@ define SetupLauncher BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1) - ifeq ($(OPENJDK_TARGET_OS), macosx) + ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix)) $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjli_static.a endif @@ -446,6 +461,16 @@ ifeq ($(OPENJDK_TARGET_OS), windows) EXE_OUT_OPTION_save := $(EXE_OUT_OPTION) EXE_OUT_OPTION := -Fe endif + +# The linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. +ifeq ($(USING_BROKEN_SUSE_LD), yes) + UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous +else + UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200 +endif + $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \ EXCLUDE_FILES := jni.cpp, \ @@ -457,7 +482,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ CFLAGS_macosx := -fPIC, \ - MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200, \ + MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS), \ LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \ LDFLAGS_posix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ @@ -601,7 +626,7 @@ BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR) LINK_JSPAWNHELPER_OBJECTS := $(JDK_OUTPUTDIR)/objs/libjava/childproc.o LINK_JSPAWNHELPER_FLAGS := -ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris), ) +ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), ) BUILD_JSPAWNHELPER := 1 endif @@ -610,7 +635,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) endif ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) - LINK_JSPAWNHELPER_FLAGS += -m64 + LINK_JSPAWNHELPER_FLAGS += $(COMPILER_TARGET_BITS_FLAG)64 endif ifeq ($(BUILD_JSPAWNHELPER), 1) diff --git a/make/data/classlist/classlist.aix b/make/data/classlist/classlist.aix new file mode 100644 index 0000000000000000000000000000000000000000..d07236da9e9390c9d930bdb234c7d70f12d00146 --- /dev/null +++ b/make/data/classlist/classlist.aix @@ -0,0 +1,2406 @@ +java/lang/Object +java/lang/String +java/io/Serializable +java/lang/Comparable +java/lang/CharSequence +java/lang/Class +java/lang/reflect/GenericDeclaration +java/lang/reflect/Type +java/lang/reflect/AnnotatedElement +java/lang/Cloneable +java/lang/ClassLoader +java/lang/System +java/lang/Throwable +java/lang/Error +java/lang/ThreadDeath +java/lang/Exception +java/lang/RuntimeException +java/security/ProtectionDomain +java/security/AccessControlContext +java/lang/ClassNotFoundException +java/lang/NoClassDefFoundError +java/lang/LinkageError +java/lang/ClassCastException +java/lang/ArrayStoreException +java/lang/VirtualMachineError +java/lang/OutOfMemoryError +java/lang/StackOverflowError +java/lang/IllegalMonitorStateException +java/lang/ref/Reference +java/lang/ref/SoftReference +java/lang/ref/WeakReference +java/lang/ref/FinalReference +java/lang/ref/PhantomReference +java/lang/ref/Finalizer +java/lang/Thread +java/lang/Runnable +java/lang/ThreadGroup +java/lang/Thread$UncaughtExceptionHandler +java/util/Properties +java/util/Hashtable +java/util/Map +java/util/Dictionary +java/lang/reflect/AccessibleObject +java/lang/reflect/Field +java/lang/reflect/Member +java/lang/reflect/Method +java/lang/reflect/Constructor +sun/reflect/MagicAccessorImpl +sun/reflect/MethodAccessorImpl +sun/reflect/MethodAccessor +sun/reflect/ConstructorAccessorImpl +sun/reflect/ConstructorAccessor +sun/reflect/DelegatingClassLoader +sun/reflect/ConstantPool +sun/reflect/UnsafeStaticFieldAccessorImpl +sun/reflect/UnsafeFieldAccessorImpl +sun/reflect/FieldAccessorImpl +sun/reflect/FieldAccessor +java/util/Vector +java/util/List +java/util/Collection +java/lang/Iterable +java/util/RandomAccess +java/util/AbstractList +java/util/AbstractCollection +java/lang/StringBuffer +java/lang/AbstractStringBuilder +java/lang/Appendable +java/lang/StackTraceElement +java/nio/Buffer +java/lang/Boolean +java/lang/Character +java/lang/Float +java/lang/Number +java/lang/Double +java/lang/Byte +java/lang/Short +java/lang/Integer +java/lang/Long +java/lang/NullPointerException +java/lang/ArithmeticException +java/io/ObjectStreamField +java/lang/String$CaseInsensitiveComparator +java/util/Comparator +java/lang/RuntimePermission +java/security/BasicPermission +java/security/Permission +java/security/Guard +sun/misc/SoftCache +java/util/AbstractMap +java/lang/ref/ReferenceQueue +java/lang/ref/ReferenceQueue$Null +java/lang/ref/ReferenceQueue$Lock +java/util/HashMap +java/lang/annotation/Annotation +java/util/HashMap$Entry +java/util/Map$Entry +java/security/AccessController +java/lang/reflect/ReflectPermission +sun/reflect/ReflectionFactory$GetReflectionFactoryAction +java/security/PrivilegedAction +java/util/Stack +sun/reflect/ReflectionFactory +java/lang/ref/Reference$Lock +java/lang/ref/Reference$ReferenceHandler +java/lang/ref/Finalizer$FinalizerThread +java/util/Hashtable$EmptyEnumerator +java/util/Enumeration +java/util/Hashtable$EmptyIterator +java/util/Iterator +java/util/Hashtable$Entry +java/nio/charset/Charset +sun/nio/cs/StandardCharsets +sun/nio/cs/FastCharsetProvider +java/nio/charset/spi/CharsetProvider +sun/nio/cs/StandardCharsets$Aliases +sun/util/PreHashedMap +sun/nio/cs/StandardCharsets$Classes +sun/nio/cs/StandardCharsets$Cache +java/lang/ThreadLocal +java/util/concurrent/atomic/AtomicInteger +sun/misc/Unsafe +java/lang/NoSuchMethodError +java/lang/IncompatibleClassChangeError +sun/reflect/Reflection +java/util/Collections +java/util/Collections$EmptySet +java/util/AbstractSet +java/util/Set +java/util/Collections$EmptyList +java/util/Collections$EmptyMap +java/util/Collections$ReverseComparator +java/util/Collections$SynchronizedMap +java/lang/Class$3 +java/lang/reflect/Modifier +java/lang/reflect/ReflectAccess +sun/reflect/LangReflectAccess +java/util/Arrays +java/lang/Math +sun/nio/cs/US_ASCII +sun/nio/cs/HistoricallyNamedCharset +sun/misc/VM +java/lang/StringCoding +java/lang/ThreadLocal$ThreadLocalMap +java/lang/ThreadLocal$ThreadLocalMap$Entry +java/lang/StringCoding$StringDecoder +sun/nio/cs/US_ASCII$Decoder +java/nio/charset/CharsetDecoder +java/nio/charset/CodingErrorAction +java/nio/ByteBuffer +java/nio/HeapByteBuffer +java/nio/Bits +java/nio/ByteOrder +java/nio/CharBuffer +java/lang/Readable +java/nio/HeapCharBuffer +java/nio/charset/CoderResult +java/nio/charset/CoderResult$1 +java/nio/charset/CoderResult$Cache +java/nio/charset/CoderResult$2 +sun/misc/Version +java/io/FileInputStream +java/io/InputStream +java/io/Closeable +java/io/FileDescriptor +java/io/FileOutputStream +java/io/OutputStream +java/io/Flushable +java/io/BufferedInputStream +java/io/FilterInputStream +java/util/concurrent/atomic/AtomicReferenceFieldUpdater +java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl +sun/reflect/misc/ReflectUtil +java/io/PrintStream +java/io/FilterOutputStream +java/io/BufferedOutputStream +java/io/OutputStreamWriter +java/io/Writer +sun/nio/cs/StreamEncoder +sun/security/action/GetPropertyAction +sun/nio/cs/US_ASCII$Encoder +java/nio/charset/CharsetEncoder +sun/nio/cs/Surrogate$Parser +sun/nio/cs/Surrogate +java/io/BufferedWriter +java/lang/Runtime +java/io/File +java/io/FileSystem +java/io/UnixFileSystem +java/io/ExpiringCache +java/io/ExpiringCache$1 +java/util/LinkedHashMap +java/util/LinkedHashMap$Entry +java/lang/StringBuilder +java/io/File$1 +sun/misc/JavaIODeleteOnExitAccess +sun/misc/SharedSecrets +java/lang/ClassLoader$3 +java/lang/StringCoding$StringEncoder +java/io/ExpiringCache$Entry +java/lang/ClassLoader$NativeLibrary +java/lang/Terminator +java/lang/Terminator$1 +sun/misc/SignalHandler +sun/misc/Signal +sun/misc/NativeSignalHandler +java/io/Console +java/io/Console$1 +sun/misc/JavaIOAccess +java/io/Console$1$1 +java/lang/Shutdown +java/util/ArrayList +java/lang/Shutdown$Lock +java/lang/ApplicationShutdownHooks +java/util/IdentityHashMap +sun/misc/OSEnvironment +java/lang/System$2 +sun/misc/JavaLangAccess +java/lang/Compiler +java/lang/Compiler$1 +sun/misc/Launcher +sun/misc/Launcher$Factory +java/net/URLStreamHandlerFactory +sun/misc/Launcher$ExtClassLoader +java/net/URLClassLoader +java/security/SecureClassLoader +sun/security/util/Debug +java/net/URLClassLoader$7 +sun/misc/JavaNetAccess +java/util/StringTokenizer +sun/misc/Launcher$ExtClassLoader$1 +java/security/PrivilegedExceptionAction +sun/misc/MetaIndex +java/io/BufferedReader +java/io/Reader +java/io/FileReader +java/io/InputStreamReader +sun/nio/cs/StreamDecoder +java/lang/reflect/Array +sun/net/www/ParseUtil +java/util/BitSet +java/io/ObjectStreamClass +java/net/URL +java/util/Locale +java/util/concurrent/ConcurrentHashMap +java/util/concurrent/ConcurrentMap +java/util/concurrent/ConcurrentHashMap$Segment +java/util/concurrent/locks/ReentrantLock +java/util/concurrent/locks/Lock +java/util/concurrent/locks/ReentrantLock$NonfairSync +java/util/concurrent/locks/ReentrantLock$Sync +java/util/concurrent/locks/AbstractQueuedSynchronizer +java/util/concurrent/locks/AbstractOwnableSynchronizer +java/util/concurrent/locks/AbstractQueuedSynchronizer$Node +java/util/concurrent/ConcurrentHashMap$HashEntry +java/lang/CharacterDataLatin1 +java/net/Parts +sun/net/www/protocol/file/Handler +java/net/URLStreamHandler +java/lang/Class$1 +sun/reflect/ReflectionFactory$1 +sun/reflect/NativeConstructorAccessorImpl +sun/reflect/DelegatingConstructorAccessorImpl +java/util/HashSet +sun/misc/URLClassPath +sun/net/www/protocol/jar/Handler +sun/misc/Launcher$AppClassLoader +sun/misc/Launcher$AppClassLoader$1 +java/lang/SystemClassLoaderAction +java/net/URLClassLoader$1 +sun/misc/URLClassPath$3 +sun/misc/URLClassPath$JarLoader +sun/misc/URLClassPath$Loader +java/security/PrivilegedActionException +sun/misc/URLClassPath$FileLoader +sun/misc/URLClassPath$FileLoader$1 +sun/misc/Resource +sun/nio/ByteBuffered +java/security/CodeSource +java/security/Permissions +java/security/PermissionCollection +sun/net/www/protocol/file/FileURLConnection +sun/net/www/URLConnection +java/net/URLConnection +java/net/UnknownContentHandler +java/net/ContentHandler +sun/net/www/MessageHeader +java/io/FilePermission +java/io/FilePermission$1 +sun/security/provider/PolicyFile +java/security/Policy +java/security/Policy$UnsupportedEmptyCollection +java/io/FilePermissionCollection +java/security/AllPermission +java/security/UnresolvedPermission +java/security/BasicPermissionCollection +java/security/Principal +java/security/cert/Certificate +java/util/AbstractList$Itr +java/util/IdentityHashMap$KeySet +java/util/IdentityHashMap$KeyIterator +java/util/IdentityHashMap$IdentityHashMapIterator +java/io/DeleteOnExitHook +java/util/LinkedHashSet +java/util/HashMap$KeySet +java/util/LinkedHashMap$KeyIterator +java/util/LinkedHashMap$LinkedHashIterator +java/awt/Frame +java/awt/MenuContainer +java/awt/Window +javax/accessibility/Accessible +java/awt/Container +java/awt/Component +java/awt/image/ImageObserver +java/lang/InterruptedException +java/awt/Label +java/util/logging/Logger +java/util/logging/Handler +java/util/logging/Level +java/util/logging/LogManager +java/util/logging/LogManager$1 +java/beans/PropertyChangeSupport +java/util/logging/LogManager$LogNode +java/util/logging/LoggingPermission +java/util/logging/LogManager$Cleaner +java/util/logging/LogManager$RootLogger +java/util/logging/LogManager$2 +java/util/Properties$LineReader +java/util/Hashtable$Enumerator +java/beans/PropertyChangeEvent +java/util/EventObject +java/awt/Component$AWTTreeLock +sun/awt/DebugHelper +sun/awt/NativeLibLoader +sun/security/action/LoadLibraryAction +java/awt/GraphicsEnvironment +java/awt/GraphicsEnvironment$1 +java/lang/ProcessEnvironment +java/lang/ProcessEnvironment$Variable +java/lang/ProcessEnvironment$ExternalData +java/lang/ProcessEnvironment$Value +java/lang/ProcessEnvironment$StringEnvironment +java/util/Collections$UnmodifiableMap +sun/awt/DebugHelperStub +java/awt/Toolkit +java/awt/Toolkit$3 +sun/util/CoreResourceBundleControl +java/util/ResourceBundle$Control +java/util/Arrays$ArrayList +java/util/Collections$UnmodifiableRandomAccessList +java/util/Collections$UnmodifiableList +java/util/Collections$UnmodifiableCollection +java/util/ResourceBundle +java/util/ResourceBundle$1 +java/util/ResourceBundle$RBClassLoader +java/util/ResourceBundle$RBClassLoader$1 +java/util/ResourceBundle$CacheKey +java/util/ResourceBundle$LoaderReference +java/util/ResourceBundle$CacheKeyReference +java/util/ResourceBundle$SingleFormatControl +sun/awt/resources/awt +java/util/ListResourceBundle +java/awt/Toolkit$1 +java/io/FileNotFoundException +java/io/IOException +java/awt/event/KeyEvent +java/awt/event/InputEvent +java/awt/event/ComponentEvent +java/awt/AWTEvent +java/awt/event/NativeLibLoader +java/util/WeakHashMap +java/util/WeakHashMap$Entry +java/awt/Component$DummyRequestFocusController +sun/awt/RequestFocusController +java/awt/LayoutManager +java/awt/LightweightDispatcher +java/awt/event/AWTEventListener +java/util/EventListener +java/awt/Dimension +java/awt/geom/Dimension2D +java/util/concurrent/atomic/AtomicBoolean +java/awt/ComponentOrientation +java/awt/Component$2 +java/lang/NoSuchMethodException +sun/awt/AppContext +sun/awt/AppContext$1 +sun/awt/AppContext$2 +sun/awt/MostRecentKeyValue +java/awt/Cursor +sun/awt/X11GraphicsEnvironment +sun/java2d/SunGraphicsEnvironment +sun/java2d/FontSupport +sun/awt/DisplayChangedListener +sun/java2d/SunGraphicsEnvironment$TTFilter +java/io/FilenameFilter +sun/java2d/SunGraphicsEnvironment$T1Filter +sun/awt/X11GraphicsEnvironment$1 +sun/awt/SunToolkit +sun/awt/WindowClosingSupport +sun/awt/WindowClosingListener +sun/awt/ComponentFactory +sun/awt/InputMethodSupport +java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject +java/util/concurrent/locks/Condition +sun/awt/AWTAutoShutdown +sun/awt/AWTAutoShutdown$PeerMap +sun/awt/SunToolkit$6 +java/awt/Dialog$ModalExclusionType +java/lang/Enum +java/awt/Dialog +java/awt/Dialog$ModalityType +java/awt/ModalEventFilter +java/awt/EventFilter +sun/reflect/UnsafeFieldAccessorFactory +sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl +sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl +sun/awt/SunDisplayChanger +sun/java2d/SunGraphicsEnvironment$1 +java/io/StreamTokenizer +sun/font/FontManager +sun/font/FileFont +sun/font/PhysicalFont +sun/font/Font2D +sun/font/CompositeFont +java/util/HashMap$Values +java/util/HashMap$ValueIterator +java/util/HashMap$HashIterator +sun/font/FontManager$1 +java/awt/Font +java/awt/geom/AffineTransform +sun/font/AttributeValues +sun/font/EAttribute +java/text/AttributedCharacterIterator$Attribute +java/lang/Class$4 +sun/reflect/NativeMethodAccessorImpl +sun/reflect/DelegatingMethodAccessorImpl +java/awt/font/TextAttribute +java/lang/Integer$IntegerCache +sun/font/TrueTypeFont +java/awt/font/FontRenderContext +java/awt/RenderingHints +sun/awt/SunHints +sun/awt/SunHints$Key +java/awt/RenderingHints$Key +sun/awt/SunHints$Value +sun/awt/SunHints$LCDContrastKey +sun/font/Type1Font +java/awt/geom/Point2D$Float +java/awt/geom/Point2D +sun/font/StrikeMetrics +java/awt/geom/Rectangle2D$Float +java/awt/geom/Rectangle2D +java/awt/geom/RectangularShape +java/awt/Shape +java/awt/geom/GeneralPath +java/awt/geom/Path2D$Float +java/awt/geom/Path2D +sun/font/CharToGlyphMapper +sun/font/PhysicalStrike +sun/font/FontStrike +sun/font/GlyphList +sun/font/StrikeCache +sun/java2d/Disposer +sun/java2d/Disposer$1 +sun/font/StrikeCache$1 +sun/font/FontManager$FontRegistrationInfo +sun/awt/motif/MFontConfiguration +sun/awt/FontConfiguration +sun/awt/FontDescriptor +java/util/Scanner +java/util/regex/Pattern +java/util/regex/Pattern$8 +java/util/regex/Pattern$Node +java/util/regex/Pattern$LastNode +java/util/regex/Pattern$GroupHead +java/util/regex/Pattern$CharPropertyNames +java/util/regex/Pattern$CharPropertyNames$1 +java/util/regex/Pattern$CharPropertyNames$CharPropertyFactory +java/util/regex/Pattern$CharPropertyNames$2 +java/util/regex/Pattern$CharPropertyNames$5 +java/util/regex/Pattern$CharPropertyNames$3 +java/util/regex/Pattern$CharPropertyNames$6 +java/util/regex/Pattern$CharPropertyNames$CloneableProperty +java/util/regex/Pattern$CharProperty +java/util/regex/Pattern$CharPropertyNames$4 +java/util/regex/Pattern$CharPropertyNames$7 +java/util/regex/Pattern$CharPropertyNames$8 +java/util/regex/Pattern$CharPropertyNames$9 +java/util/regex/Pattern$CharPropertyNames$10 +java/util/regex/Pattern$CharPropertyNames$11 +java/util/regex/Pattern$CharPropertyNames$12 +java/util/regex/Pattern$CharPropertyNames$13 +java/util/regex/Pattern$CharPropertyNames$14 +java/util/regex/Pattern$CharPropertyNames$15 +java/util/regex/Pattern$CharPropertyNames$16 +java/util/regex/Pattern$CharPropertyNames$17 +java/util/regex/Pattern$CharPropertyNames$18 +java/util/regex/Pattern$CharPropertyNames$19 +java/util/regex/Pattern$CharPropertyNames$20 +java/util/regex/Pattern$CharPropertyNames$21 +java/util/regex/Pattern$Curly +java/util/regex/Pattern$Slice +java/util/regex/Pattern$Begin +java/util/regex/Pattern$First +java/util/regex/Pattern$Start +java/util/regex/Pattern$TreeInfo +java/util/regex/Pattern$All +java/util/regex/Pattern$BitClass +java/util/regex/Pattern$BmpCharProperty +java/util/regex/Pattern$6 +java/util/regex/Pattern$CharProperty$1 +java/util/regex/Pattern$10 +sun/nio/ch/FileChannelImpl +java/nio/channels/FileChannel +java/nio/channels/ByteChannel +java/nio/channels/ReadableByteChannel +java/nio/channels/Channel +java/nio/channels/WritableByteChannel +java/nio/channels/GatheringByteChannel +java/nio/channels/ScatteringByteChannel +java/nio/channels/spi/AbstractInterruptibleChannel +java/nio/channels/InterruptibleChannel +sun/nio/ch/Util +sun/nio/ch/IOUtil +sun/nio/ch/FileDispatcher +sun/nio/ch/NativeDispatcher +sun/nio/ch/Reflect +java/nio/MappedByteBuffer +sun/nio/ch/Reflect$1 +sun/nio/ch/NativeThreadSet +java/nio/channels/Channels +java/util/Scanner$1 +sun/misc/LRUCache +java/util/regex/Matcher +java/util/regex/MatchResult +java/text/NumberFormat +java/text/Format +java/text/spi/NumberFormatProvider +java/util/spi/LocaleServiceProvider +sun/util/LocaleServiceProviderPool +sun/util/LocaleServiceProviderPool$1 +java/util/ServiceLoader +java/util/ServiceLoader$LazyIterator +java/util/ServiceLoader$1 +java/util/HashMap$EntrySet +java/util/LinkedHashMap$EntryIterator +sun/misc/Launcher$1 +sun/misc/URLClassPath$2 +java/lang/ClassLoader$2 +sun/misc/URLClassPath$1 +java/net/URLClassLoader$3 +sun/misc/CompoundEnumeration +sun/misc/URLClassPath$JarLoader$1 +sun/misc/FileURLMapper +java/net/URLClassLoader$3$1 +sun/util/resources/LocaleData +sun/util/resources/LocaleData$1 +sun/util/resources/LocaleData$LocaleDataResourceBundleControl +sun/util/LocaleDataMetaInfo +sun/text/resources/FormatData +java/util/ResourceBundle$BundleReference +sun/text/resources/FormatData_en +sun/text/resources/FormatData_en_US +java/text/DecimalFormatSymbols +java/text/spi/DecimalFormatSymbolsProvider +java/util/Currency +java/util/Currency$1 +java/util/CurrencyData +java/util/spi/CurrencyNameProvider +sun/util/resources/CurrencyNames +sun/util/resources/LocaleNamesBundle +sun/util/resources/OpenListResourceBundle +sun/util/resources/CurrencyNames_en_US +java/text/DecimalFormat +java/text/FieldPosition +java/text/DigitList +java/math/RoundingMode +java/util/regex/Pattern$GroupTail +java/util/regex/Pattern$Ctype +java/util/regex/Pattern$Ques +java/util/regex/Pattern$GroupCurly +java/util/regex/Pattern$5 +java/util/regex/Pattern$Loop +java/util/regex/Pattern$Prolog +java/util/regex/Pattern$9 +java/util/regex/Pattern$BranchConn +java/util/regex/Pattern$Branch +java/nio/channels/spi/AbstractInterruptibleChannel$1 +sun/nio/ch/Interruptible +sun/nio/ch/NativeThread +sun/nio/ch/DirectBuffer +java/nio/DirectByteBuffer +java/nio/DirectByteBuffer$Deallocator +sun/misc/Cleaner +sun/nio/ch/IOStatus +java/util/regex/ASCII +java/io/DataInputStream +java/io/DataInput +java/lang/Short$ShortCache +java/util/HashMap$KeyIterator +sun/font/CompositeFontDescriptor +sun/font/Font2DHandle +sun/font/FontFamily +java/awt/GraphicsDevice +sun/awt/X11GraphicsDevice +sun/awt/X11GraphicsConfig +java/awt/GraphicsConfiguration +java/awt/ImageCapabilities +sun/java2d/x11/X11SurfaceData +sun/java2d/SurfaceData +java/awt/Transparency +sun/java2d/DisposerTarget +sun/java2d/InvalidPipeException +java/lang/IllegalStateException +sun/java2d/NullSurfaceData +sun/java2d/loops/SurfaceType +sun/awt/image/PixelConverter +sun/awt/image/PixelConverter$Xrgb +sun/awt/image/PixelConverter$Argb +sun/awt/image/PixelConverter$ArgbPre +sun/awt/image/PixelConverter$Xbgr +sun/awt/image/PixelConverter$Rgba +sun/awt/image/PixelConverter$RgbaPre +sun/awt/image/PixelConverter$Ushort565Rgb +sun/awt/image/PixelConverter$Ushort555Rgb +sun/awt/image/PixelConverter$Ushort555Rgbx +sun/awt/image/PixelConverter$Ushort4444Argb +sun/awt/image/PixelConverter$ByteGray +sun/awt/image/PixelConverter$UshortGray +sun/awt/image/PixelConverter$Rgbx +sun/awt/image/PixelConverter$Bgrx +sun/awt/image/PixelConverter$ArgbBm +java/awt/image/ColorModel +java/awt/image/DirectColorModel +java/awt/image/PackedColorModel +java/awt/color/ColorSpace +java/awt/color/ICC_Profile +sun/awt/color/ProfileDeferralInfo +sun/awt/color/ProfileDeferralMgr +java/awt/color/ICC_ProfileRGB +java/awt/color/ICC_Profile$1 +sun/awt/color/ProfileActivator +java/awt/color/ICC_ColorSpace +sun/java2d/pipe/NullPipe +sun/java2d/pipe/PixelDrawPipe +sun/java2d/pipe/PixelFillPipe +sun/java2d/pipe/ShapeDrawPipe +sun/java2d/pipe/TextPipe +sun/java2d/pipe/DrawImagePipe +java/awt/image/IndexColorModel +sun/java2d/pipe/LoopPipe +sun/java2d/pipe/OutlineTextRenderer +sun/java2d/pipe/SolidTextRenderer +sun/java2d/pipe/GlyphListLoopPipe +sun/java2d/pipe/GlyphListPipe +sun/java2d/pipe/AATextRenderer +sun/java2d/pipe/LCDTextRenderer +sun/java2d/pipe/AlphaColorPipe +sun/java2d/pipe/CompositePipe +sun/java2d/pipe/PixelToShapeConverter +sun/java2d/pipe/TextRenderer +sun/java2d/pipe/SpanClipRenderer +sun/java2d/pipe/Region +sun/java2d/pipe/RegionIterator +sun/java2d/pipe/DuctusShapeRenderer +sun/java2d/pipe/DuctusRenderer +sun/java2d/pipe/AlphaPaintPipe +sun/java2d/pipe/SpanShapeRenderer$Composite +sun/java2d/pipe/SpanShapeRenderer +sun/java2d/pipe/GeneralCompositePipe +sun/java2d/pipe/DrawImage +sun/java2d/loops/RenderCache +sun/java2d/loops/RenderCache$Entry +sun/java2d/loops/XORComposite +java/awt/Composite +sun/font/X11TextRenderer +sun/java2d/loops/GraphicsPrimitive +sun/java2d/x11/X11PMBlitLoops +sun/java2d/loops/Blit +sun/java2d/loops/GraphicsPrimitiveMgr +sun/java2d/loops/CompositeType +sun/java2d/SunGraphics2D +sun/awt/ConstrainableGraphics +java/awt/Graphics2D +java/awt/Graphics +java/awt/Color +java/awt/Paint +java/awt/AlphaComposite +sun/java2d/loops/BlitBg +sun/java2d/loops/ScaledBlit +sun/java2d/loops/FillRect +sun/java2d/loops/FillSpans +sun/java2d/loops/DrawLine +sun/java2d/loops/DrawRect +sun/java2d/loops/DrawPolygons +sun/java2d/loops/DrawPath +sun/java2d/loops/FillPath +sun/java2d/loops/MaskBlit +sun/java2d/loops/MaskFill +sun/java2d/loops/DrawGlyphList +sun/java2d/loops/DrawGlyphListAA +sun/java2d/loops/DrawGlyphListLCD +sun/java2d/loops/TransformHelper +java/awt/BasicStroke +java/awt/Stroke +sun/misc/PerformanceLogger +sun/misc/PerformanceLogger$TimeData +sun/java2d/pipe/ValidatePipe +sun/java2d/loops/CustomComponent +sun/java2d/loops/GraphicsPrimitiveProxy +sun/java2d/loops/GeneralRenderer +sun/java2d/loops/GraphicsPrimitiveMgr$1 +sun/java2d/loops/GraphicsPrimitiveMgr$2 +sun/java2d/x11/X11PMBlitLoops$DelegateBlitLoop +sun/java2d/x11/X11PMBlitBgLoops +sun/java2d/x11/X11SurfaceData$LazyPipe +sun/awt/X11GraphicsConfig$X11GCDisposerRecord +sun/java2d/DisposerRecord +java/awt/BorderLayout +java/awt/LayoutManager2 +java/awt/Rectangle +java/awt/Toolkit$2 +sun/awt/X11/XToolkit +sun/awt/X11/XConstants +sun/awt/UNIXToolkit +java/util/TreeMap +java/util/NavigableMap +java/util/SortedMap +sun/awt/X11/XlibWrapper +sun/awt/X11/XUtilConstants +sun/awt/X11/XProtocolConstants +sun/awt/X11/XCursorFontConstants +sun/awt/X11/XlibWrapper$1 +sun/awt/X11/XToolkit$4 +sun/awt/X11/XModifierKeymap +sun/awt/X11/XWrapperBase +sun/awt/X11/Native +sun/awt/X11/Native$1 +java/awt/EventQueue +sun/awt/X11/XToolkit$7 +java/util/EmptyStackException +java/lang/reflect/InvocationTargetException +java/awt/EventDispatchThread +java/awt/event/PaintEvent +java/awt/event/MouseEvent +sun/awt/PeerEvent +java/awt/event/InvocationEvent +java/awt/ActiveEvent +java/awt/EventQueueItem +sun/awt/X11/XToolkit$1 +sun/awt/X11/XToolkit$XErrorHandler +sun/awt/X11/XToolkit$5 +sun/awt/X11/XEventDispatcher +sun/awt/SunToolkit$ModalityListenerList +sun/awt/ModalityListener +sun/awt/SunToolkit$1 +java/util/MissingResourceException +java/awt/Queue +sun/awt/PostEventQueue +java/util/LinkedList +java/util/Deque +java/util/Queue +java/util/AbstractSequentialList +java/util/LinkedList$Entry +sun/awt/X11/AwtScreenData +sun/awt/X11/XWM +sun/awt/X11/MWMConstants +sun/awt/X11/XAtom +java/awt/Insets +sun/awt/X11/XWM$1 +sun/awt/X11/XWM$2 +sun/awt/X11/XSetWindowAttributes +sun/awt/X11/XErrorEvent +sun/awt/X11/XNETProtocol +sun/awt/X11/XStateProtocol +sun/awt/X11/XLayerProtocol +sun/awt/X11/XProtocol +sun/awt/X11/XProtocol$1 +sun/awt/X11/WindowPropertyGetter +sun/awt/X11/UnsafeXDisposerRecord +sun/awt/X11/XPropertyCache +sun/awt/X11/XWINProtocol +sun/awt/X11/XAtomList +sun/awt/X11/XToolkit$3 +sun/awt/X11/XAnyEvent +sun/awt/X11/IXAnyEvent +java/awt/Window$WindowDisposerRecord +java/awt/KeyboardFocusManager +java/awt/KeyEventDispatcher +java/awt/KeyEventPostProcessor +java/awt/AWTKeyStroke +java/awt/AWTKeyStroke$1 +java/awt/DefaultKeyboardFocusManager +java/awt/DefaultFocusTraversalPolicy +java/awt/ContainerOrderFocusTraversalPolicy +java/awt/FocusTraversalPolicy +java/awt/MutableBoolean +java/util/Collections$UnmodifiableSet +sun/awt/HeadlessToolkit +sun/awt/X11/XKeyboardFocusManagerPeer +java/awt/peer/KeyboardFocusManagerPeer +sun/awt/X11/XKeyboardFocusManagerPeer$1 +sun/awt/X11/XFramePeer +java/awt/peer/FramePeer +java/awt/peer/WindowPeer +java/awt/peer/ContainerPeer +java/awt/peer/ComponentPeer +sun/awt/X11/XDecoratedPeer +sun/awt/X11/XWindowPeer +sun/awt/X11/XPanelPeer +java/awt/peer/PanelPeer +sun/awt/X11/XCanvasPeer +java/awt/peer/CanvasPeer +sun/awt/X11/XComponentPeer +java/awt/dnd/peer/DropTargetPeer +sun/awt/X11/XWindow +sun/awt/X11ComponentPeer +sun/awt/X11/XBaseWindow +sun/awt/X11/XCreateWindowParams +java/lang/Long$LongCache +sun/awt/X11/XBaseWindow$InitialiseState +sun/awt/X11/XBaseWindow$StateLock +sun/awt/X11/AwtGraphicsConfigData +sun/awt/X11/XVisualInfo +java/awt/SystemColor +sun/awt/X11/MotifColorUtilities +java/lang/StrictMath +sun/awt/X11/XRepaintArea +sun/awt/RepaintArea +sun/awt/X11/XWindowAttributesData +java/util/concurrent/locks/LockSupport +sun/awt/X11/WindowDimensions +java/awt/Point +java/util/TreeMap$Entry +sun/nio/cs/UTF_8 +sun/nio/cs/Unicode +sun/nio/cs/UTF_8$Encoder +sun/nio/cs/UTF_8$Decoder +sun/nio/cs/Surrogate$Generator +sun/awt/X11/XPropertyEvent +sun/awt/X11/XDropTargetEventProcessor +sun/awt/X11/XDragSourceContextPeer +sun/awt/X11/XDragSourceProtocolListener +sun/awt/dnd/SunDragSourceContextPeer +java/awt/dnd/peer/DragSourceContextPeer +sun/awt/X11/XAwtState +sun/awt/X11/XBaseWindow$1 +sun/awt/X11/XRootWindow +sun/nio/cs/ISO_8859_1 +sun/nio/cs/ISO_8859_1$Encoder +sun/nio/cs/ISO_8859_1$Decoder +sun/java2d/x11/X11SurfaceData$X11WindowSurfaceData +sun/java2d/loops/RenderLoops +sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec +sun/java2d/DefaultDisposerRecord +sun/java2d/x11/X11Renderer +sun/awt/X11/XGlobalCursorManager +sun/awt/GlobalCursorManager +sun/awt/X11/XToolkit$6 +java/awt/Cursor$CursorDisposer +java/awt/AWTException +java/awt/HeadlessException +java/lang/UnsupportedOperationException +sun/reflect/UnsafeLongFieldAccessorImpl +sun/reflect/UnsafeIntegerFieldAccessorImpl +sun/awt/X11/XClientMessageEvent +sun/awt/X11/XIconInfo +sun/awt/X11/XAWTIcon32_java_icon16_png +sun/awt/X11/XAWTIcon32_java_icon24_png +sun/awt/X11/XAWTIcon32_java_icon32_png +sun/awt/X11/XAWTIcon32_java_icon48_png +sun/awt/X11/XSizeHints +sun/awt/X11/XContentWindow +sun/awt/X11/XFocusProxyWindow +sun/awt/X11/XWMHints +java/util/LinkedList$ListItr +java/util/ListIterator +sun/awt/SunToolkit$2 +java/awt/image/BufferStrategy +java/awt/dnd/DropTarget +java/awt/dnd/DropTargetListener +java/awt/event/ComponentListener +java/awt/event/FocusListener +java/awt/event/HierarchyListener +java/awt/event/HierarchyBoundsListener +java/awt/event/KeyListener +java/awt/event/MouseListener +java/awt/event/MouseMotionListener +java/awt/event/MouseWheelListener +java/awt/event/InputMethodListener +java/awt/Component$NativeInLightFixer +java/awt/event/ContainerListener +javax/accessibility/AccessibleContext +sun/reflect/UnsafeObjectFieldAccessorImpl +java/awt/peer/LightweightPeer +sun/awt/X11/XLabelPeer +java/awt/peer/LabelPeer +sun/awt/X11/XMapEvent +sun/awt/X11/XQueryTree +sun/awt/X11/XConfigureEvent +sun/awt/X11/PropMwmHints +sun/awt/GlobalCursorManager$NativeUpdater +javax/swing/JFrame +javax/swing/WindowConstants +javax/swing/RootPaneContainer +javax/swing/TransferHandler$HasGetTransferHandler +javax/swing/JLabel +javax/swing/SwingConstants +javax/swing/JComponent +javax/swing/JComponent$1 +javax/swing/SwingUtilities +javax/swing/JRootPane +sun/security/action/GetBooleanAction +javax/swing/event/EventListenerList +javax/swing/JPanel +java/awt/FlowLayout +javax/swing/UIManager +javax/swing/UIManager$LookAndFeelInfo +sun/swing/SwingUtilities2 +sun/swing/SwingUtilities2$LSBCacheEntry +javax/swing/UIManager$LAFState +javax/swing/UIDefaults +javax/swing/MultiUIDefaults +javax/swing/UIManager$1 +javax/swing/plaf/metal/MetalLookAndFeel +javax/swing/plaf/basic/BasicLookAndFeel +javax/swing/LookAndFeel +sun/swing/DefaultLookup +javax/swing/plaf/metal/OceanTheme +javax/swing/plaf/metal/DefaultMetalTheme +javax/swing/plaf/metal/MetalTheme +javax/swing/plaf/ColorUIResource +javax/swing/plaf/UIResource +sun/swing/PrintColorUIResource +javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate +javax/swing/plaf/FontUIResource +sun/swing/SwingLazyValue +javax/swing/UIDefaults$LazyValue +javax/swing/UIDefaults$ActiveValue +javax/swing/plaf/InsetsUIResource +sun/swing/SwingUtilities2$2 +javax/swing/plaf/basic/BasicLookAndFeel$2 +javax/swing/plaf/DimensionUIResource +javax/swing/UIDefaults$LazyInputMap +java/lang/Character$CharacterCache +javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue +javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue +java/awt/print/PrinterJob +sun/swing/SwingUtilities2$AATextInfo +sun/awt/X11/XAWTXSettings +sun/awt/X11/XMSelectionListener +sun/awt/XSettings +sun/awt/X11/XMSelection +sun/awt/X11/XMSelection$1 +javax/swing/plaf/metal/MetalLookAndFeel$AATextListener +java/beans/PropertyChangeListener +java/beans/PropertyChangeListenerProxy +java/util/EventListenerProxy +sun/awt/EventListenerAggregate +javax/swing/UIDefaults$ProxyLazyValue +javax/swing/plaf/metal/OceanTheme$1 +javax/swing/plaf/metal/OceanTheme$2 +javax/swing/plaf/metal/OceanTheme$3 +javax/swing/plaf/metal/OceanTheme$4 +javax/swing/plaf/metal/OceanTheme$5 +javax/swing/plaf/metal/OceanTheme$6 +javax/swing/RepaintManager +javax/swing/RepaintManager$DisplayChangedHandler +javax/swing/SwingPaintEventDispatcher +sun/awt/PaintEventDispatcher +javax/swing/UIManager$2 +javax/swing/UIManager$3 +java/awt/PopupMenu +java/awt/Menu +java/awt/MenuItem +java/awt/MenuComponent +java/io/ObjectOutputStream +java/io/ObjectOutput +java/io/DataOutput +java/io/ObjectStreamConstants +java/io/PrintWriter +java/io/ObjectInputStream +java/io/ObjectInput +java/awt/Event +java/awt/im/InputContext +java/awt/event/MouseWheelEvent +java/awt/BufferCapabilities +sun/awt/CausedFocusEvent$Cause +java/awt/PointerInfo +java/awt/Component$BaselineResizeBehavior +java/awt/FontMetrics +java/awt/Image +java/awt/image/ImageProducer +java/awt/image/VolatileImage +java/awt/im/InputMethodRequests +java/awt/event/FocusEvent +java/awt/event/InputMethodEvent +java/awt/event/HierarchyEvent +javax/accessibility/AccessibleStateSet +com/sun/swing/internal/plaf/metal/resources/metal +sun/util/ResourceBundleEnumeration +com/sun/swing/internal/plaf/basic/resources/basic +javax/swing/plaf/basic/BasicPanelUI +javax/swing/plaf/PanelUI +javax/swing/plaf/ComponentUI +sun/reflect/misc/MethodUtil +sun/reflect/misc/MethodUtil$1 +java/util/jar/JarFile +java/util/zip/ZipFile +java/util/zip/ZipConstants +java/util/jar/JavaUtilJarAccessImpl +sun/misc/JavaUtilJarAccess +sun/misc/JarIndex +java/util/zip/ZipEntry +java/util/jar/JarFile$JarFileEntry +java/util/jar/JarEntry +sun/misc/URLClassPath$JarLoader$2 +sun/net/www/protocol/jar/JarURLConnection +java/net/JarURLConnection +sun/net/www/protocol/jar/JarFileFactory +sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController +java/net/HttpURLConnection +sun/net/www/protocol/jar/URLJarFile +sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry +sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream +java/util/zip/ZipFile$ZipFileInputStream +java/security/AllPermissionCollection +java/lang/IllegalAccessException +javax/swing/JPasswordField +javax/swing/JTextField +javax/swing/text/JTextComponent +javax/swing/Scrollable +javax/swing/JLayeredPane +javax/swing/JRootPane$1 +javax/swing/ArrayTable +javax/swing/JInternalFrame +javax/swing/JRootPane$RootLayout +javax/swing/BufferStrategyPaintManager +javax/swing/RepaintManager$PaintManager +javax/swing/plaf/metal/MetalRootPaneUI +javax/swing/plaf/basic/BasicRootPaneUI +javax/swing/plaf/RootPaneUI +javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap +javax/swing/plaf/ComponentInputMapUIResource +javax/swing/ComponentInputMap +javax/swing/InputMap +javax/swing/plaf/InputMapUIResource +javax/swing/KeyStroke +java/awt/VKCollection +sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl +javax/swing/plaf/basic/LazyActionMap +javax/swing/plaf/ActionMapUIResource +javax/swing/ActionMap +javax/swing/LayoutFocusTraversalPolicy +javax/swing/SortingFocusTraversalPolicy +javax/swing/InternalFrameFocusTraversalPolicy +javax/swing/SwingContainerOrderFocusTraversalPolicy +javax/swing/SwingDefaultFocusTraversalPolicy +javax/swing/LayoutComparator +javax/swing/plaf/metal/MetalLabelUI +javax/swing/plaf/basic/BasicLabelUI +javax/swing/plaf/LabelUI +javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 +javax/swing/plaf/basic/BasicHTML +javax/swing/SystemEventQueueUtilities +javax/swing/SystemEventQueueUtilities$SystemEventQueue +sun/awt/NullComponentPeer +java/awt/event/WindowEvent +java/awt/EventQueue$1 +java/awt/EventDispatchThread$1 +java/awt/Conditional +java/awt/EventDispatchThread$HierarchyEventFilter +java/awt/EventFilter$FilterAction +sun/awt/dnd/SunDropTargetEvent +java/awt/event/ActionEvent +java/util/jar/Manifest +java/io/ByteArrayInputStream +java/util/jar/Attributes +java/util/jar/Manifest$FastInputStream +java/util/jar/Attributes$Name +sun/misc/ASCIICaseInsensitiveComparator +java/util/jar/JarVerifier +java/io/ByteArrayOutputStream +sun/misc/ExtensionDependency +java/lang/Package +sun/security/util/ManifestEntryVerifier +sun/security/provider/Sun +java/security/Provider +java/security/Provider$ServiceKey +java/security/Provider$EngineDescription +sun/security/provider/Sun$1 +java/security/Security +java/security/Security$1 +sun/misc/FloatingDecimal +sun/misc/FloatingDecimal$1 +sun/security/provider/NativePRNG +java/security/SecureRandomSpi +sun/security/provider/NativePRNG$1 +sun/security/provider/NativePRNG$RandomIO +sun/misc/BASE64Decoder +sun/misc/CharacterDecoder +sun/security/util/SignatureFileVerifier +java/awt/event/KeyAdapter +java/lang/NumberFormatException +java/lang/IllegalArgumentException +java/io/FileWriter +java/net/Authenticator +java/net/MalformedURLException +javax/swing/text/Element +javax/swing/text/Document +javax/swing/text/PlainDocument +javax/swing/text/AbstractDocument +javax/swing/text/GapContent +javax/swing/text/AbstractDocument$Content +javax/swing/text/GapVector +javax/swing/text/GapContent$MarkVector +javax/swing/text/GapContent$MarkData +javax/swing/text/StyleContext +javax/swing/text/AbstractDocument$AttributeContext +javax/swing/text/StyleConstants +javax/swing/text/StyleConstants$CharacterConstants +javax/swing/text/AttributeSet$CharacterAttribute +javax/swing/text/StyleConstants$FontConstants +javax/swing/text/AttributeSet$FontAttribute +javax/swing/text/StyleConstants$ColorConstants +javax/swing/text/AttributeSet$ColorAttribute +javax/swing/text/StyleConstants$ParagraphConstants +javax/swing/text/AttributeSet$ParagraphAttribute +javax/swing/text/StyleContext$FontKey +javax/swing/text/SimpleAttributeSet +javax/swing/text/MutableAttributeSet +javax/swing/text/AttributeSet +javax/swing/text/SimpleAttributeSet$EmptyAttributeSet +javax/swing/text/StyleContext$NamedStyle +javax/swing/text/Style +javax/swing/text/SimpleAttributeSet$1 +javax/swing/text/StyleContext$SmallAttributeSet +javax/swing/text/AbstractDocument$BidiRootElement +javax/swing/text/AbstractDocument$BranchElement +javax/swing/text/AbstractDocument$AbstractElement +javax/swing/tree/TreeNode +javax/swing/text/AbstractDocument$1 +javax/swing/text/AbstractDocument$BidiElement +javax/swing/text/AbstractDocument$LeafElement +javax/swing/text/GapContent$StickyPosition +javax/swing/text/Position +javax/swing/text/StyleContext$KeyEnumeration +javax/swing/text/GapContent$InsertUndo +javax/swing/undo/AbstractUndoableEdit +javax/swing/undo/UndoableEdit +javax/swing/text/AbstractDocument$DefaultDocumentEvent +javax/swing/event/DocumentEvent +javax/swing/undo/CompoundEdit +javax/swing/event/DocumentEvent$EventType +javax/swing/text/Segment +java/text/CharacterIterator +javax/swing/text/Utilities +javax/swing/text/SegmentCache +javax/swing/text/SegmentCache$CachedSegment +javax/swing/event/UndoableEditEvent +javax/swing/text/AbstractDocument$ElementEdit +javax/swing/event/DocumentEvent$ElementChange +java/net/Socket +java/net/InetAddress +java/net/InetAddress$Cache +java/net/InetAddress$Cache$Type +java/net/InetAddressImplFactory +java/net/Inet4AddressImpl +java/net/InetAddressImpl +java/net/InetAddress$1 +sun/net/spi/nameservice/NameService +sun/net/util/IPAddressUtil +java/util/RandomAccessSubList +java/util/SubList +java/util/SubList$1 +java/util/AbstractList$ListItr +java/net/Inet4Address +java/net/InetSocketAddress +java/net/SocketAddress +java/net/SocksSocketImpl +java/net/SocksConsts +java/net/PlainSocketImpl +java/net/SocketImpl +java/net/SocketOptions +java/net/SocketException +java/net/SocksSocketImpl$5 +java/net/ProxySelector +sun/net/spi/DefaultProxySelector +sun/net/spi/DefaultProxySelector$1 +sun/net/NetProperties +sun/net/NetProperties$1 +sun/net/spi/DefaultProxySelector$NonProxyInfo +java/net/Inet6Address +java/net/URI +java/net/URI$Parser +java/net/Proxy +java/net/Proxy$Type +java/net/ConnectException +javax/swing/JMenu +javax/swing/MenuElement +javax/swing/JMenuItem +javax/swing/AbstractButton +java/awt/ItemSelectable +javax/swing/event/MenuListener +javax/swing/JCheckBoxMenuItem +javax/swing/Icon +javax/swing/JButton +java/awt/event/WindowListener +java/net/URLClassLoader$2 +javax/swing/ImageIcon +javax/swing/ImageIcon$1 +java/awt/MediaTracker +sun/misc/SoftCache$ValueCell +sun/awt/image/URLImageSource +sun/awt/image/InputStreamImageSource +sun/awt/image/ImageFetchable +sun/awt/image/ToolkitImage +java/awt/Image$1 +sun/awt/image/SurfaceManager$ImageAccessor +sun/awt/image/SurfaceManager +sun/awt/image/NativeLibLoader +java/awt/ImageMediaEntry +java/awt/MediaEntry +sun/awt/image/ImageRepresentation +java/awt/image/ImageConsumer +sun/awt/image/ImageWatched +sun/awt/image/ImageWatched$Link +sun/awt/image/ImageWatched$WeakLink +sun/awt/image/ImageConsumerQueue +sun/awt/image/ImageFetcher +sun/awt/image/FetcherInfo +sun/awt/image/ImageFetcher$1 +sun/awt/image/GifImageDecoder +sun/awt/image/ImageDecoder +sun/awt/image/GifFrame +java/awt/image/Raster +java/awt/image/DataBufferByte +java/awt/image/DataBuffer +java/awt/image/PixelInterleavedSampleModel +java/awt/image/ComponentSampleModel +java/awt/image/SampleModel +sun/awt/image/ByteInterleavedRaster +sun/awt/image/ByteComponentRaster +sun/awt/image/SunWritableRaster +java/awt/image/WritableRaster +java/awt/image/BufferedImage +java/awt/image/WritableRenderedImage +java/awt/image/RenderedImage +sun/awt/image/IntegerComponentRaster +sun/awt/image/BytePackedRaster +java/awt/Canvas +sun/font/FontDesignMetrics +sun/font/FontStrikeDesc +sun/font/CompositeStrike +sun/font/FontStrikeDisposer +sun/font/StrikeCache$SoftDisposerRef +sun/font/StrikeCache$DisposableStrike +sun/font/TrueTypeFont$TTDisposerRecord +sun/font/TrueTypeFont$1 +java/io/RandomAccessFile +java/nio/ByteBufferAsIntBufferB +java/nio/IntBuffer +sun/font/TrueTypeFont$DirectoryEntry +java/nio/ByteBufferAsShortBufferB +java/nio/ShortBuffer +sun/nio/cs/UTF_16 +sun/nio/cs/UTF_16$Decoder +sun/nio/cs/UnicodeDecoder +sun/font/FileFontStrike +sun/font/FileFont$FileFontDisposer +sun/font/TrueTypeGlyphMapper +sun/font/CMap +sun/font/CMap$NullCMapClass +sun/font/CMap$CMapFormat4 +java/nio/ByteBufferAsCharBufferB +sun/font/FontDesignMetrics$KeyReference +sun/awt/image/PNGImageDecoder +sun/awt/image/PNGFilterInputStream +java/util/zip/InflaterInputStream +java/util/zip/Inflater +sun/awt/EventQueueItem +sun/awt/SunToolkit$3 +sun/awt/X11/XExposeEvent +sun/awt/X11/ComponentAccessor +sun/awt/X11/ComponentAccessor$1 +sun/reflect/UnsafeBooleanFieldAccessorImpl +sun/awt/event/IgnorePaintEvent +java/awt/image/DataBufferInt +java/awt/image/SinglePixelPackedSampleModel +sun/awt/image/IntegerInterleavedRaster +sun/java2d/x11/X11RemoteOffScreenImage +sun/awt/image/RemoteOffScreenImage +sun/awt/image/OffScreenImage +sun/java2d/x11/X11RemoteOffScreenImage$X11RemoteSurfaceManager +sun/awt/image/OffScreenSurfaceManager +sun/awt/image/CachingSurfaceManager +sun/awt/image/RasterListener +sun/awt/image/BufImgSurfaceData +sun/java2d/opengl/GLXGraphicsConfig +sun/java2d/opengl/OGLGraphicsConfig +sun/java2d/x11/X11SurfaceData$X11PixmapSurfaceData +sun/awt/image/WritableRasterNative +sun/awt/image/DataBufferNative +sun/java2d/SurfaceManagerFactory +sun/java2d/x11/X11CachingSurfaceManager +sun/java2d/opengl/GLXSurfaceData +sun/java2d/opengl/OGLSurfaceData +sun/font/CompositeGlyphMapper +sun/java2d/loops/FontInfo +java/util/Date +sun/util/calendar/CalendarSystem +sun/util/calendar/Gregorian +sun/util/calendar/BaseCalendar +sun/util/calendar/AbstractCalendar +java/util/TimeZone +java/lang/InheritableThreadLocal +sun/util/calendar/ZoneInfo +sun/util/calendar/ZoneInfoFile +sun/util/calendar/ZoneInfoFile$1 +java/util/TimeZone$1 +sun/util/calendar/Gregorian$Date +sun/util/calendar/BaseCalendar$Date +sun/util/calendar/CalendarDate +sun/util/calendar/CalendarUtils +java/util/TimeZone$DisplayNames +sun/util/TimeZoneNameUtility +sun/util/resources/TimeZoneNames +sun/util/resources/TimeZoneNamesBundle +sun/util/resources/TimeZoneNames_en +java/util/spi/TimeZoneNameProvider +java/lang/ProcessBuilder +java/lang/ProcessImpl +java/lang/UNIXProcess +java/lang/Process +java/lang/UNIXProcess$Gate +java/lang/UNIXProcess$1 +java/lang/UNIXProcess$1$1 +java/lang/UNIXProcess$1$1$1 +java/net/ServerSocket +java/util/Random +java/util/concurrent/atomic/AtomicLong +java/lang/InternalError +java/io/StringReader +java/lang/SecurityException +java/io/FilterReader +java/lang/reflect/Proxy +java/lang/reflect/InvocationHandler +java/lang/NoSuchFieldException +java/lang/InstantiationException +java/lang/ArrayIndexOutOfBoundsException +java/lang/IndexOutOfBoundsException +javax/swing/JDialog +sun/awt/X11/XClipboard +sun/awt/datatransfer/SunClipboard +java/awt/datatransfer/Clipboard +java/awt/datatransfer/SystemFlavorMap +java/awt/datatransfer/FlavorMap +java/awt/datatransfer/FlavorTable +java/awt/datatransfer/SystemFlavorMap$1 +sun/net/ProgressMonitor +sun/net/DefaultProgressMeteringPolicy +sun/net/ProgressMeteringPolicy +java/awt/datatransfer/SystemFlavorMap$2 +java/awt/datatransfer/MimeType +java/io/Externalizable +java/awt/datatransfer/MimeTypeParameterList +sun/awt/datatransfer/DataTransferer +java/util/Collections$SynchronizedSet +java/util/Collections$SynchronizedCollection +java/awt/datatransfer/DataFlavor +java/awt/datatransfer/DataFlavor$1 +sun/awt/datatransfer/DataTransferer$CharsetComparator +sun/awt/datatransfer/DataTransferer$IndexedComparator +sun/nio/cs/UTF_16LE +sun/nio/cs/UTF_16BE +sun/awt/datatransfer/DataTransferer$DataFlavorComparator +java/rmi/Remote +sun/awt/datatransfer/DataTransferer$1 +sun/awt/X11/XDataTransferer +sun/awt/datatransfer/ToolkitThreadBlockedHandler +javax/imageio/ImageTypeSpecifier +sun/awt/X11/XSelection +sun/security/action/GetIntegerAction +sun/awt/X11/XSelection$IncrementalTransferHandler +sun/awt/X11/XSelection$SelectionEventHandler +java/awt/datatransfer/Transferable +java/io/EOFException +java/util/Vector$1 +java/util/zip/ZipFile$1 +java/util/zip/ZipFile$2 +java/util/jar/JarFile$1 +java/util/PropertyResourceBundle +java/util/ResourceBundle$Control$1 +java/util/Hashtable$EntrySet +java/lang/IllegalAccessError +java/text/MessageFormat +java/text/MessageFormat$Field +java/text/Format$Field +java/lang/CloneNotSupportedException +sun/reflect/MethodAccessorGenerator +sun/reflect/AccessorGenerator +sun/reflect/ClassFileConstants +java/lang/Void +sun/reflect/ByteVectorFactory +sun/reflect/ByteVectorImpl +sun/reflect/ByteVector +sun/reflect/ClassFileAssembler +sun/reflect/UTF8 +sun/reflect/Label +sun/reflect/Label$PatchInfo +sun/reflect/MethodAccessorGenerator$1 +sun/reflect/ClassDefiner +sun/reflect/ClassDefiner$1 +sun/reflect/BootstrapConstructorAccessorImpl +java/awt/event/ActionListener +javax/swing/Timer +javax/swing/Timer$DoPostEvent +javax/swing/TimerQueue +javax/swing/TimerQueue$1 +javax/swing/ToolTipManager +java/awt/event/MouseAdapter +javax/swing/ToolTipManager$insideTimerAction +javax/swing/ToolTipManager$outsideTimerAction +javax/swing/ToolTipManager$stillInsideTimerAction +javax/swing/ToolTipManager$Actions +sun/swing/UIAction +javax/swing/Action +javax/swing/ToolTipManager$MoveBeforeEnterListener +java/awt/event/MouseMotionAdapter +java/util/Hashtable$ValueCollection +javax/swing/event/CaretListener +javax/swing/JToolBar +javax/swing/JSplitPane +javax/swing/border/Border +javax/swing/JToggleButton +javax/swing/border/EmptyBorder +javax/swing/border/AbstractBorder +javax/swing/DefaultButtonModel +javax/swing/ButtonModel +javax/swing/AbstractButton$Handler +javax/swing/event/ChangeListener +java/awt/event/ItemListener +javax/swing/plaf/metal/MetalButtonUI +javax/swing/plaf/basic/BasicButtonUI +javax/swing/plaf/ButtonUI +javax/swing/plaf/metal/MetalBorders +javax/swing/plaf/BorderUIResource$CompoundBorderUIResource +javax/swing/border/CompoundBorder +javax/swing/plaf/metal/MetalBorders$ButtonBorder +javax/swing/plaf/basic/BasicBorders$MarginBorder +javax/swing/plaf/basic/BasicButtonListener +java/awt/AWTEventMulticaster +java/awt/event/WindowFocusListener +java/awt/event/WindowStateListener +java/awt/event/AdjustmentListener +java/awt/event/TextListener +javax/swing/event/AncestorListener +java/beans/VetoableChangeListener +javax/swing/ButtonGroup +javax/swing/JToggleButton$ToggleButtonModel +javax/swing/plaf/metal/MetalToggleButtonUI +javax/swing/plaf/basic/BasicToggleButtonUI +javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder +java/awt/CardLayout +javax/swing/Box +javax/swing/plaf/metal/MetalBorders$TextFieldBorder +javax/swing/plaf/metal/MetalBorders$Flush3DBorder +javax/swing/BoxLayout +javax/swing/JMenuBar +javax/swing/DefaultSingleSelectionModel +javax/swing/SingleSelectionModel +javax/swing/plaf/basic/BasicMenuBarUI +javax/swing/plaf/MenuBarUI +javax/swing/plaf/basic/DefaultMenuLayout +javax/swing/plaf/metal/MetalBorders$MenuBarBorder +javax/swing/plaf/basic/BasicMenuBarUI$Handler +javax/swing/KeyboardManager +javax/swing/event/MenuEvent +javax/swing/JMenu$MenuChangeListener +javax/swing/JMenuItem$MenuItemFocusListener +javax/swing/plaf/basic/BasicMenuUI +javax/swing/plaf/basic/BasicMenuItemUI +javax/swing/plaf/MenuItemUI +javax/swing/plaf/metal/MetalBorders$MenuItemBorder +javax/swing/plaf/metal/MetalIconFactory +javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon +javax/swing/plaf/basic/BasicMenuUI$Handler +javax/swing/event/MenuKeyListener +javax/swing/plaf/basic/BasicMenuItemUI$Handler +javax/swing/event/MenuDragMouseListener +javax/swing/event/MouseInputListener +javax/swing/event/ChangeEvent +java/awt/event/ContainerEvent +javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon +javax/swing/JPopupMenu +javax/swing/plaf/basic/BasicPopupMenuUI +javax/swing/plaf/PopupMenuUI +javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper +java/awt/event/AWTEventListenerProxy +java/awt/Toolkit$SelectiveAWTEventListener +java/awt/Toolkit$ToolkitEventMulticaster +javax/swing/plaf/basic/BasicLookAndFeel$1 +javax/swing/plaf/metal/MetalBorders$PopupMenuBorder +javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener +javax/swing/event/PopupMenuListener +javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener +javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber +javax/swing/MenuSelectionManager +javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper +javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 +java/awt/event/FocusAdapter +javax/swing/JMenu$WinListener +java/awt/event/WindowAdapter +javax/swing/JPopupMenu$Separator +javax/swing/JSeparator +javax/swing/plaf/metal/MetalPopupMenuSeparatorUI +javax/swing/plaf/metal/MetalSeparatorUI +javax/swing/plaf/basic/BasicSeparatorUI +javax/swing/plaf/SeparatorUI +javax/swing/JComboBox +javax/swing/event/ListDataListener +javax/swing/event/CaretEvent +javax/swing/text/TabExpander +javax/swing/JScrollBar +java/awt/Adjustable +javax/swing/event/MouseInputAdapter +javax/swing/JScrollBar$ModelListener +javax/swing/DefaultBoundedRangeModel +javax/swing/BoundedRangeModel +javax/swing/plaf/metal/MetalScrollBarUI +javax/swing/plaf/basic/BasicScrollBarUI +javax/swing/plaf/ScrollBarUI +javax/swing/plaf/metal/MetalBumps +javax/swing/plaf/metal/MetalScrollButton +javax/swing/plaf/basic/BasicArrowButton +javax/swing/plaf/basic/BasicScrollBarUI$TrackListener +javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener +javax/swing/plaf/basic/BasicScrollBarUI$ModelListener +javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener +javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler +javax/swing/plaf/basic/BasicScrollBarUI$Handler +javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener +javax/swing/CellRendererPane +java/util/HashMap$EntryIterator +javax/swing/border/MatteBorder +sun/font/StandardGlyphVector +java/awt/font/GlyphVector +sun/font/StandardGlyphVector$GlyphStrike +sun/font/CoreMetrics +sun/font/FontLineMetrics +java/awt/font/LineMetrics +javax/swing/ComboBoxModel +javax/swing/ListModel +javax/swing/ListCellRenderer +javax/swing/DefaultComboBoxModel +javax/swing/MutableComboBoxModel +javax/swing/AbstractListModel +javax/swing/JComboBox$1 +javax/swing/AncestorNotifier +javax/swing/plaf/metal/MetalComboBoxUI +javax/swing/plaf/basic/BasicComboBoxUI +javax/swing/plaf/ComboBoxUI +javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager +javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager +javax/swing/plaf/basic/BasicComboPopup +javax/swing/plaf/basic/ComboPopup +javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass +javax/swing/border/LineBorder +javax/swing/plaf/basic/BasicComboPopup$1 +javax/swing/JList +javax/swing/DropMode +javax/swing/DefaultListSelectionModel +javax/swing/ListSelectionModel +javax/swing/plaf/basic/BasicListUI +javax/swing/plaf/ListUI +javax/swing/plaf/basic/BasicListUI$ListTransferHandler +javax/swing/TransferHandler +javax/swing/TransferHandler$TransferAction +javax/swing/DefaultListCellRenderer$UIResource +javax/swing/DefaultListCellRenderer +javax/swing/TransferHandler$SwingDropTarget +java/awt/dnd/DropTargetContext +javax/swing/TransferHandler$DropHandler +javax/swing/TransferHandler$TransferSupport +javax/swing/plaf/basic/BasicListUI$Handler +javax/swing/event/ListSelectionListener +javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag +javax/swing/plaf/basic/BasicComboPopup$Handler +javax/swing/JScrollPane +javax/swing/ScrollPaneConstants +javax/swing/ScrollPaneLayout$UIResource +javax/swing/ScrollPaneLayout +javax/swing/JViewport +javax/swing/ViewportLayout +javax/swing/plaf/basic/BasicViewportUI +javax/swing/plaf/ViewportUI +javax/swing/JScrollPane$ScrollBar +javax/swing/JViewport$ViewListener +java/awt/event/ComponentAdapter +javax/swing/plaf/metal/MetalScrollPaneUI +javax/swing/plaf/basic/BasicScrollPaneUI +javax/swing/plaf/ScrollPaneUI +javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder +javax/swing/plaf/basic/BasicScrollPaneUI$Handler +javax/swing/plaf/metal/MetalScrollPaneUI$1 +javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource +javax/swing/plaf/basic/BasicComboBoxRenderer +javax/swing/plaf/metal/MetalComboBoxEditor$UIResource +javax/swing/plaf/metal/MetalComboBoxEditor +javax/swing/plaf/basic/BasicComboBoxEditor +javax/swing/ComboBoxEditor +javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField +javax/swing/JTextField$NotifyAction +javax/swing/text/TextAction +javax/swing/AbstractAction +javax/swing/text/JTextComponent$MutableCaretEvent +javax/swing/plaf/metal/MetalTextFieldUI +javax/swing/plaf/basic/BasicTextFieldUI +javax/swing/plaf/basic/BasicTextUI +javax/swing/text/ViewFactory +javax/swing/plaf/TextUI +javax/swing/plaf/basic/BasicTextUI$BasicCursor +javax/swing/text/DefaultEditorKit +javax/swing/text/EditorKit +javax/swing/text/DefaultEditorKit$InsertContentAction +javax/swing/text/DefaultEditorKit$DeletePrevCharAction +javax/swing/text/DefaultEditorKit$DeleteNextCharAction +javax/swing/text/DefaultEditorKit$ReadOnlyAction +javax/swing/text/DefaultEditorKit$DeleteWordAction +javax/swing/text/DefaultEditorKit$WritableAction +javax/swing/text/DefaultEditorKit$CutAction +javax/swing/text/DefaultEditorKit$CopyAction +javax/swing/text/DefaultEditorKit$PasteAction +javax/swing/text/DefaultEditorKit$VerticalPageAction +javax/swing/text/DefaultEditorKit$PageAction +javax/swing/text/DefaultEditorKit$InsertBreakAction +javax/swing/text/DefaultEditorKit$BeepAction +javax/swing/text/DefaultEditorKit$NextVisualPositionAction +javax/swing/text/DefaultEditorKit$BeginWordAction +javax/swing/text/DefaultEditorKit$EndWordAction +javax/swing/text/DefaultEditorKit$PreviousWordAction +javax/swing/text/DefaultEditorKit$NextWordAction +javax/swing/text/DefaultEditorKit$BeginLineAction +javax/swing/text/DefaultEditorKit$EndLineAction +javax/swing/text/DefaultEditorKit$BeginParagraphAction +javax/swing/text/DefaultEditorKit$EndParagraphAction +javax/swing/text/DefaultEditorKit$BeginAction +javax/swing/text/DefaultEditorKit$EndAction +javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction +javax/swing/text/DefaultEditorKit$InsertTabAction +javax/swing/text/DefaultEditorKit$SelectWordAction +javax/swing/text/DefaultEditorKit$SelectLineAction +javax/swing/text/DefaultEditorKit$SelectParagraphAction +javax/swing/text/DefaultEditorKit$SelectAllAction +javax/swing/text/DefaultEditorKit$UnselectAction +javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction +javax/swing/text/DefaultEditorKit$DumpModelAction +javax/swing/plaf/basic/BasicTextUI$TextTransferHandler +javax/swing/text/Position$Bias +javax/swing/plaf/basic/BasicTextUI$RootView +javax/swing/text/View +javax/swing/plaf/basic/BasicTextUI$UpdateHandler +javax/swing/event/DocumentListener +javax/swing/plaf/basic/BasicTextUI$DragListener +javax/swing/plaf/basic/BasicComboBoxEditor$UIResource +javax/swing/plaf/basic/BasicTextUI$BasicCaret +javax/swing/text/DefaultCaret +javax/swing/text/Caret +javax/swing/text/DefaultCaret$Handler +java/awt/datatransfer/ClipboardOwner +javax/swing/plaf/basic/BasicTextUI$BasicHighlighter +javax/swing/text/DefaultHighlighter +javax/swing/text/LayeredHighlighter +javax/swing/text/Highlighter +javax/swing/text/Highlighter$Highlight +javax/swing/text/DefaultHighlighter$DefaultHighlightPainter +javax/swing/text/LayeredHighlighter$LayerPainter +javax/swing/text/Highlighter$HighlightPainter +javax/swing/text/DefaultHighlighter$SafeDamager +javax/swing/text/FieldView +javax/swing/text/PlainView +javax/swing/text/JTextComponent$DefaultKeymap +javax/swing/text/Keymap +javax/swing/text/JTextComponent$KeymapWrapper +javax/swing/text/JTextComponent$KeymapActionMap +javax/swing/plaf/basic/BasicTextUI$FocusAction +javax/swing/plaf/basic/BasicTextUI$TextActionWrapper +javax/swing/JTextArea +javax/swing/JEditorPane +javax/swing/JTextField$ScrollRepainter +javax/swing/plaf/metal/MetalComboBoxEditor$1 +javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder +javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener +javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler +javax/swing/plaf/basic/BasicComboBoxUI$Handler +javax/swing/plaf/metal/MetalComboBoxButton +javax/swing/plaf/metal/MetalComboBoxIcon +javax/swing/plaf/metal/MetalComboBoxButton$1 +javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager +javax/swing/JComboBox$KeySelectionManager +javax/swing/JToolBar$DefaultToolBarLayout +javax/swing/plaf/metal/MetalToolBarUI +javax/swing/plaf/basic/BasicToolBarUI +javax/swing/plaf/ToolBarUI +javax/swing/plaf/metal/MetalBorders$ToolBarBorder +javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 +javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder +javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder +javax/swing/plaf/basic/BasicBorders$RadioButtonBorder +javax/swing/plaf/basic/BasicBorders$ButtonBorder +javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder +javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener +javax/swing/plaf/basic/BasicToolBarUI$DockingListener +javax/swing/plaf/basic/BasicToolBarUI$Handler +javax/swing/border/EtchedBorder +javax/swing/JToolBar$Separator +javax/swing/plaf/basic/BasicToolBarSeparatorUI +sun/awt/color/CMM +java/applet/Applet +java/awt/Panel +com/sun/awt/AWTUtilities +javax/swing/KeyboardManager$ComponentKeyStrokePair +sun/awt/EmbeddedFrame +sun/awt/im/InputMethodContext +java/awt/im/spi/InputMethodContext +sun/awt/im/InputContext +sun/awt/im/InputMethodManager +sun/awt/im/ExecutableInputMethodManager +sun/awt/X11/XInputMethodDescriptor +sun/awt/X11InputMethodDescriptor +java/awt/im/spi/InputMethodDescriptor +sun/awt/im/InputMethodLocator +sun/awt/im/ExecutableInputMethodManager$2 +sun/misc/Service +sun/misc/Service$LazyIterator +java/util/TreeSet +java/util/NavigableSet +java/util/SortedSet +javax/swing/SizeRequirements +javax/swing/plaf/basic/BasicGraphicsUtils +java/awt/event/AdjustmentEvent +java/awt/MenuBar +sun/awt/X11/XComponentPeer$2 +java/awt/SequencedEvent +java/beans/PropertyVetoException +java/awt/DefaultKeyboardFocusManager$TypeAheadMarker +java/awt/KeyboardFocusManager$HeavyweightFocusRequest +java/awt/KeyboardFocusManager$LightweightFocusRequest +sun/awt/KeyboardFocusManagerPeerImpl +sun/awt/SunToolkit$7 +java/awt/Window$1DisposeAction +java/awt/LightweightDispatcher$2 +sun/awt/X11/XReparentEvent +sun/awt/X11/XWindowAttributes +javax/swing/SystemEventQueueUtilities$ComponentWorkRequest +sun/awt/X11/XFocusChangeEvent +sun/awt/X11/XComponentPeer$1 +sun/awt/X11/XUnmapEvent +java/io/StringWriter +javax/swing/JWindow +java/io/UnsupportedEncodingException +java/net/UnknownHostException +java/nio/channels/SocketChannel +java/nio/channels/spi/AbstractSelectableChannel +java/nio/channels/SelectableChannel +java/net/SocketImplFactory +javax/swing/UnsupportedLookAndFeelException +java/lang/UnsatisfiedLinkError +javax/swing/Box$Filler +javax/swing/JComponent$2 +sun/net/www/MimeTable +java/net/FileNameMap +sun/net/www/MimeTable$1 +sun/net/www/MimeTable$2 +sun/net/www/MimeEntry +java/net/URLConnection$1 +java/text/SimpleDateFormat +java/text/DateFormat +java/text/DateFormat$Field +java/util/Calendar +java/util/GregorianCalendar +sun/util/resources/CalendarData +sun/util/resources/CalendarData_en +java/text/DateFormatSymbols +java/text/spi/DateFormatSymbolsProvider +java/text/DontCareFieldPosition +java/text/DontCareFieldPosition$1 +java/text/Format$FieldDelegate +javax/swing/plaf/BorderUIResource +javax/swing/BorderFactory +javax/swing/border/BevelBorder +javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon +javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 +java/util/zip/ZipInputStream +java/io/PushbackInputStream +java/util/zip/CRC32 +java/util/zip/Checksum +java/lang/Thread$State +javax/swing/SwingUtilities$SharedOwnerFrame +javax/swing/JTable +javax/swing/event/TableModelListener +javax/swing/event/TableColumnModelListener +javax/swing/event/CellEditorListener +javax/swing/event/RowSorterListener +javax/swing/BufferStrategyPaintManager$BufferInfo +java/awt/Component$BltSubRegionBufferStrategy +sun/awt/SubRegionShowable +java/awt/Component$BltBufferStrategy +sun/awt/image/SunVolatileImage +sun/awt/image/BufferedImageGraphicsConfig +sun/print/PrinterGraphicsConfig +sun/java2d/x11/X11VolatileSurfaceManager +sun/awt/image/VolatileSurfaceManager +java/awt/print/PrinterGraphics +java/awt/PrintGraphics +java/awt/GraphicsCallback$PaintCallback +java/awt/GraphicsCallback +sun/awt/SunGraphicsCallback +javax/swing/JRadioButton +java/lang/ClassFormatError +javax/swing/JTabbedPane +javax/swing/JTabbedPane$ModelListener +javax/swing/plaf/metal/MetalTabbedPaneUI +javax/swing/plaf/basic/BasicTabbedPaneUI +javax/swing/plaf/TabbedPaneUI +javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$Handler +sun/swing/ImageIconUIResource +javax/swing/GrayFilter +java/awt/image/RGBImageFilter +java/awt/image/ImageFilter +java/awt/image/FilteredImageSource +org/w3c/dom/Node +org/xml/sax/SAXException +javax/xml/parsers/ParserConfigurationException +org/xml/sax/EntityResolver +java/security/NoSuchAlgorithmException +java/security/GeneralSecurityException +java/util/zip/GZIPInputStream +java/util/zip/DeflaterOutputStream +org/xml/sax/InputSource +javax/xml/parsers/DocumentBuilderFactory +javax/xml/parsers/FactoryFinder +javax/xml/parsers/SecuritySupport +javax/xml/parsers/SecuritySupport$2 +javax/xml/parsers/SecuritySupport$5 +javax/xml/parsers/SecuritySupport$1 +javax/xml/parsers/SecuritySupport$4 +javax/xml/parsers/DocumentBuilder +org/w3c/dom/Document +org/xml/sax/helpers/DefaultHandler +org/xml/sax/DTDHandler +org/xml/sax/ContentHandler +org/xml/sax/ErrorHandler +org/xml/sax/SAXNotSupportedException +org/xml/sax/Locator +org/xml/sax/SAXNotRecognizedException +org/xml/sax/SAXParseException +org/w3c/dom/NodeList +org/w3c/dom/events/EventTarget +org/w3c/dom/traversal/DocumentTraversal +org/w3c/dom/events/DocumentEvent +org/w3c/dom/ranges/DocumentRange +org/w3c/dom/Entity +org/w3c/dom/Element +org/w3c/dom/CharacterData +org/w3c/dom/CDATASection +org/w3c/dom/Text +org/xml/sax/AttributeList +org/w3c/dom/DOMException +org/w3c/dom/Notation +org/w3c/dom/DocumentType +org/w3c/dom/Attr +org/w3c/dom/EntityReference +org/w3c/dom/ProcessingInstruction +org/w3c/dom/Comment +org/w3c/dom/DocumentFragment +org/w3c/dom/events/Event +org/w3c/dom/events/MutationEvent +org/w3c/dom/traversal/TreeWalker +org/w3c/dom/ranges/Range +org/w3c/dom/traversal/NodeIterator +org/w3c/dom/events/EventException +org/w3c/dom/NamedNodeMap +java/lang/StringIndexOutOfBoundsException +java/awt/GridLayout +javax/swing/plaf/metal/MetalRadioButtonUI +javax/swing/plaf/basic/BasicRadioButtonUI +javax/swing/plaf/basic/BasicBorders +javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon +java/awt/event/ItemEvent +java/awt/CardLayout$Card +javax/swing/JCheckBox +javax/swing/event/ListSelectionEvent +javax/swing/plaf/metal/MetalCheckBoxUI +javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon +java/lang/ExceptionInInitializerError +com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI +javax/swing/JProgressBar +javax/swing/JProgressBar$ModelListener +javax/swing/plaf/metal/MetalProgressBarUI +javax/swing/plaf/basic/BasicProgressBarUI +javax/swing/plaf/ProgressBarUI +javax/swing/plaf/BorderUIResource$LineBorderUIResource +javax/swing/plaf/basic/BasicProgressBarUI$Handler +javax/swing/tree/TreeModel +javax/swing/table/TableCellRenderer +javax/swing/table/JTableHeader +javax/swing/event/TreeExpansionListener +javax/swing/table/AbstractTableModel +javax/swing/table/TableModel +javax/swing/table/DefaultTableCellRenderer +javax/swing/JTree +javax/swing/tree/TreeSelectionModel +javax/swing/tree/DefaultTreeCellRenderer +javax/swing/tree/TreeCellRenderer +javax/swing/table/TableCellEditor +javax/swing/CellEditor +javax/swing/JToolTip +javax/swing/table/TableColumn +javax/swing/table/DefaultTableColumnModel +javax/swing/table/TableColumnModel +javax/swing/table/DefaultTableModel +javax/swing/event/TableModelEvent +sun/swing/table/DefaultTableCellHeaderRenderer +javax/swing/plaf/basic/BasicTableHeaderUI +javax/swing/plaf/TableHeaderUI +javax/swing/plaf/basic/BasicTableHeaderUI$1 +javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler +javax/swing/DefaultCellEditor +javax/swing/tree/TreeCellEditor +javax/swing/AbstractCellEditor +javax/swing/plaf/basic/BasicTableUI +javax/swing/plaf/TableUI +javax/swing/plaf/basic/BasicTableUI$TableTransferHandler +javax/swing/plaf/basic/BasicTableUI$Handler +javax/swing/tree/DefaultTreeSelectionModel +javax/swing/tree/TreePath +javax/swing/plaf/metal/MetalTreeUI +javax/swing/plaf/basic/BasicTreeUI +javax/swing/plaf/TreeUI +javax/swing/plaf/basic/BasicTreeUI$Actions +javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler +javax/swing/plaf/metal/MetalTreeUI$LineListener +javax/swing/plaf/basic/BasicTreeUI$Handler +javax/swing/event/TreeModelListener +javax/swing/event/TreeSelectionListener +javax/swing/event/SwingPropertyChangeSupport +javax/swing/tree/VariableHeightLayoutCache +javax/swing/tree/AbstractLayoutCache +javax/swing/tree/RowMapper +javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler +javax/swing/tree/AbstractLayoutCache$NodeDimensions +javax/swing/JTree$TreeModelHandler +javax/swing/tree/VariableHeightLayoutCache$TreeStateNode +javax/swing/tree/DefaultMutableTreeNode +javax/swing/tree/MutableTreeNode +javax/swing/tree/DefaultMutableTreeNode$1 +javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration +javax/swing/event/TableColumnModelEvent +java/text/ParseException +java/text/NumberFormat$Field +javax/swing/event/UndoableEditListener +javax/swing/filechooser/FileFilter +javax/swing/tree/DefaultTreeModel +javax/swing/tree/DefaultTreeCellEditor +javax/swing/tree/DefaultTreeCellEditor$1 +javax/swing/tree/DefaultTreeCellEditor$DefaultTextField +javax/swing/DefaultCellEditor$1 +javax/swing/DefaultCellEditor$EditorDelegate +javax/swing/tree/DefaultTreeCellEditor$EditorContainer +javax/swing/JTree$TreeSelectionRedirector +javax/swing/event/TreeModelEvent +javax/swing/plaf/metal/MetalSplitPaneUI +javax/swing/plaf/basic/BasicSplitPaneUI +javax/swing/plaf/SplitPaneUI +javax/swing/plaf/basic/BasicSplitPaneDivider +javax/swing/plaf/basic/BasicBorders$SplitPaneBorder +javax/swing/plaf/metal/MetalSplitPaneDivider +javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout +javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler +javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder +javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager +javax/swing/plaf/basic/BasicSplitPaneUI$1 +javax/swing/plaf/basic/BasicSplitPaneUI$Handler +javax/swing/plaf/metal/MetalSplitPaneDivider$1 +javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler +javax/swing/plaf/metal/MetalSplitPaneDivider$2 +javax/swing/border/TitledBorder +javax/swing/plaf/basic/BasicTextAreaUI +java/util/Collections$UnmodifiableCollection$1 +java/io/InterruptedIOException +java/net/NoRouteToHostException +java/net/BindException +javax/swing/tree/PathPlaceHolder +javax/swing/event/TreeSelectionEvent +javax/swing/JList$3 +javax/swing/JList$ListSelectionHandler +javax/swing/JSlider +javax/swing/JSlider$ModelListener +javax/swing/plaf/metal/MetalSliderUI +javax/swing/plaf/basic/BasicSliderUI +javax/swing/plaf/SliderUI +javax/swing/plaf/basic/BasicSliderUI$Actions +javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon +javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon +javax/swing/plaf/basic/BasicSliderUI$TrackListener +javax/swing/plaf/basic/BasicSliderUI$Handler +javax/swing/plaf/basic/BasicSliderUI$ScrollListener +javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener +javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler +sun/java2d/HeadlessGraphicsEnvironment +java/util/Hashtable$KeySet +java/awt/FontFormatException +sun/java2d/SunGraphicsEnvironment$2 +sun/font/Type1Font$1 +java/nio/channels/FileChannel$MapMode +sun/nio/ch/FileChannelImpl$Unmapper +sun/nio/ch/Util$3 +java/nio/DirectByteBufferR +java/nio/charset/Charset$3 +sun/nio/cs/ext/ExtendedCharsets +sun/nio/cs/AbstractCharsetProvider +sun/nio/cs/ext/SJIS +sun/nio/cs/ext/SJIS$Decoder +sun/nio/cs/ext/DelegatableDecoder +sun/nio/cs/ext/JIS_X_0208_Decoder +sun/nio/cs/ext/DoubleByteDecoder +sun/nio/cs/ext/JIS_X_0201$Decoder +sun/nio/cs/SingleByteDecoder +java/lang/CharacterData00 +javax/swing/DefaultListModel +javax/swing/event/ListDataEvent +javax/sound/sampled/DataLine +javax/sound/sampled/Line +javax/sound/sampled/Line$Info +javax/sound/sampled/DataLine$Info +javax/sound/sampled/Control$Type +javax/sound/sampled/FloatControl$Type +javax/sound/sampled/LineUnavailableException +javax/sound/sampled/UnsupportedAudioFileException +javax/swing/JRadioButtonMenuItem +javax/swing/JMenuItem$AccessibleJMenuItem +javax/swing/AbstractButton$AccessibleAbstractButton +javax/accessibility/AccessibleAction +javax/accessibility/AccessibleValue +javax/accessibility/AccessibleText +javax/accessibility/AccessibleExtendedComponent +javax/accessibility/AccessibleComponent +javax/swing/JComponent$AccessibleJComponent +java/awt/Container$AccessibleAWTContainer +java/awt/Component$AccessibleAWTComponent +javax/accessibility/AccessibleRelationSet +javax/accessibility/AccessibleState +javax/accessibility/AccessibleBundle +javax/swing/plaf/basic/BasicCheckBoxMenuItemUI +javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon +javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem +javax/swing/plaf/basic/BasicRadioButtonMenuItemUI +javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon +sun/awt/image/ImageDecoder$1 +javax/swing/JTabbedPane$Page +java/net/DatagramSocket +java/net/MulticastSocket +java/net/DatagramPacket +sun/net/InetAddressCachePolicy +sun/net/InetAddressCachePolicy$1 +sun/net/InetAddressCachePolicy$2 +java/net/InetAddress$CacheEntry +java/net/PlainDatagramSocketImpl +java/net/DatagramSocketImpl +java/net/NetworkInterface +java/net/InterfaceAddress +java/text/Collator +java/text/spi/CollatorProvider +sun/text/resources/CollationData +sun/text/resources/CollationData_en +sun/util/EmptyListResourceBundle +java/text/RuleBasedCollator +java/text/CollationRules +java/text/RBCollationTables +java/text/RBTableBuilder +java/text/RBCollationTables$BuildAPI +sun/text/IntHashtable +sun/text/UCompactIntArray +sun/text/normalizer/NormalizerImpl +sun/text/normalizer/ICUData +sun/text/normalizer/NormalizerDataReader +sun/text/normalizer/ICUBinary$Authenticate +sun/text/normalizer/ICUBinary +sun/text/normalizer/NormalizerImpl$FCDTrieImpl +sun/text/normalizer/Trie$DataManipulate +sun/text/normalizer/NormalizerImpl$NormTrieImpl +sun/text/normalizer/NormalizerImpl$AuxTrieImpl +sun/text/normalizer/IntTrie +sun/text/normalizer/Trie +sun/text/normalizer/CharTrie +sun/text/normalizer/CharTrie$FriendAgent +sun/text/normalizer/UnicodeSet +sun/text/normalizer/UnicodeMatcher +sun/text/normalizer/NormalizerImpl$DecomposeArgs +java/text/MergeCollation +java/text/PatternEntry$Parser +java/text/PatternEntry +java/text/EntryPair +sun/text/ComposedCharIter +sun/text/normalizer/UTF16 +sun/net/www/protocol/http/Handler +java/io/ObjectInputStream$BlockDataInputStream +java/io/ObjectInputStream$PeekInputStream +java/io/ObjectInputStream$HandleTable +java/io/ObjectInputStream$ValidationList +java/io/Bits +java/io/ObjectStreamClass$Caches +java/io/ObjectStreamClass$WeakClassKey +java/io/ObjectStreamClass$EntryFuture +java/io/ObjectStreamClass$2 +sun/reflect/SerializationConstructorAccessorImpl +java/io/ObjectStreamClass$FieldReflectorKey +java/io/ObjectStreamClass$FieldReflector +java/io/ObjectStreamClass$1 +java/io/DataOutputStream +java/io/ObjectStreamClass$MemberSignature +java/io/ObjectStreamClass$3 +java/io/ObjectStreamClass$4 +java/io/ObjectStreamClass$5 +java/security/MessageDigest +java/security/MessageDigestSpi +sun/security/jca/GetInstance +sun/security/jca/Providers +sun/security/jca/ProviderList +sun/security/jca/ProviderConfig +sun/security/jca/ProviderList$3 +sun/security/jca/ProviderList$1 +sun/security/jca/ProviderList$2 +sun/security/jca/ProviderConfig$1 +sun/security/jca/ProviderConfig$3 +java/security/Provider$Service +java/security/Provider$UString +sun/security/provider/SHA +sun/security/provider/DigestBase +sun/security/jca/GetInstance$Instance +java/security/MessageDigest$Delegate +sun/security/provider/ByteArrayAccess +java/io/ObjectStreamClass$ClassDataSlot +java/io/ObjectInputStream$CallbackContext +sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl +java/security/SignatureException +java/security/InvalidKeyException +java/security/KeyException +java/security/Signature +java/security/SignatureSpi +java/io/ObjectOutputStream$BlockDataOutputStream +sun/security/provider/DSAPublicKey +java/security/interfaces/DSAPublicKey +java/security/interfaces/DSAKey +java/security/PublicKey +java/security/Key +sun/security/x509/X509Key +java/io/ObjectOutputStream$HandleTable +java/io/ObjectOutputStream$ReplaceTable +sun/security/x509/AlgorithmId +sun/security/util/DerEncoder +sun/security/util/BitArray +sun/security/util/DerOutputStream +sun/security/util/DerValue +java/math/BigInteger +java/security/interfaces/DSAParams +sun/security/util/DerInputStream +sun/security/util/DerInputBuffer +sun/security/util/ObjectIdentifier +java/security/AlgorithmParameters +java/security/AlgorithmParametersSpi +sun/security/provider/DSAParameters +sun/security/util/ByteArrayLexOrder +sun/security/util/ByteArrayTagOrder +sun/security/util/DerIndefLenConverter +java/io/InvalidClassException +java/io/ObjectStreamException +java/io/ObjectInputStream$GetFieldImpl +java/io/ObjectInputStream$GetField +sun/security/jca/ServiceId +sun/security/jca/ProviderList$ServiceList +sun/security/jca/ProviderList$ServiceList$1 +java/security/Signature$Delegate +java/security/interfaces/DSAPrivateKey +java/security/PrivateKey +sun/security/provider/DSA$SHA1withDSA +sun/security/provider/DSA +java/security/spec/DSAParameterSpec +java/security/spec/AlgorithmParameterSpec +java/math/MutableBigInteger +java/math/SignedMutableBigInteger +java/awt/EventQueue$1AWTInvocationLock +javax/swing/SystemEventQueueUtilities$RunnableCanvas +javax/swing/SystemEventQueueUtilities$RunnableCanvasGraphics +java/awt/Component$FlipBufferStrategy +java/awt/SentEvent +sun/awt/X11/XDestroyWindowEvent +sun/awt/X11/XDropTargetRegistry +sun/awt/X11/XEmbeddedFramePeer +sun/awt/X11/XDragAndDropProtocols +sun/awt/X11/XDropTargetContextPeer +sun/awt/dnd/SunDropTargetContextPeer +java/awt/dnd/peer/DropTargetContextPeer +sun/awt/X11/XDropTargetContextPeer$XDropTargetProtocolListenerImpl +sun/awt/X11/XDropTargetProtocolListener +sun/awt/X11/XDnDDragSourceProtocol +sun/awt/X11/XDragSourceProtocol +sun/awt/X11/MotifDnDDragSourceProtocol +sun/awt/X11/XDnDDropTargetProtocol +sun/awt/X11/XDropTargetProtocol +sun/awt/X11/MotifDnDDropTargetProtocol +sun/awt/X11/XDnDConstants +sun/awt/X11/MotifDnDConstants +javax/swing/JTable$2 +javax/swing/JTable$Resizable3 +javax/swing/JTable$Resizable2 +javax/swing/JTable$5 +javax/swing/event/AncestorEvent +sun/font/FontDesignMetrics$MetricsKey +java/awt/geom/Line2D$Float +java/awt/geom/Line2D +com/sun/java/swing/plaf/gtk/GTKLookAndFeel +javax/swing/plaf/synth/SynthLookAndFeel +javax/swing/plaf/synth/DefaultSynthStyleFactory +javax/swing/plaf/synth/SynthStyleFactory +sun/swing/BakedArrayList +javax/swing/plaf/synth/SynthLookAndFeel$Handler +javax/swing/plaf/synth/SynthDefaultLookup +com/sun/java/swing/plaf/gtk/GTKEngine +com/sun/java/swing/plaf/gtk/GTKDefaultEngine +com/sun/java/swing/plaf/gtk/GTKEngine$Settings +com/sun/java/swing/plaf/gtk/GTKStyleFactory +com/sun/java/swing/plaf/gtk/PangoFonts +sun/font/FontManager$FontConfigInfo +com/sun/java/swing/plaf/gtk/GTKLookAndFeel$WeakPCL +javax/swing/plaf/synth/Region +javax/swing/plaf/synth/SynthLookAndFeel$AATextListener +com/sun/java/swing/plaf/gtk/GTKNativeEngine +com/sun/java/swing/plaf/gtk/GTKNativeEngine$WidgetType +com/sun/java/swing/plaf/gtk/GTKRegion +com/sun/java/swing/plaf/gtk/GTKDefaultStyle +com/sun/java/swing/plaf/gtk/GTKStyle +com/sun/java/swing/plaf/gtk/GTKConstants +javax/swing/plaf/synth/SynthStyle +javax/swing/plaf/synth/SynthGraphicsUtils +com/sun/java/swing/plaf/gtk/GTKGraphicsUtils +com/sun/java/swing/plaf/gtk/GTKStyle$GTKStockIcon +sun/swing/plaf/synth/SynthIcon +com/sun/java/swing/plaf/gtk/GTKColorType +javax/swing/plaf/synth/ColorType +com/sun/java/swing/plaf/gtk/resources/gtk +com/sun/swing/internal/plaf/synth/resources/synth +com/sun/java/swing/plaf/gtk/GTKStyle$GTKLazyValue +com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue +com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2 +com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3 +javax/swing/plaf/synth/SynthPanelUI +javax/swing/plaf/synth/SynthConstants +javax/swing/plaf/synth/SynthContext +javax/swing/plaf/synth/SynthBorder +javax/swing/plaf/synth/SynthRootPaneUI +javax/swing/plaf/synth/SynthLabelUI +javax/swing/plaf/synth/SynthButtonUI +javax/swing/plaf/synth/SynthToggleButtonUI +javax/swing/plaf/basic/BasicBorders$FieldBorder +javax/swing/plaf/synth/SynthMenuBarUI +javax/swing/plaf/synth/DefaultMenuLayout +javax/swing/plaf/synth/SynthMenuUI +javax/swing/plaf/synth/SynthUI +com/sun/java/swing/plaf/gtk/GTKIconFactory +com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon +com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon +com/sun/java/swing/plaf/gtk/GTKConstants$ArrowType +javax/swing/plaf/basic/BasicIconFactory +javax/swing/plaf/basic/BasicIconFactory$MenuItemCheckIcon +javax/swing/plaf/synth/SynthMenuItemUI +javax/swing/plaf/synth/SynthPopupMenuUI +javax/swing/plaf/synth/SynthSeparatorUI +javax/swing/plaf/synth/SynthScrollBarUI +javax/swing/plaf/synth/SynthArrowButton +javax/swing/plaf/synth/SynthArrowButton$SynthArrowButtonUI +javax/swing/plaf/synth/SynthComboBoxUI +javax/swing/plaf/synth/SynthComboPopup +javax/swing/plaf/synth/SynthListUI +javax/swing/plaf/synth/SynthListUI$SynthListCellRenderer +javax/swing/plaf/synth/SynthViewportUI +javax/swing/plaf/synth/SynthScrollPaneUI +javax/swing/plaf/synth/SynthScrollPaneUI$ViewportBorder +javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxRenderer +javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxEditor +javax/swing/plaf/synth/SynthTextFieldUI +javax/swing/plaf/synth/SynthToolBarUI +javax/swing/plaf/synth/SynthToolBarUI$SynthToolBarLayoutManager +com/sun/java/swing/plaf/gtk/GTKIconFactory$ToolBarHandleIcon +com/sun/java/swing/plaf/gtk/GTKConstants$Orientation +sun/awt/X11/XTranslateCoordinates +com/sun/java/swing/plaf/gtk/GTKPainter +javax/swing/plaf/synth/SynthPainter +javax/swing/plaf/synth/SynthPainter$1 +com/sun/java/swing/plaf/gtk/GTKConstants$PositionType +com/sun/java/swing/plaf/gtk/GTKConstants$ShadowType +java/io/ObjectInputStream$HandleTable$HandleList +sun/java2d/pipe/ShapeSpanIterator +sun/java2d/pipe/SpanIterator +sun/dc/path/PathConsumer +sun/dc/pr/PathStroker +sun/dc/pr/PathDasher +java/awt/geom/LineIterator +java/awt/geom/PathIterator +sun/applet/Main +sun/applet/AppletMessageHandler +sun/applet/resources/MsgAppletViewer +sun/applet/AppletSecurity +sun/awt/AWTSecurityManager +java/lang/SecurityManager +java/security/DomainCombiner +sun/applet/AppletSecurity$1 +java/lang/SecurityManager$1 +java/security/SecurityPermission +java/util/PropertyPermission +sun/applet/AppletViewer +java/applet/AppletContext +java/awt/print/Printable +sun/security/util/SecurityConstants +java/awt/AWTPermission +java/net/NetPermission +java/net/SocketPermission +javax/security/auth/AuthPermission +java/lang/Thread$1 +java/util/logging/LogManager$5 +java/util/logging/LogManager$6 +sun/applet/StdAppletViewerFactory +sun/applet/AppletViewerFactory +sun/applet/AppletViewer$UserActionListener +sun/applet/AppletViewerPanel +sun/applet/AppletPanel +java/applet/AppletStub +sun/misc/MessageUtils +sun/applet/AppletPanel$10 +java/security/Policy$1 +sun/security/provider/PolicyFile$1 +sun/security/provider/PolicyInfo +sun/security/provider/PolicyFile$3 +sun/security/util/PropertyExpander +sun/security/provider/PolicyParser +sun/security/util/PolicyUtil +sun/security/provider/PolicyParser$GrantEntry +sun/security/provider/PolicyParser$PermissionEntry +sun/security/provider/PolicyFile$PolicyEntry +sun/security/provider/PolicyFile$6 +sun/security/provider/PolicyFile$7 +sun/security/provider/SelfPermission +java/net/SocketPermissionCollection +java/util/PropertyPermissionCollection +sun/applet/AppletPanel$9 +sun/applet/AppletClassLoader +sun/applet/AppletClassLoader$4 +sun/applet/AppletThreadGroup +sun/applet/AppContextCreator +sun/applet/AppletPanel$1 +sun/awt/X11/XMenuBarPeer +java/awt/peer/MenuBarPeer +java/awt/peer/MenuComponentPeer +sun/awt/X11/XBaseMenuWindow +sun/awt/X11/XMenuPeer +java/awt/peer/MenuPeer +java/awt/peer/MenuItemPeer +sun/awt/X11/XMenuItemPeer +java/awt/MenuShortcut +sun/awt/X11/XMenuWindow +sun/awt/X11/XMenuBarPeer$1 +sun/awt/X11/XMenuItemPeer$TextMetrics +sun/awt/AppContext$3 +sun/awt/MostRecentThreadAppContext +sun/awt/X11/XMenuBarPeer$MappingData +sun/awt/X11/XBaseMenuWindow$MappingData +sun/applet/AppletViewer$1 +sun/applet/AppletViewer$1AppletEventListener +sun/applet/AppletListener +sun/applet/AppletEventMulticaster +sun/misc/Queue +sun/misc/QueueElement +sun/applet/AppletEvent +sun/applet/AppletClassLoader$1 +sun/awt/X11/XBaseMenuWindow$3 +java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent +sun/awt/CausedFocusEvent +sun/awt/X11/XWindow$1 +java/net/URLClassLoader$4 +sun/applet/AppletClassLoader$2 +javax/swing/JApplet +java/lang/ClassLoader$1 +sun/security/provider/PolicyFile$5 +java/security/PermissionsEnumerator +java/util/Collections$1 +sun/applet/AppletPanel$11 +sun/applet/AppletPanel$8 +sun/applet/AppletPanel$2 +sun/applet/AppletPanel$3 +sun/applet/AppletPanel$6 +javax/swing/BufferStrategyPaintManager$1 +# f3ac8b467e7f8c49 diff --git a/make/gendata/GendataFontConfig.gmk b/make/gendata/GendataFontConfig.gmk index dfafe8e14fc1049c5d36bc5ce5b014f178eb76d9..35b502d1c3650b3bd1f1237a5e8d2882826807df 100644 --- a/make/gendata/GendataFontConfig.gmk +++ b/make/gendata/GendataFontConfig.gmk @@ -66,6 +66,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) GENDATA_FONT_CONFIG_SRC_PREFIX := macosx. endif +ifeq ($(OPENJDK_TARGET_OS), aix) + GENDATA_FONT_CONFIG_SRC_DIR := \ + $(JDK_TOPDIR)/src/aix/classes/sun/awt/fontconfigs + GENDATA_FONT_CONFIG_SRC_FILES := fontconfig.properties + GENDATA_FONT_CONFIG_SRC_PREFIX := aix. +endif + ### $(GENDATA_FONT_CONFIG_DST)/%.src: \ diff --git a/make/gensrc/GensrcX11Wrappers.gmk b/make/gensrc/GensrcX11Wrappers.gmk index 67dee7511e662646e95f264577a247794571f625..bcf37a726b5b6acb912de5cbf44eac59dd2079b0 100644 --- a/make/gensrc/GensrcX11Wrappers.gmk +++ b/make/gensrc/GensrcX11Wrappers.gmk @@ -88,7 +88,7 @@ ifneq ($(COMPILE_TYPE), cross) # use -m32/-m64 only if the compiler supports it ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true) - MEMORY_MODEL_FLAG = "-m$*" + MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*" endif # Compile the C code into an executable. diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk index d214d026be8d36620daff472c2d60a60fec45640..fe2c1c0488c5b7f77cea39376b12259aeee6f33a 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -231,6 +231,10 @@ else ifneq ($(OPENJDK_TARGET_OS), macosx) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBAWT_DIRS += $(JDK_TOPDIR)/src/aix/porting +endif + LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \ $(X_CFLAGS) \ $(foreach dir, $(LIBAWT_DIRS), -I$(dir)) @@ -305,10 +309,14 @@ LIBAWT_FILES := \ debug_trace.c \ debug_util.c -ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux)) +ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux aix)) LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBAWT_FILES += porting_aix.c +endif + ifeq ($(OPENJDK_TARGET_OS), macosx) LIBAWT_FILES += awt_LoadLibrary.c img_colors.c LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks @@ -473,6 +481,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \ LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \ LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \ + LDFLAGS_SUFFIX_aix :=-ljvm $(LIBM) $(LIBDL) -ljava -lm,\ LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \ -framework Cocoa \ -framework OpenGL \ @@ -681,6 +690,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \ LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \ LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \ + LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=lcms.dll" \ @@ -819,6 +829,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \ + LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\ LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \ -ljava -ljvm, \ LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \ @@ -833,7 +844,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) -ifeq ($(OPENJDK_TARGET_OS), solaris) +ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix)) $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT) endif @@ -968,6 +979,7 @@ else # OPENJDK_TARGET_OS not windows $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \ LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\ LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \ LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \ -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \ @@ -1168,6 +1180,7 @@ ifeq ($(BUILD_HEADLESS), true) LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \ REORDER := $(LIBAWT_HEADLESS_REORDER), \ LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \ + LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\ LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk index ba10b6786aaff398a594485e2ca4e067d1a3b609..e5e12c32f1e7411ead00a084bc42ad80a824475b 100644 --- a/make/lib/CoreLibraries.gmk +++ b/make/lib/CoreLibraries.gmk @@ -43,6 +43,7 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) CFLAGS := $(CFLAGS_JDKLIB) \ -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ CFLAGS_windows_debug := -DLOGGING, \ + CFLAGS_aix := -qfloat=nomaf, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) @@ -198,6 +199,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ LDFLAGS_SUFFIX_posix := -ljvm -lverify, \ LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \ LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \ + LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\ LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \ -framework CoreFoundation \ -framework Foundation \ @@ -266,6 +268,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ $(WIN_JAVA_LIB), \ LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \ LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \ + LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\ LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ @@ -414,6 +417,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \ LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \ LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \ + LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\ LDFLAGS_SUFFIX_macosx := $(LIBZ), \ LDFLAGS_SUFFIX_windows := \ -export:JLI_Launch \ @@ -479,6 +483,22 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx) $(call install-file) BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a + +else ifeq ($(OPENJDK_TARGET_OS), aix) + # AIX also requires a static libjli because the compiler doesn't support '-rpath' + $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\ + STATIC_LIBRARY:=jli_static,\ + OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\ + SRC:=$(BUILD_LIBJLI_SRC_DIRS),\ + INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\ + LANG:=C,\ + OPTIMIZATION:=HIGH, \ + CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\ + ARFLAGS:=$(ARFLAGS),\ + OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static)) + + BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a + endif ########################################################################################## diff --git a/make/lib/NetworkingLibraries.gmk b/make/lib/NetworkingLibraries.gmk index 490845eec331c612600eaf22f86fc8010702f53c..347c32376301a2f3a4e724963aa20f4465b58c5b 100644 --- a/make/lib/NetworkingLibraries.gmk +++ b/make/lib/NetworkingLibraries.gmk @@ -46,6 +46,10 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) LIBNET_EXCLUDE_FILES += bsd_close.c endif +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/aix/native/java/net/ +endif + ifeq ($(OPENJDK_TARGET_OS), windows) LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c else @@ -69,6 +73,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \ LDFLAGS_SUFFIX_macosx := -ljvm -ljava, \ LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lnsl -lsocket $(LIBDL) -lc, \ LDFLAGS_SUFFIX_linux := $(LIBDL) -ljvm -lpthread -ljava, \ + LDFLAGS_SUFFIX_aix := $(LIBDL) -ljvm -ljava,\ LDFLAGS_SUFFIX_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \ delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \ -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \ diff --git a/make/lib/NioLibraries.gmk b/make/lib/NioLibraries.gmk index 05ff4ced5813e99e59504f373bb39da3f7d1edc7..6c9c46a3f3dcdf05a0adf0e1b4c800c80080f597 100644 --- a/make/lib/NioLibraries.gmk +++ b/make/lib/NioLibraries.gmk @@ -112,6 +112,24 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) UnixNativeDispatcher.c endif +ifeq ($(OPENJDK_TARGET_OS), aix) + BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) + BUILD_LIBNIO_SRC += \ + $(JDK_TOPDIR)/src/aix/native/sun/nio/ch \ + $(JDK_TOPDIR)/src/aix/native/sun/nio/fs + BUILD_LIBNIO_FILES += \ + AixPollPort.c \ + InheritedChannel.c \ + AixNativeThread.c \ + PollArrayWrapper.c \ + UnixAsynchronousServerSocketChannelImpl.c \ + UnixAsynchronousSocketChannelImpl.c \ + GnomeFileTypeDetector.c \ + UnixCopyFile.c \ + AixNativeDispatcher.c \ + UnixNativeDispatcher.c +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ LIBRARY := nio, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -125,6 +143,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX_linux := -ljava -lnet -lpthread $(LIBDL), \ + LDFLAGS_SUFFIX_aix := -ljava -lnet $(LIBDL),\ LDFLAGS_SUFFIX_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ -lsendfile -ljava -lnet -lc, \ LDFLAGS_SUFFIX_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ @@ -148,7 +167,7 @@ $(BUILD_LIBNIO): $(BUILD_LIBNET) ifeq ($(OPENJDK_TARGET_OS_API), posix) - ifneq ($(OPENJDK_TARGET_OS), macosx) + ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix)) # Suppress unused parameters required by exported JNI functions. SCTP_WERROR := -Werror -Wno-error=unused-parameter diff --git a/make/lib/ServiceabilityLibraries.gmk b/make/lib/ServiceabilityLibraries.gmk index 9d9520913d84f1ea3030250f39760a5154ecf095..d95fc7e36b19c5e3bf3204e1e19896c15e89df57 100644 --- a/make/lib/ServiceabilityLibraries.gmk +++ b/make/lib/ServiceabilityLibraries.gmk @@ -33,11 +33,19 @@ endif ifneq ($(OPENJDK_TARGET_OS), macosx) LIBATTACH_EXCLUDE_FILES += BsdVirtualMachine.c endif +ifneq ($(OPENJDK_TARGET_OS),aix) + LIBATTACH_EXCLUDE_FILES += AixVirtualMachine.c +endif + +LIBATTACH_SRC_FILES := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach +ifeq ($(OPENJDK_TARGET_OS),aix) + LIBATTACH_SRC_FILES += $(JDK_TOPDIR)/src/aix/native/sun/tools/attach +endif $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ LIBRARY := attach, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ - SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach, \ + SRC := $(LIBATTACH_SRC_FILES), \ EXCLUDE_FILES := $(LIBATTACH_EXCLUDE_FILES), \ LANG := C, \ OPTIMIZATION := LOW, \ @@ -255,6 +263,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ LDFLAGS_SUFFIX_macosx := -liconv $(LIBZ), \ LDFLAGS_SUFFIX_solaris := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc, \ LDFLAGS_SUFFIX_linux := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL), \ + LDFLAGS_SUFFIX_aix := $(LIBZ) -L$(JDK_OUTPUTDIR)/objs -ljli_static $(LIBDL),\ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=instrument.dll" \ @@ -263,7 +272,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ OBJECT_DIR := $(LIBINSTRUMENT_DIR), \ DEBUG_SYMBOLS := true)) -ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows)) +ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows aix)) $(BUILD_LIBINSTRUMENT): $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX) else $(BUILD_LIBINSTRUMENT): $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) @@ -314,6 +323,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \ LDFLAGS_solaris := -lkstat, \ LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ LDFLAGS_SUFFIX_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \ + LDFLAGS_SUFFIX_aix := -lperfstat,\ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=management.dll" \ @@ -334,6 +344,11 @@ BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo +ifeq ($(OPENJDK_TARGET_OS), aix) + BUILD_LIBHPROF_SRC += $(JDK_TOPDIR)/src/aix/porting + BUILD_LIBHPROF_CFLAGS += -I$(JDK_TOPDIR)/src/aix/porting +endif + BUILD_LIBHPROF_LDFLAGS := LIBHPROF_OPTIMIZATION := HIGHEST diff --git a/make/lib/SoundLibraries.gmk b/make/lib/SoundLibraries.gmk index 6227900c56fed25a3d6782380cfeabfbb622ea95..14580959ccc76aee4bcbad0cc53d512917d02c38 100644 --- a/make/lib/SoundLibraries.gmk +++ b/make/lib/SoundLibraries.gmk @@ -71,6 +71,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX endif # OPENJDK_TARGET_OS linux +ifeq ($(OPENJDK_TARGET_OS), aix) + LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX +endif # OPENJDK_TARGET_OS aix + ifeq ($(OPENJDK_TARGET_OS), macosx) LIBJSOUND_LANG := C++ LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \ @@ -131,6 +135,10 @@ else ifeq ($(OPENJDK_TARGET_CPU), ppc) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC endif + + ifeq ($(OPENJDK_TARGET_CPU), ppc64) + LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 + endif endif LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' diff --git a/make/mapfiles/launchers/mapfile-ppc64 b/make/mapfiles/launchers/mapfile-ppc64 new file mode 100644 index 0000000000000000000000000000000000000000..fb4ceb5cd3a889ebe3fd723e75d20ad68040be27 --- /dev/null +++ b/make/mapfiles/launchers/mapfile-ppc64 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# +# Specify what global symbols we export. Note that we're not really +# interested in declaring a version, simply scoping the file is sufficient. +# + +SUNWprivate_1.1 { + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/make/mapfiles/launchers/mapfile-ppc64.anonymous b/make/mapfiles/launchers/mapfile-ppc64.anonymous new file mode 100644 index 0000000000000000000000000000000000000000..4fcde94d1d87d2ad7aafdd352cfec5f68189ad57 --- /dev/null +++ b/make/mapfiles/launchers/mapfile-ppc64.anonymous @@ -0,0 +1,40 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/make/mapfiles/launchers/mapfile-x86.anonymous b/make/mapfiles/launchers/mapfile-x86.anonymous new file mode 100644 index 0000000000000000000000000000000000000000..49032cd10dfb784959e3261ed79c124ea4943e3e --- /dev/null +++ b/make/mapfiles/launchers/mapfile-x86.anonymous @@ -0,0 +1,49 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + ___Argv; # The following are private, but as they are + _start; # exported from ctr1/crtn, the clever hacker + _init; # might know about them. However note, that + _fini; # their use is strictly not supported. + _lib_version; +# _mcount; + __fsr; + __fsr_init_value; + __longdouble_used; + + local: + *; +}; diff --git a/make/mapfiles/launchers/mapfile-x86_64.anonymous b/make/mapfiles/launchers/mapfile-x86_64.anonymous new file mode 100644 index 0000000000000000000000000000000000000000..4fcde94d1d87d2ad7aafdd352cfec5f68189ad57 --- /dev/null +++ b/make/mapfiles/launchers/mapfile-x86_64.anonymous @@ -0,0 +1,40 @@ +# +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + global: + main; # Provides basic adb symbol offsets + environ; # Public symbols and required by Java run time + _environ; + __environ_lock; + + local: + *; +}; diff --git a/make/mapfiles/libattach/mapfile-aix b/make/mapfiles/libattach/mapfile-aix new file mode 100644 index 0000000000000000000000000000000000000000..4c02da01fced0b18d05195739e31f854d8be7671 --- /dev/null +++ b/make/mapfiles/libattach/mapfile-aix @@ -0,0 +1,39 @@ +# +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Define public interface. + +SUNWprivate_1.1 { + global: + Java_sun_tools_attach_AixVirtualMachine_socket + Java_sun_tools_attach_AixVirtualMachine_connect + Java_sun_tools_attach_AixVirtualMachine_sendQuitTo + Java_sun_tools_attach_AixVirtualMachine_checkPermissions + Java_sun_tools_attach_AixVirtualMachine_close + Java_sun_tools_attach_AixVirtualMachine_read + Java_sun_tools_attach_AixVirtualMachine_write + local: + *; +}; diff --git a/make/mapfiles/libnio/mapfile-aix b/make/mapfiles/libnio/mapfile-aix new file mode 100644 index 0000000000000000000000000000000000000000..72f54cf93d72486944a148eb00e2b462989283f5 --- /dev/null +++ b/make/mapfiles/libnio/mapfile-aix @@ -0,0 +1,33 @@ +# +# Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# TODO: implement for AIX + +SUNWprivate_1.1 { + global: + + local: + *; +}; diff --git a/make/mapfiles/libnio/mapfile-linux b/make/mapfiles/libnio/mapfile-linux index d09c1f17c6b56ae053b9092723335cd879640153..16f72e43cfa46d9425e33e1d037efb1ee4f8eda2 100644 --- a/make/mapfiles/libnio/mapfile-linux +++ b/make/mapfiles/libnio/mapfile-linux @@ -117,6 +117,12 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_pollinValue; + Java_sun_nio_ch_Net_polloutValue; + Java_sun_nio_ch_Net_pollerrValue; + Java_sun_nio_ch_Net_pollhupValue; + Java_sun_nio_ch_Net_pollnvalValue; + Java_sun_nio_ch_Net_pollconnValue; Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; diff --git a/make/mapfiles/libnio/mapfile-macosx b/make/mapfiles/libnio/mapfile-macosx index bf1561717dec69c4eb36863fc0ca9872cee0c94e..4dd0dc513e411fe3d3578f1478ed85c976c2684b 100644 --- a/make/mapfiles/libnio/mapfile-macosx +++ b/make/mapfiles/libnio/mapfile-macosx @@ -109,6 +109,12 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_pollinValue; + Java_sun_nio_ch_Net_polloutValue; + Java_sun_nio_ch_Net_pollerrValue; + Java_sun_nio_ch_Net_pollhupValue; + Java_sun_nio_ch_Net_pollnvalValue; + Java_sun_nio_ch_Net_pollconnValue; Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; diff --git a/make/mapfiles/libnio/mapfile-solaris b/make/mapfiles/libnio/mapfile-solaris index 17c4391dba2b184f60815fd3a54b1aa94d9dc888..3933cef7adaf47ee7e3a90ef52fc5d9c81368260 100644 --- a/make/mapfiles/libnio/mapfile-solaris +++ b/make/mapfiles/libnio/mapfile-solaris @@ -105,6 +105,12 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_pollinValue; + Java_sun_nio_ch_Net_polloutValue; + Java_sun_nio_ch_Net_pollerrValue; + Java_sun_nio_ch_Net_pollhupValue; + Java_sun_nio_ch_Net_pollnvalValue; + Java_sun_nio_ch_Net_pollconnValue; Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; diff --git a/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous b/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous new file mode 100644 index 0000000000000000000000000000000000000000..7f3a07934bdd47b256074eb10008fc5d7162fb52 --- /dev/null +++ b/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous @@ -0,0 +1,34 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Define anonymous library interface (i.e. without a version tag) for broken SuSE ld because +# the linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. + +{ + local: + *; +}; diff --git a/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties b/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties new file mode 100644 index 0000000000000000000000000000000000000000..29e7c7d9510f1724a2eb45bed44b720c831c2fce --- /dev/null +++ b/src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties @@ -0,0 +1,77 @@ +# +# +# Copyright 2013 SAP AG. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Minimal version for AIX using the standard Latin Type1 Fonts from the +# package X11.fnt.iso_T1. These fonts are installed by default into +# "/usr/lpp/X11/lib/X11/fonts/Type1" and sym-linked to "/usr/lib/X11/fonts/Type1" + +# Version + +version=1 + +# Component Font Mappings + +dialog.plain.latin-1=-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +dialog.bold.latin-1=-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +dialog.italic.latin-1=-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1 +dialog.bolditalic.latin-1=-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1 + +dialoginput.plain.latin-1=-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.bold.latin-1=-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.italic.latin-1=-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1 +dialoginput.bolditalic.latin-1=-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1 + +sansserif.plain.latin-1=-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.bold.latin-1=-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.italic.latin-1=-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1 +sansserif.bolditalic.latin-1=-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1 + +serif.plain.latin-1=-*-times new roman-medium-r-normal--*-%d-100-100-p-*-iso10646-1 +serif.bold.latin-1=-*-times new roman-bold-r-normal--*-%d-100-100-p-*-iso10646-1 +serif.italic.latin-1=-*-times new roman-medium-i-normal--*-%d-100-100-p-*-iso10646-1 +serif.bolditalic.latin-1=-*-times new roman-bold-i-normal--*-%d-100-100-p-*-iso10646-1 + +monospaced.plain.latin-1=-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.bold.latin-1=-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.italic.latin-1=-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1 +monospaced.bolditalic.latin-1=-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1 + +# Search Sequences + +sequence.allfonts=latin-1 + +filename.-*-courier-medium-r-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/cour.pfa +filename.-*-courier-bold-r-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/courb.pfa +filename.-*-courier-medium-o-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/couri.pfa +filename.-*-courier-bold-o-normal--*-%d-100-100-m-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/courbi.pfa +filename.-*-helvetica-medium-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helv.pfa +filename.-*-helvetica-bold-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvb.pfa +filename.-*-helvetica-medium-o-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvi.pfa +filename.-*-helvetica-bold-o-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/helvbi.pfa +filename.-*-times_new_roman-medium-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnr.pfa +filename.-*-times_new_roman-bold-r-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnrb.pfa +filename.-*-times_new_roman-medium-i-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnri.pfa +filename.-*-times_new_roman-bold-i-normal--*-%d-100-100-p-*-iso10646-1=/usr/lpp/X11/lib/X11/fonts/Type1/tnrbi.pfa diff --git a/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java b/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..4c2c3d317bf44ab64f6993e22d524fc5c105bcb6 --- /dev/null +++ b/src/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.ch; + +import java.nio.channels.*; +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadFactory; +import java.io.IOException; + +public class AixAsynchronousChannelProvider + extends AsynchronousChannelProvider +{ + private static volatile AixPollPort defaultPort; + + private AixPollPort defaultEventPort() throws IOException { + if (defaultPort == null) { + synchronized (AixAsynchronousChannelProvider.class) { + if (defaultPort == null) { + defaultPort = new AixPollPort(this, ThreadPool.getDefault()).start(); + } + } + } + return defaultPort; + } + + public AixAsynchronousChannelProvider() { + } + + @Override + public AsynchronousChannelGroup openAsynchronousChannelGroup(int nThreads, ThreadFactory factory) + throws IOException + { + return new AixPollPort(this, ThreadPool.create(nThreads, factory)).start(); + } + + @Override + public AsynchronousChannelGroup openAsynchronousChannelGroup(ExecutorService executor, int initialSize) + throws IOException + { + return new AixPollPort(this, ThreadPool.wrap(executor, initialSize)).start(); + } + + private Port toPort(AsynchronousChannelGroup group) throws IOException { + if (group == null) { + return defaultEventPort(); + } else { + if (!(group instanceof AixPollPort)) + throw new IllegalChannelGroupException(); + return (Port)group; + } + } + + @Override + public AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(AsynchronousChannelGroup group) + throws IOException + { + return new UnixAsynchronousServerSocketChannelImpl(toPort(group)); + } + + @Override + public AsynchronousSocketChannel openAsynchronousSocketChannel(AsynchronousChannelGroup group) + throws IOException + { + return new UnixAsynchronousSocketChannelImpl(toPort(group)); + } +} diff --git a/src/aix/classes/sun/nio/ch/AixPollPort.java b/src/aix/classes/sun/nio/ch/AixPollPort.java new file mode 100644 index 0000000000000000000000000000000000000000..a7a954597e5a192d718e9358841145b981939093 --- /dev/null +++ b/src/aix/classes/sun/nio/ch/AixPollPort.java @@ -0,0 +1,542 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.ch; + +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.ReentrantLock; +import sun.misc.Unsafe; + +/** + * AsynchronousChannelGroup implementation based on the AIX pollset framework. + */ +final class AixPollPort + extends Port +{ + private static final Unsafe unsafe = Unsafe.getUnsafe(); + + static { + IOUtil.load(); + init(); + } + + /** + * struct pollfd { + * int fd; + * short events; + * short revents; + * } + */ + private static final int SIZEOF_POLLFD = eventSize(); + private static final int OFFSETOF_EVENTS = eventsOffset(); + private static final int OFFSETOF_REVENTS = reventsOffset(); + private static final int OFFSETOF_FD = fdOffset(); + + // opcodes + private static final int PS_ADD = 0x0; + private static final int PS_MOD = 0x1; + private static final int PS_DELETE = 0x2; + + // maximum number of events to poll at a time + private static final int MAX_POLL_EVENTS = 512; + + // pollset ID + private final int pollset; + + // true if port is closed + private boolean closed; + + // socket pair used for wakeup + private final int sp[]; + + // socket pair used to indicate pending pollsetCtl calls + // Background info: pollsetCtl blocks when another thread is in a pollsetPoll call. + private final int ctlSp[]; + + // number of wakeups pending + private final AtomicInteger wakeupCount = new AtomicInteger(); + + // address of the poll array passed to pollset_poll + private final long address; + + // encapsulates an event for a channel + static class Event { + final PollableChannel channel; + final int events; + + Event(PollableChannel channel, int events) { + this.channel = channel; + this.events = events; + } + + PollableChannel channel() { return channel; } + int events() { return events; } + } + + // queue of events for cases that a polling thread dequeues more than one + // event + private final ArrayBlockingQueue queue; + private final Event NEED_TO_POLL = new Event(null, 0); + private final Event EXECUTE_TASK_OR_SHUTDOWN = new Event(null, 0); + private final Event CONTINUE_AFTER_CTL_EVENT = new Event(null, 0); + + // encapsulates a pollset control event for a file descriptor + static class ControlEvent { + final int fd; + final int events; + final boolean removeOnly; + int error = 0; + + ControlEvent(int fd, int events, boolean removeOnly) { + this.fd = fd; + this.events = events; + this.removeOnly = removeOnly; + } + + int fd() { return fd; } + int events() { return events; } + boolean removeOnly() { return removeOnly; } + int error() { return error; } + void setError(int error) { this.error = error; } + } + + // queue of control events that need to be processed + // (this object is also used for synchronization) + private final HashSet controlQueue = new HashSet(); + + // lock used to check whether a poll operation is ongoing + private final ReentrantLock controlLock = new ReentrantLock(); + + AixPollPort(AsynchronousChannelProvider provider, ThreadPool pool) + throws IOException + { + super(provider, pool); + + // open pollset + this.pollset = pollsetCreate(); + + // create socket pair for wakeup mechanism + int[] sv = new int[2]; + try { + socketpair(sv); + // register one end with pollset + pollsetCtl(pollset, PS_ADD, sv[0], Net.POLLIN); + } catch (IOException x) { + pollsetDestroy(pollset); + throw x; + } + this.sp = sv; + + // create socket pair for pollset control mechanism + sv = new int[2]; + try { + socketpair(sv); + // register one end with pollset + pollsetCtl(pollset, PS_ADD, sv[0], Net.POLLIN); + } catch (IOException x) { + pollsetDestroy(pollset); + throw x; + } + this.ctlSp = sv; + + // allocate the poll array + this.address = allocatePollArray(MAX_POLL_EVENTS); + + // create the queue and offer the special event to ensure that the first + // threads polls + this.queue = new ArrayBlockingQueue(MAX_POLL_EVENTS); + this.queue.offer(NEED_TO_POLL); + } + + AixPollPort start() { + startThreads(new EventHandlerTask()); + return this; + } + + /** + * Release all resources + */ + private void implClose() { + synchronized (this) { + if (closed) + return; + closed = true; + } + freePollArray(address); + close0(sp[0]); + close0(sp[1]); + close0(ctlSp[0]); + close0(ctlSp[1]); + pollsetDestroy(pollset); + } + + private void wakeup() { + if (wakeupCount.incrementAndGet() == 1) { + // write byte to socketpair to force wakeup + try { + interrupt(sp[1]); + } catch (IOException x) { + throw new AssertionError(x); + } + } + } + + @Override + void executeOnHandlerTask(Runnable task) { + synchronized (this) { + if (closed) + throw new RejectedExecutionException(); + offerTask(task); + wakeup(); + } + } + + @Override + void shutdownHandlerTasks() { + /* + * If no tasks are running then just release resources; otherwise + * write to the one end of the socketpair to wakeup any polling threads. + */ + int nThreads = threadCount(); + if (nThreads == 0) { + implClose(); + } else { + // send interrupt to each thread + while (nThreads-- > 0) { + wakeup(); + } + } + } + + // invoke by clients to register a file descriptor + @Override + void startPoll(int fd, int events) { + queueControlEvent(new ControlEvent(fd, events, false)); + } + + // Callback method for implementations that need special handling when fd is removed + @Override + protected void preUnregister(int fd) { + queueControlEvent(new ControlEvent(fd, 0, true)); + } + + // Add control event into queue and wait for completion. + // In case the control lock is free, this method also tries to apply the control change directly. + private void queueControlEvent(ControlEvent ev) { + // pollsetCtl blocks when a poll call is ongoing. This is very probable. + // Therefore we let the polling thread do the pollsetCtl call. + synchronized (controlQueue) { + controlQueue.add(ev); + // write byte to socketpair to force wakeup + try { + interrupt(ctlSp[1]); + } catch (IOException x) { + throw new AssertionError(x); + } + do { + // Directly empty queue if no poll call is ongoing. + if (controlLock.tryLock()) { + try { + processControlQueue(); + } finally { + controlLock.unlock(); + } + } else { + try { + // Do not starve in case the polling thread returned before + // we could write to ctlSp[1] but the polling thread did not + // release the control lock until we checked. Therefore, use + // a timed wait for the time being. + controlQueue.wait(100); + } catch (InterruptedException e) { + // ignore exception and try again + } + } + } while (controlQueue.contains(ev)); + } + if (ev.error() != 0) { + throw new AssertionError(); + } + } + + // Process all events currently stored in the control queue. + private void processControlQueue() { + synchronized (controlQueue) { + // On Aix it is only possible to set the event + // bits on the first call of pollsetCtl. Later + // calls only add bits, but cannot remove them. + // Therefore, we always remove the file + // descriptor ignoring the error and then add it. + Iterator iter = controlQueue.iterator(); + while (iter.hasNext()) { + ControlEvent ev = iter.next(); + pollsetCtl(pollset, PS_DELETE, ev.fd(), 0); + if (!ev.removeOnly()) { + ev.setError(pollsetCtl(pollset, PS_MOD, ev.fd(), ev.events())); + } + iter.remove(); + } + controlQueue.notifyAll(); + } + } + + /* + * Task to process events from pollset and dispatch to the channel's + * onEvent handler. + * + * Events are retreived from pollset in batch and offered to a BlockingQueue + * where they are consumed by handler threads. A special "NEED_TO_POLL" + * event is used to signal one consumer to re-poll when all events have + * been consumed. + */ + private class EventHandlerTask implements Runnable { + private Event poll() throws IOException { + try { + for (;;) { + int n; + controlLock.lock(); + try { + n = pollsetPoll(pollset, address, MAX_POLL_EVENTS); + } finally { + controlLock.unlock(); + } + /* + * 'n' events have been read. Here we map them to their + * corresponding channel in batch and queue n-1 so that + * they can be handled by other handler threads. The last + * event is handled by this thread (and so is not queued). + */ + fdToChannelLock.readLock().lock(); + try { + while (n-- > 0) { + long eventAddress = getEvent(address, n); + int fd = getDescriptor(eventAddress); + + // To emulate one shot semantic we need to remove + // the file descriptor here. + if (fd != sp[0] && fd != ctlSp[0]) { + synchronized (controlQueue) { + pollsetCtl(pollset, PS_DELETE, fd, 0); + } + } + + // wakeup + if (fd == sp[0]) { + if (wakeupCount.decrementAndGet() == 0) { + // no more wakeups so drain pipe + drain1(sp[0]); + } + + // queue special event if there are more events + // to handle. + if (n > 0) { + queue.offer(EXECUTE_TASK_OR_SHUTDOWN); + continue; + } + return EXECUTE_TASK_OR_SHUTDOWN; + } + + // wakeup to process control event + if (fd == ctlSp[0]) { + synchronized (controlQueue) { + drain1(ctlSp[0]); + processControlQueue(); + } + if (n > 0) { + continue; + } + return CONTINUE_AFTER_CTL_EVENT; + } + + PollableChannel channel = fdToChannel.get(fd); + if (channel != null) { + int events = getRevents(eventAddress); + Event ev = new Event(channel, events); + + // n-1 events are queued; This thread handles + // the last one except for the wakeup + if (n > 0) { + queue.offer(ev); + } else { + return ev; + } + } + } + } finally { + fdToChannelLock.readLock().unlock(); + } + } + } finally { + // to ensure that some thread will poll when all events have + // been consumed + queue.offer(NEED_TO_POLL); + } + } + + public void run() { + Invoker.GroupAndInvokeCount myGroupAndInvokeCount = + Invoker.getGroupAndInvokeCount(); + final boolean isPooledThread = (myGroupAndInvokeCount != null); + boolean replaceMe = false; + Event ev; + try { + for (;;) { + // reset invoke count + if (isPooledThread) + myGroupAndInvokeCount.resetInvokeCount(); + + try { + replaceMe = false; + ev = queue.take(); + + // no events and this thread has been "selected" to + // poll for more. + if (ev == NEED_TO_POLL) { + try { + ev = poll(); + } catch (IOException x) { + x.printStackTrace(); + return; + } + } + } catch (InterruptedException x) { + continue; + } + + // contine after we processed a control event + if (ev == CONTINUE_AFTER_CTL_EVENT) { + continue; + } + + // handle wakeup to execute task or shutdown + if (ev == EXECUTE_TASK_OR_SHUTDOWN) { + Runnable task = pollTask(); + if (task == null) { + // shutdown request + return; + } + // run task (may throw error/exception) + replaceMe = true; + task.run(); + continue; + } + + // process event + try { + ev.channel().onEvent(ev.events(), isPooledThread); + } catch (Error x) { + replaceMe = true; throw x; + } catch (RuntimeException x) { + replaceMe = true; throw x; + } + } + } finally { + // last handler to exit when shutdown releases resources + int remaining = threadExit(this, replaceMe); + if (remaining == 0 && isShutdown()) { + implClose(); + } + } + } + } + + /** + * Allocates a poll array to handle up to {@code count} events. + */ + private static long allocatePollArray(int count) { + return unsafe.allocateMemory(count * SIZEOF_POLLFD); + } + + /** + * Free a poll array + */ + private static void freePollArray(long address) { + unsafe.freeMemory(address); + } + + /** + * Returns event[i]; + */ + private static long getEvent(long address, int i) { + return address + (SIZEOF_POLLFD*i); + } + + /** + * Returns event->fd + */ + private static int getDescriptor(long eventAddress) { + return unsafe.getInt(eventAddress + OFFSETOF_FD); + } + + /** + * Returns event->events + */ + private static int getEvents(long eventAddress) { + return unsafe.getChar(eventAddress + OFFSETOF_EVENTS); + } + + /** + * Returns event->revents + */ + private static int getRevents(long eventAddress) { + return unsafe.getChar(eventAddress + OFFSETOF_REVENTS); + } + + // -- Native methods -- + + private static native void init(); + + private static native int eventSize(); + + private static native int eventsOffset(); + + private static native int reventsOffset(); + + private static native int fdOffset(); + + private static native int pollsetCreate() throws IOException; + + private static native int pollsetCtl(int pollset, int opcode, int fd, int events); + + private static native int pollsetPoll(int pollset, long pollAddress, int numfds) + throws IOException; + + private static native void pollsetDestroy(int pollset); + + private static native void socketpair(int[] sv) throws IOException; + + private static native void interrupt(int fd) throws IOException; + + private static native void drain1(int fd) throws IOException; + + private static native void close0(int fd); +} diff --git a/src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..8a147203402e9d18183ac7f4f9234ca71df30a77 --- /dev/null +++ b/src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpChannelImpl extends SctpChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Association association() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bind(SocketAddress local) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote, int maxOutStreams, + int maxInStreams) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean isConnectionPending() { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean finishConnect() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel shutdown() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel setOption(SctpSocketOption name, T value) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer dst, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer src, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..c2c1d96830747c8de457b7ab18d88a16a175a3fd --- /dev/null +++ b/src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpMultiChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpMultiChannelImpl extends SctpMultiChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpMultiChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Set associations() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses + (Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel shutdown(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name, + Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel setOption(SctpSocketOption name, + T value, Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer buffer, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer buffer, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel branch(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java b/src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..1e224afd13fd3be2737017d5d87a6f61f276f257 --- /dev/null +++ b/src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpServerChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpServerChannelImpl extends SctpServerChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpServerChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel accept() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel setOption(SctpSocketOption name, + T value) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/aix/classes/sun/nio/fs/AixFileStore.java b/src/aix/classes/sun/nio/fs/AixFileStore.java new file mode 100644 index 0000000000000000000000000000000000000000..c38cb46a760a95a866faf5b5096789cc7aa8ba53 --- /dev/null +++ b/src/aix/classes/sun/nio/fs/AixFileStore.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.nio.file.attribute.*; +import java.util.*; +import java.io.IOException; + +/** + * AIX implementation of FileStore + */ + +class AixFileStore + extends UnixFileStore +{ + + AixFileStore(UnixPath file) throws IOException { + super(file); + } + + AixFileStore(UnixFileSystem fs, UnixMountEntry entry) throws IOException { + super(fs, entry); + } + + /** + * Finds, and returns, the mount entry for the file system where the file + * resides. + */ + @Override + UnixMountEntry findMountEntry() throws IOException { + AixFileSystem fs = (AixFileSystem)file().getFileSystem(); + + // step 1: get realpath + UnixPath path = null; + try { + byte[] rp = UnixNativeDispatcher.realpath(file()); + path = new UnixPath(fs, rp); + } catch (UnixException x) { + x.rethrowAsIOException(file()); + } + + // step 2: find mount point + UnixPath parent = path.getParent(); + while (parent != null) { + UnixFileAttributes attrs = null; + try { + attrs = UnixFileAttributes.get(parent, true); + } catch (UnixException x) { + x.rethrowAsIOException(parent); + } + if (attrs.dev() != dev()) + break; + path = parent; + parent = parent.getParent(); + } + + // step 3: lookup mounted file systems + byte[] dir = path.asByteArray(); + for (UnixMountEntry entry: fs.getMountEntries()) { + if (Arrays.equals(dir, entry.dir())) + return entry; + } + + throw new IOException("Mount point not found"); + } + + // returns true if extended attributes enabled on file system where given + // file resides, returns false if disabled or unable to determine. + private boolean isExtendedAttributesEnabled(UnixPath path) { + return false; + } + + @Override + public boolean supportsFileAttributeView(Class type) { + return super.supportsFileAttributeView(type); + } + + @Override + public boolean supportsFileAttributeView(String name) { + return super.supportsFileAttributeView(name); + } +} diff --git a/src/aix/classes/sun/nio/fs/AixFileSystem.java b/src/aix/classes/sun/nio/fs/AixFileSystem.java new file mode 100644 index 0000000000000000000000000000000000000000..1169dd31606715f0df92447581ac086787f40482 --- /dev/null +++ b/src/aix/classes/sun/nio/fs/AixFileSystem.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; +import java.util.*; +import static sun.nio.fs.AixNativeDispatcher.*; + +/** + * AIX implementation of FileSystem + */ + +class AixFileSystem extends UnixFileSystem { + + AixFileSystem(UnixFileSystemProvider provider, String dir) { + super(provider, dir); + } + + @Override + public WatchService newWatchService() + throws IOException + { + return new PollingWatchService(); + } + + // lazy initialization of the list of supported attribute views + private static class SupportedFileFileAttributeViewsHolder { + static final Set supportedFileAttributeViews = + supportedFileAttributeViews(); + private static Set supportedFileAttributeViews() { + Set result = new HashSet(); + result.addAll(UnixFileSystem.standardFileAttributeViews()); + return Collections.unmodifiableSet(result); + } + } + + @Override + public Set supportedFileAttributeViews() { + return SupportedFileFileAttributeViewsHolder.supportedFileAttributeViews; + } + + @Override + void copyNonPosixAttributes(int ofd, int nfd) { + // TODO: Implement if needed. + } + + /** + * Returns object to iterate over the mount entries returned by mntctl + */ + @Override + Iterable getMountEntries() { + UnixMountEntry[] entries = null; + try { + entries = getmntctl(); + } catch (UnixException x) { + // nothing we can do + } + if (entries == null) { + return Collections.emptyList(); + } + return Arrays.asList(entries); + } + + @Override + FileStore getFileStore(UnixMountEntry entry) throws IOException { + return new AixFileStore(this, entry); + } +} diff --git a/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java b/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..5718d87b3879eb007869ddc253f9d309c1d66e9c --- /dev/null +++ b/src/aix/classes/sun/nio/fs/AixFileSystemProvider.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.io.IOException; + +/** + * AIX implementation of FileSystemProvider + */ + +public class AixFileSystemProvider extends UnixFileSystemProvider { + public AixFileSystemProvider() { + super(); + } + + @Override + AixFileSystem newFileSystem(String dir) { + return new AixFileSystem(this, dir); + } + + /** + * @see sun.nio.fs.UnixFileSystemProvider#getFileStore(sun.nio.fs.UnixPath) + */ + @Override + AixFileStore getFileStore(UnixPath path) throws IOException { + return new AixFileStore(path); + } +} diff --git a/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java b/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java new file mode 100644 index 0000000000000000000000000000000000000000..d46d80fc97fce1a6653747ae7ca081e905815990 --- /dev/null +++ b/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +/** + * AIX specific system calls. + */ + +class AixNativeDispatcher extends UnixNativeDispatcher { + private AixNativeDispatcher() { } + + /** + * Special implementation of 'getextmntent' (see SolarisNativeDispatcher) + * that returns all entries at once. + */ + static native UnixMountEntry[] getmntctl() throws UnixException; + + // initialize + private static native int init(); + + static { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + System.loadLibrary("nio"); + return null; + }}); + init(); + } +} diff --git a/src/aix/classes/sun/tools/attach/AixAttachProvider.java b/src/aix/classes/sun/tools/attach/AixAttachProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..a78c66097208a6482cb14a9d43b45be3860c6599 --- /dev/null +++ b/src/aix/classes/sun/tools/attach/AixAttachProvider.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.tools.attach; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.VirtualMachineDescriptor; +import com.sun.tools.attach.AttachNotSupportedException; +import com.sun.tools.attach.spi.AttachProvider; + +import java.io.IOException; + +// Based on 'LinuxAttachProvider.java'. All occurrences of the string +// "Linux" have been textually replaced by "Aix" to avoid confusion. + +/* + * An AttachProvider implementation for Aix that uses a UNIX domain + * socket. + */ +public class AixAttachProvider extends HotSpotAttachProvider { + + // perf counter for the JVM version + private static final String JVM_VERSION = "java.property.java.vm.version"; + + public AixAttachProvider() { + } + + public String name() { + return "sun"; + } + + public String type() { + return "socket"; + } + + public VirtualMachine attachVirtualMachine(String vmid) + throws AttachNotSupportedException, IOException + { + checkAttachPermission(); + + // AttachNotSupportedException will be thrown if the target VM can be determined + // to be not attachable. + testAttachable(vmid); + + return new AixVirtualMachine(this, vmid); + } + + public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) + throws AttachNotSupportedException, IOException + { + if (vmd.provider() != this) { + throw new AttachNotSupportedException("provider mismatch"); + } + // To avoid re-checking if the VM if attachable, we check if the descriptor + // is for a hotspot VM - these descriptors are created by the listVirtualMachines + // implementation which only returns a list of attachable VMs. + if (vmd instanceof HotSpotVirtualMachineDescriptor) { + assert ((HotSpotVirtualMachineDescriptor)vmd).isAttachable(); + checkAttachPermission(); + return new AixVirtualMachine(this, vmd.id()); + } else { + return attachVirtualMachine(vmd.id()); + } + } + +} diff --git a/src/aix/classes/sun/tools/attach/AixVirtualMachine.java b/src/aix/classes/sun/tools/attach/AixVirtualMachine.java new file mode 100644 index 0000000000000000000000000000000000000000..714f5c0d570749018e93057a8d292ec66a142a82 --- /dev/null +++ b/src/aix/classes/sun/tools/attach/AixVirtualMachine.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.tools.attach; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.AgentLoadException; +import com.sun.tools.attach.AttachNotSupportedException; +import com.sun.tools.attach.spi.AttachProvider; +import java.io.InputStream; +import java.io.IOException; +import java.io.File; +import java.util.Properties; + +// Based on 'LinuxVirtualMachine.java'. All occurrences of the string +// "Linux" have been textually replaced by "Aix" to avoid confusion. + +/* + * Aix implementation of HotSpotVirtualMachine + */ +public class AixVirtualMachine extends HotSpotVirtualMachine { + // "/tmp" is used as a global well-known location for the files + // .java_pid. and .attach_pid. It is important that this + // location is the same for all processes, otherwise the tools + // will not be able to find all Hotspot processes. + // Any changes to this needs to be synchronized with HotSpot. + private static final String tmpdir = "/tmp"; + + // The patch to the socket file created by the target VM + String path; + + /** + * Attaches to the target VM + */ + AixVirtualMachine(AttachProvider provider, String vmid) + throws AttachNotSupportedException, IOException + { + super(provider, vmid); + + // This provider only understands pids + int pid; + try { + pid = Integer.parseInt(vmid); + } catch (NumberFormatException x) { + throw new AttachNotSupportedException("Invalid process identifier"); + } + + // Find the socket file. If not found then we attempt to start the + // attach mechanism in the target VM by sending it a QUIT signal. + // Then we attempt to find the socket file again. + path = findSocketFile(pid); + if (path == null) { + File f = createAttachFile(pid); + try { + sendQuitTo(pid); + + // give the target VM time to start the attach mechanism + int i = 0; + long delay = 200; + int retries = (int)(attachTimeout() / delay); + do { + try { + Thread.sleep(delay); + } catch (InterruptedException x) { } + path = findSocketFile(pid); + i++; + } while (i <= retries && path == null); + if (path == null) { + throw new AttachNotSupportedException( + "Unable to open socket file: target process not responding " + + "or HotSpot VM not loaded"); + } + } finally { + f.delete(); + } + } + + // Check that the file owner/permission to avoid attaching to + // bogus process + checkPermissions(path); + + // Check that we can connect to the process + // - this ensures we throw the permission denied error now rather than + // later when we attempt to enqueue a command. + int s = socket(); + try { + connect(s, path); + } finally { + close(s); + } + } + + /** + * Detach from the target VM + */ + public void detach() throws IOException { + synchronized (this) { + if (this.path != null) { + this.path = null; + } + } + } + + // protocol version + private final static String PROTOCOL_VERSION = "1"; + + // known errors + private final static int ATTACH_ERROR_BADVERSION = 101; + + /** + * Execute the given command in the target VM. + */ + InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException { + assert args.length <= 3; // includes null + + // did we detach? + String p; + synchronized (this) { + if (this.path == null) { + throw new IOException("Detached from target VM"); + } + p = this.path; + } + + // create UNIX socket + int s = socket(); + + // connect to target VM + try { + connect(s, p); + } catch (IOException x) { + close(s); + throw x; + } + + IOException ioe = null; + + // connected - write request + // + try { + writeString(s, PROTOCOL_VERSION); + writeString(s, cmd); + + for (int i=0; i<3; i++) { + if (i < args.length && args[i] != null) { + writeString(s, (String)args[i]); + } else { + writeString(s, ""); + } + } + } catch (IOException x) { + ioe = x; + } + + + // Create an input stream to read reply + SocketInputStream sis = new SocketInputStream(s); + + // Read the command completion status + int completionStatus; + try { + completionStatus = readInt(sis); + } catch (IOException x) { + sis.close(); + if (ioe != null) { + throw ioe; + } else { + throw x; + } + } + + if (completionStatus != 0) { + sis.close(); + + // In the event of a protocol mismatch then the target VM + // returns a known error so that we can throw a reasonable + // error. + if (completionStatus == ATTACH_ERROR_BADVERSION) { + throw new IOException("Protocol mismatch with target VM"); + } + + // Special-case the "load" command so that the right exception is + // thrown. + if (cmd.equals("load")) { + throw new AgentLoadException("Failed to load agent library"); + } else { + throw new IOException("Command failed in target VM"); + } + } + + // Return the input stream so that the command output can be read + return sis; + } + + /* + * InputStream for the socket connection to get target VM + */ + private class SocketInputStream extends InputStream { + int s; + + public SocketInputStream(int s) { + this.s = s; + } + + public synchronized int read() throws IOException { + byte b[] = new byte[1]; + int n = this.read(b, 0, 1); + if (n == 1) { + return b[0] & 0xff; + } else { + return -1; + } + } + + public synchronized int read(byte[] bs, int off, int len) throws IOException { + if ((off < 0) || (off > bs.length) || (len < 0) || + ((off + len) > bs.length) || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(); + } else if (len == 0) + return 0; + + return AixVirtualMachine.read(s, bs, off, len); + } + + public void close() throws IOException { + AixVirtualMachine.close(s); + } + } + + // Return the socket file for the given process. + private String findSocketFile(int pid) { + File f = new File(tmpdir, ".java_pid" + pid); + if (!f.exists()) { + return null; + } + return f.getPath(); + } + + // On Solaris/Linux/Aix a simple handshake is used to start the attach mechanism + // if not already started. The client creates a .attach_pid file in the + // target VM's working directory (or temp directory), and the SIGQUIT handler + // checks for the file. + private File createAttachFile(int pid) throws IOException { + String fn = ".attach_pid" + pid; + String path = "/proc/" + pid + "/cwd/" + fn; + File f = new File(path); + try { + f.createNewFile(); + } catch (IOException x) { + f = new File(tmpdir, fn); + f.createNewFile(); + } + return f; + } + + /* + * Write/sends the given to the target VM. String is transmitted in + * UTF-8 encoding. + */ + private void writeString(int fd, String s) throws IOException { + if (s.length() > 0) { + byte b[]; + try { + b = s.getBytes("UTF-8"); + } catch (java.io.UnsupportedEncodingException x) { + throw new InternalError(x); + } + AixVirtualMachine.write(fd, b, 0, b.length); + } + byte b[] = new byte[1]; + b[0] = 0; + write(fd, b, 0, 1); + } + + + //-- native methods + + static native void sendQuitTo(int pid) throws IOException; + + static native void checkPermissions(String path) throws IOException; + + static native int socket() throws IOException; + + static native void connect(int fd, String path) throws IOException; + + static native void close(int fd) throws IOException; + + static native int read(int fd, byte buf[], int off, int bufLen) throws IOException; + + static native void write(int fd, byte buf[], int off, int bufLen) throws IOException; + + static { + System.loadLibrary("attach"); + } +} diff --git a/src/aix/native/java/net/aix_close.c b/src/aix/native/java/net/aix_close.c new file mode 100644 index 0000000000000000000000000000000000000000..e6e64ff5e17156a3c57456d53dccc7f1f058e92f --- /dev/null +++ b/src/aix/native/java/net/aix_close.c @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This file contains implementations of NET_... functions. The NET_.. functions are + * wrappers for common file- and socket functions plus provisions for non-blocking IO. + * + * (basically, the layers remember all file descriptors waiting for a particular fd; + * all threads waiting on a certain fd can be woken up by sending them a signal; this + * is done e.g. when the fd is closed.) + * + * This was originally copied from the linux_close.c implementation. + * + * Side Note: This coding needs initialization. Under Linux this is done + * automatically via __attribute((constructor)), on AIX this is done manually + * (see aix_close_init). + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Stack allocated by thread when doing blocking operation + */ +typedef struct threadEntry { + pthread_t thr; /* this thread */ + struct threadEntry *next; /* next thread */ + int intr; /* interrupted */ +} threadEntry_t; + +/* + * Heap allocated during initialized - one entry per fd + */ +typedef struct { + pthread_mutex_t lock; /* fd lock */ + threadEntry_t *threads; /* threads blocked on fd */ +} fdEntry_t; + +/* + * Signal to unblock thread + */ +static int sigWakeup = (SIGRTMAX - 1); + +/* + * The fd table and the number of file descriptors + */ +static fdEntry_t *fdTable = NULL; +static int fdCount = 0; + +/* + * Null signal handler + */ +static void sig_wakeup(int sig) { +} + +/* + * Initialization routine (executed when library is loaded) + * Allocate fd tables and sets up signal handler. + * + * On AIX we don't have __attribute((constructor)) so we need to initialize + * manually (from JNI_OnLoad() in 'src/share/native/java/net/net_util.c') + */ +void aix_close_init() { + struct rlimit nbr_files; + sigset_t sigset; + struct sigaction sa; + + /* Check already initialized */ + if (fdCount > 0 && fdTable != NULL) { + return; + } + + /* + * Allocate table based on the maximum number of + * file descriptors. + */ + if (-1 == getrlimit(RLIMIT_NOFILE, &nbr_files)) { + fprintf(stderr, "library initialization failed - " + "unable to get max # of allocated fds\n"); + abort(); + } + fdCount = nbr_files.rlim_max; + /* + * We have a conceptual problem here, when the number of files is + * unlimited. As a kind of workaround, we ensure the table is big + * enough for handle even a large number of files. Since SAP itself + * recommends a limit of 32000 files, we just use 64000 as 'infinity'. + */ + if (nbr_files.rlim_max == RLIM_INFINITY) { + fdCount = 64000; + } + fdTable = (fdEntry_t *)calloc(fdCount, sizeof(fdEntry_t)); + if (fdTable == NULL) { + fprintf(stderr, "library initialization failed - " + "unable to allocate file descriptor table - out of memory"); + abort(); + } + + { + int i; + for (i=0; i < fdCount; i++) { + pthread_mutex_init(&fdTable[i].lock, NULL); + } + } + + /* + * Setup the signal handler + */ + sa.sa_handler = sig_wakeup; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(sigWakeup, &sa, NULL); + + sigemptyset(&sigset); + sigaddset(&sigset, sigWakeup); + sigprocmask(SIG_UNBLOCK, &sigset, NULL); +} + +/* + * Return the fd table for this fd or NULL is fd out + * of range. + */ +static inline fdEntry_t *getFdEntry(int fd) +{ + if (fd < 0 || fd >= fdCount) { + return NULL; + } + return &fdTable[fd]; +} + +/* + * Start a blocking operation :- + * Insert thread onto thread list for the fd. + */ +static inline void startOp(fdEntry_t *fdEntry, threadEntry_t *self) +{ + self->thr = pthread_self(); + self->intr = 0; + + pthread_mutex_lock(&(fdEntry->lock)); + { + self->next = fdEntry->threads; + fdEntry->threads = self; + } + pthread_mutex_unlock(&(fdEntry->lock)); +} + +/* + * End a blocking operation :- + * Remove thread from thread list for the fd + * If fd has been interrupted then set errno to EBADF + */ +static inline void endOp + (fdEntry_t *fdEntry, threadEntry_t *self) +{ + int orig_errno = errno; + pthread_mutex_lock(&(fdEntry->lock)); + { + threadEntry_t *curr, *prev=NULL; + curr = fdEntry->threads; + while (curr != NULL) { + if (curr == self) { + if (curr->intr) { + orig_errno = EBADF; + } + if (prev == NULL) { + fdEntry->threads = curr->next; + } else { + prev->next = curr->next; + } + break; + } + prev = curr; + curr = curr->next; + } + } + pthread_mutex_unlock(&(fdEntry->lock)); + errno = orig_errno; +} + +/* + * Close or dup2 a file descriptor ensuring that all threads blocked on + * the file descriptor are notified via a wakeup signal. + * + * fd1 < 0 => close(fd2) + * fd1 >= 0 => dup2(fd1, fd2) + * + * Returns -1 with errno set if operation fails. + */ +static int closefd(int fd1, int fd2) { + int rv, orig_errno; + fdEntry_t *fdEntry = getFdEntry(fd2); + if (fdEntry == NULL) { + errno = EBADF; + return -1; + } + + /* + * Lock the fd to hold-off additional I/O on this fd. + */ + pthread_mutex_lock(&(fdEntry->lock)); + + { + /* On fast machines we see that we enter dup2 before the + * accepting thread had a chance to get and process the signal. + * So in case we woke a thread up, give it some time to cope. + * Also see https://bugs.openjdk.java.net/browse/JDK-8006395 */ + int num_woken = 0; + + /* + * Send a wakeup signal to all threads blocked on this + * file descriptor. + */ + threadEntry_t *curr = fdEntry->threads; + while (curr != NULL) { + curr->intr = 1; + pthread_kill( curr->thr, sigWakeup ); + num_woken ++; + curr = curr->next; + } + + if (num_woken > 0) { + usleep(num_woken * 50); + } + + /* + * And close/dup the file descriptor + * (restart if interrupted by signal) + */ + do { + if (fd1 < 0) { + rv = close(fd2); + } else { + rv = dup2(fd1, fd2); + } + } while (rv == -1 && errno == EINTR); + } + + /* + * Unlock without destroying errno + */ + orig_errno = errno; + pthread_mutex_unlock(&(fdEntry->lock)); + errno = orig_errno; + + return rv; +} + +/* + * Wrapper for dup2 - same semantics as dup2 system call except + * that any threads blocked in an I/O system call on fd2 will be + * preempted and return -1/EBADF; + */ +int NET_Dup2(int fd, int fd2) { + if (fd < 0) { + errno = EBADF; + return -1; + } + return closefd(fd, fd2); +} + +/* + * Wrapper for close - same semantics as close system call + * except that any threads blocked in an I/O on fd will be + * preempted and the I/O system call will return -1/EBADF. + */ +int NET_SocketClose(int fd) { + return closefd(-1, fd); +} + +/************** Basic I/O operations here ***************/ + +/* + * Macro to perform a blocking IO operation. Restarts + * automatically if interrupted by signal (other than + * our wakeup signal) + */ +#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while (ret == -1 && errno == EINTR); \ + return ret; \ +} + +int NET_Read(int s, void* buf, size_t len) { + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); +} + +int NET_ReadV(int s, const struct iovec * vector, int count) { + BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) ); +} + +int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, + struct sockaddr *from, int *fromlen) { + socklen_t socklen = *fromlen; + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) ); + *fromlen = socklen; +} + +int NET_Send(int s, void *msg, int len, unsigned int flags) { + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); +} + +int NET_WriteV(int s, const struct iovec * vector, int count) { + BLOCKING_IO_RETURN_INT( s, writev(s, vector, count) ); +} + +int NET_SendTo(int s, const void *msg, int len, unsigned int + flags, const struct sockaddr *to, int tolen) { + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); +} + +int NET_Accept(int s, struct sockaddr *addr, int *addrlen) { + socklen_t socklen = *addrlen; + BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) ); + *addrlen = socklen; +} + +int NET_Connect(int s, struct sockaddr *addr, int addrlen) { + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); +} + +#ifndef USE_SELECT +int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); +} +#else +int NET_Select(int s, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout) { + BLOCKING_IO_RETURN_INT( s-1, + select(s, readfds, writefds, exceptfds, timeout) ); +} +#endif + +/* + * Wrapper for poll(s, timeout). + * Auto restarts with adjusted timeout if interrupted by + * signal other than our wakeup signal. + */ +int NET_Timeout(int s, long timeout) { + long prevtime = 0, newtime; + struct timeval t; + fdEntry_t *fdEntry = getFdEntry(s); + + /* + * Check that fd hasn't been closed. + */ + if (fdEntry == NULL) { + errno = EBADF; + return -1; + } + + /* + * Pick up current time as may need to adjust timeout + */ + if (timeout > 0) { + gettimeofday(&t, NULL); + prevtime = t.tv_sec * 1000 + t.tv_usec / 1000; + } + + for(;;) { + struct pollfd pfd; + int rv; + threadEntry_t self; + + /* + * Poll the fd. If interrupted by our wakeup signal + * errno will be set to EBADF. + */ + pfd.fd = s; + pfd.events = POLLIN | POLLERR; + + startOp(fdEntry, &self); + rv = poll(&pfd, 1, timeout); + endOp(fdEntry, &self); + + /* + * If interrupted then adjust timeout. If timeout + * has expired return 0 (indicating timeout expired). + */ + if (rv < 0 && errno == EINTR) { + if (timeout > 0) { + gettimeofday(&t, NULL); + newtime = t.tv_sec * 1000 + t.tv_usec / 1000; + timeout -= newtime - prevtime; + if (timeout <= 0) { + return 0; + } + prevtime = newtime; + } + } else { + return rv; + } + + } +} diff --git a/src/aix/native/sun/nio/ch/AixNativeThread.c b/src/aix/native/sun/nio/ch/AixNativeThread.c new file mode 100644 index 0000000000000000000000000000000000000000..c0d5857962ae0834e5b831e0ac877c48a67b23b7 --- /dev/null +++ b/src/aix/native/sun/nio/ch/AixNativeThread.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include "jni.h" +#include "jni_util.h" +#include "jvm.h" +#include "jlong.h" +#include "sun_nio_ch_NativeThread.h" + +#include +#include + +/* Also defined in src/aix/native/java/net/aix_close.c */ +#define INTERRUPT_SIGNAL (SIGRTMAX - 1) + +static void +nullHandler(int sig) +{ +} + + +JNIEXPORT void JNICALL +Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl) +{ + /* Install the null handler for INTERRUPT_SIGNAL. This might overwrite the + * handler previously installed by java/net/aix_close.c, but that's okay + * since neither handler actually does anything. We install our own + * handler here simply out of paranoia; ultimately the two mechanisms + * should somehow be unified, perhaps within the VM. + */ + + sigset_t ss; + struct sigaction sa, osa; + sa.sa_handler = nullHandler; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + if (sigaction(INTERRUPT_SIGNAL, &sa, &osa) < 0) + JNU_ThrowIOExceptionWithLastError(env, "sigaction"); +} + +JNIEXPORT jlong JNICALL +Java_sun_nio_ch_NativeThread_current(JNIEnv *env, jclass cl) +{ + return (long)pthread_self(); +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_NativeThread_signal(JNIEnv *env, jclass cl, jlong thread) +{ + if (pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL)) + JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed"); +} diff --git a/src/aix/native/sun/nio/ch/AixPollPort.c b/src/aix/native/sun/nio/ch/AixPollPort.c new file mode 100644 index 0000000000000000000000000000000000000000..70064b890ef779e795f124879600105f46c05cf5 --- /dev/null +++ b/src/aix/native/sun/nio/ch/AixPollPort.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "jni.h" +#include "jni_util.h" +#include "jvm.h" +#include "jlong.h" + +#include "sun_nio_ch_AixPollPort.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Initially copied from src/solaris/native/sun/nio/ch/nio_util.h */ +#define RESTARTABLE(_cmd, _result) do { \ + do { \ + _result = _cmd; \ + } while((_result == -1) && (errno == EINTR)); \ +} while(0) + +typedef pollset_t pollset_create_func(int maxfd); +typedef int pollset_destroy_func(pollset_t ps); +typedef int pollset_ctl_func(pollset_t ps, struct poll_ctl *pollctl_array, int array_length); +typedef int pollset_poll_func(pollset_t ps, struct pollfd *polldata_array, int array_length, int timeout); +static pollset_create_func* _pollset_create = NULL; +static pollset_destroy_func* _pollset_destroy = NULL; +static pollset_ctl_func* _pollset_ctl = NULL; +static pollset_poll_func* _pollset_poll = NULL; + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_init(JNIEnv* env, jclass this) { + _pollset_create = (pollset_create_func*) dlsym(RTLD_DEFAULT, "pollset_create"); + _pollset_destroy = (pollset_destroy_func*) dlsym(RTLD_DEFAULT, "pollset_destroy"); + _pollset_ctl = (pollset_ctl_func*) dlsym(RTLD_DEFAULT, "pollset_ctl"); + _pollset_poll = (pollset_poll_func*) dlsym(RTLD_DEFAULT, "pollset_poll"); + if (_pollset_create == NULL || _pollset_destroy == NULL || + _pollset_ctl == NULL || _pollset_poll == NULL) { + JNU_ThrowInternalError(env, "unable to get address of pollset functions"); + } +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_eventSize(JNIEnv* env, jclass this) { + return sizeof(struct pollfd); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_eventsOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, events); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_reventsOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, revents); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_fdOffset(JNIEnv* env, jclass this) { + return offsetof(struct pollfd, fd); +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetCreate(JNIEnv *env, jclass c) { + /* pollset_create can take the maximum number of fds, but we + * cannot predict this number so we leave it at OPEN_MAX. */ + pollset_t ps = _pollset_create(-1); + if (ps < 0) { + JNU_ThrowIOExceptionWithLastError(env, "pollset_create failed"); + } + return (int)ps; +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetCtl(JNIEnv *env, jclass c, jint ps, + jint opcode, jint fd, jint events) { + struct poll_ctl event; + int res; + + event.cmd = opcode; + event.events = events; + event.fd = fd; + + RESTARTABLE(_pollset_ctl((pollset_t)ps, &event, 1 /* length */), res); + + return (res == 0) ? 0 : errno; +} + +JNIEXPORT jint JNICALL +Java_sun_nio_ch_AixPollPort_pollsetPoll(JNIEnv *env, jclass c, + jint ps, jlong address, jint numfds) { + struct pollfd *events = jlong_to_ptr(address); + int res; + + RESTARTABLE(_pollset_poll(ps, events, numfds, -1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "pollset_poll failed"); + } + return res; +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_pollsetDestroy(JNIEnv *env, jclass c, jint ps) { + int res; + RESTARTABLE(_pollset_destroy((pollset_t)ps), res); +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_socketpair(JNIEnv* env, jclass clazz, jintArray sv) { + int sp[2]; + if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) == -1) { + JNU_ThrowIOExceptionWithLastError(env, "socketpair failed"); + } else { + jint res[2]; + res[0] = (jint)sp[0]; + res[1] = (jint)sp[1]; + (*env)->SetIntArrayRegion(env, sv, 0, 2, &res[0]); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_interrupt(JNIEnv *env, jclass c, jint fd) { + int res; + int buf[1]; + buf[0] = 1; + RESTARTABLE(write(fd, buf, 1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "write failed"); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_drain1(JNIEnv *env, jclass cl, jint fd) { + int res; + char buf[1]; + RESTARTABLE(read(fd, buf, 1), res); + if (res < 0) { + JNU_ThrowIOExceptionWithLastError(env, "drain1 failed"); + } +} + +JNIEXPORT void JNICALL +Java_sun_nio_ch_AixPollPort_close0(JNIEnv *env, jclass c, jint fd) { + int res; + RESTARTABLE(close(fd), res); +} diff --git a/src/aix/native/sun/nio/fs/AixNativeDispatcher.c b/src/aix/native/sun/nio/fs/AixNativeDispatcher.c new file mode 100644 index 0000000000000000000000000000000000000000..82d8f6203e789113ca3433c5241ec668623b0c9a --- /dev/null +++ b/src/aix/native/sun/nio/fs/AixNativeDispatcher.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include +#include + +#include "jni.h" +#include "jni_util.h" + +#include "sun_nio_fs_AixNativeDispatcher.h" + +static jfieldID entry_name; +static jfieldID entry_dir; +static jfieldID entry_fstype; +static jfieldID entry_options; + +static jclass entry_cls; + +/** + * Call this to throw an internal UnixException when a system/library + * call fails + */ +static void throwUnixException(JNIEnv* env, int errnum) { + jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", + "(I)V", errnum); + if (x != NULL) { + (*env)->Throw(env, x); + } +} + +/** + * Initialization + */ +JNIEXPORT jint JNICALL +Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this) +{ + jint flags = 0; + jclass clazz; + + clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"); + if (clazz == NULL) { + return 0; + } + entry_name = (*env)->GetFieldID(env, clazz, "name", "[B"); + entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B"); + entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B"); + entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B"); + entry_cls = (*env)->NewGlobalRef(env, clazz); + + return 0; +} + +/** + * Special implementation of getextmntent (see SolarisNativeDispatcher.c) + * that returns all entries at once. + */ +JNIEXPORT jobjectArray JNICALL +Java_sun_nio_fs_AixNativeDispatcher_getmntctl(JNIEnv* env, jclass this) +{ + int must_free_buf = 0; + char stack_buf[1024]; + char* buffer = stack_buf; + size_t buffer_size = 1024; + int num_entries; + int i; + jobjectArray ret; + struct vmount * vm; + + for (i = 0; i < 5; i++) { + num_entries = mntctl(MCTL_QUERY, buffer_size, buffer); + if (num_entries != 0) { + break; + } + if (must_free_buf) { + free(buffer); + } + buffer_size *= 8; + buffer = malloc(buffer_size); + must_free_buf = 1; + } + /* Treat zero entries like errors. */ + if (num_entries <= 0) { + if (must_free_buf) { + free(buffer); + } + throwUnixException(env, errno); + return NULL; + } + ret = (*env)->NewObjectArray(env, num_entries, entry_cls, NULL); + if (ret == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + vm = (struct vmount*)buffer; + for (i = 0; i < num_entries; i++) { + jsize len; + jbyteArray bytes; + const char* fstype; + /* We set all relevant attributes so there is no need to call constructor. */ + jobject entry = (*env)->AllocObject(env, entry_cls); + if (entry == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetObjectArrayElement(env, ret, i, entry); + + /* vm->vmt_data[...].vmt_size is 32 bit aligned and also includes NULL byte. */ + /* Since we only need the characters, it is necessary to check string size manually. */ + len = strlen((char*)vm + vm->vmt_data[VMT_OBJECT].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_OBJECT].vmt_off)); + (*env)->SetObjectField(env, entry, entry_name, bytes); + + len = strlen((char*)vm + vm->vmt_data[VMT_STUB].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_STUB].vmt_off)); + (*env)->SetObjectField(env, entry, entry_dir, bytes); + + switch (vm->vmt_gfstype) { + case MNT_J2: + fstype = "jfs2"; + break; + case MNT_NAMEFS: + fstype = "namefs"; + break; + case MNT_NFS: + fstype = "nfs"; + break; + case MNT_JFS: + fstype = "jfs"; + break; + case MNT_CDROM: + fstype = "cdrom"; + break; + case MNT_PROCFS: + fstype = "procfs"; + break; + case MNT_NFS3: + fstype = "nfs3"; + break; + case MNT_AUTOFS: + fstype = "autofs"; + break; + case MNT_UDF: + fstype = "udfs"; + break; + case MNT_NFS4: + fstype = "nfs4"; + break; + case MNT_CIFS: + fstype = "smbfs"; + break; + default: + fstype = "unknown"; + } + len = strlen(fstype); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); + (*env)->SetObjectField(env, entry, entry_fstype, bytes); + + len = strlen((char*)vm + vm->vmt_data[VMT_ARGS].vmt_off); + bytes = (*env)->NewByteArray(env, len); + if (bytes == NULL) { + if (must_free_buf) { + free(buffer); + } + return NULL; + } + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)((char *)vm + vm->vmt_data[VMT_ARGS].vmt_off)); + (*env)->SetObjectField(env, entry, entry_options, bytes); + + /* goto the next vmount structure: */ + vm = (struct vmount *)((char *)vm + vm->vmt_length); + } + + if (must_free_buf) { + free(buffer); + } + return ret; +} diff --git a/src/aix/native/sun/tools/attach/AixVirtualMachine.c b/src/aix/native/sun/tools/attach/AixVirtualMachine.c new file mode 100644 index 0000000000000000000000000000000000000000..a5ba16051320352e1ff5ff995b0096c81fccfbee --- /dev/null +++ b/src/aix/native/sun/tools/attach/AixVirtualMachine.c @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "jni.h" +#include "jni_util.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Based on 'LinuxVirtualMachine.c'. Non-relevant code has been removed and all + * occurrences of the string "Linux" have been replaced by "Aix". + */ + +#include "sun_tools_attach_AixVirtualMachine.h" + +#define RESTARTABLE(_cmd, _result) do { \ + do { \ + _result = _cmd; \ + } while((_result == -1) && (errno == EINTR)); \ +} while(0) + + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: socket + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_sun_tools_attach_AixVirtualMachine_socket + (JNIEnv *env, jclass cls) +{ + int fd = socket(PF_UNIX, SOCK_STREAM, 0); + if (fd == -1) { + JNU_ThrowIOExceptionWithLastError(env, "socket"); + } + /* added time out values */ + else { + struct timeval tv; + tv.tv_sec = 2 * 60; + tv.tv_usec = 0; + + setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(tv)); + setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (char*)&tv, sizeof(tv)); + } + return (jint)fd; +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: connect + * Signature: (ILjava/lang/String;)I + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_connect + (JNIEnv *env, jclass cls, jint fd, jstring path) +{ + jboolean isCopy; + const char* p = GetStringPlatformChars(env, path, &isCopy); + if (p != NULL) { + struct sockaddr_un addr; + int err = 0; + + /* added missing structure initialization */ + memset(&addr,0, sizeof(addr)); + addr.sun_family = AF_UNIX; + strcpy(addr.sun_path, p); + /* We must call bind with the actual socketaddr length. This is obligatory for AS400. */ + if (connect(fd, (struct sockaddr*)&addr, SUN_LEN(&addr)) == -1) { + err = errno; + } + + if (isCopy) { + JNU_ReleaseStringPlatformChars(env, path, p); + } + + /* + * If the connect failed then we throw the appropriate exception + * here (can't throw it before releasing the string as can't call + * JNI with pending exception) + */ + if (err != 0) { + if (err == ENOENT) { + JNU_ThrowByName(env, "java/io/FileNotFoundException", NULL); + } else { + char* msg = strdup(strerror(err)); + JNU_ThrowIOException(env, msg); + if (msg != NULL) { + free(msg); + } + } + } + } +} + + +/* + * Structure and callback function used to send a QUIT signal to all + * children of a given process + */ +typedef struct { + pid_t ppid; +} SendQuitContext; + +static void SendQuitCallback(const pid_t pid, void* user_data) { + SendQuitContext* context = (SendQuitContext*)user_data; + pid_t parent = getParent(pid); + if (parent == context->ppid) { + kill(pid, SIGQUIT); + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: sendQuitTo + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_sendQuitTo + (JNIEnv *env, jclass cls, jint pid) +{ + if (kill((pid_t)pid, SIGQUIT)) { + JNU_ThrowIOExceptionWithLastError(env, "kill"); + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: checkPermissions + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_checkPermissions + (JNIEnv *env, jclass cls, jstring path) +{ + jboolean isCopy; + const char* p = GetStringPlatformChars(env, path, &isCopy); + if (p != NULL) { + struct stat64 sb; + uid_t uid, gid; + int res; + /* added missing initialization of the stat64 buffer */ + memset(&sb, 0, sizeof(struct stat64)); + + /* + * Check that the path is owned by the effective uid/gid of this + * process. Also check that group/other access is not allowed. + */ + uid = geteuid(); + gid = getegid(); + + res = stat64(p, &sb); + if (res != 0) { + /* save errno */ + res = errno; + } + + /* release p here before we throw an I/O exception */ + if (isCopy) { + JNU_ReleaseStringPlatformChars(env, path, p); + } + + if (res == 0) { + if ( (sb.st_uid != uid) || (sb.st_gid != gid) || + ((sb.st_mode & (S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) != 0) ) { + JNU_ThrowIOException(env, "well-known file is not secure"); + } + } else { + char* msg = strdup(strerror(res)); + JNU_ThrowIOException(env, msg); + if (msg != NULL) { + free(msg); + } + } + } +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: close + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_close + (JNIEnv *env, jclass cls, jint fd) +{ + int res; + /* Fixed deadlock when this call of close by the client is not seen by the attach server + * which has accepted the (very short) connection already and is waiting for the request. But read don't get a byte, + * because the close is lost without shutdown. + */ + shutdown(fd, 2); + RESTARTABLE(close(fd), res); +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: read + * Signature: (I[BI)I + */ +JNIEXPORT jint JNICALL Java_sun_tools_attach_AixVirtualMachine_read + (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint baLen) +{ + unsigned char buf[128]; + size_t len = sizeof(buf); + ssize_t n; + + size_t remaining = (size_t)(baLen - off); + if (len > remaining) { + len = remaining; + } + + RESTARTABLE(read(fd, buf+off, len), n); + if (n == -1) { + JNU_ThrowIOExceptionWithLastError(env, "read"); + } else { + if (n == 0) { + n = -1; // EOF + } else { + (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off)); + } + } + return n; +} + +/* + * Class: sun_tools_attach_AixVirtualMachine + * Method: write + * Signature: (I[B)V + */ +JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_write + (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint bufLen) +{ + size_t remaining = bufLen; + do { + unsigned char buf[128]; + size_t len = sizeof(buf); + int n; + + if (len > remaining) { + len = remaining; + } + (*env)->GetByteArrayRegion(env, ba, off, len, (jbyte *)buf); + + RESTARTABLE(write(fd, buf, len), n); + if (n > 0) { + off += n; + remaining -= n; + } else { + JNU_ThrowIOExceptionWithLastError(env, "write"); + return; + } + + } while (remaining > 0); +} diff --git a/src/aix/porting/porting_aix.c b/src/aix/porting/porting_aix.c new file mode 100644 index 0000000000000000000000000000000000000000..659d9c4c06b8d5321c83f647b231789b15bae833 --- /dev/null +++ b/src/aix/porting/porting_aix.c @@ -0,0 +1,86 @@ +/* + * Copyright 2012, 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include +#include +#include + +#include "porting_aix.h" + +static unsigned char dladdr_buffer[0x4000]; + +static void fill_dll_info(void) { + int rc = loadquery(L_GETINFO,dladdr_buffer, sizeof(dladdr_buffer)); + if (rc == -1) { + fprintf(stderr, "loadquery failed (%d %s)", errno, strerror(errno)); + fflush(stderr); + } +} + +static int dladdr_dont_reload(void* addr, Dl_info* info) { + const struct ld_info* p = (struct ld_info*) dladdr_buffer; + info->dli_fbase = 0; info->dli_fname = 0; + info->dli_sname = 0; info->dli_saddr = 0; + for (;;) { + if (addr >= p->ldinfo_textorg && + addr < (((char*)p->ldinfo_textorg) + p->ldinfo_textsize)) { + info->dli_fname = p->ldinfo_filename; + info->dli_fbase = p->ldinfo_textorg; + return 1; /* [sic] */ + } + if (!p->ldinfo_next) { + break; + } + p = (struct ld_info*)(((char*)p) + p->ldinfo_next); + } + return 0; /* [sic] */ +} + +#ifdef __cplusplus +extern "C" +#endif +int dladdr(void *addr, Dl_info *info) { + static int loaded = 0; + if (!loaded) { + fill_dll_info(); + loaded = 1; + } + if (!addr) { + return 0; /* [sic] */ + } + /* Address could be AIX function descriptor? */ + void* const addr0 = *( (void**) addr ); + int rc = dladdr_dont_reload(addr, info); + if (rc == 0) { + rc = dladdr_dont_reload(addr0, info); + if (rc == 0) { /* [sic] */ + fill_dll_info(); /* refill, maybe loadquery info is outdated */ + rc = dladdr_dont_reload(addr, info); + if (rc == 0) { + rc = dladdr_dont_reload(addr0, info); + } + } + } + return rc; +} diff --git a/src/aix/porting/porting_aix.h b/src/aix/porting/porting_aix.h new file mode 100644 index 0000000000000000000000000000000000000000..79d1062dd6794f67fe9533010cabb668cff60041 --- /dev/null +++ b/src/aix/porting/porting_aix.h @@ -0,0 +1,59 @@ +/* + * Copyright 2012, 2013 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * Header file to contain porting-relevant code which does not have a + * home anywhere else. + * This is intially based on hotspot/src/os/aix/vm/{loadlib,porting}_aix.{hpp,cpp} + */ + +/* + * Aix' own version of dladdr(). + * This function tries to mimick dladdr(3) on Linux + * (see http://linux.die.net/man/3/dladdr) + * dladdr(3) is not POSIX but a GNU extension, and is not available on AIX. + * + * Differences between AIX dladdr and Linux dladdr: + * + * 1) Dl_info.dli_fbase: can never work, is disabled. + * A loaded image on AIX is divided in multiple segments, at least two + * (text and data) but potentially also far more. This is because the loader may + * load each member into an own segment, as for instance happens with the libC.a + * 2) Dl_info.dli_sname: This only works for code symbols (functions); for data, a + * zero-length string is returned (""). + * 3) Dl_info.dli_saddr: For code, this will return the entry point of the function, + * not the function descriptor. + */ + +typedef struct { + const char *dli_fname; /* file path of loaded library */ + void *dli_fbase; /* doesn't make sence on AIX */ + const char *dli_sname; /* symbol name; "" if not known */ + void *dli_saddr; /* address of *entry* of function; not function descriptor; */ +} Dl_info; + +#ifdef __cplusplus +extern "C" +#endif +int dladdr(void *addr, Dl_info *info); diff --git a/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java b/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java index 4fc916f5807aa08767b19088659b46de3f6846c2..b6475b85a2421557719401524e104f5a22430233 100644 --- a/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java +++ b/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java @@ -53,10 +53,6 @@ import java.util.LinkedList; */ class KQueueArrayWrapper { - // Event masks - static final short POLLIN = AbstractPollArrayWrapper.POLLIN; - static final short POLLOUT = AbstractPollArrayWrapper.POLLOUT; - // kevent filters static short EVFILT_READ; static short EVFILT_WRITE; @@ -129,9 +125,9 @@ class KQueueArrayWrapper { // SinkChannelImpl, SourceChannelImpl, DatagramChannelImpl, // ServerSocketChannelImpl, SocketChannelImpl if (filter == EVFILT_READ) { - result |= POLLIN; + result |= Net.POLLIN; } else if (filter == EVFILT_WRITE) { - result |= POLLOUT; + result |= Net.POLLOUT; } return result; @@ -180,7 +176,7 @@ class KQueueArrayWrapper { if (!ch.isOpen()) continue; - register0(kq, ch.getFDVal(), u.events & POLLIN, u.events & POLLOUT); + register0(kq, ch.getFDVal(), u.events & Net.POLLIN, u.events & Net.POLLOUT); } } } diff --git a/src/share/bin/jli_util.h b/src/share/bin/jli_util.h index 388910407ffb39c086bd3b93c839a4a44b59147e..d3c9f0ff8f25e2d8cd5393420d763c9aff012b66 100644 --- a/src/share/bin/jli_util.h +++ b/src/share/bin/jli_util.h @@ -85,6 +85,9 @@ void JLI_CmdToArgs(char *cmdline); #ifdef MACOSX #define JLI_Lseek lseek #endif +#ifdef _AIX +#define JLI_Lseek lseek +#endif #endif /* _WIN32 */ /* diff --git a/src/share/classes/java/nio/file/CopyMoveHelper.java b/src/share/classes/java/nio/file/CopyMoveHelper.java index 54bfe085962c218f99d215199d2d3b569d9f51e7..ab9281807fdcd314b8072133d1268be3be3f784c 100644 --- a/src/share/classes/java/nio/file/CopyMoveHelper.java +++ b/src/share/classes/java/nio/file/CopyMoveHelper.java @@ -130,7 +130,7 @@ class CopyMoveHelper { // copy basic attributes to target if (opts.copyAttributes) { BasicFileAttributeView view = - Files.getFileAttributeView(target, BasicFileAttributeView.class, linkOptions); + Files.getFileAttributeView(target, BasicFileAttributeView.class); try { view.setTimes(attrs.lastModifiedTime(), attrs.lastAccessTime(), diff --git a/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java b/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java index 32a8a8b93b5cfd4cc128125dccfc4680199d39cf..0f1c594fd7f279718e97bce51c07b362cd06c613 100644 --- a/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java +++ b/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java @@ -37,14 +37,6 @@ import sun.misc.*; public abstract class AbstractPollArrayWrapper { - // Event masks - public static final short POLLIN = 0x0001; - public static final short POLLOUT = 0x0004; - public static final short POLLERR = 0x0008; - public static final short POLLHUP = 0x0010; - public static final short POLLNVAL = 0x0020; - public static final short POLLREMOVE = 0x0800; - // Miscellaneous constants static final short SIZE_POLLFD = 8; static final short FD_OFFSET = 0; diff --git a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java index 2cda6fa1527f375588ff00c2299202413f068813..c151afe570b485c0cba6b3eb5b2e51c76e5fe086 100644 --- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java +++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java @@ -1042,25 +1042,24 @@ class DatagramChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { // This should only happen if this channel is pre-closed while a // selection operation is in progress // ## Throw an error if this channel has not been pre-closed return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0)) newOps |= SelectionKey.OP_READ; - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0)) newOps |= SelectionKey.OP_WRITE; @@ -1105,11 +1104,11 @@ class DatagramChannelImpl int newOps = 0; if ((ops & SelectionKey.OP_READ) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; if ((ops & SelectionKey.OP_WRITE) != 0) - newOps |= PollArrayWrapper.POLLOUT; + newOps |= Net.POLLOUT; if ((ops & SelectionKey.OP_CONNECT) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; sk.selector.putEventOps(sk, newOps); } diff --git a/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java b/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java index 15e1a0ebde92ae44ccc24faaa0a05528ec8931e2..fe2ed23000262dfecbb99f7f918d96926238c2b6 100644 --- a/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java +++ b/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java @@ -187,9 +187,9 @@ public class DatagramSocketAdaptor if (!dc.isOpen()) throw new ClosedChannelException(); long st = System.currentTimeMillis(); - int result = dc.poll(PollArrayWrapper.POLLIN, to); + int result = dc.poll(Net.POLLIN, to); if (result > 0 && - ((result & PollArrayWrapper.POLLIN) != 0)) { + ((result & Net.POLLIN) != 0)) { if ((sender = dc.receive(bb)) != null) return sender; } diff --git a/src/share/classes/sun/nio/ch/Net.java b/src/share/classes/sun/nio/ch/Net.java index 6b82fcb85a9bad98f08431f9e9590100482154f2..79ebb2f36a5a974d70096030b54738b446670000 100644 --- a/src/share/classes/sun/nio/ch/Net.java +++ b/src/share/classes/sun/nio/ch/Net.java @@ -581,9 +581,34 @@ public class Net { private static native void initIDs(); + /** + * Event masks for the various poll system calls. + * They will be set platform dependant in the static initializer below. + */ + public static final short POLLIN; + public static final short POLLOUT; + public static final short POLLERR; + public static final short POLLHUP; + public static final short POLLNVAL; + public static final short POLLCONN; + + static native short pollinValue(); + static native short polloutValue(); + static native short pollerrValue(); + static native short pollhupValue(); + static native short pollnvalValue(); + static native short pollconnValue(); + static { IOUtil.load(); initIDs(); + + POLLIN = pollinValue(); + POLLOUT = polloutValue(); + POLLERR = pollerrValue(); + POLLHUP = pollhupValue(); + POLLNVAL = pollnvalValue(); + POLLCONN = pollconnValue(); } } diff --git a/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java b/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java index 2e5dfd4accbe50317970514566e75db015bc20bc..4357ffc4e73bc85033e3adaa8804459911823125 100644 --- a/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java +++ b/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java @@ -113,7 +113,7 @@ public class ServerSocketAdaptor // package-private if (!ssc.isOpen()) throw new ClosedChannelException(); long st = System.currentTimeMillis(); - int result = ssc.poll(PollArrayWrapper.POLLIN, to); + int result = ssc.poll(Net.POLLIN, to); if (result > 0 && ((sc = ssc.accept()) != null)) return sc.socket(); to -= System.currentTimeMillis() - st; diff --git a/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java b/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java index 000db66edddf0834c9ab36ce141f3355a86d7f0d..6b7d51bd46a362efbc1eda9d67e39619ff62212e 100644 --- a/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java +++ b/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java @@ -309,21 +309,20 @@ class ServerSocketChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { // This should only happen if this channel is pre-closed while a // selection operation is in progress // ## Throw an error if this channel has not been pre-closed return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_ACCEPT) != 0)) newOps |= SelectionKey.OP_ACCEPT; @@ -369,7 +368,7 @@ class ServerSocketChannelImpl // Translate ops if ((ops & SelectionKey.OP_ACCEPT) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; // Place ops into pollfd array sk.selector.putEventOps(sk, newOps); } diff --git a/src/share/classes/sun/nio/ch/SocketAdaptor.java b/src/share/classes/sun/nio/ch/SocketAdaptor.java index 05e9b52b9f2b342b2bec968de0f2a8c29e983896..9fd494b431f881d57ddcd85105ee36338291cdda 100644 --- a/src/share/classes/sun/nio/ch/SocketAdaptor.java +++ b/src/share/classes/sun/nio/ch/SocketAdaptor.java @@ -107,7 +107,7 @@ public class SocketAdaptor throw new ClosedChannelException(); long st = System.currentTimeMillis(); - int result = sc.poll(PollArrayWrapper.POLLCONN, to); + int result = sc.poll(Net.POLLCONN, to); if (result > 0 && sc.finishConnect()) break; to -= System.currentTimeMillis() - st; @@ -201,7 +201,7 @@ public class SocketAdaptor if (!sc.isOpen()) throw new ClosedChannelException(); long st = System.currentTimeMillis(); - int result = sc.poll(PollArrayWrapper.POLLIN, to); + int result = sc.poll(Net.POLLIN, to); if (result > 0) { if ((n = sc.read(bb)) != 0) return n; diff --git a/src/share/classes/sun/nio/ch/SocketChannelImpl.java b/src/share/classes/sun/nio/ch/SocketChannelImpl.java index 8264b1f9b4eb52cc8e7c11c651040e08cee60d5b..a977ced312bc4cef140a7c98a57fa8276a2b90b7 100644 --- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java +++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java @@ -888,15 +888,14 @@ class SocketChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { // This should only happen if this channel is pre-closed while a // selection operation is in progress // ## Throw an error if this channel has not been pre-closed return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); // No need to poll again in checkConnect, @@ -905,19 +904,19 @@ class SocketChannelImpl return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0) && (state == ST_CONNECTED)) newOps |= SelectionKey.OP_READ; - if (((ops & PollArrayWrapper.POLLCONN) != 0) && + if (((ops & Net.POLLCONN) != 0) && ((intOps & SelectionKey.OP_CONNECT) != 0) && ((state == ST_UNCONNECTED) || (state == ST_PENDING))) { newOps |= SelectionKey.OP_CONNECT; readyToConnect = true; } - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0) && (state == ST_CONNECTED)) newOps |= SelectionKey.OP_WRITE; @@ -962,11 +961,11 @@ class SocketChannelImpl public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { int newOps = 0; if ((ops & SelectionKey.OP_READ) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; if ((ops & SelectionKey.OP_WRITE) != 0) - newOps |= PollArrayWrapper.POLLOUT; + newOps |= Net.POLLOUT; if ((ops & SelectionKey.OP_CONNECT) != 0) - newOps |= PollArrayWrapper.POLLCONN; + newOps |= Net.POLLCONN; sk.selector.putEventOps(sk, newOps); } diff --git a/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java b/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java index a00eeb0e20380a31569cb81d6524581f310323d3..1d46e46d0ad1344bd5d8b7ec4cc662a648204203 100644 --- a/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java +++ b/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java @@ -1297,7 +1297,7 @@ public class ExtendedCharsets } String osName = AccessController.doPrivileged( new GetPropertyAction("os.name")); - if ("SunOS".equals(osName) || "Linux".equals(osName) + if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName) || osName.contains("OS X")) { charset("x-COMPOUND_TEXT", "COMPOUND_TEXT", new String[] { diff --git a/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider b/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider index debc75277f3252c6d19fcae0c6f73ce352cbad17..4cb7f1d2c73b2765747ac6712c7ebab619e4d2eb 100644 --- a/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider +++ b/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider @@ -31,3 +31,4 @@ #[windows]sun.tools.attach.WindowsAttachProvider #[linux]sun.tools.attach.LinuxAttachProvider #[macosx]sun.tools.attach.BsdAttachProvider +#[aix]sun.tools.attach.AixAttachProvider diff --git a/src/share/lib/security/java.security-aix b/src/share/lib/security/java.security-aix new file mode 100644 index 0000000000000000000000000000000000000000..d31a1e37005a0fb8f56709a9718d56162504faec --- /dev/null +++ b/src/share/lib/security/java.security-aix @@ -0,0 +1,498 @@ +# +# This is the "master security properties file". +# +# An alternate java.security properties file may be specified +# from the command line via the system property +# +# -Djava.security.properties= +# +# This properties file appends to the master security properties file. +# If both properties files specify values for the same key, the value +# from the command-line properties file is selected, as it is the last +# one loaded. +# +# Also, if you specify +# +# -Djava.security.properties== (2 equals), +# +# then that properties file completely overrides the master security +# properties file. +# +# To disable the ability to specify an additional properties file from +# the command line, set the key security.overridePropertiesFile +# to false in the master security properties file. It is set to true +# by default. + +# In this file, various security properties are set for use by +# java.security classes. This is where users can statically register +# Cryptography Package Providers ("providers" for short). The term +# "provider" refers to a package or set of packages that supply a +# concrete implementation of a subset of the cryptography aspects of +# the Java Security API. A provider may, for example, implement one or +# more digital signature algorithms or message digest algorithms. +# +# Each provider must implement a subclass of the Provider class. +# To register a provider in this master security properties file, +# specify the Provider subclass name and priority in the format +# +# security.provider.= +# +# This declares a provider, and specifies its preference +# order n. The preference order is the order in which providers are +# searched for requested algorithms (when no specific provider is +# requested). The order is 1-based; 1 is the most preferred, followed +# by 2, and so on. +# +# must specify the subclass of the Provider class whose +# constructor sets the values of various properties that are required +# for the Java Security API to look up the algorithms or other +# facilities implemented by the provider. +# +# There must be at least one provider specification in java.security. +# There is a default provider that comes standard with the JDK. It +# is called the "SUN" provider, and its Provider subclass +# named Sun appears in the sun.security.provider package. Thus, the +# "SUN" provider is registered via the following: +# +# security.provider.1=sun.security.provider.Sun +# +# (The number 1 is used for the default provider.) +# +# Note: Providers can be dynamically registered instead by calls to +# either the addProvider or insertProviderAt method in the Security +# class. + +# +# List of providers and their preference orders (see above): +# +security.provider.1=sun.security.provider.Sun +security.provider.2=sun.security.rsa.SunRsaSign +security.provider.3=sun.security.ec.SunEC +security.provider.4=com.sun.net.ssl.internal.ssl.Provider +security.provider.5=com.sun.crypto.provider.SunJCE +security.provider.6=sun.security.jgss.SunProvider +security.provider.7=com.sun.security.sasl.Provider +security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI +security.provider.9=sun.security.smartcardio.SunPCSC + +# +# Sun Provider SecureRandom seed source. +# +# Select the primary source of seed data for the "SHA1PRNG" and +# "NativePRNG" SecureRandom implementations in the "Sun" provider. +# (Other SecureRandom implementations might also use this property.) +# +# On Unix-like systems (for example, Solaris/Linux/MacOS), the +# "NativePRNG" and "SHA1PRNG" implementations obtains seed data from +# special device files such as file:/dev/random. +# +# On Windows systems, specifying the URLs "file:/dev/random" or +# "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding +# mechanism for SHA1PRNG. +# +# By default, an attempt is made to use the entropy gathering device +# specified by the "securerandom.source" Security property. If an +# exception occurs while accessing the specified URL: +# +# SHA1PRNG: +# the traditional system/thread activity algorithm will be used. +# +# NativePRNG: +# a default value of /dev/random will be used. If neither +# are available, the implementation will be disabled. +# "file" is the only currently supported protocol type. +# +# The entropy gathering device can also be specified with the System +# property "java.security.egd". For example: +# +# % java -Djava.security.egd=file:/dev/random MainClass +# +# Specifying this System property will override the +# "securerandom.source" Security property. +# +# In addition, if "file:/dev/random" or "file:/dev/urandom" is +# specified, the "NativePRNG" implementation will be more preferred than +# SHA1PRNG in the Sun provider. +# +securerandom.source=file:/dev/random + +# +# A list of known strong SecureRandom implementations. +# +# To help guide applications in selecting a suitable strong +# java.security.SecureRandom implementation, Java distributions should +# indicate a list of known strong implementations using the property. +# +# This is a comma-separated list of algorithm and/or algorithm:provider +# entries. +# +securerandom.strongAlgorithms=NativePRNGBlocking:SUN + +# +# Class to instantiate as the javax.security.auth.login.Configuration +# provider. +# +login.configuration.provider=sun.security.provider.ConfigFile + +# +# Default login configuration file +# +#login.config.url.1=file:${user.home}/.java.login.config + +# +# Class to instantiate as the system Policy. This is the name of the class +# that will be used as the Policy object. +# +policy.provider=sun.security.provider.PolicyFile + +# The default is to have a single system-wide policy file, +# and a policy file in the user's home directory. +policy.url.1=file:${java.home}/lib/security/java.policy +policy.url.2=file:${user.home}/.java.policy + +# whether or not we expand properties in the policy file +# if this is set to false, properties (${...}) will not be expanded in policy +# files. +policy.expandProperties=true + +# whether or not we allow an extra policy to be passed on the command line +# with -Djava.security.policy=somefile. Comment out this line to disable +# this feature. +policy.allowSystemProperty=true + +# whether or not we look into the IdentityScope for trusted Identities +# when encountering a 1.1 signed JAR file. If the identity is found +# and is trusted, we grant it AllPermission. +policy.ignoreIdentityScope=false + +# +# Default keystore type. +# +keystore.type=jks + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools. + + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, none of the class loaders supplied with the JDK call +# checkPackageDefinition. +# +package.definition=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools. + + +# +# Determines whether this properties file can be appended to +# or overridden on the command line via -Djava.security.properties +# +security.overridePropertiesFile=true + +# +# Determines the default key and trust manager factory algorithms for +# the javax.net.ssl package. +# +ssl.KeyManagerFactory.algorithm=SunX509 +ssl.TrustManagerFactory.algorithm=PKIX + +# +# The Java-level namelookup cache policy for successful lookups: +# +# any negative value: caching forever +# any positive value: the number of seconds to cache an address for +# zero: do not cache +# +# default value is forever (FOREVER). For security reasons, this +# caching is made forever when a security manager is set. When a security +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. +# +# NOTE: setting this to anything other than the default value can have +# serious security implications. Do not set it unless +# you are sure you are not exposed to DNS spoofing attack. +# +#networkaddress.cache.ttl=-1 + +# The Java-level namelookup cache policy for failed lookups: +# +# any negative value: cache forever +# any positive value: the number of seconds to cache negative lookup results +# zero: do not cache +# +# In some Microsoft Windows networking environments that employ +# the WINS name service in addition to DNS, name service lookups +# that fail may take a noticeably long time to return (approx. 5 seconds). +# For this reason the default caching policy is to maintain these +# results for 10 seconds. +# +# +networkaddress.cache.negative.ttl=10 + +# +# Properties to configure OCSP for certificate revocation checking +# + +# Enable OCSP +# +# By default, OCSP is not used for certificate revocation checking. +# This property enables the use of OCSP when set to the value "true". +# +# NOTE: SocketPermission is required to connect to an OCSP responder. +# +# Example, +# ocsp.enable=true + +# +# Location of the OCSP responder +# +# By default, the location of the OCSP responder is determined implicitly +# from the certificate being validated. This property explicitly specifies +# the location of the OCSP responder. The property is used when the +# Authority Information Access extension (defined in RFC 3280) is absent +# from the certificate or when it requires overriding. +# +# Example, +# ocsp.responderURL=http://ocsp.example.net:80 + +# +# Subject name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where +# the subject name alone is not sufficient to uniquely identify the certificate +# then both the "ocsp.responderCertIssuerName" and +# "ocsp.responderCertSerialNumber" properties must be used instead. When this +# property is set then those two properties are ignored. +# +# Example, +# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp" + +# +# Issuer name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this +# property is ignored. +# +# Example, +# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" + +# +# Serial number of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# of hexadecimal digits (colon or space separators may be present) which +# identifies a certificate in the set of certificates supplied during cert path +# validation. When this property is set then the "ocsp.responderCertIssuerName" +# property must also be set. When the "ocsp.responderCertSubjectName" property +# is set then this property is ignored. +# +# Example, +# ocsp.responderCertSerialNumber=2A:FF:00 + +# +# Policy for failed Kerberos KDC lookups: +# +# When a KDC is unavailable (network error, service failure, etc), it is +# put inside a blacklist and accessed less often for future requests. The +# value (case-insensitive) for this policy can be: +# +# tryLast +# KDCs in the blacklist are always tried after those not on the list. +# +# tryLess[:max_retries,timeout] +# KDCs in the blacklist are still tried by their order in the configuration, +# but with smaller max_retries and timeout values. max_retries and timeout +# are optional numerical parameters (default 1 and 5000, which means once +# and 5 seconds). Please notes that if any of the values defined here is +# more than what is defined in krb5.conf, it will be ignored. +# +# Whenever a KDC is detected as available, it is removed from the blacklist. +# The blacklist is reset when krb5.conf is reloaded. You can add +# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is +# reloaded whenever a JAAS authentication is attempted. +# +# Example, +# krb5.kdc.bad.policy = tryLast +# krb5.kdc.bad.policy = tryLess:2,2000 +krb5.kdc.bad.policy = tryLast + +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# +# The syntax of the disabled algorithm string is described as this Java +# BNF-style: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint +# +# KeySizeConstraint: +# keySize Operator DecimalInteger +# +# Operator: +# <= | < | == | != | >= | > +# +# DecimalInteger: +# DecimalDigits +# +# DecimalDigits: +# DecimalDigit {DecimalDigit} +# +# DecimalDigit: one of +# 1 2 3 4 5 6 7 8 9 0 +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# A "Constraint" provides further guidance for the algorithm being specified. +# The "KeySizeConstraint" requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the +# key size specified in number of bits. For example, "RSA keySize <= 1024" +# indicates that any RSA key with key size less than or equal to 1024 bits +# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates +# that any RSA key with key size less than 1024 or greater than 2048 should +# be disabled. Note that the "KeySizeConstraint" only makes sense to key +# algorithms. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 + +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including cipher +# suites selection, peer authentication and key exchange mechanisms. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: This property is currently used by Oracle's JSSE implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 diff --git a/src/share/native/common/check_code.c b/src/share/native/common/check_code.c index 6a114f1f02b10fe47b060420e04381fe441d9d75..92d96b19675c1a852e27b672811876d2b2b0d44f 100644 --- a/src/share/native/common/check_code.c +++ b/src/share/native/common/check_code.c @@ -90,6 +90,41 @@ #include "classfile_constants.h" #include "opcodes.in_out" +/* On AIX malloc(0) and calloc(0, ...) return a NULL pointer, which is legal, + * but the code here does not handles it. So we wrap the methods and return non-NULL + * pointers even if we allocate 0 bytes. + */ +#ifdef _AIX +static int aix_dummy; +static void* aix_malloc(size_t len) { + if (len == 0) { + return &aix_dummy; + } + return malloc(len); +} + +static void* aix_calloc(size_t n, size_t size) { + if (n == 0) { + return &aix_dummy; + } + return calloc(n, size); +} + +static void aix_free(void* p) { + if (p == &aix_dummy) { + return; + } + free(p); +} + +#undef malloc +#undef calloc +#undef free +#define malloc aix_malloc +#define calloc aix_calloc +#define free aix_free +#endif + #ifdef __APPLE__ /* use setjmp/longjmp versions that do not save/restore the signal mask */ #define setjmp _setjmp diff --git a/src/share/native/java/net/net_util.c b/src/share/native/java/net/net_util.c index 3aa63b4b8d5b814a7535f4adc15888a1ee1500f4..f8a0e90b53266e5eda04b1175535ac6118283f8e 100644 --- a/src/share/native/java/net/net_util.c +++ b/src/share/native/java/net/net_util.c @@ -67,7 +67,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved) supporting socket APIs are available */ IPv6_available = IPv6_supported() & (!preferIPv4Stack); - initLocalAddrTable (); + platformInit(); parseExclusiveBindProperty(env); return JNI_VERSION_1_2; diff --git a/src/share/native/java/net/net_util.h b/src/share/native/java/net/net_util.h index 8286a853c8a568c7365397d5d8f742b7f19074bf..d3b90a9102ed79c750ae0ccf66c7ef0cd809af87 100644 --- a/src/share/native/java/net/net_util.h +++ b/src/share/native/java/net/net_util.h @@ -137,7 +137,7 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr JNIEXPORT jobject JNICALL NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port); -void initLocalAddrTable (); +void platformInit(); void parseExclusiveBindProperty(JNIEnv *env); void diff --git a/src/share/native/java/util/zip/zip_util.c b/src/share/native/java/util/zip/zip_util.c index 40cf737295d044c46fd569724ef3cf806bd05f5c..a072e6624c4e707896fb89794654e802baaeac62 100644 --- a/src/share/native/java/util/zip/zip_util.c +++ b/src/share/native/java/util/zip/zip_util.c @@ -659,7 +659,10 @@ readCEN(jzfile *zip, jint knownTotal) entries = zip->entries = calloc(total, sizeof(entries[0])); tablelen = zip->tablelen = ((total/2) | 1); // Odd -> fewer collisions table = zip->table = malloc(tablelen * sizeof(table[0])); - if (entries == NULL || table == NULL) goto Catch; + /* According to ISO C it is perfectly legal for malloc to return zero + * if called with a zero argument. We check this for 'entries' but not + * for 'table' because 'tablelen' can't be zero (see computation above). */ + if ((entries == NULL && total != 0) || table == NULL) goto Catch; for (j = 0; j < tablelen; j++) table[j] = ZIP_ENDCHAIN; diff --git a/src/share/native/sun/awt/medialib/mlib_sys.c b/src/share/native/sun/awt/medialib/mlib_sys.c index cdcb5677220c2f0129c87eef68fedf6bc1e1a90d..2c07527cd0bde2114bc0393cdb627e97c6a72d11 100644 --- a/src/share/native/sun/awt/medialib/mlib_sys.c +++ b/src/share/native/sun/awt/medialib/mlib_sys.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,10 +86,13 @@ __typeof__ ( __mlib_sincosf) mlib_sincosf void *__mlib_malloc(mlib_u32 size) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(AIX) /* * Currently, all MS C compilers for Win32 platforms default to 8 byte * alignment. -- from stdlib.h of MS VC++5.0. + * + * On AIX, the malloc subroutine returns a pointer to space suitably + * aligned for the storage of any type of object (see 'man malloc'). */ return (void *) malloc(size); #elif defined(MACOSX) diff --git a/src/share/native/sun/awt/medialib/mlib_types.h b/src/share/native/sun/awt/medialib/mlib_types.h index 5c53bb531422d81e6d41844ae9a93abfcc4299c3..aba0394ffd419b271abc5e96e772007f54fa125e 100644 --- a/src/share/native/sun/awt/medialib/mlib_types.h +++ b/src/share/native/sun/awt/medialib/mlib_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ typedef unsigned int mlib_u32; typedef float mlib_f32; typedef double mlib_d64; -#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) || defined(_AIX) #include #include diff --git a/src/share/native/sun/management/DiagnosticCommandImpl.c b/src/share/native/sun/management/DiagnosticCommandImpl.c index 0ad49ddc1d2dcd32aadb651085405856db32a44a..59f3f7db9711da6a47ebe8821da27e6c8d97f9aa 100644 --- a/src/share/native/sun/management/DiagnosticCommandImpl.c +++ b/src/share/native/sun/management/DiagnosticCommandImpl.c @@ -57,7 +57,8 @@ jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command, jobject resultList; dcmd_arg_info_array = (dcmdArgInfo*) malloc(num_arg * sizeof(dcmdArgInfo)); - if (dcmd_arg_info_array == NULL) { + /* According to ISO C it is perfectly legal for malloc to return zero if called with a zero argument */ + if (dcmd_arg_info_array == NULL && num_arg != 0) { return NULL; } jmm_interface->GetDiagnosticCommandArgumentsInfo(env, command, @@ -118,21 +119,24 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo return NULL; } num_commands = (*env)->GetArrayLength(env, commands); - dcmd_info_array = (dcmdInfo*) malloc(num_commands * - sizeof(dcmdInfo)); - if (dcmd_info_array == NULL) { - JNU_ThrowOutOfMemoryError(env, NULL); - return NULL; - } - jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array); dcmdInfoCls = (*env)->FindClass(env, "sun/management/DiagnosticCommandInfo"); result = (*env)->NewObjectArray(env, num_commands, dcmdInfoCls, NULL); if (result == NULL) { - free(dcmd_info_array); JNU_ThrowOutOfMemoryError(env, 0); return NULL; } + if (num_commands == 0) { + /* Handle the 'zero commands' case specially to avoid calling 'malloc()' */ + /* with a zero argument because that may legally return a NULL pointer. */ + return result; + } + dcmd_info_array = (dcmdInfo*) malloc(num_commands * sizeof(dcmdInfo)); + if (dcmd_info_array == NULL) { + JNU_ThrowOutOfMemoryError(env, NULL); + return NULL; + } + jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array); for (i=0; iGetObjectArrayElement(env,commands,i), diff --git a/src/share/native/sun/security/ec/impl/ecc_impl.h b/src/share/native/sun/security/ec/impl/ecc_impl.h index 8a8acfc688ee51350d4c0fa5a394cf66db6073d6..40d2e3355143244a5415449bb22311d7b83e2d05 100644 --- a/src/share/native/sun/security/ec/impl/ecc_impl.h +++ b/src/share/native/sun/security/ec/impl/ecc_impl.h @@ -65,6 +65,13 @@ typedef unsigned long ulong_t; typedef enum boolean { B_FALSE, B_TRUE } boolean_t; #endif /* _ALLBSD_SOURCE */ +#ifdef AIX +#define B_FALSE FALSE +#define B_TRUE TRUE +typedef unsigned char uint8_t; +typedef unsigned long ulong_t; +#endif /* AIX */ + #ifdef _WIN32 typedef unsigned char uint8_t; typedef unsigned long ulong_t; diff --git a/src/share/transport/socket/socketTransport.c b/src/share/transport/socket/socketTransport.c index 3b1b71763b7874343cb183d616dca75a9b9b75de..c76fd1085d51a95469e0bb9d0947e28e690b716d 100644 --- a/src/share/transport/socket/socketTransport.c +++ b/src/share/transport/socket/socketTransport.c @@ -506,6 +506,19 @@ socketTransport_close(jdwpTransportEnv* env) if (fd < 0) { return JDWPTRANSPORT_ERROR_NONE; } +#ifdef _AIX + /* + AIX needs a workaround for I/O cancellation, see: + http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/close.htm + ... + The close subroutine is blocked until all subroutines which use the file + descriptor return to usr space. For example, when a thread is calling close + and another thread is calling select with the same file descriptor, the + close subroutine does not return until the select call returns. + ... + */ + shutdown(fd, 2); +#endif if (dbgsysSocketClose(fd) < 0) { /* * close failed - it's pointless to restore socketFD here because diff --git a/src/solaris/back/exec_md.c b/src/solaris/back/exec_md.c index eebfae1f7e79c9517531665fe108bed1a62954c4..b756be3297a9104b8b2dedd3f2bba52d238e6fc4 100644 --- a/src/solaris/back/exec_md.c +++ b/src/solaris/back/exec_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ #include "sys.h" #include "util.h" -#if defined(LINUX) || defined(_ALLBSD_SOURCE) - /* Linux */ +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) + /* Linux, BSD, AIX */ #define FORK() fork() #else /* Solaris (make sure we always get the POSIX-specified behavior) */ diff --git a/src/solaris/bin/java_md_solinux.c b/src/solaris/bin/java_md_solinux.c index 52f9cfe468a590aebfa938a70205bc7f05b6e77f..d2337d7120f5cbe86ba363faa639dbb16a0ba929 100644 --- a/src/solaris/bin/java_md_solinux.c +++ b/src/solaris/bin/java_md_solinux.c @@ -41,7 +41,11 @@ #define JVM_DLL "libjvm.so" #define JAVA_DLL "libjava.so" +#ifdef AIX +#define LD_LIBRARY_PATH "LIBPATH" +#else #define LD_LIBRARY_PATH "LD_LIBRARY_PATH" +#endif /* help jettison the LD_LIBRARY_PATH settings in the future */ #ifndef SETENV_REQUIRED @@ -287,6 +291,11 @@ RequiresSetenv(int wanted, const char *jvmpath) { char *dmllp = NULL; char *p; /* a utility pointer */ +#ifdef AIX + /* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */ + return JNI_TRUE; +#endif + llp = getenv("LD_LIBRARY_PATH"); #ifdef __solaris__ dmllp = (CURRENT_DATA_MODEL == 32) @@ -598,7 +607,7 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, * If not on Solaris, assume only a single LD_LIBRARY_PATH * variable. */ - runpath = getenv("LD_LIBRARY_PATH"); + runpath = getenv(LD_LIBRARY_PATH); #endif /* __solaris__ */ /* runpath contains current effective LD_LIBRARY_PATH setting */ @@ -606,8 +615,12 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, jvmpath = JLI_StringDup(jvmpath); new_runpath = JLI_MemAlloc(((runpath != NULL) ? JLI_StrLen(runpath) : 0) + 2 * JLI_StrLen(jrepath) + 2 * JLI_StrLen(arch) + +#ifdef AIX + /* On AIX we additionally need 'jli' in the path because ld doesn't support $ORIGIN. */ + JLI_StrLen(jrepath) + JLI_StrLen(arch) + JLI_StrLen("/lib//jli:") + +#endif JLI_StrLen(jvmpath) + 52); - newpath = new_runpath + JLI_StrLen("LD_LIBRARY_PATH="); + newpath = new_runpath + JLI_StrLen(LD_LIBRARY_PATH "="); /* @@ -619,9 +632,12 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, if (lastslash) *lastslash = '\0'; - sprintf(new_runpath, "LD_LIBRARY_PATH=" + sprintf(new_runpath, LD_LIBRARY_PATH "=" "%s:" "%s/lib/%s:" +#ifdef AIX + "%s/lib/%s/jli:" /* Needed on AIX because ld doesn't support $ORIGIN. */ +#endif "%s/../lib/%s", jvmpath, #ifdef DUAL_MODE @@ -629,6 +645,9 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, jrepath, GetArchPath(wanted) #else /* !DUAL_MODE */ jrepath, arch, +#ifdef AIX + jrepath, arch, +#endif jrepath, arch #endif /* DUAL_MODE */ ); @@ -1000,7 +1019,7 @@ void SplashFreeLibrary() { int ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { int rslt; -#ifdef __linux__ +#ifndef __solaris__ pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); @@ -1025,7 +1044,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void } pthread_attr_destroy(&attr); -#else /* ! __linux__ */ +#else /* __solaris__ */ thread_t tid; long flags = 0; if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { @@ -1036,7 +1055,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void /* See above. Continue in current thread if thr_create() failed */ rslt = continuation(args); } -#endif /* __linux__ */ +#endif /* !__solaris__ */ return rslt; } diff --git a/src/solaris/bin/java_md_solinux.h b/src/solaris/bin/java_md_solinux.h index a9e4438a5e259c0d4c4f18c3f6aca921ca07f2f4..3f1dc115b4d2fb0c856fcbcb5d2f62ccbb8348b6 100644 --- a/src/solaris/bin/java_md_solinux.h +++ b/src/solaris/bin/java_md_solinux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,23 +45,19 @@ extern char **environ; * A collection of useful strings. One should think of these as #define * entries, but actual strings can be more efficient (with many compilers). */ -#ifdef __linux__ -static const char *system_dir = "/usr/java"; -static const char *user_dir = "/java"; -#else /* Solaris */ +#ifdef __solaris__ static const char *system_dir = "/usr/jdk"; static const char *user_dir = "/jdk"; +#else /* !__solaris__, i.e. Linux, AIX,.. */ +static const char *system_dir = "/usr/java"; +static const char *user_dir = "/java"; #endif #include -#ifdef __linux__ -#include -#else +#ifdef __solaris__ #include +#else +#include #endif -#define JVM_DLL "libjvm.so" -#define JAVA_DLL "libjava.so" -#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" - #endif /* JAVA_MD_SOLINUX_H */ diff --git a/src/solaris/bin/ppc64/jvm.cfg b/src/solaris/bin/ppc64/jvm.cfg new file mode 100644 index 0000000000000000000000000000000000000000..2fc1214175ba1ea3c5e339f11d22a10e51983d83 --- /dev/null +++ b/src/solaris/bin/ppc64/jvm.cfg @@ -0,0 +1,33 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=" option, but that too is unsupported +# and may not be available in a future release. +# +-server KNOWN diff --git a/src/solaris/classes/java/lang/UNIXProcess.java.aix b/src/solaris/classes/java/lang/UNIXProcess.java.aix new file mode 100644 index 0000000000000000000000000000000000000000..2421646165762ee3239fa0e58036ec6799564ae2 --- /dev/null +++ b/src/solaris/classes/java/lang/UNIXProcess.java.aix @@ -0,0 +1,504 @@ +/* + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.concurrent.Executors; +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.security.AccessController; +import static java.security.AccessController.doPrivileged; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * java.lang.Process subclass in the UNIX environment. + * + * @author Mario Wolczko and Ross Knippel. + * @author Konstantin Kladko (ported to Linux) + * @author Martin Buchholz + * @author Volker Simonis (ported to AIX) + */ +final class UNIXProcess extends Process { + private static final sun.misc.JavaIOFileDescriptorAccess fdAccess + = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess(); + + private final int pid; + private int exitcode; + private boolean hasExited; + + private /* final */ OutputStream stdin; + private /* final */ InputStream stdout; + private /* final */ InputStream stderr; + + private static enum LaunchMechanism { + FORK(1), + POSIX_SPAWN(2); + + private int value; + LaunchMechanism(int x) {value = x;} + }; + + /* On AIX, the default is to spawn */ + private static final LaunchMechanism launchMechanism; + private static byte[] helperpath; + + private static byte[] toCString(String s) { + if (s == null) + return null; + byte[] bytes = s.getBytes(); + byte[] result = new byte[bytes.length + 1]; + System.arraycopy(bytes, 0, + result, 0, + bytes.length); + result[result.length-1] = (byte)0; + return result; + } + + static { + launchMechanism = AccessController.doPrivileged( + new PrivilegedAction() + { + public LaunchMechanism run() { + String javahome = System.getProperty("java.home"); + String osArch = System.getProperty("os.arch"); + + helperpath = toCString(javahome + "/lib/" + osArch + "/jspawnhelper"); + String s = System.getProperty( + "jdk.lang.Process.launchMechanism", "posix_spawn"); + + try { + return LaunchMechanism.valueOf(s.toUpperCase()); + } catch (IllegalArgumentException e) { + throw new Error(s + " is not a supported " + + "process launch mechanism on this platform."); + } + } + }); + } + + /* this is for the reaping thread */ + private native int waitForProcessExit(int pid); + + /** + * Create a process. Depending on the mode flag, this is done by + * one of the following mechanisms. + * - fork(2) and exec(2) + * - clone(2) and exec(2) + * - vfork(2) and exec(2) + * + * @param fds an array of three file descriptors. + * Indexes 0, 1, and 2 correspond to standard input, + * standard output and standard error, respectively. On + * input, a value of -1 means to create a pipe to connect + * child and parent processes. On output, a value which + * is not -1 is the parent pipe fd corresponding to the + * pipe which has been created. An element of this array + * is -1 on input if and only if it is not -1 on + * output. + * @return the pid of the subprocess + */ + private native int forkAndExec(int mode, byte[] helperpath, + byte[] prog, + byte[] argBlock, int argc, + byte[] envBlock, int envc, + byte[] dir, + int[] fds, + boolean redirectErrorStream) + throws IOException; + + /** + * The thread factory used to create "process reaper" daemon threads. + */ + private static class ProcessReaperThreadFactory implements ThreadFactory { + private final static ThreadGroup group = getRootThreadGroup(); + + private static ThreadGroup getRootThreadGroup() { + return doPrivileged(new PrivilegedAction () { + public ThreadGroup run() { + ThreadGroup root = Thread.currentThread().getThreadGroup(); + while (root.getParent() != null) + root = root.getParent(); + return root; + }}); + } + + public Thread newThread(Runnable grimReaper) { + // Our thread stack requirement is quite modest. + Thread t = new Thread(group, grimReaper, "process reaper", 32768); + t.setDaemon(true); + // A small attempt (probably futile) to avoid priority inversion + t.setPriority(Thread.MAX_PRIORITY); + return t; + } + } + + /** + * The thread pool of "process reaper" daemon threads. + */ + private static final Executor processReaperExecutor = + doPrivileged(new PrivilegedAction() { + public Executor run() { + return Executors.newCachedThreadPool + (new ProcessReaperThreadFactory()); + }}); + + UNIXProcess(final byte[] prog, + final byte[] argBlock, final int argc, + final byte[] envBlock, final int envc, + final byte[] dir, + final int[] fds, + final boolean redirectErrorStream) + throws IOException { + + pid = forkAndExec(launchMechanism.value, + helperpath, + prog, + argBlock, argc, + envBlock, envc, + dir, + fds, + redirectErrorStream); + + try { + doPrivileged(new PrivilegedExceptionAction() { + public Void run() throws IOException { + initStreams(fds); + return null; + }}); + } catch (PrivilegedActionException ex) { + throw (IOException) ex.getException(); + } + } + + static FileDescriptor newFileDescriptor(int fd) { + FileDescriptor fileDescriptor = new FileDescriptor(); + fdAccess.set(fileDescriptor, fd); + return fileDescriptor; + } + + void initStreams(int[] fds) throws IOException { + stdin = (fds[0] == -1) ? + ProcessBuilder.NullOutputStream.INSTANCE : + new ProcessPipeOutputStream(fds[0]); + + stdout = (fds[1] == -1) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ProcessPipeInputStream(fds[1]); + + stderr = (fds[2] == -1) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ProcessPipeInputStream(fds[2]); + + processReaperExecutor.execute(new Runnable() { + public void run() { + int exitcode = waitForProcessExit(pid); + UNIXProcess.this.processExited(exitcode); + }}); + } + + void processExited(int exitcode) { + synchronized (this) { + this.exitcode = exitcode; + hasExited = true; + notifyAll(); + } + + if (stdout instanceof ProcessPipeInputStream) + ((ProcessPipeInputStream) stdout).processExited(); + + if (stderr instanceof ProcessPipeInputStream) + ((ProcessPipeInputStream) stderr).processExited(); + + if (stdin instanceof ProcessPipeOutputStream) + ((ProcessPipeOutputStream) stdin).processExited(); + } + + public OutputStream getOutputStream() { + return stdin; + } + + public InputStream getInputStream() { + return stdout; + } + + public InputStream getErrorStream() { + return stderr; + } + + public synchronized int waitFor() throws InterruptedException { + while (!hasExited) { + wait(); + } + return exitcode; + } + + @Override + public synchronized boolean waitFor(long timeout, TimeUnit unit) + throws InterruptedException + { + if (hasExited) return true; + if (timeout <= 0) return false; + + long timeoutAsNanos = unit.toNanos(timeout); + long startTime = System.nanoTime(); + long rem = timeoutAsNanos; + + while (!hasExited && (rem > 0)) { + wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1)); + rem = timeoutAsNanos - (System.nanoTime() - startTime); + } + return hasExited; + } + + public synchronized int exitValue() { + if (!hasExited) { + throw new IllegalThreadStateException("process hasn't exited"); + } + return exitcode; + } + + private static native void destroyProcess(int pid, boolean force); + private void destroy(boolean force) { + // There is a risk that pid will be recycled, causing us to + // kill the wrong process! So we only terminate processes + // that appear to still be running. Even with this check, + // there is an unavoidable race condition here, but the window + // is very small, and OSes try hard to not recycle pids too + // soon, so this is quite safe. + synchronized (this) { + if (!hasExited) + destroyProcess(pid, force); + } + try { stdin.close(); } catch (IOException ignored) {} + try { stdout.close(); } catch (IOException ignored) {} + try { stderr.close(); } catch (IOException ignored) {} + } + + public void destroy() { + destroy(false); + } + + @Override + public Process destroyForcibly() { + destroy(true); + return this; + } + + @Override + public synchronized boolean isAlive() { + return !hasExited; + } + + private static native void init(); + + static { + init(); + } + + /** + * A buffered input stream for a subprocess pipe file descriptor + * that allows the underlying file descriptor to be reclaimed when + * the process exits, via the processExited hook. + * + * This is tricky because we do not want the user-level InputStream to be + * closed until the user invokes close(), and we need to continue to be + * able to read any buffered data lingering in the OS pipe buffer. + * + * On AIX this is especially tricky, because the 'close()' system call + * will block if another thread is at the same time blocked in a file + * operation (e.g. 'read()') on the same file descriptor. We therefore + * combine this 'ProcessPipeInputStream' with the DeferredCloseInputStream + * approach used on Solaris (see "UNIXProcess.java.solaris"). This means + * that every potentially blocking operation on the file descriptor + * increments a counter before it is executed and decrements it once it + * finishes. The 'close()' operation will only be executed if there are + * no pending operations. Otherwise it is deferred after the last pending + * operation has finished. + * + */ + static class ProcessPipeInputStream extends BufferedInputStream { + private final Object closeLock = new Object(); + private int useCount = 0; + private boolean closePending = false; + + ProcessPipeInputStream(int fd) { + super(new FileInputStream(newFileDescriptor(fd))); + } + + private InputStream drainInputStream(InputStream in) + throws IOException { + int n = 0; + int j; + byte[] a = null; + synchronized (closeLock) { + if (buf == null) // asynchronous close()? + return null; // discard + j = in.available(); + } + while (j > 0) { + a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j); + synchronized (closeLock) { + if (buf == null) // asynchronous close()? + return null; // discard + n += in.read(a, n, j); + j = in.available(); + } + } + return (a == null) ? + ProcessBuilder.NullInputStream.INSTANCE : + new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n)); + } + + /** Called by the process reaper thread when the process exits. */ + synchronized void processExited() { + try { + InputStream in = this.in; + if (in != null) { + InputStream stragglers = drainInputStream(in); + in.close(); + this.in = stragglers; + } + } catch (IOException ignored) { } + } + + private void raise() { + synchronized (closeLock) { + useCount++; + } + } + + private void lower() throws IOException { + synchronized (closeLock) { + useCount--; + if (useCount == 0 && closePending) { + closePending = false; + super.close(); + } + } + } + + @Override + public int read() throws IOException { + raise(); + try { + return super.read(); + } finally { + lower(); + } + } + + @Override + public int read(byte[] b) throws IOException { + raise(); + try { + return super.read(b); + } finally { + lower(); + } + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + raise(); + try { + return super.read(b, off, len); + } finally { + lower(); + } + } + + @Override + public long skip(long n) throws IOException { + raise(); + try { + return super.skip(n); + } finally { + lower(); + } + } + + @Override + public int available() throws IOException { + raise(); + try { + return super.available(); + } finally { + lower(); + } + } + + @Override + public void close() throws IOException { + // BufferedInputStream#close() is not synchronized unlike most other methods. + // Synchronizing helps avoid racing with drainInputStream(). + synchronized (closeLock) { + if (useCount == 0) { + super.close(); + } + else { + closePending = true; + } + } + } + } + + /** + * A buffered output stream for a subprocess pipe file descriptor + * that allows the underlying file descriptor to be reclaimed when + * the process exits, via the processExited hook. + */ + static class ProcessPipeOutputStream extends BufferedOutputStream { + ProcessPipeOutputStream(int fd) { + super(new FileOutputStream(newFileDescriptor(fd))); + } + + /** Called by the process reaper thread when the process exits. */ + synchronized void processExited() { + OutputStream out = this.out; + if (out != null) { + try { + out.close(); + } catch (IOException ignored) { + // We know of no reason to get an IOException, but if + // we do, there's nothing else to do but carry on. + } + this.out = ProcessBuilder.NullOutputStream.INSTANCE; + } + } + } +} diff --git a/src/solaris/classes/sun/net/PortConfig.java b/src/solaris/classes/sun/net/PortConfig.java index 0f4ca744257220594b560fd62c8be06bc086b024..1825b0b59a035f6cce49fe372faf39732e904fb9 100644 --- a/src/solaris/classes/sun/net/PortConfig.java +++ b/src/solaris/classes/sun/net/PortConfig.java @@ -55,6 +55,14 @@ public final class PortConfig { } else if (os.contains("OS X")) { defaultLower = 49152; defaultUpper = 65535; + } else if (os.startsWith("AIX")) { + // The ephemeral port is OS version dependent on AIX: + // http://publib.boulder.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.rsct315.admin/bl503_ephport.htm + // However, on AIX 5.3 / 6.1 / 7.1 we always see the + // settings below by using: + // /usr/sbin/no -a | fgrep ephemeral + defaultLower = 32768; + defaultUpper = 65535; } else { throw new InternalError( "sun.net.PortConfig: unknown OS"); diff --git a/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java index 667c51ab59f0783597a11fd53154d187793ce071..7a0ce39229982a4871535660bd607a8f1c359ccb 100644 --- a/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java +++ b/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -68,6 +68,8 @@ public class DefaultAsynchronousChannelProvider { return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider"); if (osname.contains("OS X")) return createProvider("sun.nio.ch.BsdAsynchronousChannelProvider"); + if (osname.equals("AIX")) + return createProvider("sun.nio.ch.AixAsynchronousChannelProvider"); throw new InternalError("platform not recognized"); } } diff --git a/src/solaris/classes/sun/nio/ch/EPollPort.java b/src/solaris/classes/sun/nio/ch/EPollPort.java index a345f1c39d31acb6a0b915248afa82be734027f1..651457e98df2ed7ea27efd86edc7967b62ffa203 100644 --- a/src/solaris/classes/sun/nio/ch/EPollPort.java +++ b/src/solaris/classes/sun/nio/ch/EPollPort.java @@ -93,7 +93,7 @@ final class EPollPort try { socketpair(sv); // register one end with epoll - epollCtl(epfd, EPOLL_CTL_ADD, sv[0], POLLIN); + epollCtl(epfd, EPOLL_CTL_ADD, sv[0], Net.POLLIN); } catch (IOException x) { close0(epfd); throw x; diff --git a/src/solaris/classes/sun/nio/ch/KQueuePort.java b/src/solaris/classes/sun/nio/ch/KQueuePort.java index f9cb5b8240dc0d9492057b5d6f5f8ab8671588ac..e9177e144e0eebcfc7d5ca42bab10d6b8d1d2641 100644 --- a/src/solaris/classes/sun/nio/ch/KQueuePort.java +++ b/src/solaris/classes/sun/nio/ch/KQueuePort.java @@ -172,9 +172,9 @@ final class KQueuePort // TBD: Measure cost of EV_ONESHOT vs. EV_CLEAR, either will do here. int err = 0; int flags = (EV_ADD|EV_ONESHOT); - if ((events & Port.POLLIN) > 0) + if ((events & Net.POLLIN) > 0) err = keventRegister(kqfd, fd, EVFILT_READ, flags); - if (err == 0 && (events & Port.POLLOUT) > 0) + if (err == 0 && (events & Net.POLLOUT) > 0) err = keventRegister(kqfd, fd, EVFILT_WRITE, flags); if (err != 0) throw new InternalError("kevent failed: " + err); // should not happen @@ -227,9 +227,9 @@ final class KQueuePort int filter = getFilter(keventAddress); int events = 0; if (filter == EVFILT_READ) - events = Port.POLLIN; + events = Net.POLLIN; else if (filter == EVFILT_WRITE) - events = Port.POLLOUT; + events = Net.POLLOUT; Event ev = new Event(channel, events); diff --git a/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java b/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java index 11b73f10f9b9d3bf035124e2667a0c10438c2a5e..80eb14dc4f548ac943b887e37b8afcf01df08dd0 100644 --- a/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java +++ b/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java @@ -43,8 +43,6 @@ import sun.misc.*; public class PollArrayWrapper extends AbstractPollArrayWrapper { - public static final short POLLCONN = POLLOUT; - // File descriptor to write for interrupt int interruptFD; @@ -58,7 +56,7 @@ public class PollArrayWrapper extends AbstractPollArrayWrapper { void initInterrupt(int fd0, int fd1) { interruptFD = fd1; putDescriptor(0, fd0); - putEventOps(0, POLLIN); + putEventOps(0, Net.POLLIN); putReventOps(0, 0); } diff --git a/src/solaris/classes/sun/nio/ch/Port.java b/src/solaris/classes/sun/nio/ch/Port.java index 94025089933fe7afd26b851de5add961271b979a..81e1ed876152e0c4265173c35070f76d2844af60 100644 --- a/src/solaris/classes/sun/nio/ch/Port.java +++ b/src/solaris/classes/sun/nio/ch/Port.java @@ -40,10 +40,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; */ abstract class Port extends AsynchronousChannelGroupImpl { - static final short POLLIN = 0x0001; - static final short POLLOUT = 0x0004; - static final short POLLERR = 0x0008; - static final short POLLHUP = 0x0010; /** * Implemented by clients registered with this port. @@ -76,12 +72,22 @@ abstract class Port extends AsynchronousChannelGroupImpl { } } + /** + * Callback method for implementations that need special handling when fd is + * removed (currently only needed in the AIX-Port - see AixPollPort.java). + */ + protected void preUnregister(int fd) { + // Do nothing by default. + } + /** * Unregister channel identified by its file descriptor */ final void unregister(int fd) { boolean checkForShutdown = false; + preUnregister(fd); + fdToChannelLock.writeLock().lock(); try { fdToChannel.remove(Integer.valueOf(fd)); diff --git a/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java b/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java index 7de6b8ad8e3b6dc7bb4c5ce55fc162adb3d575fd..8e437684f33bd6ac05729269fcd6d54079e160e6 100644 --- a/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java @@ -118,17 +118,16 @@ class SinkChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) + if ((ops & Net.POLLNVAL) != 0) throw new Error("POLLNVAL detected"); - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0)) newOps |= SelectionKey.OP_WRITE; @@ -146,7 +145,7 @@ class SinkChannelImpl public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { if (ops == SelectionKey.OP_WRITE) - ops = PollArrayWrapper.POLLOUT; + ops = Net.POLLOUT; sk.selector.putEventOps(sk, ops); } diff --git a/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java b/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java index 2eef64cee51effea016e523c74f563cf4e8cdb4e..b1b4f9e36f0d2b76e4d260013229bea04356118c 100644 --- a/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java @@ -118,17 +118,16 @@ class SourceChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) + if ((ops & Net.POLLNVAL) != 0) throw new Error("POLLNVAL detected"); - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0)) newOps |= SelectionKey.OP_READ; @@ -146,7 +145,7 @@ class SourceChannelImpl public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { if (ops == SelectionKey.OP_READ) - ops = PollArrayWrapper.POLLIN; + ops = Net.POLLIN; sk.selector.putEventOps(sk, ops); } diff --git a/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java b/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java index c26c18225b57509f354b7fa861b180e37f141e0e..871f19448facebb23fab7966316a6cbc0e39f9bb 100644 --- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java @@ -148,7 +148,7 @@ class UnixAsynchronousServerSocketChannelImpl synchronized (updateLock) { acceptPending = true; } - port.startPoll(fdVal, Port.POLLIN); + port.startPoll(fdVal, Net.POLLIN); return; } @@ -299,7 +299,7 @@ class UnixAsynchronousServerSocketChannelImpl } // register for connections - port.startPoll(fdVal, Port.POLLIN); + port.startPoll(fdVal, Net.POLLIN); return result; } } catch (Throwable x) { diff --git a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java index cb0de4c83548aba285d8eab0c70f64c6e2b289ae..428f05cf6ea468e093c9cc3065a06366c2f98330 100644 --- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java @@ -142,9 +142,9 @@ class UnixAsynchronousSocketChannelImpl assert Thread.holdsLock(updateLock); int events = 0; if (readPending) - events |= Port.POLLIN; + events |= Net.POLLIN; if (connectPending || writePending) - events |= Port.POLLOUT; + events |= Net.POLLOUT; if (events != 0) port.startPoll(fdVal, events); } @@ -204,9 +204,9 @@ class UnixAsynchronousSocketChannelImpl */ @Override public void onEvent(int events, boolean mayInvokeDirect) { - boolean readable = (events & Port.POLLIN) > 0; - boolean writable = (events & Port.POLLOUT) > 0; - if ((events & (Port.POLLERR | Port.POLLHUP)) > 0) { + boolean readable = (events & Net.POLLIN) > 0; + boolean writable = (events & Net.POLLOUT) > 0; + if ((events & (Net.POLLERR | Net.POLLHUP)) > 0) { readable = true; writable = true; } diff --git a/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java index 448654d9e0c906bb36dc409d7ea985e2d74b3785..246d9dea3ba612277e01b68b038a8d2bc43cb1a5 100644 --- a/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -593,15 +593,14 @@ public class SctpChannelImpl extends SctpChannel int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { /* This should only happen if this channel is pre-closed while a * selection operation is in progress * ## Throw an error if this channel has not been pre-closed */ return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); /* No need to poll again in checkConnect, @@ -610,19 +609,19 @@ public class SctpChannelImpl extends SctpChannel return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0) && isConnected()) newOps |= SelectionKey.OP_READ; - if (((ops & PollArrayWrapper.POLLCONN) != 0) && + if (((ops & Net.POLLCONN) != 0) && ((intOps & SelectionKey.OP_CONNECT) != 0) && ((state == ChannelState.UNCONNECTED) || (state == ChannelState.PENDING))) { newOps |= SelectionKey.OP_CONNECT; readyToConnect = true; } - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0) && isConnected()) newOps |= SelectionKey.OP_WRITE; @@ -646,11 +645,11 @@ public class SctpChannelImpl extends SctpChannel public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { int newOps = 0; if ((ops & SelectionKey.OP_READ) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; if ((ops & SelectionKey.OP_WRITE) != 0) - newOps |= PollArrayWrapper.POLLOUT; + newOps |= Net.POLLOUT; if ((ops & SelectionKey.OP_CONNECT) != 0) - newOps |= PollArrayWrapper.POLLCONN; + newOps |= Net.POLLCONN; sk.selector.putEventOps(sk, newOps); } diff --git a/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index c377c1e59511cf55d85039d41259b8018e1d8789..db08f342aa17f9d710545783e4300245e63004be 100644 --- a/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -321,25 +321,24 @@ public class SctpMultiChannelImpl extends SctpMultiChannel int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { /* This should only happen if this channel is pre-closed while a * selection operation is in progress * ## Throw an error if this channel has not been pre-closed */ return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0)) newOps |= SelectionKey.OP_READ; - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0)) newOps |= SelectionKey.OP_WRITE; @@ -361,9 +360,9 @@ public class SctpMultiChannelImpl extends SctpMultiChannel public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { int newOps = 0; if ((ops & SelectionKey.OP_READ) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; if ((ops & SelectionKey.OP_WRITE) != 0) - newOps |= PollArrayWrapper.POLLOUT; + newOps |= Net.POLLOUT; sk.selector.putEventOps(sk, newOps); } diff --git a/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java b/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java index 5b4b9072f5c29eb7f6ae52bcdb9003164fb20b27..ee9d7f85ea1d8182afd996c0b5d470f8f0c618b1 100644 --- a/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java +++ b/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -314,21 +314,20 @@ public class SctpServerChannelImpl extends SctpServerChannel int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) { + if ((ops & Net.POLLNVAL) != 0) { /* This should only happen if this channel is pre-closed while a * selection operation is in progress * ## Throw an error if this channel has not been pre-closed */ return false; } - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_ACCEPT) != 0)) newOps |= SelectionKey.OP_ACCEPT; @@ -352,7 +351,7 @@ public class SctpServerChannelImpl extends SctpServerChannel /* Translate ops */ if ((ops & SelectionKey.OP_ACCEPT) != 0) - newOps |= PollArrayWrapper.POLLIN; + newOps |= Net.POLLIN; /* Place ops into pollfd array */ sk.selector.putEventOps(sk, newOps); diff --git a/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java b/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java index d909916450e8354a1840ff98e4de9cc92c766421..595f3c6d18766590cafcda0c0449a02b26d5c589 100644 --- a/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java +++ b/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java @@ -63,6 +63,8 @@ public class DefaultFileSystemProvider { return createProvider("sun.nio.fs.LinuxFileSystemProvider"); if (osname.contains("OS X")) return createProvider("sun.nio.fs.MacOSXFileSystemProvider"); + if (osname.equals("AIX")) + return createProvider("sun.nio.fs.AixFileSystemProvider"); throw new AssertionError("Platform not recognized"); } } diff --git a/src/solaris/classes/sun/print/UnixPrintService.java b/src/solaris/classes/sun/print/UnixPrintService.java index 30b8dd030827fc48d81b76d1b7231274d3ccf0bf..bb9a6dfce58f92b16c093be50e86281d5456c12f 100644 --- a/src/solaris/classes/sun/print/UnixPrintService.java +++ b/src/solaris/classes/sun/print/UnixPrintService.java @@ -28,6 +28,7 @@ package sun.print; import java.io.File; import java.net.URI; import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.Locale; import javax.print.DocFlavor; @@ -273,11 +274,58 @@ public class UnixPrintService implements PrintService, AttributeUpdater, return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ; } + // Filter the list of possible AIX Printers and remove header lines + // and extra lines which have been added for remote printers. + // 'protected' because this method is also used from UnixPrintServiceLookup. + protected static String[] filterPrinterNamesAIX(String[] posPrinters) { + ArrayList printers = new ArrayList(); + String [] splitPart; + + for(int i = 0; i < posPrinters.length; i++) { + // Remove the header lines + if (posPrinters[i].startsWith("---") || + posPrinters[i].startsWith("Queue") || + posPrinters[i].equals("")) continue; + + // Check if there is a ":" in the end of the first colomn. + // This means that it is not a valid printer definition. + splitPart = posPrinters[i].split(" "); + if(splitPart.length >= 1 && !splitPart[0].trim().endsWith(":")) { + printers.add(posPrinters[i]); + } + } + + return (String[])printers.toArray(new String[printers.size()]); + } + + private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() { + // On AIX there should not be a blank after '-a'. + String command = "/usr/bin/lpstat -a" + printer; + String results[]= UnixPrintServiceLookup.execCmd(command); + + // Remove headers and bogus entries added by remote printers. + results = filterPrinterNamesAIX(results); + + if (results != null && results.length > 0) { + for (int i = 0; i < results.length; i++) { + if (results[i].contains("READY") || + results[i].contains("RUNNING")) { + return PrinterIsAcceptingJobs.ACCEPTING_JOBS; + } + } + } + + return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS; + + } + private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() { if (UnixPrintServiceLookup.isSysV()) { return getPrinterIsAcceptingJobsSysV(); } else if (UnixPrintServiceLookup.isBSD()) { return getPrinterIsAcceptingJobsBSD(); + } else if (UnixPrintServiceLookup.isAIX()) { + return getPrinterIsAcceptingJobsAIX(); } else { return PrinterIsAcceptingJobs.ACCEPTING_JOBS; } @@ -345,11 +393,32 @@ public class UnixPrintService implements PrintService, AttributeUpdater, return new QueuedJobCount(qlen); } + private QueuedJobCount getQueuedJobCountAIX() { + // On AIX there should not be a blank after '-a'. + String command = "/usr/bin/lpstat -a" + printer; + String results[]= UnixPrintServiceLookup.execCmd(command); + + // Remove headers and bogus entries added by remote printers. + results = filterPrinterNamesAIX(results); + + int qlen = 0; + if (results != null && results.length > 0){ + for (int i = 0; i < results.length; i++) { + if (results[i].contains("QUEUED")){ + qlen ++; + } + } + } + return new QueuedJobCount(qlen); + } + private QueuedJobCount getQueuedJobCount() { if (UnixPrintServiceLookup.isSysV()) { return getQueuedJobCountSysV(); } else if (UnixPrintServiceLookup.isBSD()) { return getQueuedJobCountBSD(); + } else if (UnixPrintServiceLookup.isAIX()) { + return getQueuedJobCountAIX(); } else { return new QueuedJobCount(0); } @@ -369,6 +438,13 @@ public class UnixPrintService implements PrintService, AttributeUpdater, return attrs; } + private PrintServiceAttributeSet getAIXServiceAttributes() { + PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet(); + attrs.add(getQueuedJobCountAIX()); + attrs.add(getPrinterIsAcceptingJobsAIX()); + return attrs; + } + private boolean isSupportedCopies(Copies copies) { int numCopies = copies.getValue(); return (numCopies > 0 && numCopies < MAXCOPIES); @@ -394,6 +470,8 @@ public class UnixPrintService implements PrintService, AttributeUpdater, private PrintServiceAttributeSet getDynamicAttributes() { if (UnixPrintServiceLookup.isSysV()) { return getSysVServiceAttributes(); + } else if (UnixPrintServiceLookup.isAIX()) { + return getAIXServiceAttributes(); } else { return getBSDServiceAttributes(); } diff --git a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java index a3a10e862509292b2acdc0b4cbd282e41cdf94a1..373494e510e3fe14dcc0ac9627e50ca89ffebfc0 100644 --- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java +++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java @@ -78,6 +78,19 @@ public class UnixPrintServiceLookup extends PrintServiceLookup static String osname; + // List of commands used to deal with the printer queues on AIX + String[] lpNameComAix = { + "/usr/bin/lsallq", + "/usr/bin/lpstat -W -p|/usr/bin/expand|/usr/bin/cut -f1 -d' '", + "/usr/bin/lpstat -W -d|/usr/bin/expand|/usr/bin/cut -f1 -d' '", + "/usr/bin/lpstat -W -v" + }; + private static final int aix_lsallq = 0; + private static final int aix_lpstat_p = 1; + private static final int aix_lpstat_d = 2; + private static final int aix_lpstat_v = 3; + private static int aix_defaultPrinterEnumeration = aix_lsallq; + static { /* The system property "sun.java2d.print.polling" * can be used to force the printing code to poll or not poll @@ -114,6 +127,24 @@ public class UnixPrintServiceLookup extends PrintServiceLookup osname = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("os.name")); + + /* The system property "sun.java2d.print.aix.lpstat" + * can be used to force the usage of 'lpstat -p' to enumerate all + * printer queues. By default we use 'lsallq', because 'lpstat -p' can + * take lots of time if thousands of printers are attached to a server. + */ + if (isAIX()) { + String aixPrinterEnumerator = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("sun.java2d.print.aix.lpstat")); + + if (aixPrinterEnumerator != null) { + if (aixPrinterEnumerator.equalsIgnoreCase("lpstat")) { + aix_defaultPrinterEnumeration = aix_lpstat_p; + } else if (aixPrinterEnumerator.equalsIgnoreCase("lsallq")) { + aix_defaultPrinterEnumeration = aix_lsallq; + } + } + } } static boolean isMac() { @@ -133,6 +164,10 @@ public class UnixPrintServiceLookup extends PrintServiceLookup osname.contains("OS X")); } + static boolean isAIX() { + return osname.equals("AIX"); + } + static final int UNINITIALIZED = -1; static final int BSD_LPD = 0; static final int BSD_LPD_NG = 1; @@ -267,6 +302,8 @@ public class UnixPrintServiceLookup extends PrintServiceLookup } else { if (isMac() || isSysV()) { printers = getAllPrinterNamesSysV(); + } else if (isAIX()) { + printers = getAllPrinterNamesAIX(); } else { //BSD printers = getAllPrinterNamesBSD(); } @@ -451,6 +488,8 @@ public class UnixPrintServiceLookup extends PrintServiceLookup PrintService printer = null; if (isMac() || isSysV()) { printer = getNamedPrinterNameSysV(name); + } else if (isAIX()) { + printer = getNamedPrinterNameAIX(name); } else { printer = getNamedPrinterNameBSD(name); } @@ -618,6 +657,8 @@ public class UnixPrintServiceLookup extends PrintServiceLookup } else { if (isMac() || isSysV()) { defaultPrinter = getDefaultPrinterNameSysV(); + } else if (isAIX()) { + defaultPrinter = getDefaultPrinterNameAIX(); } else { defaultPrinter = getDefaultPrinterNameBSD(); } @@ -792,11 +833,49 @@ public class UnixPrintServiceLookup extends PrintServiceLookup return (String[])printerNames.toArray(new String[printerNames.size()]); } + private String getDefaultPrinterNameAIX() { + String[] names = execCmd(lpNameComAix[aix_lpstat_d]); + // Remove headers and bogus entries added by remote printers. + names = UnixPrintService.filterPrinterNamesAIX(names); + if (names == null || names.length != 1) { + // No default printer found + return null; + } else { + return names[0]; + } + } + + private PrintService getNamedPrinterNameAIX(String name) { + // On AIX there should be no blank after '-v'. + String[] result = execCmd(lpNameComAix[aix_lpstat_v] + name); + // Remove headers and bogus entries added by remote printers. + result = UnixPrintService.filterPrinterNamesAIX(result); + if (result == null || result.length != 1) { + return null; + } else { + return new UnixPrintService(name); + } + } + + private String[] getAllPrinterNamesAIX() { + // Determine all printers of the system. + String [] names = execCmd(lpNameComAix[aix_defaultPrinterEnumeration]); + + // Remove headers and bogus entries added by remote printers. + names = UnixPrintService.filterPrinterNamesAIX(names); + + ArrayList printerNames = new ArrayList(); + for ( int i=0; i < names.length; i++) { + printerNames.add(names[i]); + } + return (String[])printerNames.toArray(new String[printerNames.size()]); + } + static String[] execCmd(final String command) { ArrayList results = null; try { final String[] cmd = new String[3]; - if (isSysV()) { + if (isSysV() || isAIX()) { cmd[0] = "/usr/bin/sh"; cmd[1] = "-c"; cmd[2] = "env LC_ALL=C " + command; diff --git a/src/solaris/demo/jvmti/hprof/hprof_md.c b/src/solaris/demo/jvmti/hprof/hprof_md.c index 64d44d987b620fae19acf64d810b576f0c7129e7..78a4f606735860d7c4212b394e4cf78143711b9b 100644 --- a/src/solaris/demo/jvmti/hprof/hprof_md.c +++ b/src/solaris/demo/jvmti/hprof/hprof_md.c @@ -42,7 +42,7 @@ #include #include -#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) +#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) && !defined(AIX) #include #endif @@ -65,6 +65,10 @@ #include "jvm_md.h" #include "hprof.h" +#ifdef AIX +#include "porting_aix.h" /* For the 'dladdr' function. */ +#endif + int md_getpid(void) { @@ -86,7 +90,7 @@ md_sleep(unsigned seconds) void md_init(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) /* No Hi-Res timer option? */ #else if ( gdata->micro_state_accounting ) { @@ -253,7 +257,7 @@ md_timeofday(void) jlong md_get_microsecs(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) return (jlong)(md_timeofday() * (jlong)1000); /* Milli to micro */ #else return (jlong)(gethrtime()/(hrtime_t)1000); /* Nano seconds to micro seconds */ @@ -271,7 +275,7 @@ md_get_timemillis(void) jlong md_get_thread_cpu_timemillis(void) { -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) return md_timeofday(); #else return (jlong)(gethrvtime()/1000); /* Nano seconds to milli seconds */ @@ -286,7 +290,7 @@ md_get_prelude_path(char *path, int path_len, char *filename) Dl_info dlinfo; libdir[0] = 0; -#if defined(LINUX) || defined(_ALLBSD_SOURCE) +#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) addr = (void*)&Agent_OnLoad; #else /* Just using &Agent_OnLoad will get the first external symbol with @@ -457,3 +461,5 @@ md_find_library_entry(void *handle, const char *name) sym = dlsym(handle, name); return sym; } + + diff --git a/src/solaris/native/common/jdk_util_md.h b/src/solaris/native/common/jdk_util_md.h index d9fd2a2557f05b826d094193aee73b0713452b55..c13bb7794e45cbc36b811c0ceb3f863563bf9ac8 100644 --- a/src/solaris/native/common/jdk_util_md.h +++ b/src/solaris/native/common/jdk_util_md.h @@ -39,6 +39,10 @@ #include #define ISNANF(f) isnanf(f) #define ISNAND(d) isnan(d) +#elif defined(_AIX) +#include +#define ISNANF(f) _isnanf(f) +#define ISNAND(d) _isnan(d) #else #error "missing platform-specific definition here" #endif diff --git a/src/solaris/native/java/io/io_util_md.c b/src/solaris/native/java/io/io_util_md.c index e74bc127102c3169c8e98ef4e9b930d818b53648..5899a4103472118c6433917a3e6f12b7bdebc21e 100644 --- a/src/solaris/native/java/io/io_util_md.c +++ b/src/solaris/native/java/io/io_util_md.c @@ -35,7 +35,7 @@ #include #endif -#if defined(__linux__) || defined(_ALLBSD_SOURCE) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include #endif diff --git a/src/solaris/native/java/lang/UNIXProcess_md.c b/src/solaris/native/java/lang/UNIXProcess_md.c index 67bc378e4efdbe8823cc98a016e8215a0f73202b..ec85b685dc66204be2044cdc2dd83165ebfd15d5 100644 --- a/src/solaris/native/java/lang/UNIXProcess_md.c +++ b/src/solaris/native/java/lang/UNIXProcess_md.c @@ -44,7 +44,7 @@ #include #include -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include #endif @@ -455,7 +455,7 @@ forkChild(ChildStuff *c) { return resultPid; } -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) static pid_t spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) { pid_t resultPid; @@ -551,7 +551,7 @@ startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) return vforkChild(c); case MODE_FORK: return forkChild(c); -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) +#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) case MODE_POSIX_SPAWN: return spawnChild(env, process, c, helperpath); #endif diff --git a/src/solaris/native/java/lang/childproc.c b/src/solaris/native/java/lang/childproc.c index 0cfcf6fe9a87470f383790d1ac99810a2686590b..1d183cf1fb270b4cafc9a96d468b3b73c820aca9 100644 --- a/src/solaris/native/java/lang/childproc.c +++ b/src/solaris/native/java/lang/childproc.c @@ -66,6 +66,9 @@ isAsciiDigit(char c) #define FD_DIR "/dev/fd" #define dirent64 dirent #define readdir64 readdir +#elif defined(_AIX) +/* AIX does not understand '/proc/self' - it requires the real process ID */ +#define FD_DIR aix_fd_dir #else #define FD_DIR "/proc/self/fd" #endif @@ -87,6 +90,12 @@ closeDescriptors(void) close(from_fd); /* for possible use by opendir() */ close(from_fd + 1); /* another one for good luck */ +#if defined(_AIX) + /* AIX does not understand '/proc/self' - it requires the real process ID */ + char aix_fd_dir[32]; /* the pid has at most 19 digits */ + snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid()); +#endif + if ((dp = opendir(FD_DIR)) == NULL) return 0; diff --git a/src/solaris/native/java/net/NetworkInterface.c b/src/solaris/native/java/net/NetworkInterface.c index 4edf567947b841a3fe96b53eaed722a3e9b40147..16acf07a26932eadd579ff8d6e769689788aff30 100644 --- a/src/solaris/native/java/net/NetworkInterface.c +++ b/src/solaris/native/java/net/NetworkInterface.c @@ -52,6 +52,13 @@ #include #endif +#if defined(_AIX) +#include +#include +#include +#include +#endif + #ifdef __linux__ #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" #endif @@ -1041,8 +1048,8 @@ static int openSocket(JNIEnv *env, int proto){ } -/** Linux **/ -#ifdef __linux__ +/** Linux, AIX **/ +#if defined(__linux__) || defined(_AIX) /* Open socket for further ioct calls, try v4 socket first and * if it falls return v6 socket */ @@ -1080,11 +1087,13 @@ static int openSocketWithFallback(JNIEnv *env, const char *ifname){ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { struct ifconf ifc; struct ifreq *ifreqP; - char *buf; + char *buf = NULL; int numifs; unsigned i; + int siocgifconfRequest = SIOCGIFCONF; +#if defined(__linux__) /* need to do a dummy SIOCGIFCONF to determine the buffer size. * SIOCGIFCOUNT doesn't work */ @@ -1093,11 +1102,21 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed"); return ifs; } +#elif defined(_AIX) + ifc.ifc_buf = NULL; + if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGSIZIFCONF failed"); + return ifs; + } +#endif /* __linux__ */ CHECKED_MALLOC3(buf,char *, ifc.ifc_len); ifc.ifc_buf = buf; - if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) { +#if defined(_AIX) + siocgifconfRequest = CSIOCGIFCONF; +#endif + if (ioctl(sock, siocgifconfRequest, (char *)&ifc) < 0) { NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed"); (void) free(buf); return ifs; @@ -1108,6 +1127,9 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { */ ifreqP = ifc.ifc_req; for (i=0; iifr_addr.sa_family != AF_INET) continue; +#endif /* * Add to the list */ @@ -1135,7 +1157,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { * Enumerates and returns all IPv6 interfaces on Linux */ -#ifdef AF_INET6 +#if defined(AF_INET6) && defined(__linux__) static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { FILE *f; char addr6[40], devname[21]; @@ -1179,11 +1201,108 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { #endif +/* + * Enumerates and returns all IPv6 interfaces on AIX + */ + +#if defined(AF_INET6) && defined(_AIX) +static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { + struct ifconf ifc; + struct ifreq *ifreqP; + char *buf; + int numifs; + unsigned i; + unsigned bufsize; + char *cp, *cplimit; + + /* use SIOCGSIZIFCONF to get size for SIOCGIFCONF */ + + ifc.ifc_buf = NULL; + if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", + "ioctl SIOCGSIZIFCONF failed"); + return ifs; + } + bufsize = ifc.ifc_len; + + buf = (char *)malloc(bufsize); + if (!buf) { + JNU_ThrowOutOfMemoryError(env, "Network interface native buffer allocation failed"); + return ifs; + } + ifc.ifc_len = bufsize; + ifc.ifc_buf = buf; + if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) { + NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", + "ioctl CSIOCGIFCONF failed"); + free(buf); + return ifs; + } + + /* + * Iterate through each interface + */ + ifreqP = ifc.ifc_req; + cp = (char *)ifc.ifc_req; + cplimit = cp + ifc.ifc_len; + + for ( ; cp < cplimit; cp += (sizeof(ifreqP->ifr_name) + MAX((ifreqP->ifr_addr).sa_len, sizeof(ifreqP->ifr_addr)))) { + ifreqP = (struct ifreq *)cp; + struct ifreq if2; + + memset((char *)&if2, 0, sizeof(if2)); + strcpy(if2.ifr_name, ifreqP->ifr_name); + + /* + * Skip interface that aren't UP + */ + if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) >= 0) { + if (!(if2.ifr_flags & IFF_UP)) { + continue; + } + } + + if (ifreqP->ifr_addr.sa_family != AF_INET6) + continue; + + if (ioctl(sock, SIOCGIFSITE6, (char *)&if2) >= 0) { + struct sockaddr_in6 *s6= (struct sockaddr_in6 *)&(ifreqP->ifr_addr); + s6->sin6_scope_id = if2.ifr_site6; + } + + /* + * Add to the list + */ + ifs = addif(env, sock, ifreqP->ifr_name, ifs, + (struct sockaddr *)&(ifreqP->ifr_addr), + AF_INET6, 0); + + /* + * If an exception occurred then free the list + */ + if ((*env)->ExceptionOccurred(env)) { + free(buf); + freeif(ifs); + return NULL; + } + } + + /* + * Free socket and buffer + */ + free(buf); + return ifs; +} +#endif + + static int getIndex(int sock, const char *name){ /* * Try to get the interface index - * (Not supported on Solaris 2.6 or 7) */ +#if defined(_AIX) + return if_nametoindex(name); +#else struct ifreq if2; strcpy(if2.ifr_name, name); @@ -1192,6 +1311,7 @@ static int getIndex(int sock, const char *name){ } return if2.ifr_ifindex; +#endif } /** @@ -1258,6 +1378,46 @@ static short getSubnet(JNIEnv *env, int sock, const char *ifname) { * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct in_addr* addr, unsigned char *buf) { +#if defined (_AIX) + int size; + struct kinfo_ndd *nddp; + void *end; + + size = getkerninfo(KINFO_NDD, 0, 0, 0); + if (size == 0) { + return -1; + } + + if (size < 0) { + perror("getkerninfo 1"); + return -1; + } + + nddp = (struct kinfo_ndd *)malloc(size); + + if (!nddp) { + return -1; + } + + if (getkerninfo(KINFO_NDD, nddp, &size, 0) < 0) { + perror("getkerninfo 2"); + return -1; + } + + end = (void *)nddp + size; + while ((void *)nddp < end) { + if (!strcmp(nddp->ndd_alias, ifname) || + !strcmp(nddp->ndd_name, ifname)) { + bcopy(nddp->ndd_addr, buf, 6); + return 6; + } else { + nddp++; + } + } + + return -1; + +#elif defined(__linux__) static struct ifreq ifr; int i; @@ -1279,6 +1439,7 @@ static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct } return -1; +#endif } static int getMTU(JNIEnv *env, int sock, const char *ifname) { diff --git a/src/solaris/native/java/net/PlainSocketImpl.c b/src/solaris/native/java/net/PlainSocketImpl.c index 5fed0700cbc3e77d16848ae68eb4508f0317be7a..aef4476ae90ee340463613ba327d966c1536bb16 100644 --- a/src/solaris/native/java/net/PlainSocketImpl.c +++ b/src/solaris/native/java/net/PlainSocketImpl.c @@ -964,7 +964,7 @@ Java_java_net_PlainSocketImpl_socketSetOption(JNIEnv *env, jobject this, } if (NET_SetSockOpt(fd, level, optname, (const void *)&optval, optlen) < 0) { -#ifdef __solaris__ +#if defined(__solaris__) || defined(_AIX) if (errno == EINVAL) { // On Solaris setsockopt will set errno to EINVAL if the socket // is closed. The default error message is then confusing diff --git a/src/solaris/native/java/net/net_util_md.c b/src/solaris/native/java/net/net_util_md.c index 191c1a29393b99fb76846f8ac14ba11e980ffb8a..8ba8732ed3f9d85c182234334a70b7a31eda3a9d 100644 --- a/src/solaris/native/java/net/net_util_md.c +++ b/src/solaris/native/java/net/net_util_md.c @@ -737,14 +737,23 @@ static int getLocalScopeID (char *addr) { return 0; } -void initLocalAddrTable () { +void platformInit () { initLoopbackRoutes(); initLocalIfs(); } +#elif defined(_AIX) + +/* Initialize stubs for blocking I/O workarounds (see src/solaris/native/java/net/linux_close.c) */ +extern void aix_close_init(); + +void platformInit () { + aix_close_init(); +} + #else -void initLocalAddrTable () {} +void platformInit () {} #endif @@ -1271,6 +1280,7 @@ int NET_SetSockOpt(int fd, int level, int opt, const void *arg, int len) { + #ifndef IPTOS_TOS_MASK #define IPTOS_TOS_MASK 0x1e #endif @@ -1291,9 +1301,6 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, #else static long maxsockbuf = -1; #endif - - int addopt; - struct linger *ling; #endif /* @@ -1386,6 +1393,29 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } #endif +#ifdef _AIX + if (level == SOL_SOCKET) { + if (opt == SO_SNDBUF || opt == SO_RCVBUF) { + /* + * Just try to set the requested size. If it fails we will leave the + * socket option as is. Setting the buffer size means only a hint in + * the jse2/java software layer, see javadoc. In the previous + * solution the buffer has always been truncated to a length of + * 0x100000 Byte, even if the technical limit has not been reached. + * This kind of absolute truncation was unexpected in the jck tests. + */ + int ret = setsockopt(fd, level, opt, arg, len); + if ((ret == 0) || (ret == -1 && errno == ENOBUFS)) { + // Accept failure because of insufficient buffer memory resources. + return 0; + } else { + // Deliver all other kinds of errors. + return ret; + } + } + } +#endif + /* * On Linux the receive buffer is used for both socket * structures and the the packet payload. The implication @@ -1442,10 +1472,12 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } } +#endif +#if defined(_ALLBSD_SOURCE) || defined(_AIX) /* * On Solaris, SO_REUSEADDR will allow multiple datagram - * sockets to bind to the same port. The network jck tests + * sockets to bind to the same port. The network jck tests check * for this "feature", so we need to emulate it by turning on * SO_REUSEPORT as well for that combination. */ @@ -1459,11 +1491,9 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } if (sotype == SOCK_DGRAM) { - addopt = SO_REUSEPORT; - setsockopt(fd, level, addopt, arg, len); + setsockopt(fd, level, SO_REUSEPORT, arg, len); } } - #endif return setsockopt(fd, level, opt, arg, len); @@ -1633,7 +1663,7 @@ NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout) if (timeout <= 0) { return read_rv > 0 ? 0 : -1; } - newTime = prevTime; + prevTime = newTime; if (read_rv > 0) { break; diff --git a/src/solaris/native/java/net/net_util_md.h b/src/solaris/native/java/net/net_util_md.h index f7bec897c7d77af5e0429c3ab5d7371e4df947b3..c602753b9507db3c9621bdfd6df2ff1dc16abdce 100644 --- a/src/solaris/native/java/net/net_util_md.h +++ b/src/solaris/native/java/net/net_util_md.h @@ -37,7 +37,17 @@ #endif -#if defined(__linux__) || defined(MACOSX) +/* + AIX needs a workaround for I/O cancellation, see: + http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/close.htm + ... + The close subroutine is blocked until all subroutines which use the file + descriptor return to usr space. For example, when a thread is calling close + and another thread is calling select with the same file descriptor, the + close subroutine does not return until the select call returns. + ... +*/ +#if defined(__linux__) || defined(MACOSX) || defined (_AIX) extern int NET_Timeout(int s, long timeout); extern int NET_Read(int s, void* buf, size_t len); extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, diff --git a/src/solaris/native/java/util/TimeZone_md.c b/src/solaris/native/java/util/TimeZone_md.c index ce2fa5aca8c999fe0e49490ccb3437189489128f..e1af8f92556823fc36b541e737acc6f75b2c4acf 100644 --- a/src/solaris/native/java/util/TimeZone_md.c +++ b/src/solaris/native/java/util/TimeZone_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -123,7 +123,7 @@ findZoneinfoFile(char *buf, size_t size, const char *dir) return NULL; } -#if defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ +#if defined(_AIX) || defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ && (defined(_POSIX_PTHREAD_SEMANTICS) || defined(_LP64))) while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) { #else @@ -615,6 +615,14 @@ getSolarisDefaultZoneID() { #endif /*__solaris__*/ #endif /*__linux__*/ +#ifdef _AIX +static char * +getPlatformTimeZoneID() +{ + return NULL; +} +#endif + /* * findJavaTZ_md() maps platform time zone ID to Java time zone ID * using /lib/tzmappings. If the TZ value is not found, it @@ -635,7 +643,7 @@ findJavaTZ_md(const char *java_home_dir, const char *country) #if defined(__linux__) || defined(_ALLBSD_SOURCE) if (tz == NULL) { #else -#ifdef __solaris__ +#if defined (__solaris__) || defined(_AIX) if (tz == NULL || *tz == '\0') { #endif #endif diff --git a/src/solaris/native/sun/awt/awt_LoadLibrary.c b/src/solaris/native/sun/awt/awt_LoadLibrary.c index 7692d01138ccfbc148fbf6672b1502ef643de7cf..4f41955b58dd27d2acfc0f61dda0b959a6a96312 100644 --- a/src/solaris/native/sun/awt/awt_LoadLibrary.c +++ b/src/solaris/native/sun/awt/awt_LoadLibrary.c @@ -37,6 +37,10 @@ #include "awt_Plugin.h" +#ifdef AIX +#include "porting_aix.h" /* For the 'dladdr' function. */ +#endif + #ifdef DEBUG #define VERBOSE_AWT_DEBUG #endif diff --git a/src/solaris/native/sun/awt/fontpath.c b/src/solaris/native/sun/awt/fontpath.c index cbf9a768d9d41ed43b4e9d2643236c9481973898..19e5d9bf8d87559fd6247ae813fb164233a26b42 100644 --- a/src/solaris/native/sun/awt/fontpath.c +++ b/src/solaris/native/sun/awt/fontpath.c @@ -64,7 +64,7 @@ extern Display *awt_display; #define MAXFDIRS 512 /* Max number of directories that contain fonts */ -#if !defined(__linux__) +#if defined(__solaris__) /* * This can be set in the makefile to "/usr/X11" if so desired. */ @@ -114,7 +114,7 @@ static char *fullSolarisFontPath[] = { NULL, /* terminates the list */ }; -#else /* __linux */ +#elif defined( __linux__) /* All the known interesting locations we have discovered on * various flavors of Linux */ @@ -134,6 +134,12 @@ static char *fullLinuxFontPath[] = { "/usr/share/fonts/default/Type1", /* RH 9.0 */ NULL, /* terminates the list */ }; +#elif defined(_AIX) +static char *fullAixFontPath[] = { + "/usr/lpp/X11/lib/X11/fonts/Type1", /* from X11.fnt.iso_T1 */ + "/usr/lpp/X11/lib/X11/fonts/TrueType", /* from X11.fnt.ucs.ttf */ + NULL, /* terminates the list */ +}; #endif static char **getFontConfigLocations(); @@ -497,10 +503,11 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) { #if defined(__linux__) knowndirs = fullLinuxFontPath; -#else /* IF SOLARIS */ +#elif defined(__solaris__) knowndirs = fullSolarisFontPath; +#elif defined(_AIX) + knowndirs = fullAixFontPath; #endif - /* REMIND: this code requires to be executed when the GraphicsEnvironment * is already initialised. That is always true, but if it were not so, * this code could throw an exception and the fontpath would fail to @@ -592,6 +599,25 @@ static void* openFontConfig() { } } #endif + +#if defined(_AIX) + /* On AIX, fontconfig is not a standard package supported by IBM. + * instead it has to be installed from the "AIX Toolbox for Linux Applications" + * site http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html + * and will be installed under /opt/freeware/lib/libfontconfig.a. + * Notice that the archive contains the real 32- and 64-bit shared libraries. + * We first try to load 'libfontconfig.so' from the default library path in the + * case the user has installed a private version of the library and if that + * doesn't succeed, we try the version from /opt/freeware/lib/libfontconfig.a + */ + libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + libfontconfig = dlopen("/opt/freeware/lib/libfontconfig.a(libfontconfig.so.1)", RTLD_MEMBER|RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + return NULL; + } + } +#else /* 64 bit sparc should pick up the right version from the lib path. * New features may be added to libfontconfig, this is expected to * be compatible with old features, but we may need to start @@ -606,6 +632,7 @@ static void* openFontConfig() { return NULL; } } +#endif /* Version 1.0 of libfontconfig crashes if HOME isn't defined in * the environment. This should generally never happen, but we can't @@ -1203,7 +1230,7 @@ Java_sun_font_FontConfigManager_getFontConfig */ if (fontformat != NULL && (strcmp((char*)fontformat, "TrueType") != 0) -#ifdef __linux__ +#if defined(__linux__) || defined(_AIX) && (strcmp((char*)fontformat, "Type 1") != 0) #endif ) { diff --git a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index 79e3be488a6a8fdb3da76a872bce3d0b68196639..fd48e42cf1ef1bc7a817237abbace4ef422255ec 100644 --- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -56,8 +56,8 @@ typedef struct _X11RIPrivate { int x, y; } X11RIPrivate; -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define XSD_MAX(a,b) ((a) > (b) ? (a) : (b)) +#define XSD_MIN(a,b) ((a) < (b) ? (a) : (b)) static LockFunc X11SD_Lock; static GetRasInfoFunc X11SD_GetRasInfo; @@ -1090,10 +1090,10 @@ X11SD_ClipToRoot(SurfaceDataBounds *b, SurfaceDataBounds *bounds, x2 = x1 + DisplayWidth(awt_display, xsdo->configData->awt_visInfo.screen); y2 = y1 + DisplayHeight(awt_display, xsdo->configData->awt_visInfo.screen); - x1 = MAX(bounds->x1, x1); - y1 = MAX(bounds->y1, y1); - x2 = MIN(bounds->x2, x2); - y2 = MIN(bounds->y2, y2); + x1 = XSD_MAX(bounds->x1, x1); + y1 = XSD_MAX(bounds->y1, y1); + x2 = XSD_MIN(bounds->x2, x2); + y2 = XSD_MIN(bounds->y2, y2); if ((x1 >= x2) || (y1 >= y2)) { return FALSE; } diff --git a/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/src/solaris/native/sun/java2d/x11/XRBackendNative.c index 0f37eab2e4d63f732f371671386d38e293617adf..733606ec444ee44ba148aceb3cae11c48dce5513 100644 --- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c +++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c @@ -72,8 +72,8 @@ typedef struct _XRadialGradient { #include -#ifdef __solaris__ -/* Solaris 10 will not have these symbols at runtime */ +#if defined(__solaris__) || defined(_AIX) +/* Solaris 10 and AIX will not have these symbols at runtime */ typedef Picture (*XRenderCreateLinearGradientFuncType) (Display *dpy, @@ -147,7 +147,7 @@ static jboolean IsXRenderAvailable(jboolean verbose, jboolean ignoreLinuxVersion return JNI_FALSE; } -#ifdef __solaris__ +#if defined(__solaris__) || defined(_AIX) xrenderlib = dlopen("libXrender.so",RTLD_GLOBAL|RTLD_LAZY); if (xrenderlib != NULL) { diff --git a/src/solaris/native/sun/management/OperatingSystemImpl.c b/src/solaris/native/sun/management/OperatingSystemImpl.c index 3f8cf82a2dc89b79974eadc8bf019cbc26432064..aa21f0198239e99ccf8e949ed2dbb66c95ea5807 100644 --- a/src/solaris/native/sun/management/OperatingSystemImpl.c +++ b/src/solaris/native/sun/management/OperatingSystemImpl.c @@ -41,7 +41,7 @@ #include #include #endif -#else +#elif !defined(_AIX) #include #endif #include @@ -57,9 +57,13 @@ #include #include +#if defined(_AIX) +#include +#endif + static jlong page_size = 0; -#if defined(_ALLBSD_SOURCE) +#if defined(_ALLBSD_SOURCE) || defined(_AIX) #define MB (1024UL * 1024UL) #else @@ -326,6 +330,12 @@ Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize */ // throw_internal_error(env, "unimplemented in FreeBSD") return (128 * MB); +#elif defined(_AIX) + perfstat_memory_total_t memory_info; + if (-1 != perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1)) { + return (jlong)(memory_info.real_free * 4L * 1024L); + } + return -1; #else // solaris / linux jlong num_avail_physical_pages = sysconf(_SC_AVPHYS_PAGES); return (num_avail_physical_pages * page_size); @@ -349,6 +359,12 @@ Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize return -1; } return result; +#elif defined(_AIX) + perfstat_memory_total_t memory_info; + if (-1 != perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1)) { + return (jlong)(memory_info.real_total * 4L * 1024L); + } + return -1; #else // solaris / linux jlong num_physical_pages = sysconf(_SC_PHYS_PAGES); return (num_physical_pages * page_size); @@ -417,7 +433,16 @@ Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount struct dirent* dentp; jlong fds = 0; - dirp = opendir("/proc/self/fd"); +#if defined(_AIX) +/* AIX does not understand '/proc/self' - it requires the real process ID */ +#define FD_DIR aix_fd_dir + char aix_fd_dir[32]; /* the pid has at most 19 digits */ + snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid()); +#else +#define FD_DIR "/proc/self/fd" +#endif + + dirp = opendir(FD_DIR); if (dirp == NULL) { throw_internal_error(env, "Unable to open directory /proc/self/fd"); return -1; diff --git a/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c b/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c index cd2f4927bdbfaad96506c0450ac52aef847cb10c..816270c9b8e07c93c50df0124ff039cc2c58e3fc 100644 --- a/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c +++ b/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c @@ -81,7 +81,7 @@ Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this, rv = connect(fd, 0, 0); #endif -#if defined(__linux__) || defined(_ALLBSD_SOURCE) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) { int len; SOCKADDR sa; @@ -114,6 +114,14 @@ Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this, #if defined(_ALLBSD_SOURCE) if (rv < 0 && errno == EADDRNOTAVAIL) rv = errno = 0; +#endif +#if defined(_AIX) + /* See W. Richard Stevens, "UNIX Network Programming, Volume 1", p. 254: + * 'Setting the address family to AF_UNSPEC might return EAFNOSUPPORT + * but that is acceptable. + */ + if (rv < 0 && errno == EAFNOSUPPORT) + rv = errno = 0; #endif } #endif diff --git a/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c b/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c index 25beacc3d5d9f43d0b314fffbd65043833fac98d..c9d201124791d260d145322a2ae051440fd30699 100644 --- a/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c +++ b/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c @@ -147,6 +147,19 @@ Java_sun_nio_ch_FileDispatcherImpl_force0(JNIEnv *env, jobject this, if (md == JNI_FALSE) { result = fdatasync(fd); } else { +#ifdef _AIX + /* On AIX, calling fsync on a file descriptor that is opened only for + * reading results in an error ("EBADF: The FileDescriptor parameter is + * not a valid file descriptor open for writing."). + * However, at this point it is not possibly anymore to read the + * 'writable' attribute of the corresponding file channel so we have to + * use 'fcntl'. + */ + int getfl = fcntl(fd, F_GETFL); + if (getfl >= 0 && (getfl & O_ACCMODE) == O_RDONLY) { + return 0; + } +#endif result = fsync(fd); } return handle(env, result, "Force failed"); diff --git a/src/solaris/native/sun/nio/ch/IOUtil.c b/src/solaris/native/sun/nio/ch/IOUtil.c index 58ef02014b511ae65d8060ad0bccda4261ce7b2c..7dbf010fcac4acef820e2b8fa599a6f011d89729 100644 --- a/src/solaris/native/sun/nio/ch/IOUtil.c +++ b/src/solaris/native/sun/nio/ch/IOUtil.c @@ -145,7 +145,6 @@ Java_sun_nio_ch_IOUtil_iovMax(JNIEnv *env, jclass this) return (jint)iov_max; } - /* Declared in nio_util.h for use elsewhere in NIO */ jint diff --git a/src/solaris/native/sun/nio/ch/Net.c b/src/solaris/native/sun/nio/ch/Net.c index 77f55ed179d99e0c483f59d8472927eae614e507..2846217bbb65171273485bb232c6f94957a81e28 100644 --- a/src/solaris/native/sun/nio/ch/Net.c +++ b/src/solaris/native/sun/nio/ch/Net.c @@ -23,6 +23,7 @@ * questions. */ +#include #include #include #include @@ -40,6 +41,9 @@ #include "nio.h" #include "sun_nio_ch_PollArrayWrapper.h" +#ifdef _AIX +#include +#endif /** * IP_MULTICAST_ALL supported since 2.6.31 but may not be available at @@ -51,24 +55,46 @@ #endif #endif -#ifdef _ALLBSD_SOURCE +#if defined(_ALLBSD_SOURCE) || defined(_AIX) #ifndef IP_BLOCK_SOURCE +#if defined(_AIX) + +#define IP_BLOCK_SOURCE 58 /* Block data from a given source to a given group */ +#define IP_UNBLOCK_SOURCE 59 /* Unblock data from a given source to a given group */ +#define IP_ADD_SOURCE_MEMBERSHIP 60 /* Join a source-specific group */ +#define IP_DROP_SOURCE_MEMBERSHIP 61 /* Leave a source-specific group */ + +#else + #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ #define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ #define IP_BLOCK_SOURCE 72 /* block a source */ #define IP_UNBLOCK_SOURCE 73 /* unblock a source */ +#endif /* _AIX */ + #endif /* IP_BLOCK_SOURCE */ #ifndef MCAST_BLOCK_SOURCE +#if defined(_AIX) + +#define MCAST_BLOCK_SOURCE 64 +#define MCAST_UNBLOCK_SOURCE 65 +#define MCAST_JOIN_SOURCE_GROUP 66 +#define MCAST_LEAVE_SOURCE_GROUP 67 + +#else + #define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ #define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ #define MCAST_BLOCK_SOURCE 84 /* block a source */ #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ +#endif /* _AIX */ + #endif /* MCAST_BLOCK_SOURCE */ #ifndef IPV6_ADD_MEMBERSHIP @@ -78,12 +104,24 @@ #endif /* IPV6_ADD_MEMBERSHIP */ +#if defined(_AIX) + +struct my_ip_mreq_source { + struct in_addr imr_multiaddr; + struct in_addr imr_sourceaddr; + struct in_addr imr_interface; +}; + +#else + struct my_ip_mreq_source { struct in_addr imr_multiaddr; struct in_addr imr_interface; struct in_addr imr_sourceaddr; }; +#endif /* _AIX */ + struct my_group_source_req { uint32_t gsr_interface; /* interface index */ struct sockaddr_storage gsr_group; /* group address */ @@ -123,6 +161,36 @@ static void initGroupSourceReq(JNIEnv* env, jbyteArray group, jint index, } #endif +#ifdef _AIX + +/* + * Checks whether or not "socket extensions for multicast source filters" is supported. + * Returns JNI_TRUE if it is supported, JNI_FALSE otherwise + */ +static jboolean isSourceFilterSupported(){ + static jboolean alreadyChecked = JNI_FALSE; + static jboolean result = JNI_TRUE; + if (alreadyChecked != JNI_TRUE){ + struct utsname uts; + memset(&uts, 0, sizeof(uts)); + strcpy(uts.sysname, "?"); + const int utsRes = uname(&uts); + int major = -1; + int minor = -1; + major = atoi(uts.version); + minor = atoi(uts.release); + if (strcmp(uts.sysname, "AIX") == 0) { + if (major < 6 || (major == 6 && minor < 1)) {// unsupported on aix < 6.1 + result = JNI_FALSE; + } + } + alreadyChecked = JNI_TRUE; + } + return result; +} + +#endif /* _AIX */ + JNIEXPORT void JNICALL Java_sun_nio_ch_Net_initIDs(JNIEnv *env, jclass clazz) { @@ -143,7 +211,7 @@ Java_sun_nio_ch_Net_isExclusiveBindAvailable(JNIEnv *env, jclass clazz) { JNIEXPORT jboolean JNICALL Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl) { -#ifdef MACOSX +#if defined(MACOSX) || defined(_AIX) /* for now IPv6 sockets cannot join IPv4 multicast groups */ return JNI_FALSE; #else @@ -475,6 +543,14 @@ Java_sun_nio_ch_Net_joinOrDrop4(JNIEnv *env, jobject this, jboolean join, jobjec /* no IPv4 include-mode filtering for now */ return IOS_UNAVAILABLE; #else + +#ifdef _AIX + /* check AIX for support of source filtering */ + if (isSourceFilterSupported() != JNI_TRUE){ + return IOS_UNAVAILABLE; + } +#endif + mreq_source.imr_multiaddr.s_addr = htonl(group); mreq_source.imr_sourceaddr.s_addr = htonl(source); mreq_source.imr_interface.s_addr = htonl(interf); @@ -486,7 +562,7 @@ Java_sun_nio_ch_Net_joinOrDrop4(JNIEnv *env, jobject this, jboolean join, jobjec n = setsockopt(fdval(env,fdo), IPPROTO_IP, opt, optval, optlen); if (n < 0) { - if (join && (errno == ENOPROTOOPT)) + if (join && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -505,6 +581,13 @@ Java_sun_nio_ch_Net_blockOrUnblock4(JNIEnv *env, jobject this, jboolean block, j int n; int opt = (block) ? IP_BLOCK_SOURCE : IP_UNBLOCK_SOURCE; +#ifdef _AIX + /* check AIX for support of source filtering */ + if (isSourceFilterSupported() != JNI_TRUE){ + return IOS_UNAVAILABLE; + } +#endif + mreq_source.imr_multiaddr.s_addr = htonl(group); mreq_source.imr_sourceaddr.s_addr = htonl(source); mreq_source.imr_interface.s_addr = htonl(interf); @@ -512,7 +595,7 @@ Java_sun_nio_ch_Net_blockOrUnblock4(JNIEnv *env, jobject this, jboolean block, j n = setsockopt(fdval(env,fdo), IPPROTO_IP, opt, (void*)&mreq_source, sizeof(mreq_source)); if (n < 0) { - if (block && (errno == ENOPROTOOPT)) + if (block && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -550,7 +633,7 @@ Java_sun_nio_ch_Net_joinOrDrop6(JNIEnv *env, jobject this, jboolean join, jobjec n = setsockopt(fdval(env,fdo), IPPROTO_IPV6, opt, optval, optlen); if (n < 0) { - if (join && (errno == ENOPROTOOPT)) + if (join && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -579,7 +662,7 @@ Java_sun_nio_ch_Net_blockOrUnblock6(JNIEnv *env, jobject this, jboolean block, j n = setsockopt(fdval(env,fdo), IPPROTO_IPV6, opt, (void*)&req, sizeof(req)); if (n < 0) { - if (block && (errno == ENOPROTOOPT)) + if (block && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) return IOS_UNAVAILABLE; handleSocketError(env, errno); } @@ -679,6 +762,42 @@ Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlo } } +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollinValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLIN; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_polloutValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLOUT; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollerrValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLERR; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollhupValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLHUP; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollnvalValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLNVAL; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollconnValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLOUT; +} + /* Declared in nio_util.h */ diff --git a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c index 3f007acced77fdb7a9af2f4a9dc59c25227cd381..55233d06cfc6ae4ad85aad02ee025b40c38afae8 100644 --- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -42,7 +42,7 @@ #include #endif -#ifdef __linux__ +#if defined(__linux__) || defined(_AIX) #include #endif @@ -294,7 +294,13 @@ Java_sun_nio_fs_UnixNativeDispatcher_strerror(JNIEnv* env, jclass this, jint err jsize len; jbyteArray bytes; +#ifdef _AIX + /* strerror() is not thread-safe on AIX so we have to use strerror_r() */ + char buffer[256]; + msg = (strerror_r((int)error, buffer, 256) == 0) ? buffer : "Error while calling strerror_r"; +#else msg = strerror((int)error); +#endif len = strlen(msg); bytes = (*env)->NewByteArray(env, len); if (bytes != NULL) { @@ -674,6 +680,15 @@ Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong val /* EINTR not listed as a possible error */ /* TDB: reentrant version probably not required here */ res = readdir64_r(dirp, ptr, &result); + +#ifdef _AIX + /* On AIX, readdir_r() returns EBADF (i.e. '9') and sets 'result' to NULL for the */ + /* directory stream end. Otherwise, 'errno' will contain the error code. */ + if (res != 0) { + res = (result == NULL && res == EBADF) ? 0 : errno; + } +#endif + if (res != 0) { throwUnixException(env, res); return NULL; @@ -877,6 +892,18 @@ Java_sun_nio_fs_UnixNativeDispatcher_statvfs0(JNIEnv* env, jclass this, if (err == -1) { throwUnixException(env, errno); } else { +#ifdef _AIX + /* AIX returns ULONG_MAX in buf.f_blocks for the /proc file system. */ + /* This is too big for a Java signed long and fools various tests. */ + if (buf.f_blocks == ULONG_MAX) { + buf.f_blocks = 0; + } + /* The number of free or available blocks can never exceed the total number of blocks */ + if (buf.f_blocks == 0) { + buf.f_bfree = 0; + buf.f_bavail = 0; + } +#endif (*env)->SetLongField(env, attrs, attrs_f_frsize, long_to_jlong(buf.f_frsize)); (*env)->SetLongField(env, attrs, attrs_f_blocks, long_to_jlong(buf.f_blocks)); (*env)->SetLongField(env, attrs, attrs_f_bfree, long_to_jlong(buf.f_bfree)); diff --git a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c index f509c42b5596a74ba77eaf6f2c10ca0da2c32d6a..8b3a62bfdc60558c2cfeee3f1e25e2d7ef0542e3 100644 --- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c +++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,11 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle { const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL); // look up existing handle only, do not load +#if defined(AIX) + void *hModule = dlopen(libName, RTLD_LAZY); +#else void *hModule = dlopen(libName, RTLD_NOLOAD); +#endif dprintf2("-handle for %s: %u\n", libName, hModule); (*env)->ReleaseStringUTFChars(env, jLibName, libName); return ptr_to_jlong(hModule); diff --git a/src/windows/classes/sun/nio/ch/PollArrayWrapper.java b/src/windows/classes/sun/nio/ch/PollArrayWrapper.java index 0d2769fdaa4c28ccc96a9b0aead049dd87f1cac3..ee0518f1de08c96fdccde696a492395f5e8ac130 100644 --- a/src/windows/classes/sun/nio/ch/PollArrayWrapper.java +++ b/src/windows/classes/sun/nio/ch/PollArrayWrapper.java @@ -53,15 +53,6 @@ class PollArrayWrapper { static short SIZE_POLLFD = 8; // sizeof pollfd struct - // events masks - @Native static final short POLLIN = AbstractPollArrayWrapper.POLLIN; - @Native static final short POLLOUT = AbstractPollArrayWrapper.POLLOUT; - @Native static final short POLLERR = AbstractPollArrayWrapper.POLLERR; - @Native static final short POLLHUP = AbstractPollArrayWrapper.POLLHUP; - @Native static final short POLLNVAL = AbstractPollArrayWrapper.POLLNVAL; - @Native static final short POLLREMOVE = AbstractPollArrayWrapper.POLLREMOVE; - @Native static final short POLLCONN = 0x0002; - private int size; // Size of the pollArray PollArrayWrapper(int newSize) { @@ -119,6 +110,6 @@ class PollArrayWrapper { // Adds Windows wakeup socket at a given index. void addWakeupSocket(int fdVal, int index) { putDescriptor(index, fdVal); - putEventOps(index, POLLIN); + putEventOps(index, Net.POLLIN); } } diff --git a/src/windows/classes/sun/nio/ch/SinkChannelImpl.java b/src/windows/classes/sun/nio/ch/SinkChannelImpl.java index 1450928a8161480a96f1588f05983bdbc81ea0e5..57e88ac38cf24bfe658652f9d6dd1c752ce9a34c 100644 --- a/src/windows/classes/sun/nio/ch/SinkChannelImpl.java +++ b/src/windows/classes/sun/nio/ch/SinkChannelImpl.java @@ -78,17 +78,16 @@ class SinkChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) + if ((ops & Net.POLLNVAL) != 0) throw new Error("POLLNVAL detected"); - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLOUT) != 0) && + if (((ops & Net.POLLOUT) != 0) && ((intOps & SelectionKey.OP_WRITE) != 0)) newOps |= SelectionKey.OP_WRITE; @@ -106,7 +105,7 @@ class SinkChannelImpl public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { if ((ops & SelectionKey.OP_WRITE) != 0) - ops = PollArrayWrapper.POLLOUT; + ops = Net.POLLOUT; sk.selector.putEventOps(sk, ops); } diff --git a/src/windows/classes/sun/nio/ch/SourceChannelImpl.java b/src/windows/classes/sun/nio/ch/SourceChannelImpl.java index da45df639af03de24b7edb4492474e451577b8a3..2605d61b47c038113ca0d663e704d7d6ec2ed5e5 100644 --- a/src/windows/classes/sun/nio/ch/SourceChannelImpl.java +++ b/src/windows/classes/sun/nio/ch/SourceChannelImpl.java @@ -77,17 +77,16 @@ class SourceChannelImpl int oldOps = sk.nioReadyOps(); int newOps = initialOps; - if ((ops & PollArrayWrapper.POLLNVAL) != 0) + if ((ops & Net.POLLNVAL) != 0) throw new Error("POLLNVAL detected"); - if ((ops & (PollArrayWrapper.POLLERR - | PollArrayWrapper.POLLHUP)) != 0) { + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); return (newOps & ~oldOps) != 0; } - if (((ops & PollArrayWrapper.POLLIN) != 0) && + if (((ops & Net.POLLIN) != 0) && ((intOps & SelectionKey.OP_READ) != 0)) newOps |= SelectionKey.OP_READ; @@ -105,7 +104,7 @@ class SourceChannelImpl public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { if ((ops & SelectionKey.OP_READ) != 0) - ops = PollArrayWrapper.POLLIN; + ops = Net.POLLIN; sk.selector.putEventOps(sk, ops); } diff --git a/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java b/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java index d84712ba97c6bf372edb8e662e927b9a00f642e4..eec35ea9518f9ef11dc7d31b98ebd7165ca8b398 100644 --- a/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java +++ b/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java @@ -313,16 +313,16 @@ final class WindowsSelectorImpl extends SelectorImpl { private int processSelectedKeys(long updateCount) { int numKeysUpdated = 0; numKeysUpdated += processFDSet(updateCount, readFds, - PollArrayWrapper.POLLIN, + Net.POLLIN, false); numKeysUpdated += processFDSet(updateCount, writeFds, - PollArrayWrapper.POLLCONN | - PollArrayWrapper.POLLOUT, + Net.POLLCONN | + Net.POLLOUT, false); numKeysUpdated += processFDSet(updateCount, exceptFds, - PollArrayWrapper.POLLIN | - PollArrayWrapper.POLLCONN | - PollArrayWrapper.POLLOUT, + Net.POLLIN | + Net.POLLCONN | + Net.POLLOUT, true); return numKeysUpdated; } diff --git a/src/windows/native/java/net/net_util_md.c b/src/windows/native/java/net/net_util_md.c index c79434a0e898cad56dada0a98f36f38cafa26d64..f9a61bf5787e35fb8d04a0ea7f23d075ea2f299f 100644 --- a/src/windows/native/java/net/net_util_md.c +++ b/src/windows/native/java/net/net_util_md.c @@ -125,8 +125,8 @@ DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) return TRUE; } -void initLocalAddrTable () {} -void parseExclusiveBindProperty (JNIEnv *env) {} +void platformInit() {} +void parseExclusiveBindProperty(JNIEnv *env) {} /* * Since winsock doesn't have the equivalent of strerror(errno) diff --git a/src/windows/native/sun/nio/ch/Net.c b/src/windows/native/sun/nio/ch/Net.c index 21933a0932f587dcedc97fe3c98c876b6096a568..9720d80ef625bfd40b526993dca2d7ca74e1de0f 100644 --- a/src/windows/native/sun/nio/ch/Net.c +++ b/src/windows/native/sun/nio/ch/Net.c @@ -554,11 +554,11 @@ Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlo FD_ZERO(&rd); FD_ZERO(&wr); FD_ZERO(&ex); - if (events & sun_nio_ch_PollArrayWrapper_POLLIN) { + if (events & POLLIN) { FD_SET(fd, &rd); } - if (events & sun_nio_ch_PollArrayWrapper_POLLOUT || - events & sun_nio_ch_PollArrayWrapper_POLLCONN) { + if (events & POLLOUT || + events & POLLCONN) { FD_SET(fd, &wr); } FD_SET(fd, &ex); @@ -572,14 +572,50 @@ Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlo } else if (rv >= 0) { rv = 0; if (FD_ISSET(fd, &rd)) { - rv |= sun_nio_ch_PollArrayWrapper_POLLIN; + rv |= POLLIN; } if (FD_ISSET(fd, &wr)) { - rv |= sun_nio_ch_PollArrayWrapper_POLLOUT; + rv |= POLLOUT; } if (FD_ISSET(fd, &ex)) { - rv |= sun_nio_ch_PollArrayWrapper_POLLERR; + rv |= POLLERR; } } return rv; } + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollinValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLIN; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_polloutValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLOUT; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollerrValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLERR; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollhupValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLHUP; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollnvalValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLNVAL; +} + +JNIEXPORT jshort JNICALL +Java_sun_nio_ch_Net_pollconnValue(JNIEnv *env, jclass this) +{ + return (jshort)POLLCONN; +} diff --git a/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c b/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c index aa10877c42b0fb18f47c07b056ef51bb46ca5b5b..7d5e1e77875977db0a9ffbf79118463bd3682313 100644 --- a/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c +++ b/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c @@ -33,13 +33,15 @@ #define FD_SETSIZE 1024 #include +#include + #include "jvm.h" #include "jni.h" #include "jni_util.h" #include "sun_nio_ch_WindowsSelectorImpl.h" #include "sun_nio_ch_PollArrayWrapper.h" -#include "winsock2.h" +#include "nio_util.h" /* Needed for POLL* constants (includes "winsock2.h") */ typedef struct { jint fd; @@ -79,12 +81,11 @@ Java_sun_nio_ch_WindowsSelectorImpl_00024SubSelector_poll0(JNIEnv *env, jobject /* Set FD_SET structures required for select */ for (i = 0; i < numfds; i++) { - if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) { + if (fds[i].events & POLLIN) { readfds.fd_array[read_count] = fds[i].fd; read_count++; } - if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT | - sun_nio_ch_PollArrayWrapper_POLLCONN)) + if (fds[i].events & (POLLOUT | POLLCONN)) { writefds.fd_array[write_count] = fds[i].fd; write_count++; @@ -110,12 +111,11 @@ Java_sun_nio_ch_WindowsSelectorImpl_00024SubSelector_poll0(JNIEnv *env, jobject /* prepare select structures for the i-th socket */ errreadfds.fd_count = 0; errwritefds.fd_count = 0; - if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) { + if (fds[i].events & POLLIN) { errreadfds.fd_array[0] = fds[i].fd; errreadfds.fd_count = 1; } - if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT | - sun_nio_ch_PollArrayWrapper_POLLCONN)) + if (fds[i].events & (POLLOUT | POLLCONN)) { errwritefds.fd_array[0] = fds[i].fd; errwritefds.fd_count = 1; diff --git a/src/windows/native/sun/nio/ch/nio_util.h b/src/windows/native/sun/nio/ch/nio_util.h index cf2df5363b73b49d27f757592b4c118d0a607713..1d463241c25898dd6ce473e4f94037f050138bd7 100644 --- a/src/windows/native/sun/nio/ch/nio_util.h +++ b/src/windows/native/sun/nio/ch/nio_util.h @@ -23,6 +23,8 @@ * questions. */ +#include + #include "jni.h" /** @@ -55,3 +57,19 @@ struct iovec { }; #endif + +#ifndef POLLIN + /* WSAPoll()/WSAPOLLFD and the corresponding constants are only defined */ + /* in Windows Vista / Windows Server 2008 and later. If we are on an */ + /* older release we just use the Solaris constants as this was previously */ + /* done in PollArrayWrapper.java. */ + #define POLLIN 0x0001 + #define POLLOUT 0x0004 + #define POLLERR 0x0008 + #define POLLHUP 0x0010 + #define POLLNVAL 0x0020 + #define POLLCONN 0x0002 +#else + /* POLLCONN must not equal any of the other constants (see winsock2.h). */ + #define POLLCONN 0x2000 +#endif diff --git a/test/ProblemList.txt b/test/ProblemList.txt index 1d9efbc98432f06958d5d814adc5baa286fa126c..96d6a4ceeec209bf706f121a6351cac432a00b1d 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -41,11 +41,11 @@ # # List items are testnames followed by labels, all MUST BE commented # as to why they are here and use a label: -# generic-all Problems on all platforms -# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, etc. -# OSNAME-all Where OSNAME is one of: solaris, linux, windows, macosx -# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. solaris-amd64 -# OSNAME-REV Specific on to one OSNAME and REV, e.g. solaris-5.8 +# generic-all Problems on all platforms +# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, etc. +# OSNAME-all Where OSNAME is one of: solaris, linux, windows, macosx, aix +# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. solaris-amd64 +# OSNAME-REV Specific on to one OSNAME and REV, e.g. solaris-5.8 # # More than one label is allowed but must be on the same line. # @@ -134,6 +134,11 @@ sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh windows-all # jdk_jmx +# 8030957 +com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all +com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all +javax/management/MBeanServer/OldMBeanServerTest.java aix-all + ############################################################################ # jdk_math diff --git a/test/com/sun/corba/5036554/TestCorbaBug.sh b/test/com/sun/corba/5036554/TestCorbaBug.sh index 983608cb5609868d4eee9923564e907186c69378..7e057e72c387d9eb270ccc2797cd7f8c13a9425b 100644 --- a/test/com/sun/corba/5036554/TestCorbaBug.sh +++ b/test/com/sun/corba/5036554/TestCorbaBug.sh @@ -48,7 +48,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/com/sun/corba/cachedSocket/7056731.sh b/test/com/sun/corba/cachedSocket/7056731.sh index 5244b9a70a53347cdf66c79d361cf8552a784fcc..3b58ad6e632e2fbfc677827320b1cc4d4930e0ec 100644 --- a/test/com/sun/corba/cachedSocket/7056731.sh +++ b/test/com/sun/corba/cachedSocket/7056731.sh @@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java b/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java index e616daadde4c586b7a7b1688de9576dec115e19a..35e55f091743fb38f19eb1e356499138e2123eca 100644 --- a/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java +++ b/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java @@ -25,7 +25,7 @@ * @bug 8016551 * @summary JMenuItem in WindowsLookAndFeel can't paint default icons * @author Leonid Romanov - * @run main bug8016551 + * @run main/othervm bug8016551 */ import javax.swing.*; diff --git a/test/com/sun/jdi/ImmutableResourceTest.sh b/test/com/sun/jdi/ImmutableResourceTest.sh index fa312adad747425fe24a8b0d03c88e0f032ab431..29c72ed6254f19e4388a5ac8c005781badcc375b 100644 --- a/test/com/sun/jdi/ImmutableResourceTest.sh +++ b/test/com/sun/jdi/ImmutableResourceTest.sh @@ -56,7 +56,7 @@ pass() OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PATHSEP=":" ;; diff --git a/test/com/sun/jdi/JITDebug.sh b/test/com/sun/jdi/JITDebug.sh index 0ec359799a688ca99bf882eb5c9f616a55cc4802..c647e1153b5e47d79e5ae45580870c2c44cb4265 100644 --- a/test/com/sun/jdi/JITDebug.sh +++ b/test/com/sun/jdi/JITDebug.sh @@ -63,7 +63,7 @@ pass() OS=`uname -s` export TRANSPORT_METHOD case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PATHSEP=":" TRANSPORT_METHOD=dt_socket ;; diff --git a/test/com/sun/jdi/PrivateTransportTest.sh b/test/com/sun/jdi/PrivateTransportTest.sh index 32677db795b73c2cf0c3a920917625ac8146365f..ee8051f46ee9e0dd823338bcd1c1384d5c31c73f 100644 --- a/test/com/sun/jdi/PrivateTransportTest.sh +++ b/test/com/sun/jdi/PrivateTransportTest.sh @@ -102,7 +102,7 @@ libdir=${TESTCLASSES} is_windows=false is_cygwin=false case `uname -s` in - SunOS|Linux) + SunOS|Linux|AIX) xx=`find ${jreloc}/lib -name libdt_socket.so` libloc=`dirname ${xx}` ;; @@ -161,13 +161,23 @@ elif [ -f ${libloc}/libdt_socket.so ] ; then echo cp ${libloc}/libdt_socket.so ${fullpath} cp ${libloc}/libdt_socket.so ${fullpath} # make sure we can find libraries in current directory - if [ "${LD_LIBRARY_PATH}" = "" ] ; then - LD_LIBRARY_PATH=${libdir} + if [ "$os" = "AIX" ] ; then + if [ "${LIBPATH}" = "" ] ; then + LIBPATH=${libdir} + else + LIBPATH=${LIBPATH}:${libdir} + fi + export LIBPATH + echo LIBPATH=${LIBPATH} else - LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${libdir} + if [ "${LD_LIBRARY_PATH}" = "" ] ; then + LD_LIBRARY_PATH=${libdir} + else + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${libdir} + fi + export LD_LIBRARY_PATH + echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} fi - export LD_LIBRARY_PATH - echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} else echo "cannot find dt_socket in ${libloc} for ${private_transport}" fail "cannot find dt_socket in ${libloc} for ${private_transport}" diff --git a/test/com/sun/jdi/ShellScaffold.sh b/test/com/sun/jdi/ShellScaffold.sh index 6ed55c1ae911604e38e5862593aea7909551d2f0..7bc063d44ebebf031edf3adf967b989f36644d7f 100644 --- a/test/com/sun/jdi/ShellScaffold.sh +++ b/test/com/sun/jdi/ShellScaffold.sh @@ -199,6 +199,8 @@ findPid() if [ "$osname" = SunOS ] ; then # Solaris and OpenSolaris use pgrep and not ps in psCmd findPidCmd="$psCmd" + elif [ "$osname" = AIX ] ; then + findPidCmd="$psCmd" else # Never use plain 'ps', which requires a "controlling terminal" # and will fail with a "ps: no controlling terminal" error. @@ -293,7 +295,7 @@ EOF psCmd=ps jstack=jstack.exe ;; - SunOS | Linux | Darwin) + SunOS | Linux | Darwin | AIX) transport=dt_socket address= devnull=/dev/null diff --git a/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh b/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh index 6222c80bd14889841e8302ff4128649fa7f85992..2b104822b17930bc7d95f7aa8f5c0c1f03d97c23 100644 --- a/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh +++ b/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh @@ -45,7 +45,7 @@ fi OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" ;; Windows* | CYGWIN*) diff --git a/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh b/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh index 148041c2825b7a28b35b1a6fce5149668feb6ba2..f772c25245f3c9c24746c4e7753f597093aef3df 100644 --- a/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh +++ b/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh @@ -102,6 +102,14 @@ case "$OS" in TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}` ;; + AIX ) + VAR="A different value for AIX" + DEFAULT_JDK=/ + FILESEP="/" + PATHSEP=":" + TMP="/tmp" + ;; + # catch all other OSs * ) echo "Unrecognized system! $OS" diff --git a/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh index 1b469dcb63c5b2f0c420544517be825dc9915c2a..290029e95a080b2b564bd0532ba37f6a873c2d7b 100644 --- a/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh +++ b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh @@ -135,6 +135,14 @@ case "$OS" in TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}` ;; + AIX ) + VAR="A different value for AIX" + DEFAULT_JDK=/ + FILESEP="/" + PATHSEP=":" + TMP="/tmp" + ;; + # catch all other OSs * ) echo "Unrecognized system! $OS" diff --git a/test/java/io/Serializable/evolution/RenamePackage/run.sh b/test/java/io/Serializable/evolution/RenamePackage/run.sh index 9ebadbc7e260ff1afb3719097003670210ada3f3..eb9f210083fb1e30a0e7692af6256278ce433569 100644 --- a/test/java/io/Serializable/evolution/RenamePackage/run.sh +++ b/test/java/io/Serializable/evolution/RenamePackage/run.sh @@ -45,7 +45,7 @@ OS=`uname -s` # Need to determine the classpath separator and filepath separator based on the # operating system. case "$OS" in -SunOS | Linux | Darwin ) +SunOS | Linux | Darwin | AIX ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; diff --git a/test/java/io/Serializable/serialver/classpath/run.sh b/test/java/io/Serializable/serialver/classpath/run.sh index 8c6b9f3d0be3f53bcf0f7584e7f290b9aa63b3f0..2aa1b0e92eaaaf24695d11fa8c35a95fc39c76d8 100644 --- a/test/java/io/Serializable/serialver/classpath/run.sh +++ b/test/java/io/Serializable/serialver/classpath/run.sh @@ -47,7 +47,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; diff --git a/test/java/io/Serializable/serialver/nested/run.sh b/test/java/io/Serializable/serialver/nested/run.sh index 765d2d41c413c86b5cd5ea2a78a177bc36b156eb..578e74afc51ea1b5a07699ba21c03a896d60cb35 100644 --- a/test/java/io/Serializable/serialver/nested/run.sh +++ b/test/java/io/Serializable/serialver/nested/run.sh @@ -47,7 +47,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; diff --git a/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh b/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh index e420de5a918fc5de7cb324e36fab91f59b2ee1e8..a70e6019eaaf92a836881dec55d1b1d97767d163 100644 --- a/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh +++ b/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh @@ -58,6 +58,9 @@ case "$OS" in Darwin ) FS="/" ;; + AIX ) + FS="/" + ;; Windows*) FS="\\" ;; diff --git a/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh b/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh index c61ac2e513c3ff1e210aece409985ae0daa2774c..678b98e5be01f46feaa6b26b997c0ccc75d497dc 100644 --- a/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh +++ b/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh @@ -63,6 +63,9 @@ case "$OS" in Darwin ) FS="/" ;; + AIX ) + FS="/" + ;; Windows* | CYGWIN* ) FS="\\" ;; diff --git a/test/java/lang/ProcessBuilder/Basic.java b/test/java/lang/ProcessBuilder/Basic.java index ff4c37443210adafcc4df5968d92f9bebda538d4..3aa96a903c22f90b5aaf56323b29b2a7492f969c 100644 --- a/test/java/lang/ProcessBuilder/Basic.java +++ b/test/java/lang/ProcessBuilder/Basic.java @@ -58,6 +58,9 @@ public class Basic { /* used for Mac OS X only */ static final String cfUserTextEncoding = System.getenv("__CF_USER_TEXT_ENCODING"); + /* used for AIX only */ + static final String libpath = System.getenv("LIBPATH"); + private static String commandOutput(Reader r) throws Throwable { StringBuilder sb = new StringBuilder(); int c; @@ -75,7 +78,11 @@ public class Basic { String output = commandOutput(r); equal(p.waitFor(), 0); equal(p.exitValue(), 0); - return output; + // The debug/fastdebug versions of the VM may write some warnings to stdout + // (i.e. "Warning: Cannot open log file: hotspot.log" if the VM is started + // in a directory without write permissions). These warnings will confuse tests + // which match the entire output of the child process so better filter them out. + return output.replaceAll("Warning:.*\\n", ""); } private static String commandOutput(ProcessBuilder pb) { @@ -585,6 +592,12 @@ public class Basic { System.getProperty("os.name").startsWith("Windows"); } + static class AIX { + public static boolean is() { return is; } + private static final boolean is = + System.getProperty("os.name").equals("AIX"); + } + static class Unix { public static boolean is() { return is; } private static final boolean is = @@ -638,7 +651,7 @@ public class Basic { private static boolean isEnglish(String envvar) { String val = getenv(envvar); - return (val == null) || val.matches("en.*"); + return (val == null) || val.matches("en.*") || val.matches("C"); } /** Returns true if we can expect English OS error strings */ @@ -713,6 +726,14 @@ public class Basic { return cleanedVars.replace(javaMainClassStr,""); } + /* Only used for AIX -- + * AIX adds the variable AIXTHREAD_GUARDPAGES=0 to the environment. + * Remove it from the list of env variables + */ + private static String removeAixExpectedVars(String vars) { + return vars.replace("AIXTHREAD_GUARDPAGES=0,",""); + } + private static String sortByLinesWindowsly(String text) { String[] lines = text.split("\n"); Arrays.sort(lines, new WindowsComparator()); @@ -1161,13 +1182,20 @@ public class Basic { ProcessBuilder pb = new ProcessBuilder(); pb.environment().clear(); String expected = Windows.is() ? "SystemRoot="+systemRoot+",": ""; + expected = AIX.is() ? "LIBPATH="+libpath+",": expected; if (Windows.is()) { pb.environment().put("SystemRoot", systemRoot); } + if (AIX.is()) { + pb.environment().put("LIBPATH", libpath); + } String result = getenvInChild(pb); if (MacOSX.is()) { result = removeMacExpectedVars(result); } + if (AIX.is()) { + result = removeAixExpectedVars(result); + } equal(result, expected); } catch (Throwable t) { unexpected(t); } @@ -1682,10 +1710,14 @@ public class Basic { } Process p = Runtime.getRuntime().exec(cmdp, envp); String expected = Windows.is() ? "=C:=\\,=ExitValue=3,SystemRoot="+systemRoot+"," : "=C:=\\,"; + expected = AIX.is() ? expected + "LIBPATH="+libpath+",": expected; String commandOutput = commandOutput(p); if (MacOSX.is()) { commandOutput = removeMacExpectedVars(commandOutput); } + if (AIX.is()) { + commandOutput = removeAixExpectedVars(commandOutput); + } equal(commandOutput, expected); if (Windows.is()) { ProcessBuilder pb = new ProcessBuilder(childArgs); @@ -1737,9 +1769,14 @@ public class Basic { if (MacOSX.is()) { commandOutput = removeMacExpectedVars(commandOutput); } + if (AIX.is()) { + commandOutput = removeAixExpectedVars(commandOutput); + } check(commandOutput.equals(Windows.is() ? "LC_ALL=C,SystemRoot="+systemRoot+"," - : "LC_ALL=C,"), + : AIX.is() + ? "LC_ALL=C,LIBPATH="+libpath+"," + : "LC_ALL=C,"), "Incorrect handling of envstrings containing NULs"); } catch (Throwable t) { unexpected(t); } @@ -2016,8 +2053,13 @@ public class Basic { if (Unix.is() && new File("/bin/bash").exists() && new File("/bin/sleep").exists()) { - final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 6666)" }; - final String[] cmdkill = { "/bin/bash", "-c", "(/usr/bin/pkill -f \"sleep 6666\")" }; + // Notice that we only destroy the process created by us (i.e. + // our child) but not our grandchild (i.e. '/bin/sleep'). So + // pay attention that the grandchild doesn't run too long to + // avoid polluting the process space with useless processes. + // Running the grandchild for 60s should be more than enough. + final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 60)" }; + final String[] cmdkill = { "/bin/bash", "-c", "(/usr/bin/pkill -f \"sleep 60\")" }; final ProcessBuilder pb = new ProcessBuilder(cmd); final Process p = pb.start(); final InputStream stdout = p.getInputStream(); @@ -2039,13 +2081,27 @@ public class Basic { reader.start(); Thread.sleep(100); p.destroy(); - // Subprocess is now dead, but file descriptors remain open. check(p.waitFor() != 0); check(p.exitValue() != 0); + // Subprocess is now dead, but file descriptors remain open. + // Make sure the test will fail if we don't manage to close + // the open streams within 30 seconds. Notice that this time + // must be shorter than the sleep time of the grandchild. + Timer t = new Timer("test/java/lang/ProcessBuilder/Basic.java process reaper", true); + t.schedule(new TimerTask() { + public void run() { + fail("Subprocesses which create subprocesses of " + + "their own caused the parent to hang while " + + "waiting for file descriptors to be closed."); + System.exit(-1); + } + }, 30000); stdout.close(); stderr.close(); stdin.close(); new ProcessBuilder(cmdkill).start(); + // All streams successfully closed so we can cancel the timer. + t.cancel(); //---------------------------------------------------------- // There remain unsolved issues with asynchronous close. // Here's a highly non-portable experiment to demonstrate: @@ -2191,8 +2247,9 @@ public class Basic { } long end = System.nanoTime(); // give waitFor(timeout) a wide berth (100ms) - if ((end - start) > 100000000) - fail("Test failed: waitFor took too long"); + // Old AIX machines my need a little longer. + if ((end - start) > 100000000L * (AIX.is() ? 4 : 1)) + fail("Test failed: waitFor took too long (" + (end - start) + "ns)"); p.destroy(); p.waitFor(); @@ -2219,7 +2276,7 @@ public class Basic { long end = System.nanoTime(); if ((end - start) < 500000000) - fail("Test failed: waitFor didn't take long enough"); + fail("Test failed: waitFor didn't take long enough (" + (end - start) + "ns)"); p.destroy(); @@ -2227,7 +2284,7 @@ public class Basic { p.waitFor(1000, TimeUnit.MILLISECONDS); end = System.nanoTime(); if ((end - start) > 900000000) - fail("Test failed: waitFor took too long on a dead process."); + fail("Test failed: waitFor took too long on a dead process. (" + (end - start) + "ns)"); } catch (Throwable t) { unexpected(t); } //---------------------------------------------------------------- diff --git a/test/java/lang/ProcessBuilder/DestroyTest.java b/test/java/lang/ProcessBuilder/DestroyTest.java index ebf00e32b793c4b6c868a0d97bc3ba6532ce0d91..401bd146c28f2a98ede11b87cef0b547f0ccee2f 100644 --- a/test/java/lang/ProcessBuilder/DestroyTest.java +++ b/test/java/lang/ProcessBuilder/DestroyTest.java @@ -154,6 +154,9 @@ public class DestroyTest { } else if (osName.equals("SunOS")) { return new UnixTest( File.createTempFile("ProcessTrap-", ".sh",null)); + } else if (osName.equals("AIX")) { + return new UnixTest( + File.createTempFile("ProcessTrap-", ".sh",null)); } return null; } diff --git a/test/java/lang/StringCoding/CheckEncodings.sh b/test/java/lang/StringCoding/CheckEncodings.sh index edc5f9a4e4988650903bf4b97135a9b8b50189bc..2936d9cae654414c208448bba121527449a893ae 100644 --- a/test/java/lang/StringCoding/CheckEncodings.sh +++ b/test/java/lang/StringCoding/CheckEncodings.sh @@ -30,7 +30,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin) ;; + SunOS | Linux | Darwin | AIX ) ;; Windows* | CYGWIN* ) echo "Passed"; exit 0 ;; * ) echo "Unrecognized system!" ; exit 1 ;; diff --git a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh index e62a63cd8a56bbd1bec49a68237b34c040c5d3d6..915aa9558ffd1e0752efadba0dae8afebc813489 100644 --- a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh +++ b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh @@ -48,7 +48,7 @@ echo "CLASSPATH=${CLASSPATH}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh b/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh index 3455959c3aa26f711dcb9892492f43442ed2dae9..c47f59de8341cd2345e8e76929a6dba2de10a822 100644 --- a/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh +++ b/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh @@ -47,6 +47,10 @@ case "$OS" in PS=":" FS="/" ;; + AIX ) + PS=":" + FS="/" + ;; Windows*) PS=";" OS="Windows" diff --git a/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh b/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh index 571a3d931a38d6d14a374cab767f4b39fc22f409..1ef2f35c8e9ad7f7873ce27d4df5c025498674e5 100644 --- a/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh +++ b/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh @@ -61,7 +61,7 @@ i=1 while true; do echo "Run $i: TestSystemLoadAvg" case `uname -s` in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) runOne GetSystemLoadAverage ;; * ) diff --git a/test/java/net/Authenticator/B4933582.sh b/test/java/net/Authenticator/B4933582.sh index 411c0739b9a14b567865e9ece31982964f463e70..c696f411f3790b13c343e10b65c0d9523e1190b0 100644 --- a/test/java/net/Authenticator/B4933582.sh +++ b/test/java/net/Authenticator/B4933582.sh @@ -26,7 +26,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/net/DatagramSocket/Send12k.java b/test/java/net/DatagramSocket/Send12k.java index 6446330d35eca3c3e48a804a93f4ed91fb753d7c..f6375c1f0b7910513b5ba43e28196ab3a0ba1a39 100644 --- a/test/java/net/DatagramSocket/Send12k.java +++ b/test/java/net/DatagramSocket/Send12k.java @@ -53,7 +53,7 @@ public class Send12k { boolean sendOkay = true; try { s1.send(p1); - } catch (SocketException e) { + } catch (IOException e) { /* * Prior to merlin a send of > 12k to loopback address * would fail silently. diff --git a/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh b/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh index 271b21d26f33915a2a59568b2b2ae18a1c88b93a..eac0315e7e364bd339beada4f8f033fd782be881 100644 --- a/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh +++ b/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh @@ -27,7 +27,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Darwin ) + SunOS | Darwin | AIX ) PATHSEP=":" FILESEP="/" ;; diff --git a/test/java/net/Socket/OldSocketImpl.sh b/test/java/net/Socket/OldSocketImpl.sh index bbe055fa2eadc8c603e6787a9d00a304822bdeb4..70b92afc7b6ac785b9e17be6ac557d9a5f689bb1 100644 --- a/test/java/net/Socket/OldSocketImpl.sh +++ b/test/java/net/Socket/OldSocketImpl.sh @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/net/URL/B5086147.sh b/test/java/net/URL/B5086147.sh index a669e1347ee1f9de1fd2111ba8149912501eece3..772d7a32cd14c529c9620250c2aede30579cda36 100644 --- a/test/java/net/URL/B5086147.sh +++ b/test/java/net/URL/B5086147.sh @@ -26,7 +26,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) exit 0 ;; CYGWIN* ) diff --git a/test/java/net/URLClassLoader/B5077773.sh b/test/java/net/URLClassLoader/B5077773.sh index 9bd9a1e6f34a78ffade747e063692916d01afc23..3b52698840a80ef4e9d2545eae493a43314c240a 100644 --- a/test/java/net/URLClassLoader/B5077773.sh +++ b/test/java/net/URLClassLoader/B5077773.sh @@ -34,7 +34,7 @@ OS=`uname -s` case "$OS" in - SunOS | Darwin ) + SunOS | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/net/URLClassLoader/sealing/checksealed.sh b/test/java/net/URLClassLoader/sealing/checksealed.sh index 0d212c62aae8563924dead634797d7df4e192586..339525a1042de26e4a5c52b7e60f8ba5e21af950 100644 --- a/test/java/net/URLClassLoader/sealing/checksealed.sh +++ b/test/java/net/URLClassLoader/sealing/checksealed.sh @@ -27,7 +27,7 @@ OS=`uname -s` case "$OS" in - SunOS | Darwin ) + SunOS | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/net/URLConnection/6212146/test.sh b/test/java/net/URLConnection/6212146/test.sh index 45f5310005ec0d091d62d13a0cda66ed1a1c38bb..9a0615cadf33d194bfd2ed2e739f9595ce6a0b23 100644 --- a/test/java/net/URLConnection/6212146/test.sh +++ b/test/java/net/URLConnection/6212146/test.sh @@ -33,7 +33,7 @@ OS=`uname -s` case "$OS" in - SunOS | Darwin ) + SunOS | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/nio/charset/coders/CheckSJISMappingProp.sh b/test/java/nio/charset/coders/CheckSJISMappingProp.sh index fd76d5a5031d3df6f40ad7c4659c6566f10c3a8d..5c14e7392ecd1c2b2584690ff986b84dff5baded 100644 --- a/test/java/nio/charset/coders/CheckSJISMappingProp.sh +++ b/test/java/nio/charset/coders/CheckSJISMappingProp.sh @@ -34,7 +34,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) ;; + SunOS | Linux | Darwin | AIX ) ;; # Skip locale test for Windows Windows* | CYGWIN* ) echo "Passed"; exit 0 ;; diff --git a/test/java/nio/charset/spi/basic.sh b/test/java/nio/charset/spi/basic.sh index 6b5ad3108ac890ede9bb31caa2032075d75595f7..6bc60d140e778ad43584d136bcdcef3fb508dbde 100644 --- a/test/java/nio/charset/spi/basic.sh +++ b/test/java/nio/charset/spi/basic.sh @@ -48,7 +48,7 @@ JAR=$COMPILEJAVA/bin/jar DIR=`pwd` case `uname` in - SunOS | Linux | Darwin ) CPS=':' ;; + SunOS | Linux | Darwin | AIX ) CPS=':' ;; Windows* ) CPS=';' ;; CYGWIN* ) DIR=`/usr/bin/cygpath -a -s -m $DIR` @@ -81,7 +81,7 @@ if [ $# -gt 0 ]; then L="$1" shift s=`uname -s` - if [ $s != Linux -a $s != SunOS -a $s != Darwin ]; then + if [ $s != Linux -a $s != SunOS -a $s != Darwin -a $s != AIX ]; then echo "$L: Locales not supported on this system, skipping..." exit 0 fi diff --git a/test/java/nio/file/Files/SBC.java b/test/java/nio/file/Files/SBC.java index ab467266edfe25d2c23bc05c7b1d3e4499822bff..d26428d5f60731f123500d8e785518062284edae 100644 --- a/test/java/nio/file/Files/SBC.java +++ b/test/java/nio/file/Files/SBC.java @@ -235,7 +235,7 @@ public class SBC { try { Files.newByteChannel(link, READ, LinkOption.NOFOLLOW_LINKS); throw new RuntimeException(); - } catch (IOException x) { + } catch (IOException | UnsupportedOperationException x) { } finally { TestUtil.deleteUnchecked(link); } diff --git a/test/java/nio/file/Files/walkFileTree/find.sh b/test/java/nio/file/Files/walkFileTree/find.sh index 41ebf663669a47a175ed622c69446e930c300479..1bf7621226b1c3658b5695d0344e6185b8bf2d22 100644 --- a/test/java/nio/file/Files/walkFileTree/find.sh +++ b/test/java/nio/file/Files/walkFileTree/find.sh @@ -43,7 +43,14 @@ case "$OS" in echo "This test does not run on Windows" exit 0 ;; + AIX ) + CLASSPATH=${TESTCLASSES}:${TESTSRC} + # On AIX "find -follow" may core dump on recursive links without '-L' + # see: http://www-01.ibm.com/support/docview.wss?uid=isg1IV28143 + FIND_FOLLOW_OPT="-L" + ;; * ) + FIND_FOLLOW_OPT= CLASSPATH=${TESTCLASSES}:${TESTSRC} ;; esac @@ -65,7 +72,7 @@ if [ $? != 0 ]; then failures=`expr $failures + 1`; fi # cycles (sym links to ancestor directories), other versions do # not. For that reason we run PrintFileTree with the -printCycles # option when the output without this option differs to find(1). -find "$ROOT" -follow > out1 +find $FIND_FOLLOW_OPT "$ROOT" -follow > out1 $JAVA ${TESTVMOPTS} PrintFileTree -follow "$ROOT" > out2 diff out1 out2 if [ $? != 0 ]; diff --git a/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh b/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh index 37e3caa9efca68b13ff22a65337914f356d0c2b2..3b6143f261629d808e0999eeb9bec5a82cfa8462 100644 --- a/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh +++ b/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh @@ -33,7 +33,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" ;; Windows* | CYGWIN* ) diff --git a/test/java/rmi/registry/readTest/readTest.sh b/test/java/rmi/registry/readTest/readTest.sh index 586460fd158ed15707307198d243b631d2cbe3fc..443253f7263574c9be2c4e90e68ba116916d8477 100644 --- a/test/java/rmi/registry/readTest/readTest.sh +++ b/test/java/rmi/registry/readTest/readTest.sh @@ -34,7 +34,7 @@ ARGS="" REGARGS="" case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" CHMOD="${FS}bin${FS}chmod" diff --git a/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh b/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh index 5f8fed4c014b1babead96be1501ef81c8c2b341b..0dc65cf709269d4ae7c1dac1f8bad58d73104bad 100644 --- a/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh +++ b/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh @@ -62,6 +62,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh b/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh index e1ed14425fa5c4c0e6008cfa935e5f1551b1317f..f2002448566feaf80f7dfafb21bbb897fe979ea3 100644 --- a/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh +++ b/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh @@ -46,6 +46,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh index e817db37898db9ae9c576af3d579849b240e218a..2951a28e54953c0445ab5267a5e248828b736d7a 100644 --- a/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh +++ b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh @@ -70,6 +70,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; Windows* ) PATHSEP=";" FILESEP="\\" diff --git a/test/java/security/Security/signedfirst/Dyn.sh b/test/java/security/Security/signedfirst/Dyn.sh index e8bf17bc95a8e5df6ab9be982936f0522bd38110..d6aa6a05cfa46670ebdd6270bf4fba7af00f5bfe 100644 --- a/test/java/security/Security/signedfirst/Dyn.sh +++ b/test/java/security/Security/signedfirst/Dyn.sh @@ -62,6 +62,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/java/security/Security/signedfirst/Static.sh b/test/java/security/Security/signedfirst/Static.sh index d7bc80254053dd5ca548efdbdd9e8bc8f1d86382..19c81def4c4a66e72117e702ada94ccc0c280cee 100644 --- a/test/java/security/Security/signedfirst/Static.sh +++ b/test/java/security/Security/signedfirst/Static.sh @@ -62,6 +62,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/java/util/Currency/PropertiesTest.sh b/test/java/util/Currency/PropertiesTest.sh index 65ab89da2e0ef44cd1540ae2ec49c1256c49d05f..01f1326cd2d474ab0a6ebc9c095865b684aab28b 100644 --- a/test/java/util/Currency/PropertiesTest.sh +++ b/test/java/util/Currency/PropertiesTest.sh @@ -52,7 +52,7 @@ echo "CLASSPATH=${CLASSPATH}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/util/Locale/LocaleCategory.sh b/test/java/util/Locale/LocaleCategory.sh index 7715d3542258009f7866fab0b2fa50e1f78389ef..989556a2477e1affb60f76768558b3222aaff124 100644 --- a/test/java/util/Locale/LocaleCategory.sh +++ b/test/java/util/Locale/LocaleCategory.sh @@ -52,7 +52,7 @@ echo "CLASSPATH=${CLASSPATH}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | *BSD | Darwin ) + SunOS | Linux | *BSD | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/util/Locale/LocaleProviders.sh b/test/java/util/Locale/LocaleProviders.sh index db6e4a92d62fbd851ca1eebd5d2bbac45c9882e6..58cd9c82060dfeb78879f4c9adb0ac3ec968fe1e 100644 --- a/test/java/util/Locale/LocaleProviders.sh +++ b/test/java/util/Locale/LocaleProviders.sh @@ -56,7 +56,7 @@ echo "CLASSPATH=${CLASSPATH}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | *BSD | Darwin ) + SunOS | Linux | *BSD | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/util/PluggableLocale/ExecTest.sh b/test/java/util/PluggableLocale/ExecTest.sh index 3aa001c86ca197893d225f84ef7ee085cef98dd8..a30d70312d26d96b22c88d9ca3f1d2c5dd33cbde 100644 --- a/test/java/util/PluggableLocale/ExecTest.sh +++ b/test/java/util/PluggableLocale/ExecTest.sh @@ -62,7 +62,7 @@ echo "CLASSPATH=${CLASSPATH}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/java/util/ResourceBundle/Bug6299235Test.sh b/test/java/util/ResourceBundle/Bug6299235Test.sh index 19ead247b3f6f9170aabe822c63e66f38c23da68..7d1d256a0e6610e83a1d144a79c151f8e78f4e07 100644 --- a/test/java/util/ResourceBundle/Bug6299235Test.sh +++ b/test/java/util/ResourceBundle/Bug6299235Test.sh @@ -31,7 +31,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PATHSEP=":" FILESEP="/" ;; diff --git a/test/java/util/ServiceLoader/basic.sh b/test/java/util/ServiceLoader/basic.sh index f71df6ccd190c14695f9a2057b7968a236efe006..697b2b0b2d32be9e465ea24bf658c7ed87f2aa4d 100644 --- a/test/java/util/ServiceLoader/basic.sh +++ b/test/java/util/ServiceLoader/basic.sh @@ -43,7 +43,7 @@ JAR="$COMPILEJAVA/bin/jar" OS=`uname -s` case "$OS" in - SunOS | Darwin ) + SunOS | Darwin | AIX ) SEP=':' ;; Linux ) SEP=':' ;; diff --git a/test/java/util/logging/AnonLoggerWeakRefLeak.sh b/test/java/util/logging/AnonLoggerWeakRefLeak.sh index eef8641c7b665ec554f0d31ba948427b9a8e118e..fc1aece9ebdcd55b2b6deb54018d1d25f6ece93a 100644 --- a/test/java/util/logging/AnonLoggerWeakRefLeak.sh +++ b/test/java/util/logging/AnonLoggerWeakRefLeak.sh @@ -83,9 +83,9 @@ if [ "$status" != 0 ]; then fi if [ "$status" != 0 ]; then - echo "ERROR: 'jmap $jmap_option' is not supported so this test" - echo "ERROR: cannot work reliably. Aborting!" - exit 2 + echo "WARNING: 'jmap $jmap_option' is not supported on this platform" + echo "WARNING: so this test cannot work reliably. Aborting!" + exit 0 fi fi diff --git a/test/java/util/logging/LoggerWeakRefLeak.sh b/test/java/util/logging/LoggerWeakRefLeak.sh index ea3dc1f8f1dd993d65bdc6912ccfa5f7bf0df5ac..25cc4aabc743aee7a615f8e0ed688e369152733a 100644 --- a/test/java/util/logging/LoggerWeakRefLeak.sh +++ b/test/java/util/logging/LoggerWeakRefLeak.sh @@ -83,9 +83,9 @@ if [ "$status" != 0 ]; then fi if [ "$status" != 0 ]; then - echo "ERROR: 'jmap $jmap_option' is not supported so this test" - echo "ERROR: cannot work reliably. Aborting!" - exit 2 + echo "WARNING: 'jmap $jmap_option' is not supported on this platform" + echo "WARNING: so this test cannot work reliably. Aborting!" + exit 0 fi fi diff --git a/test/java/util/prefs/CheckUserPrefsStorage.sh b/test/java/util/prefs/CheckUserPrefsStorage.sh index 28210696b3935d8ffdf69975e8e8f784841fc31a..bfb4a2a54c75267b8ffefbf6c6614d9d5daafd37 100644 --- a/test/java/util/prefs/CheckUserPrefsStorage.sh +++ b/test/java/util/prefs/CheckUserPrefsStorage.sh @@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/javax/crypto/SecretKeyFactory/FailOverTest.sh b/test/javax/crypto/SecretKeyFactory/FailOverTest.sh index 7a3c108b5a47079fc36615fc9e54df033f31ba46..6beb911b124bb9d45205d4ac8cfd8454e07b962c 100644 --- a/test/javax/crypto/SecretKeyFactory/FailOverTest.sh +++ b/test/javax/crypto/SecretKeyFactory/FailOverTest.sh @@ -56,7 +56,7 @@ echo "TESTCLASSES=${TESTCLASSES}" # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatTest.sh b/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatTest.sh index 84a58535cf115c00ba88b5162f424c08a9046620..800a898eb1acde27b9c3fd629f1c9727f91b0fb2 100644 --- a/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatTest.sh +++ b/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatTest.sh @@ -89,7 +89,7 @@ case "$OS" in FILESEP="/" ;; - Linux | Darwin ) + Linux | Darwin | AIX ) VAR="A different value for Linux" DEFAULT_JDK=/none #DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386 diff --git a/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh b/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh index ed36fef3f17cdc4cf4592c19f0d2b0a641a17feb..eb60ba992821e81afe94f2a91ace4a64d8943fe4 100644 --- a/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh +++ b/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh @@ -90,7 +90,7 @@ case "$OS" in FILESEP="/" ;; - Linux | Darwin ) + Linux | Darwin | AIX ) VAR="A different value for Linux" DEFAULT_JDK=/none #DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386 diff --git a/test/javax/imageio/stream/StreamCloserLeak/run_test.sh b/test/javax/imageio/stream/StreamCloserLeak/run_test.sh index 18ffc1c8d40245bd7c577a27cc9dba97345837e4..1977ca80275a2a5c593e6643175fba20880cc69a 100644 --- a/test/javax/imageio/stream/StreamCloserLeak/run_test.sh +++ b/test/javax/imageio/stream/StreamCloserLeak/run_test.sh @@ -92,6 +92,14 @@ case "$OS" in TMP="/tmp" ;; + AIX ) + VAR="A different value for AIX" + DEFAULT_JDK=/ + FILESEP="/" + PATHSEP=":" + TMP="/tmp" + ;; + Darwin ) VAR="A different value for MacOSX" DEFAULT_JDK=/usr diff --git a/test/javax/script/CommonSetup.sh b/test/javax/script/CommonSetup.sh index 69ed2379edaca7fff0048c2c0f9dd1e8b3fab939..7a64bd8c6611a11c6619c25fbeb4f46d9d93ebb6 100644 --- a/test/javax/script/CommonSetup.sh +++ b/test/javax/script/CommonSetup.sh @@ -36,7 +36,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/javax/security/auth/Subject/doAs/Test.sh b/test/javax/security/auth/Subject/doAs/Test.sh index 73565211859ea2405370754e0abdde74114ffd17..fac17d138c59549cf56d71df9d70ffe80b25d876 100644 --- a/test/javax/security/auth/Subject/doAs/Test.sh +++ b/test/javax/security/auth/Subject/doAs/Test.sh @@ -48,6 +48,11 @@ case "$OS" in FS="/" RM="/bin/rm -f" ;; + AIX ) + PS=":" + FS="/" + RM="/bin/rm -f" + ;; CYGWIN* ) PS=";" FS="/" diff --git a/test/lib/security/java.policy/Ext_AllPolicy.sh b/test/lib/security/java.policy/Ext_AllPolicy.sh index 7a5bf81092123341f540bbc4d150e332500d2a24..b3bd5d6cb0ffd3c36f4105d6e2c6c583548ccacf 100644 --- a/test/lib/security/java.policy/Ext_AllPolicy.sh +++ b/test/lib/security/java.policy/Ext_AllPolicy.sh @@ -53,7 +53,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh b/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh index 570631dc11e5ddb6e1165007de2ebebf5cf91623..aab8bbd9e88a17f06594b584ef3eb448229a852d 100644 --- a/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh +++ b/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh @@ -42,7 +42,7 @@ if [[ $OS == CYGWIN_NT* ]] ; then fi case $OS in -SunOS | Linux | Darwin) +SunOS | Linux | Darwin | AIX ) PATHSEP=":" FILESEP="/" DFILESEP=$FILESEP diff --git a/test/sun/net/ftp/MarkResetTest.sh b/test/sun/net/ftp/MarkResetTest.sh index 4a96bb27dde5ebaa0a5b03f1bedc19364a3ba010..b673e5d4d6889e26f26070eda7ccba8180a3197f 100644 --- a/test/sun/net/ftp/MarkResetTest.sh +++ b/test/sun/net/ftp/MarkResetTest.sh @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/net/www/http/HttpClient/RetryPost.sh b/test/sun/net/www/http/HttpClient/RetryPost.sh index 7d19a2b1dd3253caefc3978b9cc5d238d4138be4..218c1d4b717092775e2249905d8294b086ea0535 100644 --- a/test/sun/net/www/http/HttpClient/RetryPost.sh +++ b/test/sun/net/www/http/HttpClient/RetryPost.sh @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/net/www/protocol/jar/B5105410.sh b/test/sun/net/www/protocol/jar/B5105410.sh index f47ca5ed99de5a301eda21403ccd2993b506b1ef..aa31a53ebc2d0110631cd67f3db65e66bd9f9ed9 100644 --- a/test/sun/net/www/protocol/jar/B5105410.sh +++ b/test/sun/net/www/protocol/jar/B5105410.sh @@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/net/www/protocol/jar/jarbug/run.sh b/test/sun/net/www/protocol/jar/jarbug/run.sh index 07b832e43977e5d603b38a619a8dd1642a0506e5..32de6ee0f78e703a704143d269387a849b8551c9 100644 --- a/test/sun/net/www/protocol/jar/jarbug/run.sh +++ b/test/sun/net/www/protocol/jar/jarbug/run.sh @@ -31,7 +31,7 @@ DEST=`pwd` OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" CHMOD="${FS}bin${FS}chmod" diff --git a/test/sun/rmi/rmic/newrmic/equivalence/batch.sh b/test/sun/rmi/rmic/newrmic/equivalence/batch.sh index 020202a181876b18ead4d00891dd3fa916d84a64..25913c63ea0768928cf0a083df6892af4e0c292d 100644 --- a/test/sun/rmi/rmic/newrmic/equivalence/batch.sh +++ b/test/sun/rmi/rmic/newrmic/equivalence/batch.sh @@ -61,13 +61,13 @@ mkdir $newv11dir $newvcompatdir $newv12dir set -ex -${TESTJAVA}/bin/rmic -keep -nowrite -v1.1 -d $refv11dir -classpath "$@" -${TESTJAVA}/bin/rmic -keep -nowrite -vcompat -d $refvcompatdir -classpath "$@" -${TESTJAVA}/bin/rmic -keep -v1.2 -d $refv12dir -classpath "$@" +${TESTJAVA}/bin/rmic -keep -nowrite -v1.1 -d $refv11dir -classpath "$@" +${TESTJAVA}/bin/rmic -keep -nowrite -vcompat -d $refvcompatdir -classpath "$@" +${TESTJAVA}/bin/rmic -keep -nowrite -v1.2 -d $refv12dir -classpath "$@" -${TESTJAVA}/bin/rmic -Xnew -nowrite -keep -v1.1 -d $newv11dir -classpath "$@" -${TESTJAVA}/bin/rmic -Xnew -nowrite -keep -vcompat -d $newvcompatdir -classpath "$@" -${TESTJAVA}/bin/rmic -Xnew -keep -v1.2 -d $newv12dir -classpath "$@" +${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.1 -d $newv11dir -classpath "$@" +${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -vcompat -d $newvcompatdir -classpath "$@" +${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.2 -d $newv12dir -classpath "$@" set +ex diff --git a/test/sun/security/krb5/runNameEquals.sh b/test/sun/security/krb5/runNameEquals.sh index 8804de0a82d9e508cc58deaa16f3d5cba2f8d7bd..7710007844a0f268ccec709b0e15f99f68c6be70 100644 --- a/test/sun/security/krb5/runNameEquals.sh +++ b/test/sun/security/krb5/runNameEquals.sh @@ -66,6 +66,10 @@ case "$OS" in fi fi ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh b/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh index 30b245c81a05d9b579129ebe71c1968893e02057..7e93e184354d4cb25f7b9f40e5cee36ecbe6c871 100644 --- a/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh +++ b/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh @@ -72,6 +72,12 @@ case "$OS" in CP="${FS}bin${FS}cp" CHMOD="${FS}bin${FS}chmod" ;; + AIX ) + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; Windows* ) FS="\\" PS=";" diff --git a/test/sun/security/pkcs11/Provider/Login.sh b/test/sun/security/pkcs11/Provider/Login.sh index a1f6b132c9ee4268a039dc0d01bcb52e8b8d3891..35f9ed562eadbaabd7c4cc43989118590e878ae1 100644 --- a/test/sun/security/pkcs11/Provider/Login.sh +++ b/test/sun/security/pkcs11/Provider/Login.sh @@ -73,6 +73,12 @@ case "$OS" in CP="${FS}bin${FS}cp" CHMOD="${FS}bin${FS}chmod" ;; + AIX ) + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; Windows* ) FS="\\" PS=";" diff --git a/test/sun/security/provider/KeyStore/DKSTest.sh b/test/sun/security/provider/KeyStore/DKSTest.sh index b789e41414011e91f9755f2359c75831fe8f4132..99c7617dfa5e159892f01fca2166565e5815248f 100644 --- a/test/sun/security/provider/KeyStore/DKSTest.sh +++ b/test/sun/security/provider/KeyStore/DKSTest.sh @@ -50,15 +50,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS ) - PS=":" - FS="/" - ;; - Linux ) - PS=":" - FS="/" - ;; - Darwin ) + SunOS | Linux | Darwin | AIX) PS=":" FS="/" ;; diff --git a/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh b/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh index 5775eab80b1db73ce521cd7c7fe0e92a945059f8..e2da96ea2971395f053b44777d0a46fe02c2f171 100644 --- a/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh +++ b/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh @@ -63,6 +63,10 @@ case "$OS" in PS=":" FS="/" ;; + AIX ) + PS=":" + FS="/" + ;; CYGWIN* ) PS=";" FS="/" diff --git a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh index 9b48bee7f3bd9f43db6284d106c46bf8fdc440a4..b0a824fc45e6848913dfae9483a1bd04b8b1a22c 100644 --- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh @@ -33,7 +33,7 @@ OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh index b9f278341933b4ebcce2bf085e8ced074bdf8655..217dedf63ce95a02088cb11b54d631d52d2927b8 100644 --- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh @@ -46,7 +46,7 @@ fi OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) FILESEP="/" PATHSEP=":" ;; diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh index 4cdc5d4d1b7a801182ed00586996ae60bdc87b9b..1b7cf984e8b7eb5f814cd585764ada2054dddbb7 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh @@ -32,7 +32,7 @@ HOSTNAME=`uname -n` OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh index de7b039488c8d8a8656c5bc653196558980d15e1..fd24c76a475c000371ab7426955d28923d947c85 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh @@ -32,7 +32,7 @@ HOSTNAME=`uname -n` OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PS=":" FS="/" ;; diff --git a/test/sun/security/tools/jarsigner/AlgOptions.sh b/test/sun/security/tools/jarsigner/AlgOptions.sh index b6f8c8b3ff2937dbe94c628c240b934b6b270fd3..9b16831d799dcd209ff751f9fc96fde1a54245b4 100644 --- a/test/sun/security/tools/jarsigner/AlgOptions.sh +++ b/test/sun/security/tools/jarsigner/AlgOptions.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/jarsigner/PercentSign.sh b/test/sun/security/tools/jarsigner/PercentSign.sh index 559c0533e7352f2919524009a11107094d4fd57c..38d9ece9bbcdcf88b8a99098600da94fe430f89f 100644 --- a/test/sun/security/tools/jarsigner/PercentSign.sh +++ b/test/sun/security/tools/jarsigner/PercentSign.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/jarsigner/diffend.sh b/test/sun/security/tools/jarsigner/diffend.sh index 0f943796af4d67d85dd47bb9d67f1d0db5137cab..787b58680f3b6157b8589dbb44f7fb5528d0850f 100644 --- a/test/sun/security/tools/jarsigner/diffend.sh +++ b/test/sun/security/tools/jarsigner/diffend.sh @@ -41,7 +41,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/jarsigner/oldsig.sh b/test/sun/security/tools/jarsigner/oldsig.sh index aae758cb937983b5c24323c0535d432e07061cab..062c2aa21d9ade6a909d1ebbce635d363b0ec960 100644 --- a/test/sun/security/tools/jarsigner/oldsig.sh +++ b/test/sun/security/tools/jarsigner/oldsig.sh @@ -42,7 +42,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/keytool/AltProviderPath.sh b/test/sun/security/tools/keytool/AltProviderPath.sh index 7cb68d471f36e4c18bfeb7f459420d07a9a55df0..65b3490592268d258067012d448e01e513718cf4 100644 --- a/test/sun/security/tools/keytool/AltProviderPath.sh +++ b/test/sun/security/tools/keytool/AltProviderPath.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/keytool/CloneKeyAskPassword.sh b/test/sun/security/tools/keytool/CloneKeyAskPassword.sh index 0f9b82c84b829e97ea4730c1fa09e657b9327d09..62d1195a1ca4287e27df77eeef864e3839ca5287 100644 --- a/test/sun/security/tools/keytool/CloneKeyAskPassword.sh +++ b/test/sun/security/tools/keytool/CloneKeyAskPassword.sh @@ -59,6 +59,10 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) PATHSEP=";" FILESEP="/" diff --git a/test/sun/security/tools/keytool/NoExtNPE.sh b/test/sun/security/tools/keytool/NoExtNPE.sh index da63ed8ce3ab41534ab3c2514825221a7724496a..99b6ae51f36d2d12bc7f39fec578220200684446 100644 --- a/test/sun/security/tools/keytool/NoExtNPE.sh +++ b/test/sun/security/tools/keytool/NoExtNPE.sh @@ -51,6 +51,10 @@ case "$OS" in Darwin ) FILESEP="/" ;; + AIX ) + PATHSEP=":" + FILESEP="/" + ;; CYGWIN* ) FILESEP="/" ;; diff --git a/test/sun/security/tools/keytool/SecretKeyKS.sh b/test/sun/security/tools/keytool/SecretKeyKS.sh index 6246d2bdbb19bd70c4ae0a29d0b632ef42bd37b3..3323179daff592b7e464b5df4d6fbea3a8ffa1c6 100644 --- a/test/sun/security/tools/keytool/SecretKeyKS.sh +++ b/test/sun/security/tools/keytool/SecretKeyKS.sh @@ -45,7 +45,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/keytool/StandardAlgName.sh b/test/sun/security/tools/keytool/StandardAlgName.sh index 8ac1324bc11547bbf2914f4e9ebb052add17936d..c12348537e102804de92b9b24788fad11e54c065 100644 --- a/test/sun/security/tools/keytool/StandardAlgName.sh +++ b/test/sun/security/tools/keytool/StandardAlgName.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/keytool/StorePasswordsByShell.sh b/test/sun/security/tools/keytool/StorePasswordsByShell.sh index 7347f345878fcfd66c2ffc3eebfe57b6fbbba57f..d3cd2ff92cb5ded820b84bc8e7a01c8dafda3aa8 100644 --- a/test/sun/security/tools/keytool/StorePasswordsByShell.sh +++ b/test/sun/security/tools/keytool/StorePasswordsByShell.sh @@ -46,15 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS ) - PATHSEP=":" - FILESEP="/" - ;; - Linux ) - PATHSEP=":" - FILESEP="/" - ;; - Darwin ) + SunOS | Linux | Darwin | AIX) PATHSEP=":" FILESEP="/" ;; diff --git a/test/sun/security/tools/keytool/printssl.sh b/test/sun/security/tools/keytool/printssl.sh index e0531295ff1d44f9d2285aa5b39e18076c505ece..70b927753178cf4eb37665eed7578a58bb8ede31 100644 --- a/test/sun/security/tools/keytool/printssl.sh +++ b/test/sun/security/tools/keytool/printssl.sh @@ -40,7 +40,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) FS="/" ;; CYGWIN* ) diff --git a/test/sun/security/tools/keytool/resource.sh b/test/sun/security/tools/keytool/resource.sh index 1256422144e20b67cee1443ce21c665e6804e072..1e31ff2d2417a8945a1444eb393e2a4a236dcfd0 100644 --- a/test/sun/security/tools/keytool/resource.sh +++ b/test/sun/security/tools/keytool/resource.sh @@ -43,7 +43,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null FS="/" ;; diff --git a/test/sun/security/tools/keytool/standard.sh b/test/sun/security/tools/keytool/standard.sh index 53cec53f314eaa39596e1e1136433d48f13f1b77..83fd987f94c2607b026e1e0aeb575d0d92b2834a 100644 --- a/test/sun/security/tools/keytool/standard.sh +++ b/test/sun/security/tools/keytool/standard.sh @@ -45,7 +45,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin | CYGWIN* ) + SunOS | Linux | Darwin | AIX | CYGWIN* ) FS="/" ;; Windows_* ) diff --git a/test/sun/security/tools/policytool/Alias.sh b/test/sun/security/tools/policytool/Alias.sh index b987d2eac36cb99069ca6cafca6113c930c50c44..7cb77e7a4646c69c171f96a5227a94c4e2269777 100644 --- a/test/sun/security/tools/policytool/Alias.sh +++ b/test/sun/security/tools/policytool/Alias.sh @@ -47,7 +47,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/ChangeUI.sh b/test/sun/security/tools/policytool/ChangeUI.sh index 2764ad1e283d39a7dcbc39554d2651af6658a63f..e725350a823d21e13fbd4522e5ca8e1f8ecb1c6e 100644 --- a/test/sun/security/tools/policytool/ChangeUI.sh +++ b/test/sun/security/tools/policytool/ChangeUI.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/OpenPolicy.sh b/test/sun/security/tools/policytool/OpenPolicy.sh index bc835bca466ca52ff974022ebc51c6c5bd7e9b31..c282e0d48b91b0bff9362b3acff265b396655d85 100644 --- a/test/sun/security/tools/policytool/OpenPolicy.sh +++ b/test/sun/security/tools/policytool/OpenPolicy.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/SaveAs.sh b/test/sun/security/tools/policytool/SaveAs.sh index c5c91b598bcff1da41ffce7e09278b5a0ee5645c..de6e41a383c479281c66ab828bfce946e6702f56 100644 --- a/test/sun/security/tools/policytool/SaveAs.sh +++ b/test/sun/security/tools/policytool/SaveAs.sh @@ -47,7 +47,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/UpdatePermissions.sh b/test/sun/security/tools/policytool/UpdatePermissions.sh index 538a0a99d62e1f76ba2e64bc056472534a32b678..c6f39b7fdd721579039fe6faf3439c8443cb5262 100644 --- a/test/sun/security/tools/policytool/UpdatePermissions.sh +++ b/test/sun/security/tools/policytool/UpdatePermissions.sh @@ -47,7 +47,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/UsePolicy.sh b/test/sun/security/tools/policytool/UsePolicy.sh index 2b167ff2f6d892cd611422ad941b3742b9afd760..ceb12e1cb568b4a7d2c5776607701e6a2c3a2bd6 100644 --- a/test/sun/security/tools/policytool/UsePolicy.sh +++ b/test/sun/security/tools/policytool/UsePolicy.sh @@ -46,7 +46,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/security/tools/policytool/i18n.sh b/test/sun/security/tools/policytool/i18n.sh index 91a15e01ec245e692c0ce5b297d4e487724861bf..35dfccfbc5f9818f46d5fa9a4f2fd56757f3dc0d 100644 --- a/test/sun/security/tools/policytool/i18n.sh +++ b/test/sun/security/tools/policytool/i18n.sh @@ -49,7 +49,7 @@ fi # set platform-dependent variables OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) NULL=/dev/null PS=":" FS="/" diff --git a/test/sun/tools/common/CommonSetup.sh b/test/sun/tools/common/CommonSetup.sh index db58377a66804b6f2b383160d5a1ae52732d7531..f4401a7f6f2a1147dcaf6fc89cc22941c042c63d 100644 --- a/test/sun/tools/common/CommonSetup.sh +++ b/test/sun/tools/common/CommonSetup.sh @@ -48,6 +48,7 @@ # isSolaris - true if OS is Solaris # isWindows - true if OS is Windows # isMacos - true if OS is Macos X +# isAIX - true if OS is AIX if [ -z "${TESTJAVA}" ]; then @@ -83,6 +84,7 @@ isSolaris=false isUnknownOS=false isWindows=false isMacos=false +isAIX=false OS=`uname -s` @@ -113,6 +115,10 @@ case "$OS" in OS="Solaris" isSolaris=true ;; + AIX ) + OS="AIX" + isAIX=true + ;; Windows* ) OS="Windows" PATTERN_EOL='[ ]*$' diff --git a/test/sun/tools/jconsole/ResourceCheckTest.sh b/test/sun/tools/jconsole/ResourceCheckTest.sh index 01c2e4b6f010957158ab47eba022ca101b78dd31..b82b3ac387c2bf50d6dc09350d8ade8ceed47d97 100644 --- a/test/sun/tools/jconsole/ResourceCheckTest.sh +++ b/test/sun/tools/jconsole/ResourceCheckTest.sh @@ -54,7 +54,7 @@ pass() OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin) + SunOS | Linux | Darwin | AIX) PATHSEP=":" ;; diff --git a/test/sun/tools/jinfo/Basic.sh b/test/sun/tools/jinfo/Basic.sh index e12bbb3ce33fe4a8727a007981b6aa10aa7c1567..5905c83d009e7ab6e1606c7e8876609e99d5e371 100644 --- a/test/sun/tools/jinfo/Basic.sh +++ b/test/sun/tools/jinfo/Basic.sh @@ -45,7 +45,7 @@ failed=0 runSA=true -if [ $isMacos = true ]; then +if [ $isMacos = true -o $isAIX = true -o `uname -m` = ppc64 ]; then runSA=false fi diff --git a/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh b/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh index fa312adad747425fe24a8b0d03c88e0f032ab431..29c72ed6254f19e4388a5ac8c005781badcc375b 100644 --- a/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh +++ b/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh @@ -56,7 +56,7 @@ pass() OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) + SunOS | Linux | Darwin | AIX ) PATHSEP=":" ;; diff --git a/test/tools/launcher/ExecutionEnvironment.java b/test/tools/launcher/ExecutionEnvironment.java index c3dc1abb9f69bbc8bccb3cb1c00a9b8fa4b25180..85bd96928149bfdcda42770025671f5267a68117 100644 --- a/test/tools/launcher/ExecutionEnvironment.java +++ b/test/tools/launcher/ExecutionEnvironment.java @@ -72,7 +72,9 @@ import java.util.regex.Pattern; public class ExecutionEnvironment extends TestHelper { static final String LD_LIBRARY_PATH = TestHelper.isMacOSX ? "DYLD_LIBRARY_PATH" - : "LD_LIBRARY_PATH"; + : TestHelper.isAIX + ? "LIBPATH" + : "LD_LIBRARY_PATH"; static final String LD_LIBRARY_PATH_32 = LD_LIBRARY_PATH + "_32"; static final String LD_LIBRARY_PATH_64 = LD_LIBRARY_PATH + "_64"; @@ -144,7 +146,19 @@ public class ExecutionEnvironment extends TestHelper { for (String x : LD_PATH_STRINGS) { if (!tr.contains(x)) { - flagError(tr, "FAIL: did not get <" + x + ">"); + if (TestHelper.isAIX && x.startsWith(LD_LIBRARY_PATH)) { + // AIX does not support the '-rpath' linker options so the + // launchers have to prepend the jdk library path to 'LIBPATH'. + String aixLibPath = LD_LIBRARY_PATH + "=" + + System.getenv(LD_LIBRARY_PATH) + + System.getProperty("path.separator") + LD_LIBRARY_PATH_VALUE; + if (!tr.matches(aixLibPath)) { + flagError(tr, "FAIL: did not get <" + aixLibPath + ">"); + } + } + else { + flagError(tr, "FAIL: did not get <" + x + ">"); + } } } } @@ -180,7 +194,7 @@ public class ExecutionEnvironment extends TestHelper { Map env = new HashMap<>(); - if (TestHelper.isLinux || TestHelper.isMacOSX) { + if (TestHelper.isLinux || TestHelper.isMacOSX || TestHelper.isAIX) { for (String x : LD_PATH_STRINGS) { String pairs[] = x.split("="); env.put(pairs[0], pairs[1]); diff --git a/test/tools/launcher/Settings.java b/test/tools/launcher/Settings.java index 57a9ca644475845e0350dbfe1a2ae74e91c1e0db..16fd29b0b168a98182fef88eb2883a6bc2ab6558 100644 --- a/test/tools/launcher/Settings.java +++ b/test/tools/launcher/Settings.java @@ -73,16 +73,20 @@ public class Settings extends TestHelper { } static void runTestOptionDefault() throws IOException { + String stackSize = "256"; // in kb + if (getArch().equals("ppc64")) { + stackSize = "800"; + } TestResult tr = null; tr = doExec(javaCmd, "-Xms64m", "-Xmx512m", - "-Xss256k", "-XshowSettings", "-jar", testJar.getAbsolutePath()); + "-Xss" + stackSize + "k", "-XshowSettings", "-jar", testJar.getAbsolutePath()); containsAllOptions(tr); if (!tr.isOK()) { System.out.println(tr.status); throw new RuntimeException("test fails"); } tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m", - "-Xss256000", "-XshowSettings", "-jar", testJar.getAbsolutePath()); + "-Xss" + stackSize + "000", "-XshowSettings", "-jar", testJar.getAbsolutePath()); containsAllOptions(tr); if (!tr.isOK()) { System.out.println(tr.status); diff --git a/test/tools/launcher/TestHelper.java b/test/tools/launcher/TestHelper.java index da23181a3f68ed59c1521578eaacc60f254f7222..40737320d52e617b7903160786eff6178a12b5da 100644 --- a/test/tools/launcher/TestHelper.java +++ b/test/tools/launcher/TestHelper.java @@ -92,6 +92,8 @@ public class TestHelper { System.getProperty("os.name", "unknown").startsWith("SunOS"); static final boolean isLinux = System.getProperty("os.name", "unknown").startsWith("Linux"); + static final boolean isAIX = + System.getProperty("os.name", "unknown").startsWith("AIX"); static final String LIBJVM = isWindows ? "jvm.dll" : "libjvm" + (isMacOSX ? ".dylib" : ".so");