X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/7f385610f71190f9485678b9cca4fe5f67c41251..cae7f8650a1ef8810a11daba24d5340d059cfa6f:/lib/libc/stdlib/posix_memalign.3 diff --git a/lib/libc/stdlib/posix_memalign.3 b/lib/libc/stdlib/posix_memalign.3 index 5fff120689..050e35857a 100644 --- a/lib/libc/stdlib/posix_memalign.3 +++ b/lib/libc/stdlib/posix_memalign.3 @@ -25,11 +25,12 @@ .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 2, 2009 +.Dd August 9, 2012 .Dt POSIX_MEMALIGN 3 .Os .Sh NAME -.Nm posix_memalign +.Nm posix_memalign , +.Nm aligned_alloc .Nd aligned memory allocation .Sh LIBRARY .Lb libc @@ -37,6 +38,8 @@ .In stdlib.h .Ft int .Fn posix_memalign "void **ptr" "size_t alignment" "size_t size" +.Ft void * +.Fn aligned_alloc "size_t alignment" "size_t size" .Sh DESCRIPTION The .Fn posix_memalign @@ -59,6 +62,16 @@ can be used as an argument in subsequent calls to .Xr reallocf 3 , and .Xr free 3 . +.Pp +The +.Fn aligned_alloc +function is the same as +.Fn posix_memalign , +but it takes just +.Fa alignment +and +.Fa size +and the allocation pointer is returned. .Sh IMPLEMENTATION NOTES The .Fn posix_memalign @@ -77,10 +90,19 @@ well-fitted results when the requests are reasonable. The .Fn posix_memalign function returns the value 0 if successful; otherwise it returns an error value. +The +.Fn aligned_alloc +returns a pointer to the allocated memory if successful; otherwise a +.Dv NULL +pointer is returned and +.Va errno +is set. .Sh ERRORS The .Fn posix_memalign -function will fail if: +and +.Fn aligned_alloc +functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The @@ -101,3 +123,7 @@ The .Fn posix_memalign function conforms to .St -p1003.1-2008 . +.\"The +.\".Fn aligned_alloc +.\"function conforms to +.\".St -isoC-2011 .