[Bug 5930] Improper return value of fwrite in bytes,

bugzilla at busybox.net bugzilla at busybox.net
Thu Feb 14 11:32:51 UTC 2013


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

--- Comment #2 from upendra <upendrabaveja at gmail.com> 2013-02-14 11:33:12 UTC ---
(In reply to comment #1)
> fwrite does return the number of elements written. See libc/stdio/fwrite.c, 
> return __stdio_fwrite()/size.
> 
> can you please attach your .config (which STDIO_BUFF settings do you use) and
> it would help if you could also paste an strace -v of your failing test
> program.
> 
> thanks,

Hi
Below are the STDIO_BUFF settings used in .config
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
UCLIBC_HAS_STDIO_BUFSIZ_4096=y
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
# UCLIBC_HAS_STDIO_GETC_MACRO is not set
# UCLIBC_HAS_STDIO_PUTC_MACRO is not set
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
UCLIBC_HAS_STDIO_FUTEXES=y

the same settings work with uClibc09.33. version.
But in uClibc 09.33.2 if i comment the following part in _WRITE.c
 if (errno != EINTR && errno != EAGAIN) {
      /* do we have other "soft" errors?*/
      break;
 }
code seems to work fine.
i have just used a normal fwrite function call with following check
if(fwrite(buf, sizeof(buf), 1, fp != 1) {
     printf("error %s\n", strerror(errno));
}

this is the way i checked return value for fwrite.

thanks.

-- 
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