Pedro Alves wrote:
Hi all,

While porting gdbserver I stumbled on yet again having to provide write and read functions
as wrappers around ReadFile and WriteFile.
This is about the fourth time I do in a short period, so, I've put those functions in libmingwex.a (*), to make this the last time. While I was at it, I added also fdopen, implemented in terms of the wide version found in coredll.dll, and also added open and lseek.

And I missed 'close'.
Here is is. Committed.

Cheers,
Pedro Alves

---

2006-11-12  Pedro Alves  <[EMAIL PROTECTED]>

   * mingwex/wince/close.c: New file.
   * mingwex/Makefile.in (WINCE_DISTFILES): Add close.c.
   (WINCE_OBJS): Add close.o.


Index: Makefile.in
===================================================================
--- Makefile.in (revision 785)
+++ Makefile.in (working copy)
@@ -85,7 +85,7 @@
 
 WINCE_DISTFILES = \
        asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \
-       tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c
+       tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c 
close.c
 
 CC = @CC@
 # FIXME: Which is it, CC or CC_FOR_TARGET?
@@ -185,7 +185,8 @@
        ctan.o ctanf.o ctanl.o ctanh.o ctanhf.o ctanhl.o
 WINCE_OBJS = \
        asctime.o freopen.o gmtime.o localtime.o mktime.o strftime.o time.o \
-       tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o
+       tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o \
+       close.o
 
 ifneq (,$(findstring wince,$(target_alias)))
 LIB_OBJS = $(WINCE_OBJS)
Index: wince/close.c
===================================================================
--- wince/close.c       (revision 0)
+++ wince/close.c       (revision 0)
@@ -0,0 +1,10 @@
+#include <windows.h>
+#include <unistd.h>
+
+int
+_close (int fildes)
+{
+  if (CloseHandle ((HANDLE) fildes))
+    return 0;
+  return -1;
+}

Property changes on: wince\close.c
___________________________________________________________________
Name: svn:eol-style
   + native

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to