Hi,

sorry, <sys/unistd.h> needs to be included in, or symbol doesn't get
exported. Here is the updated diff.


On Fri, Aug 29, 2008 at 3:52 PM, Pawel Veselov <[EMAIL PROTECTED]> wrote:
> Hi,
>
> this attached fix should take care of providing fsync()/fdatasync()
> functionliaty. For now it's a straight call to FlushFileBuffers().
>
> Thanks,
>  Pawel.
>
> On Fri, Aug 29, 2008 at 11:07 AM, Danny Backx <[EMAIL PROTECTED]> wrote:
>
> [ skipped ]
>
>> If you have corrections/submissions of this kind, please send in a
>> patch !
>>
>>        Danny
>> --
>> Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
>>
>>
>
>
>
> --
> With best of best regards
> Pawel S. Veselov
>



-- 
With best of best regards
Pawel S. Veselov
Index: src/newlib/newlib/libc/sys/wince/io.c
===================================================================
--- src/newlib/newlib/libc/sys/wince/io.c	(revision 1168)
+++ src/newlib/newlib/libc/sys/wince/io.c	(working copy)
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <sys/unistd.h>
 #include <fcntl.h>
 #include <reent.h>
 #include <errno.h>
@@ -99,6 +100,21 @@
   LeaveCriticalSection(&critsect);
 }
 
+int fsync(int fd) {
+  WCETRACE(WCE_IO, "syncing descriptor %d", fd);
+  FDCHECK(fd);
+  if (FlushFileBuffers(_fdtab[fd].hnd)) {
+      errno = _winerr2errno(GetLastError());
+      WCETRACE(WCE_IO, "FlushFileBuffers(%d): errno=%d oserr=%d\n", fd, errno, GetLastError());
+      return -1;
+  }
+  return 0;
+}
+
+int fdatasync(int fd) {
+    return fsync(fd);
+}
+
 void
 _initfds()
 {
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to