Gcc-2.95.3 libIO patch for ULTRIX
Zur Navigation springen
Zur Suche springen
/* patch from John David Anglin as posted on the gcc-bugs@gcc.gnu.org mailing
list, 29 Sep 2000. fixes a problem in libio on ULTRIX with gcc-2.95.3
copy this to the libio dir of the gcc source tree and apply like
/usr/local/bin/patch < libio_patch.txt */
--- fileops.c.orig Mon Apr 12 14:27:49 1999
+++ fileops.c Fri Sep 29 11:07:29 2000
@@ -155,11 +155,20 @@
_IO_default_finish (fp, 0);
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_FILE *
+_IO_file_fopen (fp, filename, mode, tbd)
+ _IO_FILE *fp;
+ const char *filename;
+ const char *mode;
+ int tbd;
+#else
_IO_FILE *
_IO_file_fopen (fp, filename, mode)
_IO_FILE *fp;
const char *filename;
const char *mode;
+#endif
{
int oflags = 0, omode;
int read_write, fdesc;
@@ -419,14 +428,27 @@
return retval;
}
_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
+_IO_file_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
+_IO_off_t
_IO_file_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
- _IO_pos_t result;
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+ _IO_off64_t result;
+#else
+ _IO_off_t result;
+#endif
_IO_off_t delta, new_offset;
long count;
/* POSIX.1 8.2.3.7 says that after a call the fflush() the file
@@ -587,11 +609,19 @@
return read (fp->_fileno, buf, size);
}
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
+_IO_file_seek (fp, offset, dir)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+#else
+_IO_off_t
_IO_file_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
+#endif
{
return lseek (fp->_fileno, offset, dir);
}
--- genops.c.orig Thu Mar 4 19:19:08 1999
+++ genops.c Thu Sep 28 22:24:25 2000
@@ -467,13 +467,21 @@
return fp;
}
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
_IO_default_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_off64_t pos;
int mode;
+#else
+_IO_off_t
+_IO_default_seekpos (fp, pos, mode)
+ _IO_FILE *fp;
+ _IO_off_t pos;
+ int mode;
+#endif
{
- return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
+ return _IO_SEEKOFF (fp, pos, 0, mode);
}
int
@@ -551,12 +559,21 @@
_IO_un_link (fp);
}
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
+_IO_default_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
+_IO_off_t
_IO_default_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
return _IO_pos_BAD;
}
@@ -882,11 +899,19 @@
return (unsigned char) *fp->_IO_read_ptr;
}
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
+_IO_default_seek (fp, offset, dir)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+#else
+_IO_off_t
_IO_default_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
+#endif
{
return _IO_pos_BAD;
}
--- ioseekoff.c.orig Tue Sep 16 12:00:21 1997
+++ ioseekoff.c Thu Sep 28 22:30:27 2000
@@ -25,14 +25,27 @@
#include <libioP.h>
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
+_IO_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
+_IO_off_t
_IO_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
- _IO_pos_t retval;
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+ _IO_off64_t retval;
+#else
+ _IO_off_t retval;
+#endif
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
--- ioseekpos.c.orig Tue Sep 16 12:00:23 1997
+++ ioseekpos.c Thu Sep 28 22:33:42 2000
@@ -25,13 +25,25 @@
#include <libioP.h>
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
_IO_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_off64_t pos;
int mode;
+#else
+_IO_off_t
+_IO_seekpos (fp, pos, mode)
+ _IO_FILE *fp;
+ _IO_off_t pos;
+ int mode;
+#endif
{
- _IO_pos_t retval;
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+ _IO_off64_t retval;
+#else
+ _IO_off_t retval;
+#endif
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
--- strops.c.orig Fri May 22 16:40:02 1998
+++ strops.c Thu Sep 28 22:56:35 2000
@@ -205,15 +205,28 @@
- fp->_IO_read_base);
}
-_IO_pos_t
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_off64_t
_IO_str_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#else
+_IO_off_t
+_IO_str_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off_t offset;
+ int dir;
+ int mode;
+#endif
{
_IO_ssize_t cur_size = _IO_str_count (fp);
- _IO_pos_t new_pos = EOF;
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+ _IO_off64_t new_pos = EOF;
+#else
+ _IO_off_t new_pos = EOF;
+#endif
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
--- libioP.h.orig Fri Jun 30 11:25:33 2000
+++ libioP.h Fri Sep 29 10:55:40 2000
@@ -233,7 +233,7 @@
typedef int (*_IO_stat_t) __PMT ((_IO_FILE *, void *));
#define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
-#if _G_IO_IO_FILE_VERSION == 0x20001
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
/* The 'showmany' hook can be used to get an image how much input is
available. In many cases the answer will be 0 which means unknown
but some cases one can provide real information. */