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 6, 2012, 15:15 UTC
Message-ID
<5048BDF6.2000602@gnu.org>
In-Reply-To
<010a01cd8c3e$25609500$7021bf00$@schmitz-digital.de>
Il 06/09/2012 16:44, Joachim Schmitz ha scritto:
Show 14 quoted lines
>> > Yes, it's an usleep(autocorrect * 100000) basically (poll takes
>> > milliseconds, not micro).
> OK, it is _supposed_ to do this usleep(), but is does not, as poll() returns early with EFAULT in this case:
>   /* EFAULT is not necessary to implement, but let's do it in the
>      simplest case. */
>   if (!pfd)
>     {
>       errno = EFAULT;
>       return -1;
>     }
> 
> poll() is doing this before calling select(), so won't sleep.
> So there's a bug in {gnulib|git}'s poll(), right?
> 
Yes, it should be "if (!pfd && nfd)".
Paolo
Previous: Joachim SchmitzNext: Joachim Schmitz
Message 11 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.