https://llvm.org/bugs/show_bug.cgi?id=23078

            Bug ID: 23078
           Summary: fstream doesn't play well with named pipes
           Product: libc++
           Version: 3.5
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Given a pipe created at the command line using 'mkfifo my_pipe' and given the
following snippet:

#include <fstream>
#include <iostream>
#include <string>

int main(int, char*[])
{
    std::fstream pipe("my_pipe");
    std::string message;
    while(std::getline(pipe, message) && message != "EXIT")
    {
        std::cout << message << std::endl
    }

    return 0;
}

If I run the program and (from another command prompt) issue the command "echo
banana > my_pipe", nothing gets printed as it appears the call to getline never
returns. The same snippet and scenario with libstdc++ 4.7.2 works as expected.
That is getline returns, cout prints the message and we loop until message is
"EXIT".


MacOS X 10.10.2

clang -v:
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to