Menu

SvnRepo Commit Log


Commit Date  
[r55] by jost2345

error messages

2004-10-18 17:37:49 Tree
[r54] by jost2345

correct author

2004-10-18 17:20:21 Tree
[r53] by jost2345

threads check

2004-10-18 15:39:10 Tree
[r52] by jost2345

solaris 64

2004-10-14 16:32:13 Tree
[r51] by jost2345

tests for broken stdio added

2004-10-14 12:55:34 Tree
[r50] by jost2345

tests for broken stdio added

2004-10-14 12:52:39 Tree
[r49] by jost2345

Added support for Slowlaris' broken stdio:
SFREAD SFWRITE SFDOPEN SFCLOSE SFEOF SFERROR: Use these instead of the stdio
versions. On Solaris these functions access the raw socket, which is slow
but at least it works

2004-10-12 17:07:16 Tree
[r48] by jost2345

Fixed a bug that appeared on Slowlaris 9 stdio implementations.

From the BSD fopen(3) manpage (solaris' own manpage is pretty useless):

Reads and writes may be intermixed on read/write streams in any order,
and do not require an intermediate seek as in previous versions of stdio.
This is not portable to other systems, however; ANSI C requires that a
file positioning function intervene between output and input, unless an
input operation encounters end-of-file.

One of these "other systems" is solaris 9. From Linux' manpage:

Reads and writes may be intermixed on read/write streams in any order.
Note that ANSI C requires that a file positioning function intervene
between output and input, unless an input operation encounters end-of-
file. (If this condition is not met, then a read is allowed to return
the result of writes other than the most recent.) Therefore it is good
practice (and indeed sometimes necessary under Linux) to put an fseek
or fgetpos operation between write and read operations on such a
stream. This operation may be an apparent no-op (as in fseek(..., 0L,
SEEK_CUR) called for its synchronizing side effect.

The problem is that the above paragraph does not apply to fdopen'ed streams
because these streams are not seekable. Applying a seek operation on a
socket stream generates an error:

From Nathan Kurz:

Ok, so I'll put one in. But everything I try comes back with an error that the
operation is not permitted. I've tried all the combinations of fseek() and
fsetpos() that I can think of (to the current position, to the beginning, the
end) but (logically enough) none are supported.

So one cannot use fseek on sockets streams. That's why *all* stdio
implementations, except Solaris' do *not* require fseek() anymore.

But that still does not solve our problem; we must rewind the Solaris stdio
buffers somehow. fseek() does not work, but fortunately fflush() does
what we want. In other words, this is a hack that Sun invented to make
stdio buffers work with socket streams. Die, sun, DIE!

Bugfix: Call fflush right before fwrite and fread so that the
Sun stdio implementation rewinds the bufer pointers.

2004-10-11 18:11:53 Tree
[r47] by jost2345

nmemb may be 0

2004-10-09 22:22:00 Tree
[r46] by jost2345

workaround for broken sparc stdio

2004-10-09 21:57:20 Tree
Older >
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.