Barak A. Pearlmutter

Merge remote-tracking branch 'upstream/master'

Showing 74 changed files with 2385 additions and 306 deletions
... ... @@ -43,26 +43,28 @@ to/
tmp
# autotools build debris
/compile
/libtool
/ltmain.sh
/.deps/
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/compile
/config.guess
/config.h*
/config.log
/config.status
/config.guess
/config.sub
/configure
/depcomp
/examples/Makefile
/examples/Makefile.in
/install-sh
/libtool
/ltmain.sh
/m4/
/missing
/pkgconfig/libclsync.pc
/stamp-h1
Makefile
Makefile.in
pkgconfig/clsync.pc
/debian/autoreconf.after
/debian/autoreconf.before
... ...
#!/bin/bash -x
#!/bin/sh -x
# configuration
TIMEOUT_SYNC=15
case $(uname -s) in
Linux)
MAKE='make'
;;
*)
MAKE='gmake'
;;
esac
# test aggressive optimizations
export CFLAGS="-O3 -march=native"
export CFLAGS="$CFLAGS -O3 -march=native"
autoreconf -if
# Build unit test
build_test() {
make clean
$MAKE clean
echo ">>> Testing with \"$@\""
# make sure we test paralled build as they tend to fail when single works
./configure $@ && make -j5 || {
./configure $@ && $MAKE -j5 || {
echo "!!! test with \"$@\" configure options failed"
exit 1
}
... ... @@ -36,8 +45,8 @@ run_example() {
export CLSYNC_PIDFILE="/tmp/clsync-example-$MODE.pid"
rm -rf "examples/testdir"/{to,from}/*
mkdir -p "examples/testdir/"{to,from}
rm -rf "examples/testdir"/*/*
mkdir -p "examples/testdir/to" "examples/testdir/from"
trap run_example_cleanup_failure INT TERM
cd examples
... ... @@ -46,7 +55,9 @@ run_example() {
sleep 1
mkdir -p examples/testdir/from/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/DIR
touch examples/testdir/from/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/{a,b,c,d,e,f,g,h}
touch examples/testdir/from/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/a
touch examples/testdir/from/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/b
touch examples/testdir/from/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/c
touch examples/testdir/from/a/b/c/d/e/f/g/h/7
touch examples/testdir/from/test
mkdir examples/testdir/from/dontSync
... ... @@ -57,7 +68,7 @@ run_example() {
break
fi
sleep 1
(( i++ ))
i=$(( $i + 1 ))
done
if [ "$i" -gt "$TIMEOUT_SYNC" ]; then
run_example_cleanup_failure "$MODE" "timed out on initial syncing"
... ... @@ -78,7 +89,7 @@ run_example() {
return
fi
sleep 1
(( i++ ))
i=$(( $i + 1 ))
done
run_example_cleanup_failure "$MODE" "no successful sync"
}
... ... @@ -88,24 +99,36 @@ if true; then
# Test all possible package-specific configure options.
# Do not test empty cases save as no options at all.
build_test ${arg[@]}
for a0 in "--enable-cluster" "--disable-cluster"; do
arg[0]="$a0"
for a1 in "--enable-debug" "--disable-debug"; do
arg[1]="$a1"
for a2 in "--enable-paranoid=0" "--enable-paranoid=1" "--enable-paranoid=2" ; do
arg[2]="$a2"
for a3 in "--with-capabilities" "--without-capabilities"; do
arg[3]="$a3"
for a4 in "--with-mhash" "--without-mhash"; do
arg[4]="$a4"
build_test ${arg[@]}
build_test
# clsync enabled
a0="--enable-clsync"
for a1 in "--enable-cluster --with-mhash" "--enable-cluster --without-mhash" "--disable-cluster"; do
for a2 in "--enable-debug" "--disable-debug"; do
for a3 in "--enable-paranoid=0" "--enable-paranoid=1" "--enable-paranoid=2" ; do
for a4 in "--with-capabilities" "--without-capabilities"; do
for a5 in "--enable-socket" "--disable-socket"; do
for a6 in "--enable-libclsync" "--disable-libclsync"; do
arg="$a0 $a1 $a2 $a3 $a4 $a5 $a6"
build_test "$arg"
done
done
done
done
done
done
# clsync disabled, libclsync enabled
a0="--disable-clsync --enable-libclsync"
for a2 in "--enable-debug" "--disable-debug"; do
for a3 in "--enable-paranoid=0" "--enable-paranoid=1" "--enable-paranoid=2" ; do
arg="$a0 $a1 $a2"
build_test "$arg"
done
done
# clsync disabled, libclsync disabled
build_test "--disable-clsync --disable-libclsync"
fi
... ...
language: c
before_install:
- sudo apt-get install libcap-dev libglib2.0-dev libmhash-dev
- sudo apt-get install libcap-dev libglib2.0-dev libmhash-dev libkqueue.*
- sudo pip install cpp-coveralls --use-mirrors
script:
- ./.travis.sh
after_success:
- coveralls -x c --exclude examples --exclude debian --exclude gentoo --exclude autom4te.cache --exclude man --exclude conf*.dir --exclude cluster.c
- coveralls -x c --exclude examples --exclude debian --exclude gentoo --exclude freebsd --exclude m4 --exclude autom4te.cache --exclude man --exclude conf*.dir --exclude cluster.c
... ...
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = examples
if CLSYNC
bin_PROGRAMS = clsync
clsync_SOURCES = cluster.c error.c fileutils.c glibex.c main.c \
malloc.c sync.c cluster.h fileutils.h glibex.h main.h sync.h \
common.h control.h
clsync_SOURCES = calc.c cluster.c error.c fileutils.c glibex.c \
indexes.c main.c malloc.c sync.c calc.h cluster.h fileutils.h \
glibex.h main.h port-hacks.h sync.h common.h control.h
clsync_CFLAGS = $(AM_CFLAGS)
if HAVE_KQUEUE
clsync_CFLAGS += -DKQUEUE_SUPPORT
clsync_SOURCES += mon_kqueue.c mon_kqueue.h
endif
if HAVE_INOTIFY
clsync_CFLAGS += -DINOTIFY_SUPPORT
clsync_SOURCES += mon_inotify.c mon_inotify.h
if INOTIFY_OLD
clsync_CFLAGS += -DINOTIFY_OLD
endif
endif
if HAVE_FANOTIFY
clsync_CFLAGS += -DFANOTIFY_SUPPORT
clsync_SOURCES += mon_fanotify.c mon_fanotify.h
endif
if HAVE_BSM
clsync_CFLAGS += -DBSM_SUPPORT
clsync_SOURCES += mon_bsm.c mon_bsm.h
endif
if HAVE_DTRACEPIPE
clsync_CFLAGS += -DDTRACEPIPE_SUPPORT
clsync_SOURCES += mon_dtracepipe.c mon_dtracepipe.h
endif
if SOCKET
lib_LTLIBRARIES = libclsync.la
libclsync_la_SOURCES = malloc.c libclsync.c socket.c
libclsync_la_LDFLAGS = -version-info 0:0:0
clsync_SOURCES += socket.c control.c
clsync_SOURCES += socket.c control.c program.h
endif
main.o: revision.h
dist_man_MANS = man/man1/clsync.1
endif
dist_doc_DATA = CONTRIB DEVELOPING LICENSE PROTOCOL README.md TODO
EXTRA_DIST = .doxygen .travis.sh .travis.yml NOTES SHORTHANDS debian gentoo
EXTRA_DIST = .doxygen .travis.sh .travis.yml NOTES SHORTHANDS freebsd debian gentoo
if LIBCLSYNC
lib_LTLIBRARIES = libclsync.la
libclsync_la_SOURCES = malloc.c libclsync.c socket.c
libclsync_la_LDFLAGS = -version-info 0:0:0
endif
REVISION=$(shell [ -d .git ] &&\
(echo -n \
... ... @@ -36,26 +65,41 @@ REVISION=$(shell [ -d .git ] &&\
AM_CFLAGS := -DREVISION=$(REVISION)
clsync_includedir = $(includedir)/clsync
libclsync_includedir = $(includedir)/libclsync
if CLSYNC
clsync_include_HEADERS = \
error.h \
malloc.h
clsync_include_HEADERS += \
clsync.h \
configuration.h \
indexes.h
if SOCKET
clsync_include_HEADERS += \
socket.h \
ctx.h
endif
endif
if LIBCLSYNC
libclsync_include_HEADERS = \
clsync.h \
malloc.h \
indexes.h \
ctx.h \
error.h \
socket.h \
libclsync.h
libclsync.h \
malloc.h \
socket.h
endif
doc:
doxygen .doxygen
if SOCKET
pkgconfig_DATA = pkgconfig/clsync.pc
pkgconfig_DATA = pkgconfig/libclsync.pc
endif
CLEANFILES = revision.h
if CLSYNC
CLEANFILES += examples/rules
clean-local:
-rm -rf examples/testdir examples/*.o examples/*.so examples/*.xz doc
endif
... ...
... ... @@ -15,8 +15,10 @@ Contents
7. Other uses
8. Clustering
9. Known building issues
10. Support
11. Developing
10. FreeBSD support
11. Support
12. Developing
13. Articles
1. Name
... ... @@ -26,9 +28,9 @@ Why "clsync"? The first name of the utility was "insync" (due to inotify), but
then I suggested to use "fanotify" instead of "inotify" and utility was been
renamed to "fasync". After that I started to intensively write the program.
However I faced with some problems in "fanotify", so I was have to temporary
fallback to "inotify", then I decided, that the best name is "Runtime Sync" or
"Live Sync", but "rtsync" is a name of some corporation, and "lsync" is busy
by "lsyncd" project ("https://github.com/axkibe/lsyncd"). So I called it
fallback to "inotify", then I decided that the best name is "Runtime Sync" or
"Live Sync", but "rtsync" is a name of some corporation and "lsync" is busy
by "[lsyncd](https://github.com/axkibe/lsyncd)". So I called it
"clsync", that should be interpreted as "lsync, but on c" due to "lsyncd" that
written on "LUA" and may be used for the same purposes.
... ... @@ -40,15 +42,15 @@ can be interpreted as "cluster live sync". ;)
-------------
This utility was been writted for two purposes:
- for making failover clusters
- for making high availability clusters
- for making backups of them
To do failover cluster I've tried a lot of different solutions, like "simple
To do HA cluster I've tried a lot of different solutions, like "simple
rsync by cron", "glusterfs", "ocfs2 over drbd", "common mirrorable external
storage", "incron + perl + rsync", "inosync", "lsyncd" and so on. Currently we
are using "lsyncd", "ceph" and "ocfs2 over drbd". However all of this
solutions doesn't arrange me, so I was have to write own utility for this
purpose.
storage", "incron + perl + rsync", "inosync", "lsyncd" and so on. When I
started to write the utility we was using "lsyncd", "ceph" and
"ocfs2 over drbd". However all of this solutions doesn't arrange me, so I
was have to write own utility for this purpose.
To do backups we also tried a lot of different solution, and again I was have
to write own utility for this purpose.
... ... @@ -70,9 +72,10 @@ event. :(
- It can't set another event-collecting delay for big files. We don't
want to sync big files (`>1GiB`) so often as ordinary files.
- Shared object (.so file) cannot be used as rsync-wrapper.
- It doesn't support kqueue/bsm
Sorry, if I'm wrong. Let me know if it is, please :). "lsyncd" - is really
good and useful utility, just it's not appropriate for us.
interesting and useful utility, just it's not appropriate for us.
UPD.: Also clsync was used to replace incron/csync2/etc in HPC-clusters for
syncing /etc/{passwd,shadow,group,shells} files.
... ... @@ -234,7 +237,28 @@ May be problems with "configuring" or compilation. In this case just try
next command:
echo '#define REVISION "-custom"' > revision.h; gcc -std=gnu99 -D\_FORTIFY\_SOURCE=2 -DPARANOID -pipe -Wall -ggdb3 --param ssp-buffer-size=4 -fstack-check -fstack-protector-all -Xlinker -zrelro -pthread $(pkg-config --cflags glib-2.0) $(pkg-config --libs glib-2.0) -ldl \*.c -o /tmp/clsync
10. Support
10. FreeBSD support
-------------------
clsync was been ported to FreeBSD.
FreeBSD doesn't support inotify, so there're 3 ways to use clsync on it:
* using [libinotify](https://github.com/dmatveev/libinotify-kqueue);
* using BSM API;
* using kqueue/kevent directly.
However:
* kqueue/kevent doesn't allow to catch file creation events. However it allows to catch an event of directory content change (without details). So clsync waits for such events and rescans (non-recursively) the whole dir on each such event. This algorithm is not tested and may be buggy. Moreover kqueue/kevent requires to open a file descriptor for every watched file. So this way may eat a lot of CPU and file descriptors.
* libinotify is not production ready. There may be problems with it. Moreover libinotify backends to kqueue API anyway. On the other hand inotify support is well tested in clsync, so this way should be stable (if libinotify is stable) in contrast to kqueue direct use.
* Using of BSM API requires auditd reconfiguration. It may hopple to real audit. Moreover this's a global OS setting. And using of this way forces clsync to catch all FS events of the whole system.
I recommend to use the BSM API at the moment. However when the libinotify will be production ready you should try that way.
I hope you will send me bugreports to make me able to improve the FreeBSD support :)
11. Support
-----------
To get support, you can contact with me this ways:
... ... @@ -242,7 +266,7 @@ To get support, you can contact with me this ways:
- Where else can you find me: IRC:SSL+UTF-8 irc.campus.mephi.ru:6695#mephi,xaionaro,xai
- And e-mail: <dyokunev@ut.mephi.ru>, <xaionaro@gmail.com>; PGP pubkey: 0x8E30679C
11. Developing
12. Developing
--------------
I started to write "DEVELOPING" and "PROTOCOL" files.
... ... @@ -250,6 +274,14 @@ You can look there if you wish. ;)
I'll be glad to receive code contribution :)
13. Articles
------------
Russian:
- [HA clustering](https://gitlab.ut.mephi.ru/ut/articles/blob/master/clsync/ha)
- [syncing to many nodes](https://gitlab.ut.mephi.ru/ut/articles/blob/master/clsync/inotify-to-many-nodes)
- [atomic sync](https://gitlab.ut.mephi.ru/ut/articles/blob/master/clsync/atomicsync)
-- Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
... ...
/*
clsync - file tree sync utility based on inotify/kqueue
Copyright (C) 2014 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
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 of the License, 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/>.
*/
#include "calc.h"
#ifdef HAVE_MHASH
#include <mhash.h>
#endif
#ifndef HAVE_MHASH
/**
* @brief Calculated Adler32 value for char array
*
* @param[in] date Pointer to data
* @param[in] len Length of the data
*
* @retval uint32_t Adler32 value of data
*
*/
// Copied from http://en.wikipedia.org/wiki/Adler-32
uint32_t adler32_calc(const unsigned char *const data, uint32_t len) { // where data is the location of the data in physical
// memory and len is the length of the data in bytes
const int MOD_ADLER = 65521;
uint32_t a = 1, b = 0;
int32_t index;
// Process each byte of the data in order
for (index = 0; index < len; ++index)
{
a = (a + data[index]) % MOD_ADLER;
b = (b + a) % MOD_ADLER;
}
return (b << 16) | a;
}
#endif
... ...
/*
clsync - file tree sync utility based on inotify/kqueue
Copyright (C) 2014 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
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 of the License, 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/>.
*/
#include <stdint.h>
#ifdef HAVE_MHASH
#include <mhash.h>
static inline uint32_t adler32_calc(const unsigned char *const data, uint32_t len) {
uint32_t adler32;
MHASH td = mhash_init(MHASH_ADLER32);
mhash(td, data, len);
mhash_deinit(td, &adler32);
return adler32;
}
#else
extern uint32_t adler32_calc(const unsigned char *const data, uint32_t len);
#endif
... ...
/*
clsync - file tree sync utility based on fanotify and inotify
clsync - file tree sync utility based on inotify
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
... ... @@ -31,6 +31,8 @@ enum eventobjtype {
EOT_DOESNTEXIST = 1, // Doesn't exists (not created yet or already deleted)
EOT_FILE = 2, // File
EOT_DIR = 3, // Directory
// The value cannot be higher than "65535". It's due to recognize_event() function of mon_*.c
};
typedef enum eventobjtype eventobjtype_t;
... ...
/*
clsync - file tree sync utility based on fanotify and inotify
clsync - file tree sync utility based on inotify
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
... ... @@ -33,15 +33,14 @@
#ifdef CLUSTER_SUPPORT
#include "common.h"
#include "port-hacks.h"
#include "indexes.h"
#include "error.h"
#include "cluster.h"
#include "sync.h"
#include "calc.h"
#include "malloc.h"
#ifdef HAVE_MHASH
#include <mhash.h>
#endif
// Global variables. They will be initialized in cluster_init()
#define NODES_ALLOC (MAX(MAXNODES, NODEID_NOID)+1)
... ... @@ -221,36 +220,6 @@ static inline int clustercmd_window_del(window_t *window_p, clustercmdqueuedpack
}
#ifndef HAVE_MHASH
/**
* @brief Calculated Adler32 value for char array
*
* @param[in] date Pointer to data
* @param[in] len Length of the data
*
* @retval uint32_t Adler32 value of data
*
*/
// Copied from http://en.wikipedia.org/wiki/Adler-32
uint32_t adler32_calc(unsigned char *data, int32_t len) { // where data is the location of the data in physical
// memory and len is the length of the data in bytes
const int MOD_ADLER = 65521;
uint32_t a = 1, b = 0;
int32_t index;
// Process each byte of the data in order
for (index = 0; index < len; ++index)
{
a = (a + data[index]) % MOD_ADLER;
b = (b + a) % MOD_ADLER;
}
return (b << 16) | a;
}
#endif
/**
* @brief Calculates Adler32 for clustercmd
*
... ... @@ -277,13 +246,7 @@ int clustercmd_adler32_calc(clustercmd_t *clustercmd_p, clustercmdadler32_t *clu
char *ptr = (char *)&clustercmd_p->h;
// Calculating
#ifdef HAVE_MHASH
MHASH td = mhash_init(MHASH_ADLER32);
mhash(td, ptr, size);
mhash_deinit(td, &adler32);
#else
adler32 = adler32_calc((unsigned char *)ptr, size);
#endif
// Ending
memcpy(&clustercmd_p->h.adler32, &adler32_save, sizeof(clustercmdadler32_t));
... ... @@ -305,13 +268,7 @@ int clustercmd_adler32_calc(clustercmd_t *clustercmd_p, clustercmdadler32_t *clu
#endif
// Calculating
#ifdef HAVE_MHASH
MHASH td = mhash_init(MHASH_ADLER32);
mhash(td, ptr, size);
mhash_deinit(td, &adler32);
#else
adler32 = adler32_calc((unsigned char *)ptr, size);
#endif
// Ending
clustercmdadler32_p->dat = adler32 ^ 0xFFFFFFFF;
... ... @@ -1295,7 +1252,7 @@ int cluster_modtime_update(const char *path, short int dirlevel, mode_t st_mode)
// Getting directory/file-'s information (including "change time" aka "st_ctime")
struct stat64 stat64;
stat64_t stat64;
ret=lstat64(path, &stat64);
if(ret) {
error("Cannot lstat64()", path);
... ...
/*
clsync - file tree sync utility based on fanotify and inotify
clsync - file tree sync utility based on inotify
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
... ... @@ -244,7 +244,7 @@ typedef int (*cluster_recvproc_funct_t)(clustercmd_t *clustercmd_p);
// Externs
extern int cluster_init(ctx_t *ctx_p, indexes_t *indexes_p);
extern int cluster_init(struct ctx *ctx_p, struct indexes *indexes_p);
extern int cluster_deinit();
extern int cluster_lock(const char *fpath);
... ...
/*
clsync - file tree sync utility based on fanotify and inotify
clsync - file tree sync utility based on inotify
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
... ... @@ -17,15 +17,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CLSYNC_COMMON_H
#define __CLSYNC_COMMON_H
#ifndef __linux__
# ifdef HAVE_CAPABILITIES
# undef HAVE_CAPABILITIES
# warning Capabilities support can be built only on Linux
# endif
#endif
#define _GNU_SOURCE
#define _XOPEN_SOURCE 700
//#define _XOPEN_SOURCE 700
#define _LARGEFILE64_SOURCE
#define PROGRAM "clsync"
#define VERSION_MAJ 0
#define VERSION_MIN 3
#define AUTHOR "Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
... ... @@ -42,58 +48,57 @@
#include <errno.h>
#include <ctype.h>
#include <signal.h>
#include <wait.h>
#include <fts.h>
#ifdef KQUEUE_SUPPORT
# include <sys/event.h>
#endif
#ifdef INOTIFY_SUPPORT
# include <sys/inotify.h>
#endif
#ifdef FANOTIFY_SUPPORT
#include <sys/fanotify.h>
# include <sys/fanotify.h>
#endif
#include <sys/inotify.h>
#include <sys/wait.h>
#include <fts.h>
#include <sys/time.h>
#include <dirent.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <libgen.h>
#include <pthread.h>
#include <glib.h>
#ifdef HAVE_CAPABILITIES
#include <sys/capability.h> // for capset()/capget() for --preserve-file-access
#include <sys/prctl.h> // for prctl() for --preserve-fil-access
# include <sys/capability.h> // for capset()/capget() for --preserve-file-access
# include <sys/prctl.h> // for prctl() for --preserve-fil-access
#endif
#include "configuration.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#include "clsync.h"
#include "ctx.h"
#include "indexes.h"
#include "program.h"
#ifndef MIN
#define MIN(a,b) ((a)>(b)?(b):(a))
#endif
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
#include <sys/param.h>
#ifndef IN_CREATE_SELF
#define IN_CREATE_SELF IN_CREATE
# define IN_CREATE_SELF IN_CREATE
#endif
#ifdef _DEBUG
#define DEBUGV(...) __VA_ARGS__
# define DEBUGV(...) __VA_ARGS__
#else
#define DEBUGV(...)
# define DEBUGV(...)
#endif
#ifdef PARANOID
#define PARANOIDV(...) __VA_ARGS__
# define PARANOIDV(...) __VA_ARGS__
#else
#define PARANOIDV(...)
# define PARANOIDV(...)
#endif
#ifdef _GNU_SOURCE
... ... @@ -118,6 +123,9 @@
#define COLLECTDELAY_INSTANT ((unsigned int)~0)
#define require_strlen_le(str, limit) \
if (strlen(str) >= limit)\
critical("length of "TOSTR(str)" (\"%s\") >= "TOSTR(limit));\
enum paramsource_enum {
PS_UNKNOWN = 0,
... ... @@ -129,12 +137,13 @@ typedef enum paramsource_enum paramsource_t;
enum notifyengine_enum {
NE_UNDEFINED = 0,
#ifdef FANOTIFY_SUPPORT
NE_FANOTIFY,
#endif
NE_INOTIFY
NE_INOTIFY,
NE_KQUEUE,
NE_BSM,
NE_DTRACEPIPE,
};
typedef enum notifyengine_enum notifyenfine_t;
typedef enum notifyengine_enum notifyengine_t;
#define STATE_STARTING(state_p) (state_p == NULL)
enum state_enum {
... ... @@ -230,7 +239,7 @@ struct dosync_arg {
char outf_path[PATH_MAX+1];
FILE *outf;
ctx_t *ctx_p;
indexes_t *indexes_p;
struct indexes *indexes_p;
void *data;
int linescount;
api_eventinfo_t *api_ei;
... ... @@ -254,7 +263,7 @@ struct pushdoubleentry_arg {
struct doubleentry *entry;
};
struct entry {
struct myentry {
size_t size;
size_t alloc;
void *dat;
... ... @@ -264,7 +273,7 @@ struct pushentry_arg {
int allocated;
int total;
size_t size;
struct entry *entry;
struct myentry *entry;
};
enum initsync {
... ... @@ -283,9 +292,5 @@ struct sighandler_arg {
};
typedef struct sighandler_arg sighandler_arg_t;
enum unified_evetnmask {
UEM_DIR = 0x01,
UEM_CREATED = 0x02,
UEM_DELETED = 0x04,
};