Update of /cvsroot/libsysio/libsysio/dev/stdfd
In directory sc8-pr-cvs1:/tmp/cvs-serv16191/dev/stdfd
Modified Files:
Makefile.am stdfd.c
Log Message:
merge cplant branch into head
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- Makefile.am 24 Mar 2003 22:09:02 -0000 1.2
+++ Makefile.am 14 Aug 2003 18:39:32 -0000 1.3
@@ -5,3 +5,11 @@ EXTRA_DIST = stdfd.h
libsysio_stdfd_a_SOURCES = stdfd.c
include $(top_srcdir)/Rules.make
+
+if WITH_CPLANT_YOD
+YOD_DRIVER_FLAGS = -DCPLANT_YOD $(YOD_DRIVER_INCLUDE)
+else
+YOD_DRIVER_FLAGS =
+endif
+
+AM_CPPFLAGS += $(YOD_DRIVER_FLAGS)
Index: stdfd.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- stdfd.c 31 Jul 2003 22:21:36 -0000 1.3
+++ stdfd.c 14 Aug 2003 18:39:33 -0000 1.4
@@ -58,6 +58,16 @@
#include "stdfd.h"
+#ifdef CPLANT_YOD
+#include <sys/statfs.h>
+#include "cplant-yod.h"
+#define dowrite(f, b, n) write_yod(f, b, n)
+#define doread(f, b, n) read_yod(f, b, n)
+#else
+#define dowrite(f, b, n) syscall(SYS_write, f, b, n)
+#define doread(f, b, n) syscall(SYS_read, f, b, n)
+#endif
+
/*
* Pre-opened standard file descriptors driver.
*/
@@ -153,7 +163,7 @@ static ssize_t
stdfd_read(int fd, char *buf, size_t nbytes)
{
- return syscall(SYS_read, fd, buf, nbytes);
+ return doread(fd, buf, nbytes);
}
static int
@@ -171,7 +181,7 @@ stdfd_write(int fd,
size_t nbytes)
{
- return syscall(SYS_write, fd, buf, nbytes);
+ return dowrite(fd, buf, nbytes);
}
static int
|