Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man3c/inotify_add_watch.3c
          +++ new/usr/src/man/man3c/inotify_add_watch.3c
   1    1  '\" te
   2    2  .\"  Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
   3    3  .\"  This file and its contents are supplied under the terms of the
   4    4  .\"  Common Development and Distribution License ("CDDL"), version 1.0.
   5    5  .\"  You may only use this file in accordance with the terms of version
   6    6  .\"  1.0 of the CDDL.
   7    7  .\" 
   8    8  .\"  A full copy of the text of the CDDL should have accompanied this
   9    9  .\"  source.  A copy of the CDDL is also available via the Internet at
  10   10  .\"  http://www.illumos.org/license/CDDL.
  11   11  .TH INOTIFY_ADD_WATCH 3C "Sep 17, 2014"
  12   12  .SH NAME
  13   13  inotify_add_watch \- add a watch to an inotify instance
  14   14  .SH SYNOPSIS
  15   15  
  16   16  .LP
  17   17  .nf
  18   18  #include <sys/inotify.h>
  19   19  
  20   20  \fBint\fR \fBinotify_add_watch\fR(\fBint\fR \fIfd\fR, \fBconst char *\fR\fIpathname\fR, \fBuint32_t\fR \fImask\fR);
  21   21  .fi
  22   22  
  23   23  .SH DESCRIPTION
  24   24  .sp
  25   25  .LP
  26   26  The \fBinotify_add_watch()\fR function adds a watch for the file or
  27   27  directory specified by \fIpathname\fR to the inotify instance 
  28   28  specified by \fIfd\fR for the events specified by \fImask\fR.  See
  29   29  \fBinotify\fR(5) for details on the meaning of \fImask\fR, how
  30   30  it affects the interpretation of \fIpathname\fR, and how 
  31   31  events for the watched file or directory are subsequently 
  32   32  retrieved via \fBread\fR(2).
  33   33  
  34   34  .SH RETURN VALUES
  35   35  .sp
  36   36  .LP
  37   37  Upon succesful completion, \fBinotify_add_watch()\fR returns the
  38   38  watch descriptor associated with the new watch.
  39   39  If an error occurs, -1 is returned and errno is set to indicate
  40   40  the error.
  41   41  
  42   42  .SH ERRORS
  43   43  .sp
  44   44  .LP
  45   45  \fBinotify_add_watch()\fR will fail if:
  46   46  .sp
  47   47  .ne 2
  48   48  .na
  49   49  \fB\fBEACCES\fR\fR
  50   50  .ad
  51   51  .RS 10n
  52   52  \fIpathname\fR could not be opened for reading.
  53   53  .RE
  54   54  
  55   55  .sp
  56   56  .ne 2
  57   57  .na
  58   58  \fB\fBEBADF\fR\fR
  59   59  .ad
  60   60  .RS 10n
  61   61  The \fIfd\fR argument is not a valid open file descriptor.
  62   62  .RE
  63   63  
  64   64  .sp
  65   65  .ne 2
  66   66  .na
  67   67  \fB\fBEFAULT\fR\fR
  68   68  .ad
  69   69  .RS 10n
  70   70  The memory associated with \fIpathname\fR was not mapped.
  71   71  .RE
  72   72  
  73   73  .sp
  74   74  .ne 2
  75   75  .na
  76   76  \fB\fBEINVAL\fR\fR
  77   77  .ad
  78   78  .RS 10n
  79   79  The \fIfd\fR argument does not correspond to an
  80   80  \fBinotify\fR(5) instance as initialized with 
  81   81  \fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C).
  82   82  .RE
  83   83  
  84   84  .sp
  85   85  .ne 2
  86   86  .na
  87   87  \fB\fBENOSPC\fR\fR
  88   88  .ad
  89   89  .RS 10n
  90   90  The number of watches on the specified instance would exceed the
  91   91  maximum number of watches per \fBinotify\fR(5) instance.
  92   92  .RE
  93   93  
  94   94  .sp
  95   95  .ne 2
  96   96  .na
  97   97  \fB\fBENOTDIR\fR\fR
  98   98  .ad
  99   99  .RS 10n
 100  100  \fIpathname\fR does not correspond to a directory and 
 101  101  \fBIN_ONLYDIR\fR was specified in \fImask\fR.
 102  102  .RE
 103  103  
 104  104  .sp
 105  105  .SH NOTES
 106  106  .sp
 107  107  .LP
 108  108  
 109  109  While the \fBinotify\fR(5) facility is implemented for purposes of
 110  110  offering compatibility for Linux-borne applications, native
 111  111  applications may opt to use it instead of (or in addition to) the 
 112  112  \fBPORT_SOURCE_FILE\fR capability of event ports.  See
 113  113  \fBinotify\fR(5) for details and restrictions.
 114  114  
 115  115  .SH SEE ALSO
 116  116  .sp
 117  117  .LP
 118  118  \fBinotify_init\fR(3C), \fBinotify_init1\fR(3C),
 119  119  \fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C),
 120  120  \fBinotify\fR(5)
  
    | 
      ↓ open down ↓ | 
    120 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX