From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27947 invoked by alias); 30 May 2011 23:08:33 -0000 Received: (qmail 27934 invoked by uid 22791); 30 May 2011 23:08:31 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 May 2011 23:08:18 +0000 From: "chianshin at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12825] write function returning -1 in cookie_io_functions_t will crash the program X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: chianshin at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 30 May 2011 23:08:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00271.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12825 --- Comment #3 from Xin Qian 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.