Conceptual question about writeable file descriptors

This is a discussion on Conceptual question about writeable file descriptors within the Linux Programming forums, part of the Platform Specific Boards category; Say program A closes it's write half of the connection and then Program B, which was communicating with Program A ...

  1. #1
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329

    Conceptual question about writeable file descriptors

    Say program A closes it's write half of the connection and then
    Program B, which was communicating with Program A (via a pipe), then
    tries to write to the fd on Program A. Program A would generate
    SIGPIPE right?

    If Program A generates a SIGPIPE, how can the fd on Program A be ready
    for writing? Ie, if program A closes it's write end, then how can it
    be ready for writing?

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    Quote Originally Posted by Overworked_PhD View Post
    Say program A closes it's write half of the connection and then
    Program B, which was communicating with Program A (via a pipe), then
    tries to write to the fd on Program A. Program A would generate
    SIGPIPE right?
    Huh? You said Program A has the write end of the pipe. How, then, could Program B write to it? Surely Program B has the read end.

    If Program A generates a SIGPIPE, how can the fd on Program A be ready
    for writing? Ie, if program A closes it's write end, then how can it
    be ready for writing?
    Not really sure what you mean. Are you possibly using select() and wondering why it returns a writable status when the pipe is actually closed?

  3. #3
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Wait, never mind. I figured it out. And no, I wasn't using select().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 11:39 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 05:54 PM
  4. Replies: 15
    Last Post: 10-31-2005, 08:29 AM
  5. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 09:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21