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

Re: poll() emulation in git

From
Paolo Bonzini <bonzini@gnu.org>
Date
Sep 5, 2012, 12:05 UTC
Message-ID
<50474001.5030407@gnu.org>
In-Reply-To
<00c001cd8b59$028e41c0$07aac540$@schmitz-digital.de>
Il 05/09/2012 13:24, Joachim Schmitz ha scritto:
> However: this poll implementation, while compiling OK, doesn't work properly.
> Because it uses recv(...,MSG_PEEK), it works on sockets only (returns ENOTSOCK on anything else), while the real poll() works on all
> kind if file descriptors, at least that is my understanding.

Actually recv(...,MSG_PEEK) on most Unix variants works on non-sockets too. The trick is taken from GNU Pth in turn.

> Here on HP NonStop, when being connected via an non-interactive SSH, we get a set of pipes (stdin, stdout, stderr) instead of a
> socket to talk to, so the poll() just hangs/loops.
Does your system have a working FIONREAD ioctl for pipes?
Show 5 quoted lines
> As git's implementation is based on ('stolen' from?) gnulib's and still pretty similar, CC to the gnulib list and Paolo
> 
> Any idea how this could get solved? I.e. how to implement a poll() that works on non-sockets too?
> There is some code that pertains to a seemingly similar problem in Mac OS X, but my problem is not identical, as that fix doesn't
> help.
Paolo
Previous: Joachim SchmitzNext: Joachim Schmitz
Message 4 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.