blob: 869e8d891a4fcd1d4c158c029fa898bd4f1b38c3 [file] [log] [blame]
Jens Axboed0983d02009-12-16 09:53:24 +01001#include <stdlib.h>
2#include <errno.h>
3#include "compiler/compiler.h"
4
5/*
6 * Some Solaris versions don't have posix_memalign(), provide a private
7 * weak alternative
8 */
9int __weak posix_memalign(void **ptr, size_t align, size_t size)
10{
11 *ptr = memalign(align, size);
12 if (*ptr)
13 return 0;
14
15 return ENOMEM;
16}