bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

valloc is not detected during configuration


From: Göran Uddeborg
Subject: valloc is not detected during configuration
Date: Mon, 28 Apr 2003 14:37:01 +0200

I'm trying to make tar write using aligned buffers.  See parantheses
below for why.

As delivered, tar does not use an aligned buffer when writing.  While
I looked if it would be possible to change this, I noted that the
buffer is allocated with valloc() in buffer.c, which SHOULD give an
aligned buffer.  Looking further, I realised there is code to replace
valloc() with plain malloc() when the former is not available, this is
in system.h.  But the configure script never checks to see if valloc()
is available!  So this replacement will happen on all systems, even
those which do have valloc().

To me, this looks a mistake.  The obvious patch is included below.  It
was applied to tar 1.13.25, as delivered by Red Hat.

(In case you wonder why I care: I want to write tar archives to
DVD+R(W) disks from a Linux systems.  There are kernel patches
available (http://fy.chalmers.se/~appro/linux/DVD+RW/) to make this
possible.  They work best if used through the /dev/raw interface.
This interface requires aligned buffers, 2 kB-aligned in this case.
Adding the included configure fix to tar seems to be enough for this
to work with standard archives.  For multi-volume archives tar does
most if its writes from two blocks into the buffer, so that case needs
some additional modifications.  I haven't figured out the details
about that yet.)

Attachment: tar.valloc-config-patch
Description: Patch to make configure look for valloc too.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]