git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: poll() emulation in git

From
Joachim Schmitz <jojo@schmitz-digital.de>
Date
Sep 7, 2012, 07:39 UTC
Message-ID
<000e01cd8ccb$e20301b0$a6090510$@schmitz-digital.de>
In-Reply-To
<5048B3D0.2070809@gnu.org>
Show 41 quoted lines
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini
> Sent: Thursday, September 06, 2012 4:32 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org; 'Junio C Hamano'; 'Erik Faye-Lund'; bug-gnulib@gnu.org; rsbecker@nexbridge.com
> Subject: Re: poll() emulation in git
> 
> Il 06/09/2012 16:02, Joachim Schmitz ha scritto:
> > ...
> > # else
> >       char data[64];
> >       r = recv (fd, data, sizeof (data), MSG_PEEK);
> >       socket_errno = (r < 0) ? errno : 0;
> > # endif
> >       if (r == 0)
> >         happened |= POLLHUP;
> >
> >       /* If the event happened on an unconnected server socket,
> >          that's fine. */
> >       else if (r > 0 || ( /* (r == -1) && */ socket_errno == ENOTCONN))
> >         happened |= (POLLIN | POLLRDNORM) & sought;
> >
> >       /* Distinguish hung-up sockets from other errors.  */
> >       else if (socket_errno == ESHUTDOWN || socket_errno == ECONNRESET
> >                || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
> >         happened |= POLLHUP;
> >
> > #ifdef __TANDEM /* as we can't recv(...,MSG_PEEK) on a non-socket */
> >       else if (socket_errno == ENOTSOCK)
> >         happened |= (POLLIN | POLLRDNORM) & sought;
> > #endif
> >       else
> >         happened |= POLLERR;
> >     }
> > ...
> >
> > We won't detect POLLHUP that way I think. However it seems to work, we've been able to clone, push, pull, branch that way with
> > NonStop being the (ssh-)server, something that didn't work at all without that hack (and yes, I believe it is just that).
> > Someone in for a cleaner way of managing this?
> 
> I suppose it works to always handle ENOTSOCK that way, even on
> non-__TANDEM systems.
Will you be fixing this in gnulib? How?
Bye, Jojo
Previous: Joachim SchmitzNext: Paolo Bonzini
Message 13 of 14 in “RE: poll() emulation in git”
  1. Joachim SchmitzSep 5, 2012
  2. Bastien ROUCARIESSep 5, 2012
  3. Joachim SchmitzSep 5, 2012
  4. Paolo BonziniSep 5, 2012
  5. Joachim SchmitzSep 5, 2012
  6. Joachim SchmitzSep 5, 2012
  7. Paolo BonziniSep 5, 2012
  8. Joachim SchmitzSep 6, 2012
  9. Paolo BonziniSep 6, 2012
  10. Joachim SchmitzSep 6, 2012
  11. Paolo BonziniSep 6, 2012
  12. Joachim SchmitzSep 7, 2012
  13. Joachim SchmitzSep 7, 2012
  14. Paolo BonziniSep 7, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.