Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 65231 Details for
Bug 184433
Contribute symlink-enabled liblocalfile for Linux x86_64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Additional patch allowing to get supported attributes from native lib
localfile_nativeAttributes_patch.txt (text/plain), 7.28 KB, created by
Martin Oberhuber
on 2007-04-27 12:56:05 EDT
(
hide
)
Description:
Additional patch allowing to get supported attributes from native lib
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2007-04-27 12:56:05 EDT
Size:
7.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.filesystem >Index: natives/unix/localfile.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.filesystem/natives/unix/localfile.c,v >retrieving revision 1.8 >diff -u -r1.8 localfile.c >--- natives/unix/localfile.c 23 Apr 2007 16:32:08 -0000 1.8 >+++ natives/unix/localfile.c 27 Apr 2007 16:53:05 -0000 >@@ -11,6 +11,7 @@ > * Martin Oberhuber (Wind River) - [170317] add symbolic link support to API > * Corey Ashford (IBM) - [177400] fix threading issues on Linux-PPC > * Martin Oberhuber (Wind River) - [183137] liblocalfile for solaris-sparc >+ * Martin Oberhuber (Wind River) - [184433] get attributes from native lib > *******************************************************************************/ > #include <jni.h> > #include <sys/types.h> >@@ -61,6 +62,21 @@ > > /* > * Class: org_eclipse_core_internal_filesystem_local_LocalFileNatives >+ * Method: nativeAttributes >+ * Signature: ()I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_filesystem_local_LocalFileNatives_nativeAttributes >+ (JNIEnv *env, jclass clazz) { >+#if defined(EFS_SYMLINK_SUPPORT) >+ return ATTRIBUTE_READ_ONLY | ATTRIBUTE_EXECUTABLE | ATTRIBUTE_SYMLINK | ATTRIBUTE_LINK_TARGET; >+#else >+ return ATTRIBUTE_READ_ONLY | ATTRIBUTE_EXECUTABLE; >+#endif >+} >+ >+ >+/* >+ * Class: org_eclipse_core_internal_filesystem_local_LocalFileNatives > * Method: internalIsUnicode > * Signature: ()Z > */ >Index: src/org/eclipse/core/internal/filesystem/local/LocalFileSystem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFileSystem.java,v >retrieving revision 1.15 >diff -u -r1.15 LocalFileSystem.java >--- src/org/eclipse/core/internal/filesystem/local/LocalFileSystem.java 27 Apr 2007 15:15:41 -0000 1.15 >+++ src/org/eclipse/core/internal/filesystem/local/LocalFileSystem.java 27 Apr 2007 16:53:05 -0000 >@@ -10,6 +10,7 @@ > * Martin Oberhuber (Wind River) - [170317] add symbolic link support to API > * Martin Oberhuber (Wind River) - [183137] liblocalfile for solaris-sparc > * Martin Oberhuber (Wind River) - [184433] liblocalfile for Linux x86_64 >+ * Martin Oberhuber (Wind River) - [184433] get attributes from native lib > *******************************************************************************/ > package org.eclipse.core.internal.filesystem.local; > >@@ -82,7 +83,15 @@ > attributes = 0; > if (!LocalFileNatives.usingNatives()) > return attributes; >+ >+ //try to query supported attributes from native lib impl >+ int nativeAttributes = LocalFileNatives.attributes(); >+ if (nativeAttributes >= 0) { >+ attributes = nativeAttributes; >+ return attributes; >+ } > >+ //fallback for older lib: compute attributes as known before > //all known platforms with native implementation support the read only flag > attributes |= EFS.ATTRIBUTE_READ_ONLY; > >Index: src/org/eclipse/core/internal/filesystem/local/LocalFileNatives.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFileNatives.java,v >retrieving revision 1.10 >diff -u -r1.10 LocalFileNatives.java >--- src/org/eclipse/core/internal/filesystem/local/LocalFileNatives.java 27 Mar 2007 22:28:27 -0000 1.10 >+++ src/org/eclipse/core/internal/filesystem/local/LocalFileNatives.java 27 Apr 2007 16:53:05 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,10 +7,12 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Martin Oberhuber (Wind River) - [184433] get attributes from native lib > *******************************************************************************/ > package org.eclipse.core.internal.filesystem.local; > > import org.eclipse.core.filesystem.IFileInfo; >+import org.eclipse.core.filesystem.IFileSystem; > import org.eclipse.core.filesystem.provider.FileInfo; > import org.eclipse.core.internal.filesystem.Messages; > import org.eclipse.core.internal.filesystem.Policy; >@@ -36,6 +38,43 @@ > } > > /** >+ * Return the bit-mask of EFS attributes that this native >+ * file system implementation supports. >+ * <p> >+ * This is an optional method: if it has not been compiled >+ * into the native library, the client must catch the >+ * resulting UnsatisfiedLinkError and handle attributes >+ * as known by older version libraries. >+ * </p> >+ * @see IFileSystem#attributes() >+ * @return an integer bit mask of attributes. >+ */ >+ private static final native int nativeAttributes(); >+ >+ /** >+ * Return the value that the native library thinks >+ * {@link IFileSystem#attributes()} should return. >+ * >+ * Returns -1 when the native library has not been >+ * loaded, or is a version that does not support >+ * this investigation method yet. >+ * >+ * @return an positive value that is a bit-mask >+ * suitable for use in {@link IFileSystem#attributes}, >+ * or -1 if native attributes are not available. >+ */ >+ public static int attributes() { >+ try { >+ return nativeAttributes(); >+ } catch (UnsatisfiedLinkError e) { >+ //older native implementations did not support this >+ //call, so we cannot return supported attribute >+ //information for them. >+ return -1; >+ } >+ } >+ >+ /** > * Copies file attributes from source to destination. The copyLastModified attribute > * indicates whether the lastModified attribute should be copied. > * @param source >Index: natives/localfile.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.filesystem/natives/localfile.h,v >retrieving revision 1.4 >diff -u -r1.4 localfile.h >--- natives/localfile.h 29 Jan 2007 23:21:08 -0000 1.4 >+++ natives/localfile.h 27 Apr 2007 16:53:05 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Martin Oberhuber (Wind River) - [170317] add symbolic link support to API >+ * Martin Oberhuber (Wind River) - [184433] get attributes from native lib > */ > /* DO NOT EDIT THIS FILE - it is machine generated */ > #include <jni.h> >@@ -40,12 +41,20 @@ > #define SET_LAST_MODIFIED 0x02l > > /* >- * Class: org_eclipse_core_internal_localstore_CoreFileSystemLibrary >+ * Class: org_eclipse_core_internal_filesystem_local_LocalFileNatives >+ * Method: nativeAttributes >+ * Signature: ()I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_core_internal_filesystem_local_LocalFileNatives_nativeAttributes >+ (JNIEnv *, jclass); >+ >+/* >+ * Class: org_eclipse_core_internal_filesystem_local_LocalFileNatives > * Method: internalIsUnicode > * Signature: ()Z > */ >-JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_localstore_CoreFileSystemLibrary_internalIsUnicode >- (JNIEnv *, jclass); >+JNIEXPORT jboolean JNICALL Java_org_eclipse_core_internal_filesystem_local_LocalFileNatives_internalIsUnicode >+ (JNIEnv *, jclass); > > /* > * Class: org_eclipse_core_internal_filesystem_local_LocalFileNatives
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184433
:
65211
|
65212
|
65231
|
65234
|
66509