[Libsysio-commit] namespace_assembly: libsysio/src access.c chdir.c chmod.c chown.c dev.c dup.c fcnt
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:10
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/src Modified Files: Tag: namespace_assembly access.c chdir.c chmod.c chown.c dev.c dup.c fcntl.c fsync.c getdirentries.c init.c inode.c ioctl.c iowait.c link.c lseek.c mkdir.c mknod.c namei.c open.c read.c rmdir.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c write.c Log Message: Bring in changes from the HEAD. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -w -b -B -p -r1.2 -r1.2.6.1 --- access.c 6 Aug 2003 19:10:26 -0000 1.2 +++ access.c 28 Jan 2004 13:16:56 -0000 1.2.6.1 @@ -47,6 +47,8 @@ #include <sys/stat.h> #include <unistd.h> +#include "sysio-symbols.h" + int access(const char *path, int amode) { @@ -108,3 +110,8 @@ out: return err; } + +#ifdef REDSTORM +#undef __access +sysio_sym_weak_alias(access, __access) +#endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -w -b -B -p -r1.10 -r1.10.2.1 --- chdir.c 27 Oct 2003 23:42:29 -0000 1.10 +++ chdir.c 28 Jan 2004 13:16:56 -0000 1.10.2.1 @@ -119,14 +118,19 @@ chdir(const char *path) { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } - return _sysio_p_chdir(pno); + err = _sysio_p_chdir(pno); + + SYSIO_LEAVE; + return err; } /* @@ -135,6 +139,11 @@ chdir(const char *path) * If the buf pointer is NULL, a buffer large enough to hold the path * is allocated from the heap. */ +#ifdef REDSTORM +#undef __chdir +sysio_sym_weak_alias(chdir, __chdir) +#endif + static int _sysio_p_path(struct pnode *pno, char **buf, size_t size) { @@ -219,12 +228,15 @@ char * getcwd(char *buf, size_t size) { int err; + SYSIO_ENTER; err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); if (err) { errno = -err; + SYSIO_LEAVE; return NULL; } + SYSIO_LEAVE; return buf; } @@ -232,7 +244,7 @@ getcwd(char *buf, size_t size) sysio_sym_weak_alias(getcwd, __getcwd) #endif -#ifdef PATH_MAX +#if defined(PATH_MAX) && !(defined(REDSTORM)) char * getwd(char *buf) { Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- chmod.c 27 Sep 2003 19:42:02 -0000 1.4 +++ chmod.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int do_chmod(struct pnode *pno, struct inode *ino, mode_t mode) @@ -70,12 +71,11 @@ do_chmod(struct pnode *pno, struct inode int chmod(const char *path, mode_t mode) { - struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; - INTENT_INIT(&intent, INT_SETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); + err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; err = do_chmod(pno, pno->p_base->pb_ino, mode); @@ -85,9 +85,15 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } +#ifdef REDSTORM +#undef __chmod +sysio_sym_weak_alias(chmod, __chmod) +#endif + int fchmod(int fd, mode_t mode) { @@ -109,3 +115,8 @@ out: } return err; } + +#ifdef REDSTORM +#undef __fchmod +sysio_sym_weak_alias(fchmod, __fchmod) +#endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- chown.c 27 Sep 2003 19:42:02 -0000 1.4 +++ chown.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int _do_chown(struct pnode *pno, struct inode *ino, uid_t owner, gid_t group) @@ -59,6 +60,7 @@ _do_chown(struct pnode *pno, struct inod int err; struct intnl_stat stbuf; unsigned mask; + SYSIO_ENTER; (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); mask = 0; @@ -91,7 +93,13 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __chown +sysio_sym_weak_alias(chown, __chown) +#endif + } int @@ -113,5 +121,10 @@ out: errno = -err; err = -1; } + +#ifdef REDSTORM +#undef __fchown +sysio_sym_weak_alias(fchown, __fchown) +#endif return err; } Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- dev.c 10 Oct 2003 18:50:31 -0000 1.4 +++ dev.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -158,7 +158,7 @@ _sysio_dev_lookup(mode_t mode, dev_t dev struct device *devtbl; dev_t major; - if (S_ISCHR(mode)) + if (S_ISCHR(mode) || S_ISFIFO(mode)) devtbl = cdev; else return (struct inode_ops *)&_sysio_nodev_ops; Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- dup.c 23 Oct 2003 15:16:05 -0000 1.2 +++ dup.c 28 Jan 2004 13:16:56 -0000 1.2.2.1 @@ -48,29 +48,61 @@ #include "sysio.h" #include "file.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" int dup2(int oldfd, int newfd) { + int rc; + SYSIO_ENTER; if (newfd < 0) { errno = EBADF; + SYSIO_LEAVE; return -1; } - if (oldfd == newfd) + if (oldfd == newfd) { +#ifdef REDSTORM +#undef __dup2 +sysio_sym_weak_alias(dup2, __dup2) +#endif + + SYSIO_LEAVE; return newfd; + } + + rc = _sysio_fd_dup2(oldfd, newfd); + if (rc < 0) { + +#ifdef REDSTORM +#undef __dup +sysio_sym_weak_alias(dup, __dup) +#endif + errno = -rc; + rc = -1; + } - return _sysio_fd_dup2(oldfd, newfd); + SYSIO_LEAVE; + return rc; } int dup(int oldfd) { + int rc; + SYSIO_ENTER; + + rc = _sysio_fd_dup2(oldfd, -1); + if (rc < 0) { + errno = -rc; + rc = -1; + } - return _sysio_fd_dup2(oldfd, -1); + SYSIO_LEAVE; + return rc; } #ifdef __GLIBC__ Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- fcntl.c 14 Oct 2003 18:00:29 -0000 1.6 +++ fcntl.c 28 Jan 2004 13:16:56 -0000 1.6.2.1 @@ -59,6 +59,7 @@ fcntl(int fd, int cmd, ...) int err; struct file *fil; va_list ap; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -72,6 +73,7 @@ fcntl(int fd, int cmd, ...) case F_DUPFD: { long newfd; + int rc; va_start(ap, cmd); newfd = va_arg(ap, long); @@ -80,7 +82,10 @@ fcntl(int fd, int cmd, ...) err = -EBADF; goto out; } - return _sysio_fd_dup2(fd, (int )newfd); + rc = _sysio_fd_dup2(fd, (int )newfd); + + SYSIO_LEAVE; + return rc; } break; default: @@ -95,6 +100,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } @@ -103,7 +109,7 @@ out: sysio_sym_weak_alias(fcntl, __fcntl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fcntl sysio_sym_weak_alias(fcntl, _fcntl) #endif Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.2 retrieving revision 1.2.16.1 diff -u -w -b -B -p -r1.2 -r1.2.16.1 --- fsync.c 9 Mar 2003 06:22:43 -0000 1.2 +++ fsync.c 28 Jan 2004 13:16:56 -0000 1.2.16.1 @@ -55,17 +55,22 @@ fsync(int fd) { struct file *fil; int err; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; + SYSIO_LEAVE; return -1; } err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + + SYSIO_LEAVE; return 0; } @@ -74,16 +79,21 @@ fdatasync(int fd) { struct file *fil; int err; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; + SYSIO_LEAVE; return -1; } err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + + SYSIO_LEAVE; return 0; } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- getdirentries.c 14 Oct 2003 18:00:29 -0000 1.4 +++ getdirentries.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -96,8 +95,10 @@ getdirentries(int fd, size_t n; size_t reclen; char *cp; + SYSIO_ENTER; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) + #ifdef __GLIBC__ #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ @@ -102,11 +103,15 @@ getdirentries(int fd, #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ ~(__alignof__ (struct dirent) - 1)) -#define _fast_alloc(n) alloca(n) -#define _fast_free(p) #else /* !defined(__GLIBC__) */ #define _dreclen(namlen) \ _rndup(_dbaselen + (namlen) + 1, sizeof(int)) +#endif + +#if defined(__GLIBC__) && !(defined(REDSTORM)) +#define _fast_alloc(n) alloca(n) +#define _fast_free(p) +#else /* !defined(__GLIBC__) || defined(REDSTORM) */ #define _fast_alloc(n) malloc(n) #define _fast_free(p) free(p) #endif @@ -128,6 +133,7 @@ getdirentries(int fd, ibuf = _fast_alloc(inbytes); if (!ibuf) { errno = ENOMEM; + SYSIO_LEAVE; return -1; } @@ -199,6 +205,7 @@ out: if (dp == (struct dirent *)buf && cc < 0) { errno = (int )-cc; + SYSIO_LEAVE; return -1; } cc = (char *)dp - buf; @@ -209,6 +216,7 @@ out: #else off; #endif + SYSIO_LEAVE; return cc; #ifdef __GLIBC__ @@ -222,6 +230,10 @@ out: sysio_sym_strong_alias(_getdirentries64, getdirentries) #endif +#ifdef REDSTORM +#undef __getdirentries +sysio_sym_weak_alias(getdirentries, __getdirentries) +#endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries sysio_sym_weak_alias(getdirentries, _getdirentries) Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -u -w -b -B -p -r1.3 -r1.3.12.1 --- init.c 24 Mar 2003 22:09:06 -0000 1.3 +++ init.c 28 Jan 2004 13:16:56 -0000 1.3.12.1 @@ -64,6 +64,9 @@ int _sysio_init() { int err; +#ifdef WITH_SOCKETS + int _sysio_sockets_init(void); +#endif err = _sysio_ioctx_init(); if (err) @@ -83,6 +86,11 @@ _sysio_init() if (err) goto error; #endif +#ifdef WITH_SOCKETS + err = _sysio_sockets_init(); + if (err) + goto error; +#endif goto out; error: Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- inode.c 15 Oct 2003 18:00:57 -0000 1.11 +++ inode.c 28 Jan 2004 13:16:56 -0000 1.11.2.1 @@ -217,7 +217,7 @@ _sysio_i_new(struct filesys *fs, if (!ino) return NULL; ino->i_ops = *ops; - if (S_ISBLK(type) || S_ISCHR(type)) { + if (S_ISBLK(type) || S_ISCHR(type) || S_ISFIFO(type)) { struct inode_ops *o; /* Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- ioctl.c 14 Oct 2003 18:00:30 -0000 1.4 +++ ioctl.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -58,6 +58,7 @@ ioctl(int fd, unsigned long request, ... int err; struct file *fil; va_list ap; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -75,6 +76,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } @@ -84,7 +86,7 @@ out: sysio_sym_weak_alias(ioctl, __ioctl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _ioctl sysio_sym_weak_alias(ioctl, _ioctl) #endif Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- iowait.c 17 Oct 2003 21:30:29 -0000 1.4 +++ iowait.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -70,13 +70,19 @@ int iodone(ioid_t ioid) { struct ioctx *ioctx; + int rc; + SYSIO_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) + if (!ioctx) { + SYSIO_LEAVE; return -1; + } - return (ioctx->ioctx_done || + rc = (ioctx->ioctx_done || (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); + SYSIO_LEAVE; + return rc; } /* @@ -90,15 +96,19 @@ iowait(ioid_t ioid) { struct ioctx *ioctx; ssize_t cc; + SYSIO_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) + if (!ioctx) { + SYSIO_LEAVE; return -1; + } cc = _sysio_ioctx_wait(ioctx); if (cc < 0) { errno = -(int )cc; cc = -1; } + SYSIO_LEAVE; return cc; } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -w -b -B -p -r1.2 -r1.2.4.1 --- link.c 20 Oct 2003 16:31:23 -0000 1.2 +++ link.c 28 Jan 2004 13:16:56 -0000 1.2.4.1 @@ -52,6 +52,7 @@ #include "sysio.h" #include "mount.h" #include "inode.h" +#include "sysio-symbols.h" int link(const char *oldpath, const char *newpath) @@ -100,3 +101,8 @@ error2: out: return err; } + +#ifdef REDSTORM +#undef __link +sysio_sym_weak_alias(link, __link) +#endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- lseek.c 29 Oct 2003 00:10:42 -0000 1.9 +++ lseek.c 28 Jan 2004 13:16:56 -0000 1.9.2.1 @@ -110,6 +110,10 @@ sysio_sym_weak_alias(_sysio_lseek, lseek #undef __lseek64 sysio_sym_weak_alias(_sysio_lseek, __lseek64) #endif +#ifdef REDSTORM +#undef __libc_lseek64 +sysio_sym_weak_alias(_sysio_lseek, __libc_lseek64) +#endif #endif #undef lseek @@ -119,15 +123,20 @@ lseek(int fd, off_t offset, int whence) { _SYSIO_OFF_T off; off_t rtn; + SYSIO_ENTER; off = _sysio_lseek(fd, offset, whence); - if (off < 0) + if (off < 0) { + SYSIO_LEAVE; return -1; + } rtn = (off_t )off; if ((_SYSIO_OFF_T )rtn != off) { errno = EINVAL; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return rtn; } Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -u -w -b -B -p -r1.3 -r1.3.12.1 --- mkdir.c 24 Mar 2003 22:09:06 -0000 1.3 +++ mkdir.c 28 Jan 2004 13:16:56 -0000 1.3.12.1 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int mkdir(const char *path, mode_t mode) @@ -58,6 +59,7 @@ mkdir(const char *path, mode_t mode) int err; struct intent intent; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); @@ -80,5 +82,12 @@ out: errno = -err; err = -1; } + + +#ifdef REDSTORM +#undef __mkdir +sysio_sym_weak_alias(mkdir, __mkdir) +#endif + SYSIO_LEAVE; return err; } Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- mknod.c 10 Oct 2003 18:50:31 -0000 1.4 +++ mknod.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -81,7 +81,8 @@ __xmknod(int __ver, const char *path, mo /* * Support only character-special right now. */ - if ((mode & S_IFMT) != S_IFCHR) { + if (((mode & S_IFMT) != S_IFIFO) && + ((mode & S_IFMT) != S_IFCHR)) { err = -EPERM; goto out; } @@ -110,12 +111,22 @@ out: } return err; } +#ifdef REDSTORM +#undef _xmknod +sysio_sym_weak_alias(__xmknod, _xmknod) +#endif + static int __mknod(const char *path, mode_t mode, dev_t dev) { + int rc; + SYSIO_ENTER; + + rc = __xmknod(_MKNOD_VER, path, mode, &dev); - return __xmknod(_MKNOD_VER, path, mode, &dev); + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__mknod, mknod) Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- namei.c 28 Oct 2003 20:59:39 -0000 1.8 +++ namei.c 28 Jan 2004 13:16:56 -0000 1.8.2.1 @@ -435,28 +435,12 @@ _sysio_path_walk(struct pnode *parent, s } #ifdef CPLANT_YOD -static const char * -strip_prefix(const char *path) -{ - /* * for backward compatibility w/protocol switch - * remove 'prefix:' iff first ':' immediately - * precedes first '/' + * remove everything up to the first ':' + * fortran libs prepend cwd to path, so not much choice */ - - 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) +#define STRIP_PREFIX(p) strchr(p,':') ? strchr(p,':')+1 : p #else #define STRIP_PREFIX(p) p #endif Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- open.c 14 Oct 2003 18:00:30 -0000 1.11 +++ open.c 28 Jan 2004 13:16:56 -0000 1.11.2.1 @@ -55,6 +55,7 @@ #include "file.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" @@ -129,6 +130,7 @@ open(const char *path, int flags, ...) int err; struct pnode *pno; struct file *fil; + SYSIO_ENTER; /* * Get mode argument and determine parameters for namei @@ -169,7 +171,7 @@ open(const char *path, int flags, ...) * Find the file. */ fil = NULL; - INTENT_INIT(&intent, intent.int_opmask, &mode, NULL); + INTENT_INIT(&intent, intent.int_opmask, &mode, &flags); pno = NULL; err = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno); if (err) { @@ -196,6 +198,7 @@ open(const char *path, int flags, ...) P_RELE(pno); + SYSIO_LEAVE; return err; error: @@ -204,6 +207,7 @@ error: if (pno) P_RELE(pno); errno = -err; + SYSIO_LEAVE; return -1; } @@ -216,7 +220,12 @@ sysio_sym_weak_alias(open, open64) sysio_sym_weak_alias(open, __open64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_open64 +sysio_sym_weak_alias(open, __libc_open64) +#endif + +#ifdef BSD #undef _open sysio_sym_weak_alias(open, _open) #endif @@ -225,10 +234,12 @@ int close(int fd) { int err; + SYSIO_ENTER; err = _sysio_fd_close(fd); if (err) errno = -err; + SYSIO_LEAVE; return err ? -1 : 0; } @@ -237,7 +248,7 @@ close(int fd) sysio_sym_weak_alias(close, __close) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _close sysio_sym_weak_alias(close, _close) #endif @@ -258,7 +269,12 @@ sysio_sym_weak_alias(creat, creat64) sysio_sym_weak_alias(creat, __creat64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_creat +sysio_sym_weak_alias(creat, __libc_creat) +#endif + +#ifdef BSD #undef _creat sysio_sym_weak_alias(creat, _creat) #endif @@ -272,3 +288,8 @@ umask(mode_t mask) _sysio_umask = mask & 0777; return omask; } + +#ifdef REDSTORM +#undef __umask +sysio_sym_weak_alias(umask, __umask) +#endif Index: read.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/read.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- read.c 14 Oct 2003 18:00:30 -0000 1.9 +++ read.c 28 Jan 2004 13:16:56 -0000 1.9.2.1 @@ -112,14 +111,17 @@ ipreadv(int fd, const struct iovec *iov, { struct file *fil; struct ioctx *ioctxp; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = -EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ioctxp = do_ixreadv(fil, iov, count, offset, NULL); + SYSIO_LEAVE; return ioctxp ? ioctxp->ioctx_id : IOID_FAIL; } @@ -178,6 +180,13 @@ pread(int fd, void *buf, size_t count, o } #else #undef pread +#ifdef REDSTORM +#undef __libc_pread +sysio_sym_weak_alias(pread, __libc_pread) +#undef __libc_pread64 +sysio_sym_weak_alias(pread64, __libc_pread64) +#endif + sysio_sym_weak_alias(_pread, pread) #endif @@ -189,16 +198,21 @@ ireadv(int fd, const struct iovec *iov, { struct file *fil; struct ioctx *ioctxp; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = -EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ioctxp = do_ixreadv(fil, iov, count, fil->f_pos, _sysio_fcompletio); - if (!ioctxp) + if (!ioctxp) { + SYSIO_LEAVE; return IOID_FAIL; + } + SYSIO_LEAVE; return ioctxp->ioctx_id; } @@ -227,11 +241,18 @@ readv(int fd, const struct iovec *iov, i return iowait(ioid); } -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _readv sysio_sym_weak_alias(readv, _readv) #endif +#ifdef REDSTORM +#undef __libc_readv +sysio_sym_weak_alias(readv, __libc_readv) +#undef __readv +sysio_sym_weak_alias(readv, __readv) +#endif + ssize_t read(int fd, void *buf, size_t count) { @@ -248,7 +269,12 @@ read(int fd, void *buf, size_t count) sysio_sym_weak_alias(read, __read) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_read +sysio_sym_weak_alias(read, __libc_read) +#endif + +#ifdef BSD #undef _read sysio_sym_weak_alias(read, _read) #endif Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- rmdir.c 27 Sep 2003 19:42:03 -0000 1.4 +++ rmdir.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int rmdir(const char *path) @@ -58,6 +59,7 @@ rmdir(const char *path) struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); @@ -82,5 +84,11 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __rmdir +sysio_sym_weak_alias(rmdir, __rmdir) +#endif return err; } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- stat.c 24 Oct 2003 18:49:24 -0000 1.7 +++ stat.c 28 Jan 2004 13:16:56 -0000 1.7.2.1 @@ -99,6 +99,11 @@ __fxstat(int __ver, int __fildes, struct if (__ver != _STAT_VER) { err = -ENOSYS; +#ifdef REDSTORM +#undef _fxstat +sysio_sym_weak_alias(__fxstat, _fxstat) +#endif + goto out; } @@ -129,13 +134,18 @@ out: static int __fstat(int fd, struct stat *buf) { + int rc; + SYSIO_ENTER; + + rc = __fxstat(_STAT_VER, fd, buf); - return __fxstat(_STAT_VER, fd, buf); + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__fstat, fstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fstat sysio_sym_weak_alias(__fstat, _fstat) #endif @@ -171,6 +181,11 @@ __xstat(int __ver, const char *__filenam ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); +#ifdef REDSTORM +#undef _xstat +sysio_sym_weak_alias(__xstat, _xstat) +#endif + P_RELE(pno); #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); @@ -186,13 +201,18 @@ out: static int __stat(const char *filename, struct stat *buf) { + int rc; + SYSIO_ENTER; - return __xstat(_STAT_VER, filename, buf); + rc = __xstat(_STAT_VER, filename, buf); + + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__stat, stat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _stat sysio_sym_weak_alias(__stat, _stat) #endif @@ -228,6 +248,11 @@ __lxstat(int __ver, const char *__filena ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); +#ifdef REDSTORM +#undef _lxstat +sysio_sym_weak_alias(__lxstat, _lxstat) +#endif + P_RELE(pno); #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); @@ -243,13 +268,18 @@ out: static int __lstat(const char *filename, struct stat *buf) { + int rc; + SYSIO_ENTER; + + rc = __lxstat(_STAT_VER, filename, buf); - return __lxstat(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__lstat, lstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _lstat sysio_sym_weak_alias(__lstat, _lstat) #endif Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- stat64.c 21 Oct 2003 01:13:58 -0000 1.5 +++ stat64.c 28 Jan 2004 13:16:56 -0000 1.5.2.1 @@ -91,8 +91,13 @@ out: int fstat64(int fd, struct stat64 *buf) { + int rc; + SYSIO_ENTER; - return __fxstat64(_STAT_VER, fd, buf); + rc = __fxstat64(_STAT_VER, fd, buf); + + SYSIO_LEAVE; + return rc; } int @@ -127,8 +132,13 @@ out: int stat64(const char *filename, struct stat64 *buf) { + int rc; + SYSIO_ENTER; + + rc = __xstat64(_STAT_VER, filename, buf); - return __xstat64(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } int @@ -163,7 +173,12 @@ out: int lstat64(const char *filename, struct stat64 *buf) { + int rc; + SYSIO_ENTER; + + rc = __lxstat64(_STAT_VER, filename, buf); - return __lxstat64(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } #endif /* !_LARGEFILE64_SOURCE */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- statvfs.c 10 Oct 2003 18:50:31 -0000 1.4 +++ statvfs.c 28 Jan 2004 13:16:56 -0000 1.4.2.1 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> @@ -55,6 +55,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" #undef statvfs #undef fstatvfs @@ -88,6 +89,7 @@ statvfs(const char *path, struct statvfs struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -105,7 +107,13 @@ err: errno = -err; err = -1; out: + SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __statvfs +sysio_sym_weak_alias(statvfs, __statvfs) +#endif + } int @@ -119,6 +127,7 @@ fstatvfs(int fd, struct statvfs *buf) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif + SYSIO_ENTER; err = 0; filp = _sysio_fd_find(fd); @@ -138,7 +147,14 @@ err: errno = -err; err = -1; out: + SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs +sysio_sym_weak_alias(fstatvfs, __fstatvfs) +#endif + +#endif /* ifndef BSD */ #endif /* defined(_HAVE_STATVFS) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- statvfs64.c 21 Oct 2003 13:38:47 -0000 1.5 +++ statvfs64.c 28 Jan 2004 13:16:56 -0000 1.5.2.1 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> #include <assert.h> @@ -54,12 +54,14 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int statvfs64(const char *path, struct statvfs64 *buf) { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -72,6 +74,13 @@ out: errno = -err; err = -1; } + + SYSIO_LEAVE; +#ifdef REDSTORM +#undef __statvfs64 +sysio_sym_weak_alias(statvfs64, __statvfs64) +#endif + return err; } @@ -80,6 +89,7 @@ fstatvfs64(int fd, struct statvfs64 *buf { int err; struct file *filp; + SYSIO_ENTER; err = 0; filp = _sysio_fd_find(fd); @@ -94,7 +104,15 @@ out: errno = -err; err = -1; } + + SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs64 +sysio_sym_weak_alias(fstatvfs64, __fstatvfs64) +#endif + +#endif /* ifndef BSD */ #endif /* define(_HAVE_STATVFS) */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -u -w -b -B -p -r1.3 -r1.3.12.1 --- symlink.c 24 Mar 2003 22:09:07 -0000 1.3 +++ symlink.c 28 Jan 2004 13:16:56 -0000 1.3.12.1 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int symlink(const char *oldpath, const char *newpath) @@ -58,6 +59,7 @@ symlink(const char *oldpath, const char int err; struct intent intent; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno); @@ -81,5 +83,11 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __symlink +sysio_sym_weak_alias(symlink, __symlink) +#endif return err; } Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- truncate.c 23 Oct 2003 15:20:31 -0000 1.5 +++ truncate.c 28 Jan 2004 13:16:57 -0000 1.5.2.1 @@ -84,6 +84,7 @@ _truncate(const char *path, _SYSIO_OFF_T { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -96,6 +97,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } @@ -120,6 +122,7 @@ _ftruncate(int fd, _SYSIO_OFF_T length) { int err; struct file *fil; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -133,6 +136,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- unlink.c 30 Oct 2003 15:20:49 -0000 1.5 +++ unlink.c 28 Jan 2004 13:16:57 -0000 1.5.2.1 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int unlink(const char *path) @@ -58,6 +59,7 @@ unlink(const char *path) struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); @@ -82,5 +84,11 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __unlink +sysio_sym_weak_alias(unlink, __unlink) +#endif return err; } Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -u -w -b -B -p -r1.1 -r1.1.10.1 --- utime.c 27 Sep 2003 19:42:03 -0000 1.1 +++ utime.c 28 Jan 2004 13:16:57 -0000 1.1.10.1 @@ -58,14 +58,12 @@ int utime(const char *path, const struct utimbuf *buf) { - struct intent intent; int err; struct pnode *pno; struct utimbuf _utbuffer; struct intnl_stat stbuf; - INTENT_INIT(&intent, INT_SETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); + err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; if (!buf) { Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -w -b -B -p -r1.10 -r1.10.2.1 --- write.c 20 Oct 2003 15:51:22 -0000 1.10 +++ write.c 28 Jan 2004 13:16:57 -0000 1.10.2.1 @@ -112,14 +111,17 @@ ipwritev(int fd, const struct iovec *iov { struct file *fil; struct ioctx *ioctxp; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = -EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ioctxp = do_ixwritev(fil, iov, count, offset, NULL); + SYSIO_LEAVE; return ioctxp ? ioctxp->ioctx_id : IOID_FAIL; } @@ -178,6 +180,17 @@ pwrite(int fd, const void *buf, size_t c } #else #undef pwrite +#ifdef REDSTORM +#undef __libc_pwrite +sysio_sym_weak_alias(pwrite, __libc_pwrite) +#undef __libc_pwrite64 +sysio_sym_weak_alias(pwrite, __libc_pwrite64) +#undef __pwrite +sysio_sym_weak_alias(pwrite, __pwrite) +#undef __pwrite64 +sysio_sym_weak_alias(pwrite, __pwrite64) +#endif + sysio_sym_weak_alias(_pwrite, pwrite) #endif @@ -189,16 +202,21 @@ iwritev(int fd, const struct iovec *iov, { struct file *fil; struct ioctx *ioctxp; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { - errno = -EBADF; + errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ioctxp = do_ixwritev(fil, iov, count, fil->f_pos, _sysio_fcompletio); - if (!ioctxp) + if (!ioctxp) { + SYSIO_LEAVE; return IOID_FAIL; + } + SYSIO_LEAVE; return ioctxp->ioctx_id; } @@ -227,11 +245,18 @@ writev(int fd, const struct iovec *iov, return iowait(ioid); } -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _writev sysio_sym_weak_alias(writev, _writev) #endif +#ifdef REDSTORM +#undef __libc_writev +sysio_sym_weak_alias(writev, __libc_writev) +#undef __writev +sysio_sym_weak_alias(writev, __writev) +#endif + ssize_t write(int fd, const void *buf, size_t count) { @@ -248,7 +273,12 @@ write(int fd, const void *buf, size_t co sysio_sym_weak_alias(write, __write) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_write +sysio_sym_weak_alias(write, __libc_write) +#endif + +#ifdef BSD #undef _write sysio_sym_weak_alias(write, _write) #endif |