archive mirror
 help / color / mirror / Atom feed
From: Andrew Barton <>
To: Matti Aarnio <>
Subject: Re: forkpty with streams
Date: 25 Jul 2003 12:53:18 +0000	[thread overview]
Message-ID: <1059137598.13910.17.camel@localhost> (raw)
In-Reply-To: <>

On Fri, 2003-07-25 at 18:46, Matti Aarnio wrote:

> dup() helps you to have two fd:s,  fdopen() for both, one with "w",
> other "r".   Things should not need that dup() actually.
> Also fcntl() the fd's to be non-blocking.
> Actually I am always nervous with stdio streams in places
> where I want to use non-blocking file handles, and carefull
> read()ing and write()ng along with select()s to handle
> non-stagnation of this type of communications.

In my program, the standard input is filtered through a lex scanner
whose output file is the pty. So it does indeed need to be a stream.
Since I'm using flex, I won't have much control over the writing
process. When will it be necessary to read from the pty, to prevent a
deadlock? After each character the user types?

I might use SIGIO to read from the pty, but I have the 2.4 kernel that
doesn't support SIGIO on pipes and FIFOs. I assume ptys have the same

  reply	other threads:[~2003-07-25 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-24 23:28 forkpty with streams Andrew Barton
2003-07-25 13:02 ` Doug McNaught
2003-07-25 15:27 ` Andries Brouwer
2003-07-25 10:59   ` Andrew Barton
2003-07-25 18:46     ` Matti Aarnio
2003-07-25 12:53       ` Andrew Barton [this message]
2003-07-25 20:10     ` Andries Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1059137598.13910.17.camel@localhost \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).