[Bug 4670] fopencookie custom IO stream behaviour without buffering differs from GNU C

bugzilla at busybox.net bugzilla at busybox.net
Thu Jan 5 08:48:12 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=4670

--- Comment #2 from Tomi <farago1 at zonnet.nl> 2012-01-05 08:48:12 UTC ---
My apologies, I might not have been complete on my report.
Yes, you are right, output is indeed the following when you take size into
account as I have in the actual code. Sorry I did not do it for the example.
However, when passing these strings to syslog each of the calls is output to a
new line.

So let's take the following example with the a newline added after the string,
and log_writer function properly only writing as many characters as specified
by size.

teststring: fprintf(log_stream, "TEST::%s::TEST\n", "param");

output on GNU C Lib:
1 function call:
log_writer(cookie, buffer="TEST::param::TEST\n", size=18)
syslog("%s", "TEST::param::TEST\n")

output:
Jan  5 09:43:09 syslogd: TEST::param::TEST


output on uClibC lib:
3 functions calls:
log_writer(cookie, buffer="TEST::%s::TEST\n", size=6)
syslog("%s", "TEST::")
log_writer(cookie, buffer="param", size=5)
syslog("%s", "param")
log_writer(cookie, buffer="::TEST\n", size=7)
syslog("%s", "::TEST\n")

output:
Jan  5 09:43:09 syslogd: TEST::
Jan  5 09:43:09 syslogd: param
Jan  5 09:43:09 syslogd: ::TEST

This is different behaviour from GNU C. However if uClib's buffering is
expected to be different from GNU C, I accept that. I can work around this
issue which I found in davfs2's SSL library calls.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list