Update of /cvsroot/libsysio/libsysio/dev/stdfd
In directory sc8-pr-cvs1:/tmp/cvs-serv12723/dev/stdfd
Modified Files:
Tag: RedStorm
Makefile.am stdfd.c
Log Message:
Merged with current head.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -w -b -B -p -r1.2 -r1.2.6.1
--- Makefile.am 24 Mar 2003 22:09:02 -0000 1.2
+++ Makefile.am 26 Sep 2003 21:28:33 -0000 1.2.6.1
@@ -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.2
retrieving revision 1.2.6.1
diff -u -w -b -B -p -r1.2 -r1.2.6.1
--- stdfd.c 24 Mar 2003 22:09:02 -0000 1.2
+++ stdfd.c 26 Sep 2003 21:28:33 -0000 1.2.6.1
@@ -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.
*/
@@ -120,7 +130,7 @@ doio(ssize_t (*f)(int, char *, size_t),
struct ioctx *ioctx;
const struct iovec *iov;
size_t n;
- ssize_t cc;
+ ssize_t cc = 0;
ioctx = _sysio_ioctx_new(ino, ioargs);
if (!ioctx)
@@ -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
|