[Libsysio-commit] RedStorm: libsysio/src Makefile.am access.c chdir.c fcntl.c file.c inode.c ioctl.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2003-09-26 21:28:50
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12723/src
Modified Files:
Tag: RedStorm
Makefile.am access.c chdir.c fcntl.c file.c inode.c ioctl.c
lseek.c mount.c namei.c open.c read.c statvfs.c statvfs64.c
write.c
Log Message:
Merged with current head.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/Makefile.am,v
retrieving revision 1.5.6.3
retrieving revision 1.5.6.4
diff -u -w -b -B -p -r1.5.6.3 -r1.5.6.4
--- Makefile.am 30 Jul 2003 14:00:02 -0000 1.5.6.3
+++ Makefile.am 26 Sep 2003 21:28:34 -0000 1.5.6.4
@@ -3,6 +3,13 @@ lib_LIBRARIES = libsysio.a
libsysio_a_SOURCES = chdir.c chmod.c chown.c dev.c dup.c fcntl.c file.c fs.c \
fsync.c getdirentries.c init.c inode.c ioctl.c ioctx.c iowait.c \
lseek.c mkdir.c mknod.c mount.c namei.c open.c read.c rmdir.c stat.c \
- stat64.c symlink.c truncate.c unlink.c write.c access.c
+ 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: access.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/access.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -w -b -B -p -r1.1.2.1 -r1.1.2.2
--- access.c 29 Jul 2003 20:17:22 -0000 1.1.2.1
+++ access.c 26 Sep 2003 21:28:34 -0000 1.1.2.2
@@ -52,10 +52,9 @@ access(const char *path, int amode)
{
gid_t *list, *entry;
size_t n;
- int err;
+ int err = 0;
unsigned mask, mode;
struct stat stbuf;
- int oerrno;
err = 0;
@@ -69,7 +68,7 @@ access(const char *path, int amode)
}
}
err = getgroups(n, list);
- if (err)
+ if (err != (int ) n)
goto out;
err = stat(path, &stbuf);
@@ -85,36 +84,27 @@ access(const char *path, int amode)
mask |= S_IXUSR;
mode = stbuf.st_mode;
- if (stbuf.st_uid == getuid() && (mode & mask) != mask) {
- err = -1;
+ if (stbuf.st_uid == getuid() && (mode & mask) == mask)
goto out;
- }
+
mask >>= 3;
- entry = list;
- while (n--) {
- if (stbuf.st_gid == *entry++) {
- if ((mode & mask) != mask) {
- err = -1;
+ if (stbuf.st_gid == getgid() && (mode & mask) == mask)
goto out;
- }
- break;
- }
- }
- if (stbuf.st_gid == getgid() && (mode & mask) != mask) {
- err = -1;
+
+ entry = list;
+ while (n--)
+ if (stbuf.st_gid == *entry++ && (mode & mask) == mask)
goto out;
- }
+
mask >>= 3;
- if ((mode & mask) != mask) {
- err = -1;
+ if ((mode & mask) == mask)
goto out;
- }
+
+ err = -1;
out:
- oerrno = errno;
if (list)
free(list);
- errno = oerrno;
return err;
}
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.3
retrieving revision 1.3.10.1
diff -u -w -b -B -p -r1.3 -r1.3.10.1
--- chdir.c 9 Mar 2003 16:57:47 -0000 1.3
+++ chdir.c 26 Sep 2003 21:28:34 -0000 1.3.10.1
@@ -98,62 +98,6 @@ chdir(const char *path)
return 0;
}
-char *
-getwd(char *buf)
-{
- size_t len, n;
- struct pnode *tmp;
- char *cp;
-
- /*
- * First pass: Traverse to the root of the sub-tree, remembering
- * lengths.
- */
- len = 0;
- tmp = _sysio_cwd;
- do {
- n = tmp->p_base->pb_name.len;
- len += tmp->p_base->pb_name.len;
- if (n)
- len++;
- tmp = tmp->p_parent;
- /*
- * Traverse mount points.
- */
- while (tmp->p_mount->mnt_root == tmp &&
- tmp != tmp->p_mount->mnt_covers)
- tmp = tmp->p_mount->mnt_root;
- } while (tmp != tmp->p_parent);
- if (!len)
- len++;
- /*
- * Fill in the path buffer -- Backwards, since we're starting
- * from the end.
- */
- cp = buf;
- *cp = PATH_SEPARATOR;
- cp += len;
- *cp = '\0'; /* NUL term */
- tmp = _sysio_cwd;
- do {
- cp -= tmp->p_base->pb_name.len;
- n = tmp->p_base->pb_name.len;
- if (n) {
- (void )strncpy(cp, tmp->p_base->pb_name.name, n);
- *--cp = PATH_SEPARATOR;
- }
- tmp = tmp->p_parent;
- /*
- * Traverse mount points.
- */
- while (tmp->p_mount->mnt_root == tmp &&
- tmp != tmp->p_mount->mnt_covers)
- tmp = tmp->p_mount->mnt_root;
- } while (tmp != tmp->p_parent);
-
- return buf;
-}
-
/*
* Return path tracked by the path ancestor chain.
*
@@ -178,12 +122,6 @@ _sysio_p_path(struct pnode *pno, char **
n = 0;
do {
/*
- * Traverse back through mounts.
- */
- while (pno->p_mount->mnt_root == pno &&
- pno != pno->p_mount->mnt_covers)
- pno = pno->p_mount->mnt_root;
- /*
* Add length of this component to running sum and
* account for this vertex.
*/
@@ -217,20 +155,13 @@ _sysio_p_path(struct pnode *pno, char **
*cp = '\0'; /* NUL terminate */
do {
/*
- * Traverse back through mounts.
- */
- while (pno->p_mount->mnt_root == pno &&
- pno != pno->p_mount->mnt_covers)
- pno = pno->p_mount->mnt_root;
- /*
* 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 +180,23 @@ 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
+
+#ifdef PATH_MAX
+char *
+getwd(char *buf)
+{
+
+ if (!buf)
+ return -EFAULT;
+
+ return getcwd(buf, PATH_MAX);
+}
+#endif
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- fcntl.c 4 Apr 2003 20:09:47 -0000 1.3
+++ fcntl.c 26 Sep 2003 21:28:34 -0000 1.3.4.1
@@ -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: file.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/file.c,v
retrieving revision 1.4
retrieving revision 1.4.10.1
diff -u -w -b -B -p -r1.4 -r1.4.10.1
--- file.c 9 Mar 2003 17:18:57 -0000 1.4
+++ file.c 26 Sep 2003 21:28:34 -0000 1.4.10.1
@@ -128,7 +128,7 @@ fd_grow(size_t n)
if (n < 8)
n = 8;
- if (n > _sysio_oftab_size && n - _sysio_oftab_size < _sysio_oftab_size)
+ if (n >= _sysio_oftab_size && n - _sysio_oftab_size < _sysio_oftab_size)
n = (n + 1) * 2;
noftab = realloc(_sysio_oftab, n * sizeof(struct file *));
if (!noftab)
Index: inode.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v
retrieving revision 1.7.4.1
retrieving revision 1.7.4.2
diff -u -w -b -B -p -r1.7.4.1 -r1.7.4.2
--- inode.c 29 Jul 2003 19:05:08 -0000 1.7.4.1
+++ inode.c 26 Sep 2003 21:28:34 -0000 1.7.4.2
@@ -497,43 +497,19 @@ _sysio_p_gone(struct pnode *pno)
int
_sysio_p_validate(struct pnode *pno, struct intent *intnt, const char *path)
{
- struct pnode *parent;
- int err;
struct inode *ino;
+ struct pnode_base *rootpb;
+ int err;
- err = 0;
-
+ ino = pno->p_base->pb_ino;
/*
- * Make sure we can use the parent. We don't validate that
- * unless we have to. Beware of this! It's assuming the caller
- * recently revalidated. Namei will do this for instance.
- */
- parent = pno->p_parent;
- if (!parent->p_base->pb_ino) {
- err = _sysio_p_validate(parent, NULL, NULL);
- if (err) {
- /*
- * I really, really want to smash the association
- * of the passed path node with it's i-node. Can't
- * do it, though, since at least one FS driver can
- * still accomplish IO accesses to the currently
- * held i-node. For now, the driver needs to
- * record that the i-node has become (semi) invalid
- * and return appropriate errors itself.
- *
- * We *might* be able to do this, now, with the
- * recent changes to the open file table. Must check
- * on it. It is so annoying to have these half
- * dead i-nodes hanging around.
+ * An invalid pnode will not have an associated inode. We'll use
+ * the FS root inode, then -- It *must* be valid.
*/
- return err;
- }
- }
-
- ino = pno->p_base->pb_ino;
- if (!err)
+ rootpb = pno->p_mount->mnt_root->p_base;
+ assert(rootpb->pb_ino);
err =
- parent->p_base->pb_ino->i_ops.inop_lookup(pno,
+ rootpb->pb_ino->i_ops.inop_lookup(pno,
&ino,
intnt,
path);
@@ -630,6 +606,30 @@ _sysio_p_find_alias(struct pnode *parent
}
/*
+ * Prune idle path base nodes freom the passed sub-tree, including the root.
+ */
+static void
+_sysio_prune(struct pnode_base *rpb)
+{
+ struct pnode_base *nxtpb, *pb;
+
+ nxtpb = rpb->pb_children.lh_first;
+ while ((pb = nxtpb)) {
+ nxtpb = pb->pb_sibs.le_next;
+ if (pb->pb_aliases.lh_first)
+ continue;
+ if (pb->pb_children.lh_first) {
+ _sysio_prune(pb);
+ continue;
+ }
+ _sysio_pb_gone(pb);
+ }
+ if (rpb->pb_children.lh_first)
+ return;
+ _sysio_pb_gone(rpb);
+}
+
+/*
* Prune idle nodes from the passed sub-tree, including the root.
*
* Returns the number of aliases on the same mount that could not be pruned.
@@ -647,6 +647,10 @@ _sysio_p_prune(struct pnode *root)
while ((pb = nxtpb)) {
nxtpb = pb->pb_sibs.le_next;
nxtpno = pb->pb_aliases.lh_first;
+ if (!nxtpno) {
+ _sysio_prune(pb);
+ continue;
+ }
while ((pno = nxtpno)) {
nxtpno = pno->p_links.le_next;
if (pno->p_mount != root->p_mount) {
@@ -688,10 +692,10 @@ _sysio_p_prune(struct pnode *root)
if (_sysio_do_unmount(pno->p_mount) != 0) {
P_RELE(pno);
count++;
- continue;
}
+ continue;
#endif
- } else
+ }
_sysio_p_gone(pno);
}
}
@@ -706,9 +710,9 @@ _sysio_p_prune(struct pnode *root)
/*
* All that is left is the root. Try for it too.
*/
- if (root->p_ref)
+ if (root->p_ref) {
count++;
- else if (root->p_mount->mnt_root == root) {
+ } else if (root->p_mount->mnt_root == root) {
#ifndef AUTOMOUNT_FILE_NAME
count++;
#else
Index: ioctl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.14.1
diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.14.1
--- ioctl.c 22 Feb 2003 16:33:07 -0000 1.1.1.1
+++ ioctl.c 26 Sep 2003 21:28:34 -0000 1.1.1.1.14.1
@@ -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.4.4.1
retrieving revision 1.4.4.2
diff -u -w -b -B -p -r1.4.4.1 -r1.4.4.2
--- lseek.c 12 May 2003 11:48:45 -0000 1.4.4.1
+++ lseek.c 26 Sep 2003 21:28:34 -0000 1.4.4.2
@@ -58,7 +58,7 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset
{
int err;
struct file *fil;
- off_t off;
+ off_t off = 0;
struct intnl_stat stbuf;
err = 0;
@@ -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: mount.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -w -b -B -p -r1.5 -r1.5.4.1
--- mount.c 18 Apr 2003 20:24:05 -0000 1.5
+++ mount.c 26 Sep 2003 21:28:34 -0000 1.5.4.1
@@ -106,8 +106,8 @@ _sysio_do_mount(struct filesys *fs,
struct inode *ino;
/*
- * It's really poor form to allow the new root to be
- * descendant of the pnode being covered.the one being covered.
+ * It's really poor form to allow the new root to be a
+ * descendant of the pnode being covered.
*/
if (tocover) {
struct pnode_base *pb;
@@ -142,7 +142,8 @@ _sysio_do_mount(struct filesys *fs,
/*
* Get alias for the new root.
*/
- mnt->mnt_root = _sysio_p_new_alias(NULL, rootpb, mnt);
+ mnt->mnt_root =
+ _sysio_p_new_alias(tocover ? tocover->p_parent : NULL, rootpb, mnt);
if (!mnt->mnt_root) {
err = -ENOMEM;
goto error;
@@ -541,11 +542,12 @@ parse_opts(char *opts, unsigned *flagsp)
*dst++ = *src++;
while (src != cp);
}
- *dst = '\0';
if (!*src)
break;
+ *dst = '\0';
src++; /* skip comma */
}
+ *dst = '\0';
*flagsp = flags;
return opts;
Index: namei.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v
retrieving revision 1.5.6.1
retrieving revision 1.5.6.2
diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.2
--- namei.c 29 Jul 2003 19:05:09 -0000 1.5.6.1
+++ namei.c 26 Sep 2003 21:28:34 -0000 1.5.6.2
@@ -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.4.1
retrieving revision 1.7.4.2
diff -u -w -b -B -p -r1.7.4.1 -r1.7.4.2
--- open.c 19 May 2003 13:51:20 -0000 1.7.4.1
+++ open.c 26 Sep 2003 21:28:34 -0000 1.7.4.2
@@ -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.
*/
@@ -230,3 +238,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.2.10.1
diff -u -w -b -B -p -r1.2 -r1.2.10.1
--- read.c 9 Mar 2003 06:36:37 -0000 1.2
+++ read.c 26 Sep 2003 21:28:34 -0000 1.2.10.1
@@ -57,9 +57,10 @@
* Schedule asynchronous read of iovec at some file extent.
*/
static struct ioctx *
-do_ipreadv(struct file *fil,
+do_ixreadv(struct file *fil,
const struct iovec *iov, size_t count,
- off_t offset)
+ off_t offset,
+ void (*fcompletio)(struct ioctx *))
{
struct inode *ino;
int err;
@@ -82,7 +83,7 @@ do_ipreadv(struct file *fil,
IOARG_INIT(&ioarguments,
iov, count,
offset,
- (void (*)(void *))_sysio_fcompletio, fil);
+ (void (*)(void *))fcompletio, fil);
err = ino->i_ops.inop_ipreadv(fil->f_ino, &ioarguments, &ioctx);
if (err) {
errno = -err;
@@ -106,7 +107,7 @@ ipreadv(int fd, const struct iovec *iov,
return IOID_FAIL;
}
- ioctxp = do_ipreadv(fil, iov, count, offset);
+ ioctxp = do_ixreadv(fil, iov, count, offset, NULL);
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -168,7 +169,7 @@ ireadv(int fd, const struct iovec *iov,
return IOID_FAIL;
}
- ioctxp = do_ipreadv(fil, iov, count, fil->f_pos);
+ ioctxp = do_ixreadv(fil, iov, count, fil->f_pos, _sysio_fcompletio);
if (!ioctxp)
return IOID_FAIL;
return ioctxp->ioctx_id;
@@ -222,5 +223,13 @@ read_list(int fd,
{
errno = ENOSYS;
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: statvfs.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v
retrieving revision 1.3.6.1
retrieving revision 1.3.6.2
diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.2
--- statvfs.c 12 May 2003 11:48:45 -0000 1.3.6.1
+++ statvfs.c 26 Sep 2003 21:28:34 -0000 1.3.6.2
@@ -41,6 +41,8 @@
* le...@sa...
*/
+#ifdef _HAVE_STATVFS
+
#if !(defined(BSD) || defined(REDSTORM))
#include <unistd.h>
@@ -139,3 +141,4 @@ out:
return err;
}
#endif /* if !(defined(BSD) || defined(REDSTORM)) */
+#endif /* defined(_HAVE_STATVFS) */
Index: statvfs64.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v
retrieving revision 1.3.6.1
retrieving revision 1.3.6.2
diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.2
--- statvfs64.c 12 May 2003 11:48:45 -0000 1.3.6.1
+++ statvfs64.c 26 Sep 2003 21:28:34 -0000 1.3.6.2
@@ -41,6 +41,8 @@
* le...@sa...
*/
+#ifdef _HAVE_STATVFS
+
#if !(defined(BSD) || defined(REDSTORM))
#include <unistd.h>
#include <errno.h>
@@ -95,3 +97,4 @@ out:
return err;
}
#endif /* if !(defined(BSD) || defined(REDSTORM)) */
+#endif /* define(_HAVE_STATVFS) */
Index: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.2
retrieving revision 1.2.12.1
diff -u -w -b -B -p -r1.2 -r1.2.12.1
--- write.c 7 Mar 2003 03:31:36 -0000 1.2
+++ write.c 26 Sep 2003 21:28:34 -0000 1.2.12.1
@@ -59,9 +59,10 @@
* Schedule asynchronous write of iovec at some file extent.
*/
static struct ioctx *
-do_ipwritev(struct file *fil,
+do_ixwritev(struct file *fil,
const struct iovec *iov, size_t count,
- off_t offset)
+ off_t offset,
+ void (*fcompletio)(struct ioctx *))
{
struct inode *ino;
int err;
@@ -88,7 +89,7 @@ do_ipwritev(struct file *fil,
IOARG_INIT(&ioarguments,
iov, count,
offset,
- (void (*)(void *))_sysio_fcompletio, fil);
+ (void (*)(void *))fcompletio, fil);
err = ino->i_ops.inop_ipwritev(fil->f_ino, &ioarguments, &ioctx);
if (err) {
errno = -err;
@@ -112,7 +113,7 @@ ipwritev(int fd, const struct iovec *iov
return IOID_FAIL;
}
- ioctxp = do_ipwritev(fil, iov, count, offset);
+ ioctxp = do_ixwritev(fil, iov, count, offset, NULL);
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -174,7 +175,7 @@ iwritev(int fd, const struct iovec *iov,
return IOID_FAIL;
}
- ioctxp = do_ipwritev(fil, iov, count, fil->f_pos);
+ ioctxp = do_ixwritev(fil, iov, count, fil->f_pos, _sysio_fcompletio);
if (!ioctxp)
return IOID_FAIL;
return ioctxp->ioctx_id;
@@ -230,3 +231,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
+
|