[Libsysio-commit] cplant: libsysio/src chdir.c fcntl.c ioctl.c lseek.c open.c read.c write.c
Brought to you by:
lward
|
From: Ruth K. <rk...@us...> - 2003-10-06 21:14:28
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv17203
Modified Files:
Tag: cplant
chdir.c fcntl.c ioctl.c lseek.c open.c read.c write.c
Log Message:
replace fn defs with symbol aliases
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -w -b -B -p -r1.4.2.1 -r1.4.2.2
--- chdir.c 26 Aug 2003 17:21:39 -0000 1.4.2.1
+++ chdir.c 6 Oct 2003 21:14:21 -0000 1.4.2.2
@@ -77,6 +77,8 @@
#include "mount.h"
#include "file.h"
+#include "sysio-symbols.h"
+
struct pnode *_sysio_cwd = NULL;
int
@@ -181,12 +183,8 @@ 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);
-}
+#ifdef __GLIBC__
+sysio_sym_weak_alias(getcwd, __getcwd)
#endif
#ifdef PATH_MAX
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -w -b -B -p -r1.4 -r1.4.2.1
--- fcntl.c 14 Aug 2003 18:39:33 -0000 1.4
+++ fcntl.c 6 Oct 2003 21:14:22 -0000 1.4.2.1
@@ -51,6 +51,8 @@
#include "inode.h"
#include "file.h"
+#include "sysio-symbols.h"
+
int
fcntl(int fd, int cmd, ...)
{
@@ -96,17 +98,7 @@ 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;
-}
+#ifdef __GLIBC__
+#undef __fcntl
+sysio_sym_weak_alias(fcntl, __fcntl)
#endif
Index: ioctl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -w -b -B -p -r1.2 -r1.2.2.1
--- ioctl.c 14 Aug 2003 18:39:33 -0000 1.2
+++ ioctl.c 6 Oct 2003 21:14:22 -0000 1.2.2.1
@@ -50,6 +50,8 @@
#include "inode.h"
#include "file.h"
+#include "sysio-symbols.h"
+
int
ioctl(int fd, unsigned long request, ...)
{
@@ -77,17 +79,7 @@ out:
}
-#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;
-}
+#ifdef __GLIBC__
+#undef __ioctl
+sysio_sym_weak_alias(ioctl, __ioctl)
#endif
Index: lseek.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -w -b -B -p -r1.6 -r1.6.2.1
--- lseek.c 14 Aug 2003 18:39:33 -0000 1.6
+++ lseek.c 6 Oct 2003 21:14:22 -0000 1.6.2.1
@@ -103,7 +103,14 @@ out:
return fil->f_pos = off;
}
+#if _LARGEFILE64_SOURCE
+#undef lseek64
sysio_sym_weak_alias(_sysio_lseek, lseek64)
+#ifdef __GLIBC__
+#undef __lseek64
+sysio_sym_weak_alias(_sysio_lseek, __lseek64)
+#endif
+#endif
#undef lseek
@@ -114,30 +121,7 @@ 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);
-}
-
+#ifdef __GLIBC__
+#undef __lseek
+sysio_sym_weak_alias(lseek, __lseek)
#endif
Index: open.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/open.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -w -b -B -p -r1.8 -r1.8.2.1
--- open.c 14 Aug 2003 18:39:33 -0000 1.8
+++ open.c 6 Oct 2003 21:14:22 -0000 1.8.2.1
@@ -49,7 +49,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/queue.h>
-#include <features.h>
#include "sysio.h"
#include "inode.h"
@@ -57,12 +56,7 @@
#include "fs.h"
#include "mount.h"
-#ifdef __GLIBC__
-#undef open
-#undef __open
-#undef open64
-#undef __open64
-#endif
+#include "sysio-symbols.h"
/*
* Open file support.
@@ -206,6 +200,15 @@ error:
return -1;
}
+#ifdef __GLIBC__
+#undef __open
+sysio_sym_weak_alias(open, __open)
+#undef open64
+sysio_sym_weak_alias(open, open64)
+#undef __open64
+sysio_sym_weak_alias(open, __open64)
+#endif
+
int
close(int fd)
{
@@ -217,6 +220,11 @@ close(int fd)
return err ? -1 : 0;
}
+#ifdef __GLIBC__
+#undef __close
+sysio_sym_weak_alias(close, __close)
+#endif
+
int
creat(const char *path, mode_t mode)
{
@@ -224,6 +232,15 @@ creat(const char *path, mode_t mode)
return open(path, O_CREAT|O_WRONLY|O_TRUNC, mode);
}
+#ifdef __GLIBC__
+#undef __creat
+sysio_sym_weak_alias(creat, __creat)
+#undef creat64
+sysio_sym_weak_alias(creat, creat64)
+#undef __creat64
+sysio_sym_weak_alias(creat, __creat64)
+#endif
+
mode_t
umask(mode_t mask)
{
@@ -233,49 +250,3 @@ 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.3
retrieving revision 1.3.2.1
diff -u -w -b -B -p -r1.3 -r1.3.2.1
--- read.c 14 Aug 2003 18:39:33 -0000 1.3
+++ read.c 6 Oct 2003 21:14:22 -0000 1.3.2.1
@@ -53,6 +53,8 @@
#include "file.h"
#include "inode.h"
+#include "sysio-symbols.h"
+
/*
* Schedule asynchronous read of iovec at some file extent.
*/
@@ -210,6 +212,16 @@ read(int fd, void *buf, size_t count)
return iowait(ioid);
}
+#ifdef __GLIBC__
+#undef __read
+sysio_sym_weak_alias(read, __read)
+#endif
+
+#if _LARGEFILE64_SOURCE
+#undef read64
+sysio_sym_weak_alias(read, read64)
+#endif
+
#ifdef notdef
int
read_list(int fd,
@@ -222,13 +234,5 @@ 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: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -w -b -B -p -r1.3 -r1.3.2.1
--- write.c 14 Aug 2003 18:39:33 -0000 1.3
+++ write.c 6 Oct 2003 21:14:22 -0000 1.3.2.1
@@ -55,6 +55,8 @@
#include "fs.h"
#include "mount.h"
+#include "sysio-symbols.h"
+
/*
* Schedule asynchronous write of iovec at some file extent.
*/
@@ -216,6 +218,16 @@ write(int fd, const void *buf, size_t co
return iowait(ioid);
}
+#ifdef __GLIBC__
+#undef __write
+sysio_sym_weak_alias(write, __write)
+#endif
+
+#if _LARGEFILE64_SOURCE
+#undef write64
+sysio_sym_weak_alias(write, write64)
+#endif
+
#ifdef notdef
int
write_list(int fd,
@@ -230,18 +242,3 @@ 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
-
|