summaryrefslogtreecommitdiff
path: root/libio/filebuf.cc
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-01 12:29:15 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-01 12:29:15 +0000
commit660426353bcfabbe622e49d5fdd04e79272c3d55 (patch)
tree7f82432d8e5d72c64bd5ab979676321ca1746dc6 /libio/filebuf.cc
parent4dd476d49b5d9edeb46c8ba15b0969ed032bf1da (diff)
downloadgcc-660426353bcfabbe622e49d5fdd04e79272c3d55.tar.gz
* filebuf.cc (filebuf::open): Call _IO_file_open if
_G_HAVE_IO_FILE_OPEN is 1. * libio.h (_IO_fpos64_t, _IO_off64_t): Defined if _G_IO_IO_FILE_VERSION == 0x20001. * libioP.h (_IO_file_open): New declaration. * libio.h (_IO_FILE, _IO_stdin_, _IO_stdout_, _IO_stderr_, _IO_seekoff, _IO_seekpos): Add support for libio in egcs 2.1. * libioP.h (_IO_seekoff_t, _IO_seekpos_t, _IO_seek_t, _IO_seekoff, _IO_seekpos, _IO_default_seekoff, _IO_default_seekpos, _IO_default_seek, _IO_file_seekoff, _IO_file_seek, _IO_str_seekoff, _IO_pos_BAD, _IO_pos_as_off, _IO_pos_0): Ditto. * streambuf.h (streamoff, streampos): Ditto. * gen-params (__extension__): Use only if gcc version >= 2.8. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libio/filebuf.cc')
-rw-r--r--libio/filebuf.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/libio/filebuf.cc b/libio/filebuf.cc
index 1e2682fbce9..0cc67493a48 100644
--- a/libio/filebuf.cc
+++ b/libio/filebuf.cc
@@ -111,6 +111,10 @@ filebuf* filebuf::open(const char *filename, ios::openmode mode, int prot)
posix_mode |= O_CREAT;
if (mode & (int)ios::noreplace)
posix_mode |= O_EXCL;
+#if _G_HAVE_IO_FILE_OPEN
+ return (filebuf*)_IO_file_open (this, filename, posix_mode, prot,
+ read_write, 0);
+#else
int fd = ::open(filename, posix_mode, prot);
if (fd < 0)
return NULL;
@@ -122,6 +126,7 @@ filebuf* filebuf::open(const char *filename, ios::openmode mode, int prot)
}
_IO_link_in(this);
return this;
+#endif
}
filebuf* filebuf::open(const char *filename, const char *mode)