.\" -*- coding: UTF-8 -*- .\" Copyright 2005, Robert Love .\" Copyright 2006, Michael Kerrisk .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH inotify_add_watch 2 "8 février 2026" "Pages du manuel de Linux 6.18" .SH NOM inotify_add_watch \- Ajouter une surveillance à une instance inotify déjà initialisée .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBint inotify_add_watch(int \fP\fIfd\fP\fB, const char *\fP\fIpath\fP\fB, uint32_t \fP\fImask\fP\fB);\fP .fi .SH DESCRIPTION \fBinotify_add_watch\fP() adds a new watch, or modifies an existing watch, for the file whose location is specified in \fIpath\fP; the caller must have read permission for this file. The \fIfd\fP argument is a file descriptor referring to the inotify instance whose watch list is to be modified. The events to be monitored for \fIpath\fP are specified in the \fImask\fP bit\-mask argument. See \fBinotify\fP(7) for a description of the bits that can be set in \fImask\fP. .P A successful call to \fBinotify_add_watch\fP() returns a unique watch descriptor for this inotify instance, for the filesystem object (inode) that corresponds to \fIpath\fP. If the filesystem object was not previously being watched by this inotify instance, then the watch descriptor is newly allocated. If the filesystem object was already being watched (perhaps via a different link to the same object), then the descriptor for the existing watch is returned. .P Le descripteur de surveillance est renvoyé par des appels ultérieurs à \fBread\fP(2) sur le descripteur de fichier inotify. Ces lectures renvoient des structures \fIinotify_event\fP (consultez \fBinotify\fP(7)) indiquant des événements sur le système de fichiers\ ; le descripteur de surveillance de cette structure identifie l'objet pour lequel un événement a eu lieu. .SH "VALEUR RENVOYÉE" S'il réussit, \fBinotify_add_watch\fP() renvoie un descripteur de surveillance (un entier positif). En cas d'erreur, il renvoie \fB\-1\fP et positionne \fIerrno\fP pour indiquer l'erreur. .SH ERREURS .TP \fBEACCES\fP L'accès en lecture au fichier indiqué est interdit. .TP \fBEBADF\fP Le descripteur de fichier n’est pas valable. .TP \fBEEXIST\fP \fImask\fP contains \fBIN_MASK_CREATE\fP and \fIpath\fP refers to a file already being watched by the same \fIfd\fP. .TP \fBEFAULT\fP \fIpath\fP points outside of the process's accessible address space. .TP \fBEINVAL\fP Le masque d'événements indiqué ne contient aucun événement valable ; ou \fImask\fP contient à la fois \fBIN_MASK_ADD\fP et \fBIN_MASK_CREATE\fP ; ou \fIfd\fP n'est pas un descripteur de fichier inotify. .TP \fBENAMETOOLONG\fP \fIpath\fP est 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 La limite sur le nombre total de surveillances inotify pour l'utilisateur est atteinte, ou le noyau n'a pas pu allouer une ressource système nécessaire. .TP \fBENOTDIR\fP \fImask\fP contains \fBIN_ONLYDIR\fP and \fIpath\fP is not a directory. .SH NORMES Linux. .SH HISTORIQUE Linux 2.6.13. .SH EXEMPLES Consultez \fBinotify\fP(7). .SH "VOIR AUSSI" \fBinotify_init\fP(2), \fBinotify_rm_watch\fP(2), \fBinotify\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 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 .