Re: [PATCH] 0-byte read()/write() behaviour

From: Linus Torvalds (torvalds@transmeta.com)
Date: Fri Oct 20 2000 - 13:47:45 EDT

  • Next message: Jeff Garzik: "Re: VM_RESERVED [was Re: mapping user space buffer to kernel address space]"

    On Fri, 20 Oct 2000, Philipp Rumpf wrote:
    >
    > Single Unix specifies that 0-byte reads, as well as 0-byte writes, should
    > "return 0 and have no other results". Our current implementation violates
    > the first requirement and makes it very easy to violate the second one.

    Note that there _are_ cases where 0-byte reads and writes have specific
    meaning, notably there are some networking things where a 0-byte sendto()
    does something special if I remember correctly. And I seem to remember
    that this also _did_ translate into write().

    I remember that Linux used to do exactly this, and we had to pass the
    0-byte writes into the low-level cases exactly because some low-level
    cases do care. I suspect SUS only talks about regular files.

                    Linus

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



    This archive was generated by hypermail 2b29 : Fri Oct 20 2000 - 13:52:56 EDT