• R
    fix multiple stdio functions' behavior on zero-length operations · 6e2bb7ac
    Rich Felker 提交于
    previously, fgets, fputs, fread, and fwrite completely omitted locking
    and access to the FILE object when their arguments yielded a zero
    length read or write operation independent of the FILE state. this
    optimization was invalid; it wrongly skipped marking the stream as
    byte-oriented (a C conformance bug) and exposed observably missing
    synchronization (a POSIX conformance bug) where one of these functions
    could wrongly complete despite another thread provably holding the
    lock.
    6e2bb7ac
fwrite.c 696 字节