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, 15:25 UTC
Message-ID
<50476EFD.2000500@gnu.org>
In-Reply-To
<00d801cd8b6b$844bbcd0$8ce33670$@schmitz-digital.de>
Il 05/09/2012 15:36, Joachim Schmitz ha scritto:
Show 25 quoted lines
>>> > > Does your system have a working FIONREAD ioctl for pipes?
>> > 
>> > It does have FIONREAD ioctl. Whether it works properly is to be determined...
>> > I'll test if you could show me how?
> Oh, now I see what you aimed at, but no, that Mac OS X method doesn't work for me, I tried (at least I think I did).
> 
> And <sys/ioctl.h> has
> /*
>  * Normal IOCTL's supported by the socket interface
>  */
> #define FIONREAD        _IOR(0, 8, _ioctl_int)       /* Num of bytes to read */
> #define FIONBIO         _IOW(0, 9, _ioctl_int)       /* Non-blocking I/O     */
> 
> So these seem to be supported on sockets only, I guess.
> And indeed the man pages for ioctl confirms:
> 
>           Valid values for the request parameter for AF_INET or
>           AF_INET6 sockets are:
> 
> 
>           FIONREAD  Gets the number of bytes available for reading and
>                     stores it at the int pointed at by arg.
> 
> 
> So not even AF_UNIX sockets, not to mention pipes...

So there's no way you can support POLLHUP. Your system is quite crippled. :(

Paolo
Previous: Joachim SchmitzNext: Joachim Schmitz
Message 7 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.