Commit 69ef29fd by Benjamin Kosnik Committed by Benjamin Kosnik

basic_file_stdio.cc: Revert.


2003-07-04  Benjamin Kosnik  <bkoz@redhat.com>
            Petur Runolfsson  <peturr02@ru.is>

	* config/io/basic_file_stdio.cc: Revert.

Co-Authored-By: Petur Runolfsson <peturr02@ru.is>

From-SVN: r68938
parent 5b5bf717
2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
Petur Runolfsson <peturr02@ru.is>
* config/io/basic_file_stdio.cc: Revert.
2003-07-04 Paolo Carlini <pcarlini@unitus.it> 2003-07-04 Paolo Carlini <pcarlini@unitus.it>
* include/bits/deque.tcc: Fully qualify standard * include/bits/deque.tcc: Fully qualify standard
......
...@@ -207,32 +207,32 @@ namespace std ...@@ -207,32 +207,32 @@ namespace std
streamsize streamsize
__basic_file<char>::xsgetn(char* __s, streamsize __n) __basic_file<char>::xsgetn(char* __s, streamsize __n)
{ return fread(__s, 1, __n, _M_cfile); } {
streamsize __ret;
do
__ret = read(this->fd(), __s, __n);
while (__ret == -1L && errno == EINTR);
return __ret;
}
streamsize streamsize
__basic_file<char>::xsputn(const char* __s, streamsize __n) __basic_file<char>::xsputn(const char* __s, streamsize __n)
{ return fwrite(__s, 1, __n, _M_cfile); } {
streamsize __ret;
do
__ret = write(this->fd(), __s, __n);
while (__ret == -1L && errno == EINTR);
return __ret;
}
streampos streampos
__basic_file<char>::seekoff(streamoff off, ios_base::seekdir way, __basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode /*__mode*/) ios_base::openmode /*__mode*/)
{ { return lseek(this->fd(), __off, __way); }
streampos ret(-1);
fpos_t tmp;
if (!fseek(_M_cfile, off, way) && !fgetpos(_M_cfile, &tmp))
ret = tmp;
return ret;
}
streampos streampos
__basic_file<char>::seekpos(streampos pos, ios_base::openmode /*__mode*/) __basic_file<char>::seekpos(streampos __pos, ios_base::openmode /*__mode*/)
{ { return lseek(this->fd(), __pos, ios_base::beg); }
streampos ret(-1);
fpos_t tmp = pos;
if (!fsetpos(_M_cfile, &tmp) && !fgetpos(_M_cfile, &tmp))
ret = tmp;
return ret;
}
int int
__basic_file<char>::sync() __basic_file<char>::sync()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment