genericopenlibs/openenvcore/libc/src/link.cpp
branchRCL_3
changeset 15 18da5738c9b6
parent 0 e4d67989cc36
child 45 4b03adbd26ca
equal deleted inserted replaced
10:3a3c1a7fa1e8 15:18da5738c9b6
   177 // -----------------------------------------------------------------------------
   177 // -----------------------------------------------------------------------------
   178 //
   178 //
   179 
   179 
   180 EXPORT_C int lstat(const char *file_name, struct stat *buf)
   180 EXPORT_C int lstat(const char *file_name, struct stat *buf)
   181 	{
   181 	{
   182 	return stat(file_name, buf);
   182     if(!buf)
   183 	}
   183        {
   184 
   184         errno = EFAULT ;
       
   185         return -1 ; 
       
   186        }
       
   187     
       
   188     wchar_t tmpbuf[MAXPATHLEN+1];   
       
   189     if ((size_t)-1 != mbstowcs(tmpbuf, file_name, MAXPATHLEN))
       
   190         {
       
   191         return _lstat_r(&errno, tmpbuf, buf);
       
   192         }
       
   193     errno = EILSEQ;     
       
   194     return -1;    
       
   195 	}
   185 EXPORT_C int __xstat(int /*vers*/, const char *file, struct stat *buf)
   196 EXPORT_C int __xstat(int /*vers*/, const char *file, struct stat *buf)
   186 	{
   197 	{
   187 	return stat(file, buf);
   198 	return stat(file, buf);
   188 	}
   199 	}
   189 
   200 
   190 EXPORT_C int __lxstat (int /*version*/, const char *file, struct stat *buf)
   201 EXPORT_C int __lxstat (int /*version*/, const char *file, struct stat *buf)
   191 	{
   202 	{
   192 	return stat(file, buf);
   203 	return lstat(file, buf);
   193 	}
   204 	}
   194 
   205 
   195     
   206     
   196 } // extern "C"
   207 } // extern "C"
   197 
   208