lockf
Poser, examiner ou supprimer un verrou POSIX sur un fichier ouvert
- Provided by: manpages-fr-dev (Version: 4.29.1-1)
- Source: manpages-l10n
- Report a bug
Poser, examiner ou supprimer un verrou POSIX sur un fichier ouvert
Bibliothèque C standard (libc, -lc)
#include <unistd.h>
int lockf(int fd, int op, off_t size);
lockf() :
_XOPEN_SOURCE >= 500
|| /* glibc >= 2.19 : */ _DEFAULT_SOURCE
|| /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE
Apply, test, or remove a POSIX lock on a section of an open file. The file is specified by fd, a file descriptor open for writing, the action by op, and the section consists of byte positions pos..pos+size-1 if size is positive, and pos-size..pos-1 if size is negative, where pos is the current file position, and if size is zero, the section extends from the current file position to infinity, encompassing the present and future end-of-file positions. In all cases, the section may extend past current end-of-file.
Sous Linux, lockf() est une interface de vérrou au dessus de fcntl(2). Beaucoup d'autres systèmes implémentent lockf() de cette façon, cependant POSIX.1 ne spécifie pas la relation de vérrou entre lockf() et fcntl(2). Une application portable ne devrait pas mixer des appels à ces deux interfaces.
Les opérations valides sont les suivantes :
En cas de succès, zéro est renvoyé. En cas d'erreur, -1 est renvoyé et errno est définie pour préciser l'erreur.
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
| Interface | Attribut | Valeur |
| lockf() | Sécurité des threads | MT-Safe |
POSIX.1-2008.
POSIX.1-2001, SVr4.
locks.txt et mandatory-locking.txt dans le répertoire Documentation/filesystems des sources du noyau Linux. (Sur d'anciens noyaux, ces fichiers se trouvent dans le répertoire Documentation et mandatory-locking.txt est appelé mandatory.txt.)
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 Jean-Pierre Giraud <jean-pierregiraud@neuf.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.