НАИМЕНОВАНИЕ
- Provided by: manpages-ru-dev (Version: 4.31.0-1)
- Source: manpages-l10n
- Report a bug
Стандартная библиотека языка C (libc, -lc)
#include <sys/inotify.h>
int inotify_add_watch(int fd, const char *path, uint32_t mask);
inotify_add_watch() adds a new watch, or modifies an existing watch, for the file whose location is specified in path; the caller must have read permission for this file. The fd argument is a file descriptor referring to the inotify instance whose watch list is to be modified. The events to be monitored for path are specified in the mask bit-mask argument. See inotify(7) for a description of the bits that can be set in mask.
A successful call to inotify_add_watch() returns a unique watch descriptor for this inotify instance, for the filesystem object (inode) that corresponds to path. 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.
Дескриптор сторожка возвращается при последующих операциях read(2) из файлового дескриптора inotify. При чтении извлекаются структуры inotify_event (см. inotify(7)), указывающие на события в файловой системе; дескриптор сторожка внутри этой структуры определяет объект, для которого произошло событие.
При успешном выполнении inotify_add_watch() возвращает дескриптор наблюдения (неотрицательное целое число). В случае ошибки возвращает -1, а errno устанавливается для указания ошибки.
Linux.
Linux 2.6.13.
Смотрите inotify(7).
Русский перевод этой страницы руководства разработал(и) Azamat Hackimov <azamat.hackimov@gmail.com>, Dmitriy S. Seregin <dseregin@59.ru>, Yuri Kozlov <yuray@komyakino.ru> и Иван Павлов <pavia00@gmail.com>
Этот перевод является свободной программной документацией; он распространяется на условиях общедоступной лицензии GNU (GNU General Public License - GPL, https://www.gnu.org/licenses/gpl-3.0.html версии 3 или более поздней) в отношении авторского права, но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ.
Если вы обнаружите какие-либо ошибки в переводе этой страницы руководства, пожалуйста, сообщите об этом разработчику(ам) по его(их) адресу(ам) электронной почты или по адресу списка рассылки русских переводчиков.