Re: PROBLEM: blocking read on socket repeatedly returns EAGAIN

From: Alan Cox (alan_at_lxorguk.ukuu.org.uk)
Date: 08/16/05

  • Next message: Matthew Wilcox: "Re: [PATCH] IDE: don't offer IDE_GENERIC on ia64"
    To: Kern Sibbald <kern@sibbald.com>
    Date:	Tue, 16 Aug 2005 15:03:11 +0100
    
    

    On Maw, 2005-08-16 at 15:19 +0200, Kern Sibbald wrote:
    > have written, nor does it write() anything. When my read() is issued, I
    > expect it to block, but it immediately returns with -1 and errno set to
    > EAGAIN. If the read() is re-issued, a CPU intensive loop results as long as
    > the other end does not read() the data written to the socket. This is a
    > multi-threaded program, but the other threads are all blocked on something.

    You are describing behaviour as expected with nonblocking set. That
    suggests to me that something or someone set or inherited the nonblock
    flag on that socket. Is the strange behaviour specific to the latest
    kernel ?

    Alan
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Matthew Wilcox: "Re: [PATCH] IDE: don't offer IDE_GENERIC on ia64"

    Relevant Pages

    • 2.6.0 - Network doesnt come up.
      ... Bringing up loopback interface: arping: socket: Address family not supported ... some other host already uses address 127.0.0.1. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: GFS, whats remainingh
      ... But you said it runs on an aging Alpha, surely you do not intend to expand it ... synchronization keeps you from spreading out the load over multiple boxes? ... Use a socket, as ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Help with /proc/net/tcp fields
      ... | /proc/net/tcp means, with little success. ... | on that socket, and when will ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [NBD] Use per-device semaphore instead of BKL
      ... > while you're clearing the queue someone else could have set the ... > socket again and started queueing requests). ... BKL to protect the ioctl's against each other. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)