[linux-lvm] [lvm-devel] MUSL fun

Brendan Heading brendanheading at gmail.com
Sat Feb 13 21:31:11 UTC 2016

>> There is a reason from lvm2 implementation here - freopen() is not giving
>> application full control over internal buffer allocation and we need to be
>> sure we lock-in memory for critical section - and some glibc versions are
>> allocating buffers here via 'mmap' call.
>> That said - there could be accepted a patch checking in configure  for
>> 'read-only' stdin  - and using then #ifdef compilation that would
>> replace use of  internal lvm2 reopen code with libc function.
> I had a suspicion you would have a good reason.
> On first glance your proposal sounds like a good compromise and one
> that would be worth exploring.

As an alternative idea, what about changing the codebase not to use
stdin/stdout/stderr, using it's own file descriptor names and calling
dup2() as appropriate to set them up on startup ?

Just flying the kite - I haven't looked to see how painful this might be.


More information about the linux-lvm mailing list