<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - stdin should not be read-only"
   href="http://llvm.org/bugs/show_bug.cgi?id=21946">21946</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>stdin should not be read-only
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bruce.mitchener@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In ProcessLaunchInfo, there is this code:

            if (default_to_use_pty && (!in_path || !out_path || !err_path)) {
                if (m_pty->OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0))
{
                    const char *slave_path = m_pty->GetSlaveName(NULL, 0);

                    if (!in_path) {
                        AppendOpenFileAction(STDIN_FILENO, slave_path, true,
false);
                    }

                    if (!out_path) {
                        AppendOpenFileAction(STDOUT_FILENO, slave_path, false,
true);
                    }

                    if (!err_path) {
                        AppendOpenFileAction(STDERR_FILENO, slave_path, false,
true);
                    }
                }
            }

Where the prototype of AppendOpenFileAction is:

    bool ProcessLaunchInfo::AppendOpenFileAction (int fd, const char *path,
bool read, bool write)

Unfortunately, some programs rely upon being able to write to stdin and work
fine when run normally, but fail when run under lldb.  I'm pretty sure that the
failure is due to this read-only stdin being created ... I've run into this
with libtermkey.

There's nothing in
<a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/stdin.html">http://pubs.opengroup.org/onlinepubs/009695399/functions/stdin.html</a> which says
stdin should be read-only (or that it should be writeable) and I'm not sure
what else other documents might say.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>