Index: port/cpl_csv.cpp
===================================================================
--- port/cpl_csv.cpp	(revision 18567)
+++ port/cpl_csv.cpp	(working copy)
@@ -119,7 +119,7 @@
 /* -------------------------------------------------------------------- */
 /*      If not, try to open it.                                         */
 /* -------------------------------------------------------------------- */
-    fp = VSIFOpen( pszFilename, "rb" );
+    fp = VSIFOpenL( pszFilename, "rb" );
     if( fp == NULL )
         return NULL;
 
@@ -203,7 +203,7 @@
 /*      Free the table.                                                 */
 /* -------------------------------------------------------------------- */
     if( psTable->fp != NULL )
-        VSIFClose( psTable->fp );
+        VSIFCloseL( psTable->fp );
 
     CSLDestroy( psTable->papszFieldNames );
     CSLDestroy( psTable->papszRecFields );
@@ -214,7 +214,7 @@
 
     CPLFree( psTable );
 
-    CPLReadLine( NULL );
+    CPLReadLineL( NULL );
 }
 
 /************************************************************************/
@@ -349,12 +349,12 @@
 /* -------------------------------------------------------------------- */
 /*      Ingest whole file.                                              */
 /* -------------------------------------------------------------------- */
-    VSIFSeek( psTable->fp, 0, SEEK_END );
-    nFileLen = VSIFTell( psTable->fp );
-    VSIRewind( psTable->fp );
+    VSIFSeekL( psTable->fp, 0, SEEK_END );
+    nFileLen = VSIFTellL( psTable->fp );
+    VSIRewindL( psTable->fp );
 
     psTable->pszRawData = (char *) CPLMalloc(nFileLen+1);
-    if( (int) VSIFRead( psTable->pszRawData, 1, nFileLen, psTable->fp ) 
+    if( (int) VSIFReadL( psTable->pszRawData, 1, nFileLen, psTable->fp ) 
         != nFileLen )
     {
         CPLFree( psTable->pszRawData );
@@ -418,7 +418,7 @@
 /* -------------------------------------------------------------------- */
 /*      We should never need the file handle against, so close it.      */
 /* -------------------------------------------------------------------- */
-    VSIFClose( psTable->fp );
+    VSIFCloseL( psTable->fp );
     psTable->fp = NULL;
 }
 
@@ -496,7 +496,7 @@
     if( fp == NULL )
         return( NULL );
     
-    pszLine = CPLReadLine( fp );
+    pszLine = CPLReadLineL( fp );
     if( pszLine == NULL )
         return( NULL );
 
@@ -527,7 +527,7 @@
         if( nCount % 2 == 0 )
             break;
 
-        pszLine = CPLReadLine( fp );
+        pszLine = CPLReadLineL( fp );
         if( pszLine == NULL )
             break;
 
@@ -831,8 +831,8 @@
             CSVScanLinesIngested( psTable, iKeyField, pszValue, eCriteria );
     else
     {
-        VSIRewind( psTable->fp );
-        CPLReadLine( psTable->fp );         /* throw away the header line */
+        VSIRewindL( psTable->fp );
+        CPLReadLineL( psTable->fp );         /* throw away the header line */
     
         psTable->papszRecFields =
             CSVScanLines( psTable->fp, iKeyField, pszValue, eCriteria );
@@ -860,7 +860,7 @@
     
     CPLAssert( fp != NULL && pszFieldName != NULL );
 
-    VSIRewind( fp );
+    VSIRewindL( fp );
 
     papszFields = CSVReadParseLine( fp );
     for( i = 0; papszFields != NULL && papszFields[i] != NULL; i++ )
@@ -1066,7 +1066,7 @@
             return pszResult;
     }
             
-    if( (fp = fopen( "csv/horiz_cs.csv", "rt" )) != NULL )
+    if( (fp = VSIFOpenL( "csv/horiz_cs.csv", "rt" )) != NULL )
     {
         strcpy( pTLSData->szPath, "csv/" );
         CPLStrlcat( pTLSData->szPath, pszBasename, sizeof(pTLSData->szPath) );
@@ -1085,12 +1085,12 @@
         strcpy( pTLSData->szPath, "/usr/local/share/epsg_csv/" );
         CPLStrlcat( pTLSData->szPath, pszBasename, sizeof(pTLSData->szPath) );
 #endif
-        if( (fp = fopen( pTLSData->szPath, "rt" )) == NULL )
+        if( (fp = VSIFOpenL( pTLSData->szPath, "rt" )) == NULL )
             CPLStrlcpy( pTLSData->szPath, pszBasename, sizeof(pTLSData->szPath) );
     }
-
+    
     if( fp != NULL )
-        fclose( fp );
+        VSIFCloseL( fp );
         
     return( pTLSData->szPath );
 }
Index: port/cpl_findfile.cpp
===================================================================
--- port/cpl_findfile.cpp	(revision 18567)
+++ port/cpl_findfile.cpp	(working copy)
@@ -127,12 +127,12 @@
     for( i = nLocations-1; i >= 0; i-- )
     {
         const char  *pszResult;
-        VSIStatBuf  sStat;
+        VSIStatBufL  sStat;
 
         pszResult = CPLFormFilename( pTLSData->papszFinderLocations[i], pszBasename, 
                                      NULL );
 
-        if( VSIStat( pszResult, &sStat ) == 0 )
+        if( VSIStatL( pszResult, &sStat ) == 0 )
             return pszResult;
     }
     
Index: ogr/ogr_srs_esri.cpp
===================================================================
--- ogr/ogr_srs_esri.cpp	(revision 18567)
+++ ogr/ogr_srs_esri.cpp	(working copy)
@@ -379,7 +379,7 @@
 /*      Try to open the datum.csv file.                                 */
 /* -------------------------------------------------------------------- */
     const char  *pszFilename = CSVFilename("gdal_datum.csv");
-    FILE * fp = VSIFOpen( pszFilename, "rb" );
+    FILE * fp = VSIFOpenL( pszFilename, "rb" );
 
 /* -------------------------------------------------------------------- */
 /*      Use simple default set if we can't find the file.               */
@@ -442,7 +442,7 @@
         CSLDestroy( papszFields );
     }
 
-    VSIFClose( fp );
+    VSIFCloseL( fp );
 
     papszDatumMapping[nMappingCount*3+0] = NULL;
     papszDatumMapping[nMappingCount*3+1] = NULL;

