Skip to content

Commit

Permalink
Merge branch 'feature/file-event-notification-support' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
emcrisostomo committed Oct 23, 2015
2 parents b2efb47 + 91dc952 commit d951ef2
Show file tree
Hide file tree
Showing 23 changed files with 738 additions and 24 deletions.
3 changes: 3 additions & 0 deletions Makefile.am
Expand Up @@ -27,9 +27,12 @@ dist_doc_DATA = README.bsd
dist_doc_DATA += README.codestyle
dist_doc_DATA += README.freebsd
dist_doc_DATA += README.gnu-build-system
dist_doc_DATA += README.illumos
dist_doc_DATA += README.md
dist_doc_DATA += README.linux
dist_doc_DATA += README.osx
dist_doc_DATA += README.smartos
dist_doc_DATA += README.solaris
dist_doc_DATA += README.windows
dist_doc_DATA += ABOUT-NLS AUTHORS CONTRIBUTING.md COPYING LICENSE NEWS

Expand Down
9 changes: 8 additions & 1 deletion NEWS
Expand Up @@ -3,9 +3,16 @@ NEWS

New in 1.7.0.develop:

* Feature 98: Add (-d, --directories) option to request the monitor to watch
* Issue 35: Support Solaris/Illumos File Events Notification API.

* Issue 98: Add (-d, --directories) option to request the monitor to watch
directories only during a recursive scan.

* Issue 99: A monitor using the File Events Notification API of the
Solaris/Illumos kernel has been added.

* Issue 101: Add flag to watch file accesses.

New in 1.6.1:

* Texinfo documentation now includes @dircategory and @direntry tags to be
Expand Down
1 change: 1 addition & 0 deletions README.illumos
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -255,6 +255,11 @@ Bug Reports

Bug reports can be sent directly to the authors.

Contact the Authors
-------------------

The author can be contacted on IRC, using the Freenode `#fswatch` channel.

-----

Copyright (c) 2014-2015 Enrico M. Crisostomo
Expand Down
111 changes: 111 additions & 0 deletions README.smartos
@@ -0,0 +1,111 @@
README.smartos
**************

Introduction
============

This file describes the steps required to build this bundle on SmartOS. A
complete C/C++ toolchain for SmartOS is provided on the base-multiarch image.

The user is currently using the following image for the development of fswatch
on SmartOS:

UUID: 9250f5a8-6e9c-11e5-9cdb-67fab8707bfd
NAME: base-multiarch
VERSION: 15.3.0

Setting Up a Development Zone
=============================

A development zone can be setup using the following procedure:

* Search for the latest base-multiarch image:

$ imgadm avail | grep base-multiarch
9250f5a8-6e9c-11e5-9cdb-67fab8707bfd base-multiarch 15.3.0 smartos 2015-10-09T15:44:05Z

* Install the latest image available:

$ imgadm import 9250f5a8-6e9c-11e5-9cdb-67fab8707bfd

* Create a zone manifest called development.json. A simple zone manifest
template is the following:

{
"brand": "joyent",
"image_uuid": "9250f5a8-6e9c-11e5-9cdb-67fab8707bfd",
"alias": "development",
"hostname": "development",
"max_physical_memory": 4096,
"quota": 10,
"resolvers": ["8.8.8.8", "8.8.4.4"],
"nics": [
{
"nic_tag": "admin",
"ip": "dhcp"
}
]
}

* Install a zone using the specified image and manifest:

$ vmadm create -f development.json

Prerequisites
=============

The following packages must be installed on the zone where fswatch is built:

* autoconf

* automake

* gettext

* libtool

* gcc49

* git

* gmake

* gtexinfo

Packages can be installed using pkgin:

$ pkgin update
$ pkgin install package ...

Installation
============

See the INSTALL file for detailed information about how to configure and install
fswatch.

fswatch is a C++ program and a C++ compiler compliant with the C++11 standard is
required to compile it. Check the documentation of your distribution to learn
how to install the required software.

The configure script enforces an ordered compiler search list and clang++ will
be used first if available. If you do not like this choice and wish to use
another compiler set the value of the CXX environment variable to the name of
your compiler binary. If, for example, you wish to use the g++ compiler, then
use this command to configure the build:

$ ./configure CXX=g++

-----

Copyright (c) 2015 Enrico M. Crisostomo

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
57 changes: 57 additions & 0 deletions README.solaris
@@ -0,0 +1,57 @@
README.solaris
**************

Introduction
============

This file describes the steps required to build this bundle on a supported
system running the Solaris or the Illumos kernel. See README for more
information about the tested configurations.

When Illumos was created, the Solaris kernel already included the File Events
Notification API. Hence, the fen_monitor should be available on any system
running Solaris (> 10) or an Illumos kernel.

Additionally, a Solaris/Illumos system should be able to use the following
monitors:

* inotify_monitor, depending on the kernel version.

* poll_monitor.

So far, however, the author has only tested this release on SmartOS. Feedback
on different Solaris/Illumos systems is much appreciated and will benefit other
users as well.

Installation
============

See the INSTALL file for detailed information about how to configure and install
fswatch.

fswatch is a C++ program and a C++ compiler compliant with the C++11 standard is
required to compile it. Check the documentation of your distribution to learn
how to install the required software.

The configure script enforces an ordered compiler search list and clang++ will
be used first if available. If you do not like this choice and wish to use
another compiler set the value of the CXX environment variable to the name of
your compiler binary. If, for example, you wish to use the g++ compiler, then
use this command to configure the build:

$ ./configure CXX=g++

-----

Copyright (c) 2015 Enrico M. Crisostomo

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
11 changes: 9 additions & 2 deletions libfswatch/NEWS
Expand Up @@ -3,8 +3,15 @@ NEWS

New in 1.7.0.develop:

* A monitor can be requested to watch directories only during a recursive
scan.
* Issue 35: Support Solaris/Illumos File Events Notification API.

* Issue 98: A monitor can be requested to watch directories only during a
recursive scan.

* Issue 99: A monitor using the File Events Notification API of the
Solaris/Illumos kernel has been added.

* Issue 101: Add flag to watch file accesses.

New in 1.6.1:

Expand Down
5 changes: 5 additions & 0 deletions libfswatch/README.md
Expand Up @@ -30,6 +30,11 @@ Bug Reports

Bug reports can be sent directly to the authors.

Contact the Authors
-------------------

The author can be contacted on IRC, using the Freenode `#fswatch` channel.

-----

Copyright (c) 2014-2015 Enrico M. Crisostomo
Expand Down
18 changes: 18 additions & 0 deletions libfswatch/configure.ac
Expand Up @@ -105,6 +105,24 @@ AS_VAR_IF([ac_cv_header_sys_event_h], ["yes"], [

AM_CONDITIONAL([USE_KQUEUE], [test "x${KQUEUE_AVAILABLE}" = "xyes"])

# Check for Solaris/Illumos File Events Notification API.
AC_CHECK_HEADERS([port.h])
AS_VAR_IF([ac_cv_header_port_h], ["yes"], [
AS_VAR_SET([FEN_AVAILABLE], ["yes"])
AC_CHECK_DECLS(
[port_create],
[],
[AS_VAR_SET([FEN_AVAILABLE], ["no"])],
[
AC_INCLUDES_DEFAULT
[#include <port.h>]
]
)
AC_CHECK_LIB([c], [port_create], [], [AS_VAR_SET([FEN_AVAILABLE], ["no"])])
])

AM_CONDITIONAL([USE_FEN], [test "x${FEN_AVAILABLE}" = "xyes"])

# Check for Linux inotify.
AC_CHECK_HEADERS([sys/inotify.h])
AS_VAR_IF([ac_cv_header_sys_inotify_h], ["yes"], [
Expand Down
1 change: 1 addition & 0 deletions libfswatch/po/POTFILES.in
Expand Up @@ -18,6 +18,7 @@
src/libfswatch/c/libfswatch.cpp
src/libfswatch/c/libfswatch_log.cpp
src/libfswatch/c++/event.cpp
src/libfswatch/c++/fen_monitor.cpp
src/libfswatch/c++/fsevents_monitor.cpp
src/libfswatch/c++/inotify_monitor.cpp
src/libfswatch/c++/kqueue_monitor.cpp
Expand Down
6 changes: 6 additions & 0 deletions libfswatch/src/libfswatch/Makefile.am
Expand Up @@ -39,6 +39,9 @@ endif
if USE_KQUEUE
libfswatch_la_SOURCES += c++/kqueue_monitor.cpp
endif
if USE_FEN
libfswatch_la_SOURCES += c++/fen_monitor.cpp
endif
if USE_INOTIFY
libfswatch_la_SOURCES += c++/inotify_monitor.cpp
endif
Expand Down Expand Up @@ -93,6 +96,9 @@ endif
if USE_KQUEUE
libfswatch_cpp_HEADERS += c++/kqueue_monitor.hpp
endif
if USE_FEN
libfswatch_cpp_HEADERS += c++/fen_monitor.hpp
endif
if USE_INOTIFY
libfswatch_cpp_HEADERS += c++/inotify_monitor.hpp
endif
Expand Down

0 comments on commit d951ef2

Please sign in to comment.