Thread: Conceptual question about writeable file descriptors

  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
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    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, 10:39 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04: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, 08:39 AM