home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,325 of 33,346   
   =?UTF-8?Q?Tobias=20M=C3=BCller?= to James K. Lowden   
   Re: Make std::cout accept std::wstring ?   
   09 May 14 15:54:54   
   
   l-september.org> 527634f8   
   From: troplin@bluewin.ch   
      
   "James K. Lowden"  wrote:   
   > On Thu,  8 May 2014 06:39:57 CST   
   > Seungbeom Kim  wrote:   
   >   
   >>> Those states are as specific as I can imagine without getting into   
   >>> details from the OS.  It deals cleanly with with the EOF ambiguity   
   >>> of read(2) and, unlike stdio, distinguishes between recoverable and   
   >>> nonrecoverable errors.   
   >>   
   >> Can you please explain what is the EOF ambiguity of read(2)?   
   >   
   > When read(2) returns zero bytes, it may mean that no data   
   > were pending on a socket with nonblocking I/O, or EOF.   
   >   
   > Granted, files aren't sockets, and the standard library doesn't   
   > implement network I/O for iostreams.   But, as you know, just as a   
   > stream is not a socket, neither is it a file.  It strikes me as   
   > prescient that EOF and "no data read" are distinct.   
      
   AFAIK read/recv only return 0 on EOF. If no data is pending for nonblocking   
   IO, it returns -1 with errno set to EWOULDBLOCK or EAGAIN.   
      
   Tobi   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca