diff options
Diffstat (limited to 'libmount/src')
-rw-r--r-- | libmount/src/monitor.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libmount/src/monitor.c b/libmount/src/monitor.c index f7323f693..28064b896 100644 --- a/libmount/src/monitor.c +++ b/libmount/src/monitor.c @@ -10,6 +10,26 @@ * @title: Monitor * @short_description: interface to monitor mount tables * + * For example monitor VFS (/proc/self/mountinfo) for changes: + * + * <informalexample> + * <programlisting> + * const char *filename; + * struct libmount_monitor *mn = mnt_new_monitor(); + * + * mnt_monitor_enable_kernel(mn, TRUE)); + * + * printf("waiting for changes...\n"); + * while (mnt_monitor_wait(mn, -1) > 0) { + * printf("notification detected\n"); + * + * while (mnt_monitor_next_change(mn, &filename, NULL) == 0) + * printf(" %s: change detected\n", filename); + * } + * mnt_unref_monitor(mn); + * </programlisting> + * </informalexample> + * */ #include "fileutils.h" |