added posix_memalign()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21974 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2007-08-16 09:19:56 +00:00
parent bd14785126
commit bf7beb500c
2 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,7 @@ extern void *calloc(size_t nmemb, size_t size);
extern void free(void *pointer);
extern void *malloc(size_t size);
extern void *realloc(void * ptr, size_t size);
extern int posix_memalign(void **memptr, size_t alignment, size_t size);
/* process termination */
extern void abort(void);

View File

@ -274,6 +274,18 @@ memalign(size_t alignment, size_t size)
}
extern "C" int
posix_memalign(void **memptr, size_t alignment, size_t size)
{
if (!memptr)
return EINVAL;
*memptr = memalign(alignment, size);
if (memptr == NULL)
return ENOMEM;
return 0;
}
extern "C" void *
valloc(size_t size)
{