This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12825] write function returning -1 in cookie_io_functions_t will crash the program


http://sourceware.org/bugzilla/show_bug.cgi?id=12825

--- Comment #3 from Xin Qian <chianshin at gmail dot com> 2011-05-30 23:08:00 UTC ---
1. In the libc's manual/stdio.texi line 5057-5064
http://sourceware.org/git/?p=glibc.git;a=blob;f=manual/stdio.texi;hb=HEAD
it is said that the writer function will return -1 for error.

If write function do not use -1 return value to indicate error, how about read
function? still use -1 to indicate error.

If people agree, I might submit a change to the manual/stdio.texi.

2. 
Another thing in my mind is that if the stream is not installed by fopencookie,
it is hooked up to a char device in linux.
The write function of that driver is also returning negative value for error.
Is this causing problem in libc also? 

http://www.xml.com/ldd/chapter/book/ch03.html
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
Sends data to the device. If missing, -EINVAL is returned to the program
calling the write system call. The return value, if non-negative, represents
the number of bytes successfully written.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]