[Libsysio-commit] HEAD: libsysio/src Makefile.am chdir.c fcntl.c ioctl.c lseek.c namei.c open.c read
Brought to you by:
lward
|
From: Ruth K. <rk...@us...> - 2003-08-14 19:22:03
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv16191/src
Modified Files:
Makefile.am chdir.c fcntl.c ioctl.c lseek.c namei.c open.c
read.c write.c
Log Message:
merge cplant branch into head
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -b -B -p -r1.6 -r1.7
--- Makefile.am 29 Jul 2003 19:53:33 -0000 1.6
+++ Makefile.am 14 Aug 2003 18:39:33 -0000 1.7
@@ -6,3 +6,10 @@ libsysio_a_SOURCES = chdir.c chmod.c cho
stat64.c statvfs.c symlink.c truncate.c unlink.c write.c access.c
include $(top_srcdir)/Rules.make
+
+if WITH_CPLANT_YOD
+YOD_DRIVER_FLAGS = -DCPLANT_YOD
+else
+YOD_DRIVER_FLAGS =
+endif
+AM_CPPFLAGS += ${YOD_DRIVER_FLAGS}
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- chdir.c 9 Mar 2003 16:57:47 -0000 1.3
+++ chdir.c 14 Aug 2003 18:39:33 -0000 1.4
@@ -226,11 +226,10 @@ _sysio_p_path(struct pnode *pno, char **
* Add component and separator.
*/
cp -= pno->p_base->pb_name.len;
- if (pno->p_base->pb_name.len)
- (void )memcpy(cp--,
- pno->p_base->pb_name.name,
+ (void )memcpy(cp, pno->p_base->pb_name.name,
pno->p_base->pb_name.len);
- *cp = PATH_SEPARATOR;
+
+ *--cp = PATH_SEPARATOR;
pno = pno->p_parent;
} while (pno != pno->p_parent);
@@ -249,3 +248,12 @@ getcwd(char *buf, size_t size)
}
return buf;
}
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+char *
+__getcwd(char *buf, size_t size)
+{
+ return getcwd(buf, size);
+}
+#endif
+
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- fcntl.c 4 Apr 2003 20:09:47 -0000 1.3
+++ fcntl.c 14 Aug 2003 18:39:33 -0000 1.4
@@ -95,3 +95,18 @@ out:
}
return err;
}
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+int
+__fcntl(int fd, int cmd, ...)
+{
+ int rc;
+ va_list ap;
+
+ va_start(ap, cmd);
+ rc = fcntl(fd, cmd, ap);
+ va_end(ap);
+
+ return rc;
+}
+#endif
Index: ioctl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -w -b -B -p -r1.1.1.1 -r1.2
--- ioctl.c 22 Feb 2003 16:33:07 -0000 1.1.1.1
+++ ioctl.c 14 Aug 2003 18:39:33 -0000 1.2
@@ -75,3 +75,19 @@ out:
}
return err;
}
+
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+int
+__ioctl(int fd, unsigned long request, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start(ap, request);
+ rc = ioctl(fd, request, ap);
+ va_end(ap);
+
+ return rc;
+}
+#endif
Index: lseek.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- lseek.c 31 Jul 2003 22:21:35 -0000 1.5
+++ lseek.c 14 Aug 2003 18:39:33 -0000 1.6
@@ -113,3 +113,31 @@ lseek(int fd, off_t offset, int whence)
return (off_t )_sysio_lseek(fd, offset, whence);
}
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+
+off_t
+__lseek(int fd, off_t offset, int whence)
+{
+ return lseek(fd, offset, whence);
+}
+
+loff_t
+__lseek64( int fd, loff_t offset, int whence)
+{
+ return lseek( fd, offset, whence );
+}
+
+loff_t
+__llseek( int fd, loff_t offset, int whence)
+{
+ return __lseek64(fd, offset, whence);
+}
+
+loff_t
+__llseek64( int fd, loff_t offset, int whence)
+{
+ return __lseek64(fd, offset, whence);
+}
+
+#endif
Index: namei.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -b -B -p -r1.6 -r1.7
--- namei.c 11 Jun 2003 20:43:34 -0000 1.6
+++ namei.c 14 Aug 2003 18:39:33 -0000 1.7
@@ -434,6 +434,33 @@ _sysio_path_walk(struct pnode *parent, s
return err;
}
+#ifdef CPLANT_YOD
+static const char *
+strip_prefix(const char *path)
+{
+
+ /*
+ * for backward compatibility w/protocol switch
+ * remove 'prefix:' iff first ':' immediately
+ * precedes first '/'
+ */
+
+ char *colon, *slash;
+
+ colon = strchr(path, ':');
+ slash = strchr(path, '/');
+
+ if (slash == colon + 1)
+ return(slash);
+ else
+ return(path);
+
+}
+#define STRIP_PREFIX(p) strip_prefix(p)
+#else
+#define STRIP_PREFIX(p) p
+#endif
+
/*
* Expanded form of the path-walk routine, with the common arguments, builds
* the nameidata bundle and calls path-walk.
@@ -448,7 +475,7 @@ _sysio_namei(struct pnode *parent,
struct nameidata nameidata;
int err;
- ND_INIT(&nameidata, flags, path, _sysio_root, intnt);
+ ND_INIT(&nameidata, flags, STRIP_PREFIX(path), _sysio_root, intnt);
err = _sysio_path_walk(parent, &nameidata);
if (!err)
*pnop = nameidata.nd_pno;
Index: open.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/open.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -b -B -p -r1.7 -r1.8
--- open.c 23 Apr 2003 18:13:44 -0000 1.7
+++ open.c 14 Aug 2003 18:39:33 -0000 1.8
@@ -49,6 +49,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/queue.h>
+#include <features.h>
#include "sysio.h"
#include "inode.h"
@@ -56,6 +57,13 @@
#include "fs.h"
#include "mount.h"
+#ifdef __GLIBC__
+#undef open
+#undef __open
+#undef open64
+#undef __open64
+#endif
+
/*
* Open file support.
*/
@@ -225,3 +233,49 @@ umask(mode_t mask)
_sysio_umask = mask & 0777;
return omask;
}
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+int
+open64(const char *fname, int flags, ...)
+{
+ va_list ap;
+ mode_t mode;
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
+ return open(fname, flags, mode);
+}
+
+int
+__open64(const char *fname, int flags, ...)
+{
+ va_list ap;
+ mode_t mode;
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
+ return open(fname, flags, mode);
+}
+int
+__open(const char *fname, int flags, ...)
+{
+ va_list ap;
+ mode_t mode;
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
+ return open(fname, flags, mode);
+}
+
+int
+__close(int fd) {
+
+ return close(fd);
+}
+#endif
Index: read.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/read.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- read.c 9 Mar 2003 06:36:37 -0000 1.2
+++ read.c 14 Aug 2003 18:39:33 -0000 1.3
@@ -224,3 +224,11 @@ read_list(int fd,
return -1;
}
#endif
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+ssize_t
+__read(int fd, void *buf, size_t count)
+{
+ return read(fd, buf, count);
+}
+#endif
Index: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- write.c 7 Mar 2003 03:31:36 -0000 1.2
+++ write.c 14 Aug 2003 18:39:33 -0000 1.3
@@ -230,3 +230,18 @@ write_list(int fd,
return -1;
}
#endif
+
+#if defined(__GLIBC__) && defined(ALPHA_LINUX)
+ssize_t
+__write(int fd, const void *buf, size_t count)
+{
+ return write(fd, buf, count);
+}
+
+ssize_t
+__writev(int fd, const struct iovec *iov, int count)
+{
+ return writev(fd, iov, count);
+}
+#endif
+
|