This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #12723] Fix pathconf and fpathconf on Linux


On 03/01/2013 03:13 PM, Siddhesh Poyarekar wrote:
On 1 March 2013 19:38, Florian Weimer <fweimer@redhat.com> wrote:
I think both the patch and the original code are wrong because Linux does
not guarantee atomic delivery beyond PAGE_SIZE (at least that's how I read
the code).  So pathconf(_PC_PIPE_BUF) should return PAGE_SIZE
unconditionally.

F_SETPIPE_SZ increases the amount of data which can ideally be written
without blocking, but not the size of atomically delivered chunks.


I had thought that too, but the pipe_write code seems to be synced with a mutex_lock() on the inode, which is why I figured that the writes may be atomic.

pipe_wait() is called from within the loop and drops the mutex temporarily.


--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]