+void seekdir(DIR *dirp, long loc)
+{
+  
+  WCETRACE(WCE_IO, "seekdir: called 0x%p , %d", dirp, loc);
+  if (dirp == NULL ) 
+    {
+      errno = EINVAL;
+    }  
+  
+  if ( loc < 0 )
+    {
+      WCETRACE(WCE_IO, "telldir: Invalid loc %d for DIR dirp 0x%p",
loc,  dirp);
+      errno = EINVAL;
+    }
+  
+else
+    
+    dirp->dd_loc  = loc ;
+  
+}

This looks a bit simple, as you said :-)

I would have expected at least one additional test (whether dd_loc is
smaller than dd_size).

With this implementation, it's quite easy to get things messed up, isn't
it ?

        Danny

On Tue, 2008-03-25 at 17:42 +0100, Mario Latronico wrote:
> 2008/3/21, Danny Backx <[EMAIL PROTECTED]>:
> >  - extend our dirent.c (and submit the extensions), no change to Kaffe
> >
> >         Danny
> 
> I extended dirent.c with the methods telldir() and seekdir(). A patch
> is attached. My implementation is very simple, i'm not sure that it is
> completely correct but for a simple example i compiled for Cygwin/x86
> and Cygwin/ARM it gives the same results.

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to