| posix_memalign(3) | Library Functions Manual | posix_memalign(3) |
NOM
posix_memalign - allocate aligned memory
BIBLIOTHÈQUE
Bibliothèque C standard (libc, -lc)
SYNOPSIS
#include <stdlib.h>
int posix_memalign(void **memptr, size_t alignment, size_t size);
posix_memalign() :
_POSIX_C_SOURCE >= 200112L
DESCRIPTION
posix_memalign() alloue taille octets et place l'adresse de la mémoire allouée dans *memptr. L'adresse de la mémoire allouée est un multiple de alignement, qui doit lui-même être une puissance de deux et un multiple de sizeof(void *). Cette adresse peut être plus tard passée à free(3). Si taille vaut 0, alors la valeur dans *memptr est soit NULL, soit une valeur de pointeur unique.
The memory is not zeroed.
aligned_alloc(3) is a standard function that provides the same functionality, and has a more ergonomic prototype. Use that instead.
VALEUR RENVOYÉE
posix_memalign() returns zero on success, or one of the error values listed in the next section on failure. The value of errno is not set.
ERREURS
ATTRIBUTS
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
| Interface | Attribut | Valeur |
| posix_memalign() | Sécurité des threads | MT-Safe |
NORMES
POSIX.1-2024.
HISTORIQUE
glibc 2.1.91. POSIX.1d, POSIX.1-2001.
CAVEATS
On Linux (and other systems), posix_memalign() does not modify memptr on failure. A requirement standardizing this behavior was added in POSIX.1-2008 TC2.
VOIR AUSSI
TRADUCTION
La traduction française de cette page de manuel a été créée par Christophe Blaess https://www.blaess.fr/christophe/, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org>, David Prévot <david@tilapin.org> et Grégoire Scano <gregoire.scano@malloc.fr>
Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.
Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org.
| 8 février 2026 | Pages du manuel de Linux 6.17 |