From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: wait_reading_process_ouput hangs in certain cases (w/ patches) Date: Mon, 13 Nov 2017 22:12:26 +0200 Message-ID: <83efp2kket.fsf@gnu.org> References: <83lgjz8eiy.fsf@gnu.org> <831slp98ut.fsf@gnu.org> <83tvyj62qg.fsf@gnu.org> <83r2tetf90.fsf@gnu.org> <5150d198-8dd3-9cf4-5914-b7e945294452@binary-island.eu> <83tvy7s6wi.fsf@gnu.org> <83inemrqid.fsf@gnu.org> <398f8d17-b727-d5d6-4a31-772448c7ca0d@binary-island.eu> <83bmk6n9hs.fsf@gnu.org> <83y3nakw2f.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1510603949 23313 195.159.176.226 (13 Nov 2017 20:12:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Nov 2017 20:12:29 +0000 (UTC) Cc: ml_emacs-lists@binary-island.eu, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 13 21:12:24 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEL5j-0005k3-0E for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2017 21:12:23 +0100 Original-Received: from localhost ([::1]:56200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEL5q-000559-Bx for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2017 15:12:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEL5j-000554-Cc for emacs-devel@gnu.org; Mon, 13 Nov 2017 15:12:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEL5f-0007BR-Sl for emacs-devel@gnu.org; Mon, 13 Nov 2017 15:12:23 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEL5f-0007BN-P9; Mon, 13 Nov 2017 15:12:19 -0500 Original-Received: from [176.228.60.248] (port=2831 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eEL5f-000181-75; Mon, 13 Nov 2017 15:12:19 -0500 In-reply-to: (message from Paul Eggert on Mon, 13 Nov 2017 11:42:50 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220157 Archived-At: > Cc: ml_emacs-lists@binary-island.eu, emacs-devel@gnu.org > From: Paul Eggert > Date: Mon, 13 Nov 2017 11:42:50 -0800 > > Hmm, well, since I wrote some of that commentary and code, I can state > that it was my understanding that the caller should not care about the > exact value of wait_reading_process_output's result (only whether it is > negative, zero, or positive), and that my understanding of this API has > survived until the present day. Partly this was because I did not want > to change the type of the result if we should ever increase the buffer > size from 4096 to a value that might not fit in 'int'. In other words, > the documentation is written the way it's written in order to give the > implementation some freedom that could be useful in the future. Since this is not a library which should not change its API contract, we don't really need such a freedom. We can change the meaning of the return value whenever we want. So I'd rather we documented the meaning of the return value. More importantly, if we sometimes return the number of bytes and sometimes just 1, we should tell when each one happens, because this will make it easier for others to use this function without being privy to its details and history.