summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/gen/memalign.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/port/gen/memalign.c')
-rw-r--r--usr/src/lib/libc/port/gen/memalign.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr/src/lib/libc/port/gen/memalign.c b/usr/src/lib/libc/port/gen/memalign.c
index a54a10868f..a6320a7a0b 100644
--- a/usr/src/lib/libc/port/gen/memalign.c
+++ b/usr/src/lib/libc/port/gen/memalign.c
@@ -22,13 +22,12 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2016 Joyent, Inc.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "lint.h"
#include "mallint.h"
#include "mtlib.h"
@@ -183,3 +182,15 @@ memalign(size_t align, size_t nbytes)
(void) mutex_unlock(&libc_malloc_lock);
return (DATA(aligned_blk));
}
+
+/*
+ * This is the ISO/IEC C11 version of memalign. We have kept it as a separate
+ * function, but it is basically the same thing. Note that this is implemented
+ * this way to make life easier to libraries which already interpose on
+ * memalign.
+ */
+void *
+aligned_alloc(size_t align, size_t size)
+{
+ return (memalign(align, size));
+}