[Libsysio-commit] HEAD: libsysio/src access.c chdir.c chmod.c chown.c dup.c fcntl.c getdirentries.c
Brought to you by:
lward
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11610/src Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c getdirentries.c ioctl.c link.c lseek.c mkdir.c mknod.c open.c read.c rmdir.c stat.c statvfs.c statvfs64.c symlink.c unlink.c write.c Log Message: Patches from Kevin Pedretti (kt...@sa...) allowing for the change from a BSD-based libc to glibc-based on Red Storm. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- access.c 6 Aug 2003 19:10:26 -0000 1.2 +++ access.c 26 Jan 2004 16:34:54 -0000 1.3 @@ -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.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- chdir.c 21 Jan 2004 14:44:53 -0000 1.11 +++ chdir.c 26 Jan 2004 16:34:54 -0000 1.12 @@ -140,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) { @@ -240,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.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- chmod.c 21 Jan 2004 14:44:53 -0000 1.5 +++ chmod.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -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) @@ -88,6 +89,11 @@ out: 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.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- chown.c 21 Jan 2004 14:44:53 -0000 1.5 +++ chown.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -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) @@ -94,6 +95,11 @@ out: } SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __chown +sysio_sym_weak_alias(chown, __chown) +#endif + } int @@ -115,5 +121,10 @@ out: errno = -err; err = -1; } + +#ifdef REDSTORM +#undef __fchown +sysio_sym_weak_alias(fchown, __fchown) +#endif return err; } Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- dup.c 21 Jan 2004 14:44:53 -0000 1.3 +++ dup.c 26 Jan 2004 16:34:54 -0000 1.4 @@ -48,6 +48,7 @@ #include "sysio.h" #include "file.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" @@ -64,12 +65,22 @@ dup2(int oldfd, int 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; } Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- fcntl.c 21 Jan 2004 14:44:53 -0000 1.7 +++ fcntl.c 26 Jan 2004 16:34:54 -0000 1.8 @@ -109,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: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- getdirentries.c 21 Jan 2004 14:44:53 -0000 1.5 +++ getdirentries.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -99,15 +98,20 @@ getdirentries(int fd, SYSIO_ENTER; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) -#ifdef __GLIBC__ + +#ifdef __GLIBC #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__) */ +#else /* !define(__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 @@ -226,6 +230,11 @@ out: sysio_sym_strong_alias(_getdirentries64, getdirentries) #endif +#endif + +#ifdef REDSTORM +#undef __getdirentries +sysio_sym_weak_alias(getdirentries, __getdirentries) #if defined(BSD) || defined(REDSTORM) #undef _getdirentries sysio_sym_weak_alias(getdirentries, _getdirentries) Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- ioctl.c 21 Jan 2004 14:44:53 -0000 1.5 +++ ioctl.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -86,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: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- link.c 20 Oct 2003 16:31:23 -0000 1.2 +++ link.c 26 Jan 2004 16:34:54 -0000 1.3 @@ -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.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- lseek.c 21 Jan 2004 14:44:53 -0000 1.10 +++ lseek.c 26 Jan 2004 16:34:54 -0000 1.11 @@ -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 Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- mkdir.c 21 Jan 2004 14:44:53 -0000 1.4 +++ mkdir.c 26 Jan 2004 16:34:54 -0000 1.5 @@ -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) @@ -82,6 +83,11 @@ out: 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.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- mknod.c 21 Jan 2004 14:44:53 -0000 1.6 +++ mknod.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -111,6 +111,11 @@ 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) Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- open.c 21 Jan 2004 14:44:53 -0000 1.12 +++ open.c 26 Jan 2004 16:34:54 -0000 1.13 @@ -220,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 @@ -243,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 @@ -264,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 @@ -278,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.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- read.c 21 Jan 2004 15:06:31 -0000 1.11 +++ read.c 26 Jan 2004 16:34:54 -0000 1.12 @@ -181,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 @@ -235,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) { @@ -256,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.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- rmdir.c 21 Jan 2004 14:44:53 -0000 1.5 +++ rmdir.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int rmdir(const char *path) @@ -84,5 +85,10 @@ out: 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.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- stat.c 21 Jan 2004 14:44:53 -0000 1.8 +++ stat.c 26 Jan 2004 16:34:54 -0000 1.9 @@ -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; } @@ -140,7 +145,7 @@ __fstat(int fd, struct stat *buf) sysio_sym_weak_alias(__fstat, fstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fstat sysio_sym_weak_alias(__fstat, _fstat) #endif @@ -176,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); @@ -202,7 +212,7 @@ __stat(const char *filename, struct stat sysio_sym_weak_alias(__stat, stat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _stat sysio_sym_weak_alias(__stat, _stat) #endif @@ -238,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); @@ -264,7 +279,7 @@ __lstat(const char *filename, struct sta sysio_sym_weak_alias(__lstat, lstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _lstat sysio_sym_weak_alias(__lstat, _lstat) #endif Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- statvfs.c 21 Jan 2004 14:44:53 -0000 1.5 +++ statvfs.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -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 @@ -108,6 +109,11 @@ err: out: SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __statvfs +sysio_sym_weak_alias(statvfs, __statvfs) +#endif + } int @@ -144,5 +150,11 @@ 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.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- statvfs64.c 21 Jan 2004 14:44:53 -0000 1.6 +++ statvfs64.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> #include <assert.h> @@ -54,6 +54,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int statvfs64(const char *path, struct statvfs64 *buf) @@ -75,6 +76,11 @@ out: } SYSIO_LEAVE; +#ifdef REDSTORM +#undef __statvfs64 +sysio_sym_weak_alias(statvfs64, __statvfs64) +#endif + return err; } @@ -102,5 +108,11 @@ out: 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.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- symlink.c 21 Jan 2004 14:44:53 -0000 1.4 +++ symlink.c 26 Jan 2004 16:34:54 -0000 1.5 @@ -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) @@ -83,5 +84,10 @@ out: err = -1; } SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __symlink +sysio_sym_weak_alias(symlink, __symlink) +#endif return err; } Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- unlink.c 21 Jan 2004 14:44:53 -0000 1.6 +++ unlink.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int unlink(const char *path) @@ -84,5 +85,10 @@ out: err = -1; } SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __unlink +sysio_sym_weak_alias(unlink, __unlink) +#endif return err; } Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- write.c 21 Jan 2004 15:06:31 -0000 1.12 +++ write.c 26 Jan 2004 16:34:54 -0000 1.13 @@ -181,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 @@ -235,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) { @@ -256,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 |