[Libreoffice-commits] .: sal/inc sal/osl sal/qa sal/util
sal/inc/osl/file.h| 43 sal/inc/osl/file.hxx | 28 - sal/osl/unx/file_volume.cxx | 80 -- sal/osl/w32/file_dirvol.cxx | 18 sal/qa/helper/gcov/deprecated.txt |2 sal/util/sal.map |2 6 files changed, 173 deletions(-) New commits: commit 32009128e4c77cfd6506ab50a5345776de8144e6 Author: François Tigeot ftig...@wolfpond.org Date: Sun Feb 5 18:33:57 2012 +0100 Remove unused VolumeDevice functions and related code diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h index 3bcd877..2c2713b 100644 --- a/sal/inc/osl/file.h +++ b/sal/inc/osl/file.h @@ -467,47 +467,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileStatus( typedef void *oslVolumeDeviceHandle; - -/** Unmount a volume device. - -Unmount the volume specified by the given oslVolumeDeviceHandle. - -@param Handle [in] -An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). - -@return -osl_File_E_None on successbr - -@todo -specify all error codes that may be returned - -@see osl_getVolumeInformation() -*/ - -SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmountVolumeDevice( -oslVolumeDeviceHandle Handle ); - - -/** Automount a volume device. - -Automount the volume device specified by the given oslVolumeDeviceHandle. - -@param Handle [in] -An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). - -@return -osl_File_E_None on successbr - -@todo -specify all error codes that may be returned - -@see osl_getVolumeInformation() -*/ - -SAL_DLLPUBLIC oslFileError SAL_CALL osl_automountVolumeDevice( -oslVolumeDeviceHandle Handle ); - - /** Release a volume device handle. Releases the given oslVolumeDeviceHandle which was acquired by a call to @@ -575,8 +534,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_acquireVolumeDeviceHandle( osl_File_E_EOVERFLOW value too large for defined data typebr @seeosl_getVolumeInformation() -@seeosl_automountVolumeDevice() -@seeosl_unmountVolumeDevice() */ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getVolumeDeviceMountPath( diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx index d63126b..8c97750 100644 --- a/sal/inc/osl/file.hxx +++ b/sal/inc/osl/file.hxx @@ -388,34 +388,6 @@ public: return *this; } -/** Automount a volume device. - -@return -E_None on success - -@todo -specify all error codes that may be returned -*/ - -inline RC automount() -{ -return (RC)osl_automountVolumeDevice( _aHandle ); -} - -/** Unmount a volume device. - -@return -E_None on success - -@todo -specify all error codes that may be returned -*/ - -inline RC unmount() -{ -return (RC)osl_unmountVolumeDevice( _aHandle ); -} - /** Get the full qualified URL where a device is mounted to. @return diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index ce9f832..42965a7 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -59,14 +59,12 @@ #include sys/mnttab.h #include sys/statvfs.h #define HAVE_STATFS_H -static const sal_Char* MOUNTTAB=/etc/mnttab; #elif defined(LINUX) #include mntent.h #include sys/vfs.h #define HAVE_STATFS_H -static const sal_Char* MOUNTTAB=/etc/mtab; #elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY) @@ -75,16 +73,11 @@ static const sal_Char* MOUNTTAB=/etc/mtab; #include sys/mount.h #define HAVE_STATFS_H -/* No mounting table on *BSD - * This information is stored only in the kernel. */ -/* static const sal_Char* MOUNTTAB=/etc/mtab; */ - #elif defined(MACOSX) #include sys/param.h #include sys/mount.h #define HAVE_STATFS_H -// static const sal_Char* MOUNTTAB=/etc/mtab; #endif /* HAVE_STATFS_H */ @@ -360,42 +353,6 @@ static oslFileError osl_psz_getVolumeInformation ( * */ - -/* - * osl_unmountVolumeDevice - / - -oslFileError osl_unmountVolumeDevice( oslVolumeDeviceHandle Handle ) -{ -oslFileError tErr = osl_File_E_NOSYS; - - /* Perhaps current working directory is set to mount point */ - - if ( tErr ) -{ -sal_Char *pszHomeDir = getenv(HOME); - -if ( pszHomeDir strlen( pszHomeDir ) 0 == chdir( pszHomeDir ) ) -{ -/* try again */ -OSL_ENSURE( tErr, osl_unmountVolumeDevice: CWD was set to volume mount point ); -} -} - -return tErr; -} - -/* - * osl_automountVolumeDevice - / - -oslFileError osl_automountVolumeDevice( oslVolumeDeviceHandle Handle )
[Libreoffice-commits] .: sal/inc sal/osl sal/util tools/inc tools/source
sal/inc/osl/detail/file.h | 12 -- sal/inc/osl/file.h |1 sal/osl/unx/file.cxx|2 - sal/osl/unx/file_stat.cxx | 12 -- sal/util/sal.map|2 - tools/inc/tools/stream.hxx |4 +- tools/source/stream/strmunx.cxx | 71 +++- 7 files changed, 38 insertions(+), 66 deletions(-) New commits: commit 4a086fca7b0a77c20bc9f1c97507966e2861f3da Author: Michael Meeks michael.me...@suse.com Date: Thu Jan 19 12:23:23 2012 + fix SvStream to not require a custom open or lstat method. diff --git a/sal/inc/osl/detail/file.h b/sal/inc/osl/detail/file.h index 108d230..065c355 100644 --- a/sal/inc/osl/detail/file.h +++ b/sal/inc/osl/detail/file.h @@ -49,25 +49,13 @@ extern C { #define osl_File_OpenFlag_Trunc 0x0010L #define osl_File_OpenFlag_NoExcl0x0020L -/* Variant of osl_openFile that takes the file pathname directly as a - char* -*/ - -SAL_DLLPUBLIC oslFileError SAL_CALL osl_openFilePath( -const char *cpFilePath, -oslFileHandle *pHandle, -sal_uInt32 uFlags ); - /* Compare directory items for being the same underlying file * this unwinds unix hard-links and symlinks etc. */ SAL_DLLPUBLIC sal_Bool SAL_CALL osl_identicalDirectoryItem(oslDirectory a, oslDirectory b); -SAL_DLLPUBLIC oslFileError SAL_CALL osl_lstatFilePath( const char *cpFilePath, struct stat *statb ); - /* Get the OS specific handle of an open file. */ - SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle( oslFileHandle Handle, sal_IntPtr *piFileHandle ); diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h index 2a8cf37..0e0d765 100644 --- a/sal/inc/osl/file.h +++ b/sal/inc/osl/file.h @@ -664,6 +664,7 @@ typedef void *oslFileHandle; #define osl_File_OpenFlag_Write 0x0002L #define osl_File_OpenFlag_Create0x0004L #define osl_File_OpenFlag_NoLock0x0008L +/* larger bit-fields reserved for internal use cf. detail/file.h */ /** Open a regular file. diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 64ce977..7bb6bae 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -892,7 +892,7 @@ SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandl #define OPEN_CREATE_FLAGS ( O_CREAT | O_RDWR ) #endif -oslFileError +static oslFileError SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_uInt32 uFlags ) { oslFileError eRet; diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index 0477a52..320744f 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -462,7 +462,6 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b) return sal_True; fprintf (stderr, We have to do an inode compare !\n); - /* int rc = stat_c( cpFilePath, statb ); @@ -475,15 +474,4 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b) return sal_False; } -oslFileError -SAL_CALL osl_lstatFilePath( const char *cpFilePath, struct stat *statb ) -{ -int rc = lstat_c( cpFilePath, statb ); - -if (rc == -1) -return oslTranslateFileError(OSL_FET_ERROR, errno); -else -return osl_File_E_None; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/util/sal.map b/sal/util/sal.map index 26c30fc..02610f5 100644 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -647,9 +647,7 @@ PRIVATE_textenc.1 { # LibreOffice 3.6 PRIVATE_file.1 { # LibreOffice 3.6 global: -osl_openFilePath; osl_identicalDirectoryItem; -osl_lstatFilePath; osl_getFileOSHandle; }; diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 37b7c3f..8c7fa0c 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -576,10 +576,10 @@ class TOOLS_DLLPUBLIC SvFileStream : public SvStream friend class FileCopier; private: -StreamData* pInstanceData; +StreamData* pInstanceData; String aFilename; sal_uInt16 nLockCounter; -sal_BoolbIsOpen; +sal_BoolbIsOpen; sal_uInt32 GetFileHandle() const; // Forbidden and not implemented. diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 0fcddbd..d2135fa 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -223,7 +223,7 @@ class StreamData public: oslFileHandle rHandle; -StreamData() { } +StreamData() : rHandle( 0 ) { } }; // --- @@ -683,8 +683,6 @@ void SvFileStream::Open( const String rFilename, StreamMode nOpenMode ) { sal_uInt32 uFlags; oslFileHandle nHandleTmp; -struct stat buf; -sal_Bool bStatValid = sal_False; Close(); errno = 0; @@ -707,16 +705,22 @@ void SvFileStream::Open( const
[Libreoffice-commits] .: sal/inc sal/osl sal/util store/source xmlreader/source
sal/inc/osl/file.h | 45 sal/osl/unx/file.cxx | 56 - sal/osl/w32/file.cxx |7 + sal/util/sal.map |5 +++ store/source/lockbyte.cxx | 14 ++ xmlreader/source/xmlreader.cxx |4 +- 6 files changed, 112 insertions(+), 19 deletions(-) New commits: commit e3ab0fd9016bc24c5a0eb0807f171d5025c3bb79 Author: Tor Lillqvist tlillqv...@suse.com Date: Wed Dec 21 13:51:50 2011 +0200 osl_unmapFile can't work for files bundled inside the .apk on Android On Android, when an app is installed, arbitrary files bundled in the app won't be unpacked into actual separate files in the file system. They will exist only as archive entries in the .apk file (which is a zip archive). The SDK tooling puts such files under the /assets folder in the .apk. The LibreOffice bootstrapping code for Android maps the .apk file into memory. osl_openFile() knows about the /assets special case, and uses a separate abstraction for such memory-mapped files. Obviously, when producing an .apk, one needs to make sure these bundled files are not compressed, if one wants to be able to use them directly from the memory-mapped .apk file. We do that in our test and sample Android projects. When mapping such files under /assets , just return a pointer to the file's location inside the mapped .apk archive. We can't use the old osl_unmapFile() on such mapped files, as that would unexpectedly unmap fairly arbitrary pages of the .apk mapping, wreaking havoc on later use of the same pages. So, introduce a new osl_unmapMappedFile() function that takes also the oslFileHandle originally passed to osl_mapFile(). Use this instead in the few places where the code actually called osl_unmapFile(). Make sure osl_mapFile() is nonexistent on Android. diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h index cc12b1c..ecf9e60 100644 --- a/sal/inc/osl/file.h +++ b/sal/inc/osl/file.h @@ -680,6 +680,12 @@ typedef void *oslFileHandle; @param uFlags [in] Specifies the open mode. +On Android, if the file path is below the /assets folder, the file +exists only as a hopefully uncompressed element inside the app +package (.apk), which has been mapped into memory as a whole by +the LibreOffice Android bootstrapping code. So files opened from +there aren't actually files in the OS sense. + @return osl_File_E_None on successbr osl_File_E_NOMEM not enough memory for allocating structures br @@ -837,6 +843,15 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileSize( /** Map a shared file into memory. +Don't know what the shared is supposed to mean there? Also, +obviously this API can be used to map *part* of a file into +memory, and different parts can be mapped separately even. + +On Android, if the Handle refers to a file that is actually inside +the app package (.apk zip archive), no new mapping is created, +just a pointer to the file inside the already mapped .apk is +returned. + @since UDK 3.2.10 */ SAL_DLLPUBLIC oslFileError SAL_CALL osl_mapFile ( @@ -848,8 +863,19 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_mapFile ( ); +#ifndef ANDROID + /** Unmap a shared file from memory. +Ditto here, why do we need to mention shared? + +This function just won't work on Android in general where for +(uncompressed) files inside the .apk, per SDK conventions in the +/assets folder, osl_mapFile() returns a pointer to the file inside +the already by LibreOffice Android-specific bootstrapping code +mmapped .apk archive. We can't go and randomly munmap part of the +.apk archive. So this function is not present on Android. + @since UDK 3.2.10 */ SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapFile ( @@ -857,6 +883,25 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapFile ( sal_uInt64 uLength ); +#endif + +/** Unmap a file segment from memory. + +Like osl_unmapFile(), but takes also the oslFileHandle argument +passed to osl_mapFile() when creating this mapping. + +On Android, for files below /assets, i.e. located inside the app +archive (.apk), this won't actually unmap anything; all the .apk +stays mapped. + +@since UDK 3.6 + */ +SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapMappedFile ( + oslFileHandle Handle, + void* pAddr, + sal_uInt64 uLength +); + /** Read a number of bytes from a file. diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index f060413..458554e 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -865,7 +865,6 @@ SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandl eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM); return eRet; } -pImpl-m_kind =
[Libreoffice-commits] .: sal/inc sal/osl
sal/inc/osl/endian.h | 21 - sal/osl/unx/system.h | 16 2 files changed, 37 deletions(-) New commits: commit 3a1441c0d3107c69fd80492fa7e182d4f8c02d3d Author: François Tigeot ftig...@wolfpond.org Date: Fri Nov 25 10:38:14 2011 +0100 PDP_ENDIAN and variants are unused. Remove their use from the code. diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h index 7069c3b..dace25b 100644 --- a/sal/inc/osl/endian.h +++ b/sal/inc/osl/endian.h @@ -61,8 +61,6 @@ extern C { # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif __BYTE_ORDER == __PDP_ENDIAN -# define _PDP_ENDIAN # endif #endif @@ -76,8 +74,6 @@ extern C { # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif __BYTE_ORDER == __PDP_ENDIAN -# define _PDP_ENDIAN # endif #endif @@ -85,13 +81,8 @@ extern C { # include machine/endian.h # if BYTE_ORDER == LITTLE_ENDIAN # undef _BIG_ENDIAN -# undef _PDP_ENDIAN # elif BYTE_ORDER == BIG_ENDIAN # undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN # endif #endif @@ -103,8 +94,6 @@ extern C { # define _LITTLE_ENDIAN # elif BYTE_ORDER == BIG_ENDIAN # define _BIG_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# define _PDP_ENDIAN # endif #endif #endif @@ -119,8 +108,6 @@ extern C { # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# define _PDP_ENDIAN # endif #endif @@ -138,10 +125,6 @@ extern C { # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# ifndef _PDP_ENDIAN -# define _PDP_ENDIAN -# endif # endif #endif @@ -155,10 +138,6 @@ extern C { # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# ifndef _PDP_ENDIAN -# define _PDP_ENDIAN -# endif # endif #endif diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h index c8f4871..71b9b31 100644 --- a/sal/osl/unx/system.h +++ b/sal/osl/unx/system.h @@ -89,8 +89,6 @@ # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif __BYTE_ORDER == __PDP_ENDIAN -# define _PDP_ENDIAN # endif # define IORESOURCE_TRANSFER_BSD # define IOCHANNEL_TRANSFER_BSD_RENO @@ -142,8 +140,6 @@ # define _LITTLE_ENDIAN_OO # elif BYTE_ORDER == BIG_ENDIAN # define _BIG_ENDIAN_OO -# elif BYTE_ORDER == PDP_ENDIAN -# define _PDP_ENDIAN_OO # endif # define IORESOURCE_TRANSFER_BSD # define IOCHANNEL_TRANSFER_BSD_RENO @@ -179,8 +175,6 @@ # define _LITTLE_ENDIAN # elif BYTE_ORDER == BIG_ENDIAN # define _BIG_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# define _PDP_ENDIAN # endif #endif # define NO_PTHREAD_RTL @@ -248,8 +242,6 @@ # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# define _PDP_ENDIAN # endif # define SLEEP_TIMESPEC(timespec)nsleep(timespec, 0) # define LIBPATH LIBPATH @@ -301,10 +293,6 @@ # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# ifndef _PDP_ENDIAN -# define _PDP_ENDIAN -# endif # endif # define IOCHANNEL_TRANSFER_BSD_RENO # define NO_PTHREAD_RTL @@ -341,10 +329,6 @@ int macxp_resolveAlias(char *path, int buflen); # ifndef _BIG_ENDIAN # define _BIG_ENDIAN # endif -# elif BYTE_ORDER == PDP_ENDIAN -# ifndef _PDP_ENDIAN -# define _PDP_ENDIAN -# endif # endif # define IOCHANNEL_TRANSFER_BSD_RENO # define NO_PTHREAD_RTL ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sal/inc sal/osl sal/textenc
sal/inc/osl/module.h| 24 ++ sal/inc/osl/module.hxx | 15 sal/osl/unx/module.c| 168 +++- sal/osl/w32/module.cxx |6 + sal/textenc/textenc.cxx | 12 --- 5 files changed, 144 insertions(+), 81 deletions(-) New commits: commit 193715bbf0e59256fd8da7ebd8dc5eb937615281 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Sep 27 10:06:54 2011 +0200 FullTextEncodingDataSingleton must not call itself recursively. Happened on non-standard locales (like hu_HU on Linux) when osl_loadModuleRelative wanted to access non-standard text encodings. For Windows, the fix is still only a TODO: FIXME dummy. diff --git a/sal/inc/osl/module.h b/sal/inc/osl/module.h index c103e41..6784232 100644 --- a/sal/inc/osl/module.h +++ b/sal/inc/osl/module.h @@ -102,6 +102,30 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR oslModule SAL_CALL osl_loadModuleRelative( oslGenericFunction baseModule, rtl_uString * relativePath, sal_Int32 mode); +/** Load a module located relative to some other module. + +@param baseModule +must point to a function that is part of the code of some loaded module; +must not be NULL. + +@param relativePath +a relative URL containing only ASCII (0x01--7F) characters; must not be +NULL. + +@param mode +the SAL_LOADMODULE_xxx flags. + +@return +a non-NULL handle to the loaded module, or NULL if an error occurred. + +@since LibreOffice 3.5 +*/ +oslModule SAL_CALL osl_loadModuleRelativeAscii( +oslGenericFunction baseModule, char const * relativePath, sal_Int32 mode); +/* This function is guaranteed not to call into + FullTextEncodingDataSingleton in sal/textenc/textenc.cxx, so can be used + in its implementation without running into circles. */ + /** Retrieve the handle of an already loaded module. This function can be used to search for a function symbol in the process address space. diff --git a/sal/inc/osl/module.hxx b/sal/inc/osl/module.hxx index cfc1c5e..3ece623 100644 --- a/sal/inc/osl/module.hxx +++ b/sal/inc/osl/module.hxx @@ -102,6 +102,16 @@ public: return is(); } +/// @since LibreOffice 3.5 +sal_Bool SAL_CALL loadRelative( +oslGenericFunction baseModule, char const * relativePath, +sal_Int32 mode = SAL_LOADMODULE_DEFAULT) +{ +unload(); +m_Module = osl_loadModuleRelativeAscii(baseModule, relativePath, mode); +return is(); +} + void SAL_CALL unload() { if (m_Module) @@ -144,6 +154,11 @@ public: return ( osl_getFunctionSymbol( m_Module, ustrFunctionSymbolName.pData ) ); } +/// @since LibreOffice 3.5 +oslGenericFunction SAL_CALL getFunctionSymbol(char const * name) const { +return osl_getAsciiFunctionSymbol(m_Module, name); +} + operator oslModule() const { return m_Module; diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c index 63fbc20..7db8011 100644 --- a/sal/osl/unx/module.c +++ b/sal/osl/unx/module.c @@ -46,6 +46,69 @@ /* implemented in file.c */ extern int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32); +static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) { +sal_Bool result = sal_False; +/* Bah, we do want to use dladdr here also on iOS, I think? */ +#if !defined(NO_DL_FUNCTIONS) || defined(IOS) +#if defined(AIX) +int i; +int size = 4 * 1024; +char *buf, *filename=NULL; +struct ld_info *lp; + +if ((buf = malloc(size)) == NULL) +return result; + +while((i = loadquery(L_GETINFO, buf, size)) == -1 errno == ENOMEM) +{ +size += 4 * 1024; +if ((buf = malloc(size)) == NULL) +break; +} + +lp = (struct ld_info*) buf; +while (lp) +{ +unsigned long start = (unsigned long)lp-ldinfo_dataorg; +unsigned long end = start + lp-ldinfo_datasize; +if (start = (unsigned long)address end (unsigned long)address) +{ +filename = lp-ldinfo_filename; +break; +} +if (!lp-ldinfo_next) +break; +lp = (struct ld_info*) ((char *) lp + lp-ldinfo_next); +} + +if (filename) +{ +rtl_string_newFromStr(path, filename); +result = sal_True; +} +else +{ +result = sal_False; +} + +free(buf); +#else +Dl_info dl_info; + +if ((result = dladdr(address, dl_info)) != 0) +{ +rtl_string_newFromStr(path, dl_info.dli_fname); +result = sal_True; +} +else +{ +result = sal_False; +} +#endif +#endif +return result; +} + /*/ /* osl_loadModule */ /*/ @@ -104,6 +167,34 @@ oslModule SAL_CALL