POSIX_FALLOCATE(3) | Manuel du programmeur Linux | POSIX_FALLOCATE(3) |
posix_fallocate - Allouer de l'espace pour un fichier
#include <fcntl.h>
int posix_fallocate(int fd, off_t offset, off_t len);
posix_fallocate() :
The function posix_fallocate() ensures that disk space is allocated for the file referred to by the file descriptor fd for the bytes in the range starting at offset and continuing for len bytes. After a successful call to posix_fallocate(), subsequent writes to bytes in the specified range are guaranteed not to fail because of lack of disk space.
Si la taille du fichier est inférieure offset+len, le fichier est agrandi à cette taille ; autrement, la taille du fichier n'est pas modifiée.
posix_fallocate() renvoie 0 si elle réussit et un numéro d'erreur si elle échoue. Notez que errno n'est pas écrite.
posix_fallocate() est disponible depuis la glibc 2.1.94.
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
Interface | Attribut | Valeur |
posix_fallocate() | Sécurité des threads | MT-Safe (but see NOTES) |
POSIX.1-2001.
POSIX.1-2008 indique qu'une implémentation doit renvoyer l'erreur EINVAL si len valait 0 ou si offset était inférieur à 0. POSIX.1-2001 indique qu'une implémentation doit renvoyer l'erreur EINVAL était inférieur à 0 ou si offset était inférieur à 0 et peut renvoyer cette erreur si len est égal à 0.
In the glibc implementation, posix_fallocate() is implemented using the fallocate(2) system call, which is MT-safe. If the underlying filesystem does not support fallocate(2), then the operation is emulated with the following caveats:
In general, the emulation is not MT-safe. On Linux, applications may use fallocate(2) if they cannot tolerate the emulation caveats. In general, this is only recommended if the application plans to terminate the operation if EOPNOTSUPP is returned, otherwise the application itself will need to implement a fallback with all the same problems as the emulation provided by glibc.
Cette page fait partie de la publication 5.10 du projet man-pages Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse https://www.kernel.org/doc/man-pages/.
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> et David Prévot <david@tilapin.org>
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.
1 novembre 2020 | GNU |