added posix_memalign()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21974 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bd14785126
commit
bf7beb500c
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user