unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: jim@meyering.net, emacs-devel@gnu.org
Subject: Re: oops? read/write vs type of length parameter
Date: Wed, 13 Apr 2011 20:22:11 +0300	[thread overview]
Message-ID: <83bp0aqd6k.fsf@gnu.org> (raw)
In-Reply-To: <4DA5C9F6.3070209@cs.ucla.edu>

> Date: Wed, 13 Apr 2011 09:06:14 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: jim@meyering.net, emacs-devel@gnu.org
> 
> On 04/13/2011 02:46 AM, Eli Zaretskii wrote:
> > I was asking whether testing errno for EWOULDBLOCK
> > and EAGAIN, and the code that deals with when that happens, are good
> > enough for all the possible reasons that emacs_write and
> > emacs_gnutls_write could return a partial count of bytes.
> 
> The revised send_process code tests for EWOULDBLOCK and EAGAIN under
> the same conditions that it does now.

That's true, but it's not my point.  The original code continued
looping and trying to write the rest of the stuff if emacs_write
returned a positive value that is smaller than what is was asked to
write.  The new code bails out of the loop in that case, assuming that
it's due to an error.

> > sysdep.c is not about system things, it's about Emacs code that
> > requires platform-dependent techniques.  Most of that indeed deals
> > with system types, but you will find quite a few Emacs specific
> > internals
> 
> Yes, and I had already mentioned that the abstraction boundaries were
> sometimes being violated there.  But let's not make matters worse.
> sysdep.c is supposed to be for interfaces to system-dependent kernel
> and library code, not for access to Emacs Lisp internals.

I was trying to point out that you are mistaken in your interpretation
of what sysdep.c is.  But even I accept your POV, access to OS-level
features does not mean we cannot use Emacs-specific data types there
or forget about Emacs design.  sysdep.c is not a library, it's part of
an application.

> >> For example, it would be a fairly small change to make Emacs buildable on
> >> a machine with 32-bit pointers and 64-bit EMACS_INT.
> > 
> > Somehow, I doubt it is a small change.  But if it is, by all means
> > let's do it now!  What are we waiting for?
> 
> I suspect you are joking, but if not, I'd be happy to implement it.

I'm not joking.  How could I?

> It shouldn't take that long, and it'd be nice to remove that silly 512
> MiB limit.  Would you object to such a change?

Of course not!  Why should I object to a great feature like that?

> in the meantime, we have a proposed change that
> fixes bugs and doesn't introduce bugs.  Since there are no downsides
> to this fix now, and no improvements to it have been suggested, we can
> install it now, and worry about future improvements later.

I'll let Stefan and Chong decide on that.  I still think that using
ssize_t as the last argument to emacs_write is better.

> > Either you care about future changes or you don't.
> 
> Both.  I care about plausible future changes; and I also realize that
> we don't have time to program for all possibilities and need to fix
> what's before us, which the proposed patch does.

IOW, you care for what supports your arguments and don't care about
the rest.



  reply	other threads:[~2011-04-13 17:22 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11  8:55 oops? read/write vs type of length parameter Jim Meyering
2011-04-11  9:44 ` Eli Zaretskii
2011-04-11 11:08   ` Jim Meyering
2011-04-11 11:28     ` David Kastrup
2011-04-11 11:52     ` Eli Zaretskii
2011-04-11 12:27       ` Jim Meyering
2011-04-11 12:31         ` David Kastrup
2011-04-11 21:54           ` Jim Meyering
2011-04-12  4:44             ` Eli Zaretskii
2011-04-12 13:24             ` Ted Zlatanov
2011-04-12 13:29               ` Eli Zaretskii
2011-04-12 14:47                 ` Ted Zlatanov
2011-04-12 17:00                   ` Large file support (was: oops? read/write vs type of length parameter) Eli Zaretskii
2011-04-14 20:57             ` oops? read/write vs type of length parameter Michael Welsh Duggan
2011-04-11 14:02         ` Eli Zaretskii
2011-04-11 11:40   ` Stephen J. Turnbull
2011-04-11 13:58     ` Eli Zaretskii
2011-04-12  1:16       ` Paul Eggert
2011-04-12  3:01         ` Eli Zaretskii
2011-04-12  5:06           ` Paul Eggert
2011-04-12  5:46             ` Eli Zaretskii
2011-04-12  8:19             ` Paul Eggert
2011-04-12  9:41               ` Eli Zaretskii
2011-04-12 15:53                 ` Paul Eggert
2011-04-12 16:56                   ` Eli Zaretskii
2011-04-12 23:55                   ` Juanma Barranquero
2011-04-13  5:14                   ` Paul Eggert
2011-04-13  6:31                     ` Jim Meyering
2011-04-13  6:37                     ` Eli Zaretskii
2011-04-13  8:15                       ` Paul Eggert
2011-04-13  9:46                         ` Eli Zaretskii
2011-04-13 16:06                           ` Paul Eggert
2011-04-13 17:22                             ` Eli Zaretskii [this message]
2011-04-13 19:31                               ` Paul Eggert
2011-04-13 19:59                               ` PJ Weisberg
2011-04-14  4:49                                 ` Eli Zaretskii
2011-04-13 20:02                               ` Paul Eggert
2011-04-13  6:49                     ` Eli Zaretskii
2011-04-13 14:35                     ` Ted Zlatanov
2011-04-15 13:13                       ` Ted Zlatanov
2011-04-15 16:34                         ` Paul Eggert
2011-04-15 18:20                           ` Ted Zlatanov
2011-04-15  1:29                   ` Stefan Monnier
2011-04-15  8:55                     ` Paul Eggert
2011-04-15  9:41                       ` Eli Zaretskii
2011-04-15 10:24                         ` Paul Eggert
2011-04-12 12:32             ` Davis Herring
2011-04-12 13:38               ` Eli Zaretskii
2011-04-12 15:43                 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83bp0aqd6k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=jim@meyering.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).