.\" -*- coding: UTF-8 -*- .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: GPL-1.0-or-later .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH mknod 2 "17 mai 2025" "Pages du manuel de Linux 6.15" .SH NOM mknod, mknodat \- Créer un fichier spécial ou ordinaire .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBint mknod(const char *\fP\fIpath\fP\fB, mode_t \fP\fImode\fP\fB, dev_t \fP\fIdev\fP\fB);\fP .P \fB#include \fP/* Définition des constantes AT_* */ \fB#include \fP .P \fBint mknodat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpath\fP\fB, mode_t \fP\fImode\fP\fB, dev_t \fP\fIdev\fP\fB);\fP .fi .P .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7)) : .RE .P \fBmknod\fP() : .nf .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE >= 500 || /* Depuis la glibc 2.19 : */ _DEFAULT_SOURCE || /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE .fi .SH DESCRIPTION The system call \fBmknod\fP() creates a filesystem node (file, device special file, or named pipe) named \fIpath\fP, with attributes specified by \fImode\fP and \fIdev\fP. .P L'argument \fImode\fP définit à la fois les permissions d'utilisation, et le type de nœud à créer. C'est une combinaison (en utilisant une opération \fIOU\fP bit à bit) entre l'un des types de fichier ci\-dessous et aucun ou plusieurs bits de mode de fichier listés dans \fBinode\fP(7). .P Le mode du fichier est modifié par le \fIumask\fP du processus de manière habituelle : en l'absence de liste de contrôle d'accès (ACL) par défaut, les permissions du nœud créé sont (\fImode\fP & \[ti]\fIumask\fP). .P .\" (S_IFSOCK since Linux 1.2.4) Le type de nœud doit être l'un des suivants \fBS_IFREG\fP, \fBS_IFCHR\fP, \fBS_IFBLK\fP, \fBS_IFIFO\fP ou \fBS_IFSOCK\fP pour indiquer respectivement un fichier régulier (vide à la création), un fichier spécial mode caractère, un fichier spécial mode bloc, un tube nommé (FIFO) ou un socket du domaine UNIX. Un type de fichier égal à zéro est équivalent à \fBS_IFREG\fP. .P Si le type de fichier est \fBS_IFCHR\fP ou \fBS_IFBLK\fP alors \fIdev\fP doit indiquer les numéros majeur et mineur du fichier spécial nouvellement créé (\fBmakedev\fP(3) peut être utile pour construire la valeur de \fIdev\fP). Pour les autres types de fichier, \fIdev\fP est ignoré. .P If \fIpath\fP already exists, or is a symbolic link, this call fails with an \fBEEXIST\fP error. .P .\" .\" Le nœud nouvellement créé aura pour propriétaire l'UID effectif du processus. Si le répertoire contenant ce nœud a son bit Set\-GID défini, ou si le système de fichiers est monté avec une sémantique de groupe BSD, le nouveau nœud héritera de la propriété de groupe de son répertoire parent. Sinon il appartiendra au GID effectif du processus. .SS mknodat() L'appel système \fBmknodat\fP() agit exactement de la même façon que \fBmknod\fP(2), aux différences suivantes près. .P If \fIpath\fP is relative, then it is interpreted relative to the directory referred to by the file descriptor \fIdirfd\fP (rather than relative to the current working directory of the calling process, as is done by \fBmknod\fP() for a relative pathname). .P If \fIpath\fP is relative and \fIdirfd\fP is the special value \fBAT_FDCWD\fP, then \fIpath\fP is interpreted relative to the current working directory of the calling process (like \fBmknod\fP()). .P Si \fIpath\fP est absolu, alors \fIdirfd\fP est ignoré. .P Consultez \fBopenat\fP(2) pour une explication de la nécessité de \fBmknodat\fP(). .SH "VALEUR RENVOYÉE" \fBmknod\fP() et \fBmknodat\fP() renvoient \fB0\fP s’ils réussissent. En cas d'erreur, la valeur de retour est \fB\-1\fP et \fIerrno\fP est défini pour préciser l'erreur. .SH ERREURS .TP \fBEACCES\fP The parent directory does not allow write permission to the process, or one of the directories in the path prefix of \fIpath\fP did not allow search permission. (See also \fBpath_resolution\fP(7).) .TP \fBEBADF\fP (\fBmknodat\fP()) \fIpath\fP is relative but \fIdirfd\fP is neither \fBAT_FDCWD\fP nor a valid file descriptor. .TP \fBEDQUOT\fP Le quota de blocs de disque ou d'inœuds de l'utilisateur sur le système de fichiers a été atteint. .TP \fBEEXIST\fP \fIpath\fP already exists. This includes the case where \fIpath\fP is a symbolic link, dangling or not. .TP \fBEFAULT\fP \fIpath\fP pointe en dehors de l'espace d'adressage accessible. .TP \fBEINVAL\fP \fImode\fP demande la création d'autre chose qu'un fichier régulier, fichier spécial de périphérique, FIFO ou socket. .TP \fBELOOP\fP \fIpath\fP contient une référence circulaire (à travers un lien symbolique) .TP \fBENAMETOOLONG\fP \fIpath\fP était trop long. .TP \fBENOENT\fP Un des répertoires du chemin d'accès \fIchemin\fP n'existe pas ou est un lien symbolique pointant nulle part. .TP \fBENOMEM\fP La mémoire disponible du noyau n'était pas suffisante. .TP \fBENOSPC\fP The device containing \fIpath\fP has no room for the new node. .TP \fBENOTDIR\fP Un élément, utilisé comme répertoire, du chemin d'accès \fIchemin\fP n'est pas en fait un répertoire. .TP \fBENOTDIR\fP (\fBmknodat\fP()) \fIpath\fP is relative and \fIdirfd\fP is a file descriptor referring to a file other than a directory. .TP \fBEPERM\fP .\" For UNIX domain sockets and regular files, EPERM is returned only in .\" Linux 2.2 and earlier; in Linux 2.4 and later, unprivileged can .\" use mknod() to make these files. \fImode\fP requested creation of something other than a regular file, FIFO (named pipe), or UNIX domain socket, and the caller is not privileged (Linux: does not have the \fBCAP_MKNOD\fP capability); also returned if the filesystem containing \fIpath\fP does not support the type of node requested. .TP \fBEROFS\fP \fIpath\fP est placé sur un système de fichiers en lecture seule. .SH VERSIONS POSIX.1\-2001 dit\ : «\ Le seul usage portable de \fBmknod\fP() est réservé à la création de fichiers spéciaux FIFO. Si le \fImode\fP n'est pas \fBS_IFIFO\fP ou si \fIdev\fP n'est pas 0, alors le comportement de \fBmknod\fP() est indéterminé\ ». Toutefois, aujourd'hui, on ne devrait jamais utiliser \fBmknod\fP() pour cela ; on devrait utiliser \fBmkfifo\fP(3), une fonction spécialement conçue pour cela. .P .\" and one should make UNIX domain sockets with socket(2) and bind(2). Sous Linux, \fBmknod\fP() ne peut pas être utilisé pour créer des répertoires. Il faut créer les répertoires avec \fBmkdir\fP(2). .SH STANDARDS POSIX.1\-2008. .SH HISTORIQUE .TP \fBmknod\fP() .\" The Linux version differs from the SVr4 version in that it .\" does not require root permission to create pipes, also in that no .\" EMULTIHOP, ENOLINK, or EINTR error is documented. SVr4, 4.4BSD, POSIX.1\-2001 (mais voir VERSIONS). .TP \fBmknodat\fP() Linux 2.6.16, glibc 2.4. POSIX.1\-2008. .SH NOTES Il y a de nombreux problèmes avec le protocole sous\(hyjacent à NFS, certains d'entre eux pouvant affecter \fBmknod\fP() et \fBmknodat\fP(). .SH "VOIR AUSSI" \fBmknod\fP(1), \fBchmod\fP(2), \fBchown\fP(2), \fBfcntl\fP(2), \fBmkdir\fP(2), \fBmount\fP(2), \fBsocket\fP(2), \fBstat\fP(2), \fBumask\fP(2), \fBunlink\fP(2), \fBmakedev\fP(3), \fBmkfifo\fP(3), \fBacl\fP(5), \fBpath_resolution\fP(7) .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot , Cédric Boutillier , Frédéric Hantrais et Jean-Philippe MENGUAL . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .