Scroll to navigation

mkfifo(3) Library Functions Manual mkfifo(3)

NOM

mkfifo, mkfifoat - Créer un fichier spécial FIFO (un tube nommé)

BIBLIOTHÈQUE

Bibliothèque C standard (libc-lc)

SYNOPSIS

#include <sys/types.h>
#include <sys/stat.h>
int mkfifo(const char *path, mode_t mode);
#include <fcntl.h>           /* Définition des constantes AT_* */
#include <sys/stat.h>
int mkfifoat(int dirfd, const char *path, mode_t mode);

Exigences de macros de test de fonctionnalités pour la glibc (consulter feature_test_macros(7)) :

mkfifoat() :


Depuis la glibc 2.10 :
_POSIX_C_SOURCE >= 200809L
avant la glibc 2.10 :
_ATFILE_SOURCE

DESCRIPTION

mkfifo() makes a FIFO special file with name path. mode specifies the FIFO's permissions. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask).

Un fichier spécial FIFO est semblable à un tube (pipe), sauf qu'il est créé différemment. Plutôt qu'un canal de communication anonyme, un fichier FIFO est inséré dans le système de fichiers en appelant mkfifo().

Une fois qu'un fichier FIFO est créé, n'importe quel processus peut l'ouvrir en lecture ou écriture, comme tout fichier ordinaire. En fait, il faut ouvrir les deux extrémités simultanément avant de pouvoir effectuer une opération d'écriture ou de lecture. L'ouverture d'un FIFO en lecture est généralement bloquante, jusqu'à ce qu'un autre processus ouvre le même FIFO en écriture, et inversement. Consultez fifo(7) pour la gestion non bloquante d'une FIFO.

mkfifoat()

La fonction mkfifoat() opère exactement de la même façon que la fonction mkfifo(), à une différence près (décrite ci-dessous).

If path is relative, then it is interpreted relative to the directory referred to by the file descriptor dirfd (rather than relative to the current working directory of the calling process, as is done by mkfifo() for a relative pathname).

If path is relative and dirfd is the special value AT_FDCWD, then path is interpreted relative to the current working directory of the calling process (like mkfifo()).

Si path est absolu, alors dirfd est ignoré.

Consultez openat(2) pour une explication sur la nécessité de mkfifoat().

VALEUR RENVOYÉE

La valeur renvoyée par mkfifo() et par mkfifoat() lorsqu'elles réussissent est 0. Si elles échouent, ces fonctions renvoient -1 et errno est défini pour préciser l'erreur.

ERREURS

One of the directories in path did not allow search (execute) permission.
(mkfifoat()) path is relative but dirfd is neither AT_FDCWD nor a valid file descriptor.
Le quota de blocs de disque ou d'inœuds de l'utilisateur sur le système de fichiers a été atteint.
path already exists. This includes the case where path is a symbolic link, dangling or not.
Either the total size of path is greater than PATH_MAX, or an individual filename component has a length greater than NAME_MAX. In the GNU system, there is no imposed limit on overall filename length, but some filesystems may place limits on the length of a component.
Un des répertoires du chemin d'accès chemin n'existe pas ou est un lien symbolique pointant nulle part.
Le répertoire, ou le système de fichiers, n'a pas assez de place pour un nouveau fichier.
Un élément, utilisé comme répertoire, du chemin d'accès chemin n'est pas en fait un répertoire.
(mkfifoat()) path is relative and dirfd is a file descriptor referring to a file other than a directory.
path refers to a read-only filesystem.

ATTRIBUTS

Pour une explication des termes utilisés dans cette section, consulter attributes(7).

Interface Attribut Valeur
mkfifo(), mkfifoat() Sécurité des threads MT-Safe

VERSIONS

Elle est implémentée au moyen de mknodat(2)

STANDARDS

POSIX.1-2008.

HISTORIQUE

POSIX.1-2001.
glibc 2.4. POSIX.1-2008.

VOIR AUSSI

mkfifo(1), close(2), open(2), read(2), stat(2), umask(2), write(2), fifo(7)

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>, Cédric Boutillier <cedric.boutillier@gmail.com>, Frédéric Hantrais <fhantrais@gmail.com> 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.

17 mai 2025 Pages du manuel de Linux (non publiées)