From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Mon, 19 Feb 2018 12:31:15 -0800 Message-ID: <38a35e4b-8f30-aea3-dbfd-0cb82a5d2cbc@dancol.org> References: <1775923222.898447.1518559575706@mail.libero.it> <277032065.898859.1518560883271@mail.libero.it> <83eflg91j6.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519072184 19303 195.159.176.226 (19 Feb 2018 20:29:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 20:29:44 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii , Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 19 21:29:40 2018 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 1ens3z-000460-H4 for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 21:29:27 +0100 Original-Received: from localhost ([::1]:52249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ens61-0003rI-R1 for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 15:31:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ens5t-0003r7-J4 for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:31:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ens5s-0000Ec-Ni for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:31:25 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:43712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ens5s-0000EE-Dk; Mon, 19 Feb 2018 15:31:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=3hz4/28VJr3E9t5LaQmH82lkDuKLU0+3k2saJyHdptM=; b=E5eEt2SU8SBxyQjufm6DnyouTuPyefRbqS/w08lDaILTXo+7W2XVq6JCUQFD4/beBut1VDZFo1cTRcRXTtSjTOzV8VxMEg2cj5cUU6CmFiAQiDw2tGMxZ1t+dA9Qi75XhV5XYcYLOdVHIa+/UArjHMYxI0SecYFifc9XFHOy8oyillerQCt/3Z/t79XWcq0nLSTNJ9yHUnDPngCmWRNq/EUMH/gnJi8hLaG2YwkN2KcxpbLkgms7Vax8OhsOgODA0XH4pYVz7xx83UDwAZljj0FApiQcIs4iNXQLQjccIzgI11R1hEzItoiUP5sxwaCoZ2GIKp0wK48kUjOzyVCrKw==; Original-Received: from [2604:4080:1321:8ab0:359b:2963:5873:c169] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ens5q-0001ig-JI; Mon, 19 Feb 2018 12:31:22 -0800 In-Reply-To: <83eflg91j6.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:223485 On 02/19/2018 12:18 PM, Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Mon, 19 Feb 2018 20:03:09 +0000 >> >> int sys_read(int fd, char *buffer, unsigned int count); >> >> The limit for a chunk should be INT_MAX (not UINT_MAX) so that it >> is representable in the (signed) return value. > > We should be able to change sys_read to return ssize_t instead. Can > you try that? I looked at the w32 code --- we give the size to _read directly in the non-pipe, non-socket, non-serial case, and MSDN doesn't say what happens when size > INT_MAX, so in the interest of being rather safe than sorry, I just changed the pdumper code to use INT_MAX. It shouldn't matter in practice.