[Libsysio-commit] RedStorm_merge: libsysio/dev/stdfd Makefile.am stdfd.c
Brought to you by:
lward
From: Sonja T. <so...@us...> - 2003-10-09 15:04:15
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1:/tmp/cvs-serv7240/dev/stdfd Modified Files: Tag: RedStorm_merge Makefile.am stdfd.c Log Message: Merging redstorm changes Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.10.1 diff -u -w -b -B -p -r1.2 -r1.2.10.1 --- Makefile.am 24 Mar 2003 22:09:02 -0000 1.2 +++ Makefile.am 9 Oct 2003 15:04:09 -0000 1.2.10.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.10.1 diff -u -w -b -B -p -r1.2 -r1.2.10.1 --- stdfd.c 24 Mar 2003 22:09:02 -0000 1.2 +++ stdfd.c 9 Oct 2003 15:04:09 -0000 1.2.10.1 @@ -58,6 +58,20 @@ #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 + +#ifdef REDSTORM +#include <catamount/syscall.h> +#endif + /* * Pre-opened standard file descriptors driver. */ @@ -120,7 +134,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 +167,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 +185,7 @@ stdfd_write(int fd, size_t nbytes) { - return syscall(SYS_write, fd, buf, nbytes); + return dowrite(fd, buf, nbytes); } static int |