[lkml]   [2003]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: forkpty with streams
    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

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:47    [W:0.021 / U:161.448 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site