The build fails on SLE11 as the function aligned_alloc is not
available there. Replace it by memalign that has the same semantics
and is commonly used in fstests code base. aligned_alloc has
additional requirements on the alignment and buffer size but that is
ok as the buffer is defined in multiples of the alignment.
Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
+#include <malloc.h>
#define SECTOR_SIZE 512
#define BUFFER_SIZE (150 * SECTOR_SIZE)
do_splice == do_splice1 ? "sequential" : "concurrent",
(open_flags & O_DIRECT) ? "with" : "without");
- buffer = aligned_alloc(SECTOR_SIZE, BUFFER_SIZE);
+ buffer = memalign(SECTOR_SIZE, BUFFER_SIZE);
if (buffer == NULL)
- err(1, "aligned_alloc");
+ err(1, "memalign");
fd = open(filename, open_flags, 0666);
if (fd == -1)