summaryrefslogtreecommitdiff
path: root/src/stat_cache.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-11-04 04:20:00 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-11-04 20:16:30 -0500
commit0b00b13a423f87bc56c8128e4b9f1c0297990017 (patch)
treeb68fd3cecdba15a5b5553a068871f871c4d3358b /src/stat_cache.h
parent1efd74457b0d91cff58780f4e4715e4e36260b4a (diff)
downloadlighttpd-git-0b00b13a423f87bc56c8128e4b9f1c0297990017.tar.gz
[core] use kqueue() instead of FAM/gamin on *BSD
Note: there have always been limitations with lighttpd stat_cache.[ch] using FAM/gamin on *BSD via kqueue() as lighttpd stat_cache.[ch] only monitors directories. This kqueue() implementation also only monitors directories and has limitations. lighttpd stat_cache.[ch] is notified about additions and removals of files within a monitored directory but might not be notified of changes such as timestamps (touch), ownership, or even changes in contents (e.g. if a file is edited through a hard link) server.stat-cache-engine = "disable" should be used when files should not be cached. Full stop. Similarly, "disable" is recommended if files change frequently. If using server.stat-cache-engine with any engine, there are caching effects and tradeoffs. On *BSD and using kqueue() on directories, any change detected clears the stat_cache of all entries in that directory, since monitoring only the directory does not indicate which file was added or removed. This is not efficient for directories containing frequently changed files.
Diffstat (limited to 'src/stat_cache.h')
-rw-r--r--src/stat_cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stat_cache.h b/src/stat_cache.h
index 3c496bd1..06c1142e 100644
--- a/src/stat_cache.h
+++ b/src/stat_cache.h
@@ -17,7 +17,7 @@ typedef struct stat_cache_entry {
time_t stat_ts;
int fd;
int refcnt;
- #if defined(HAVE_FAM_H) || defined(HAVE_SYS_INOTIFY_H)
+ #if defined(HAVE_FAM_H) || defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_SYS_EVENT_H)
void *fam_dir;
#endif
buffer etag;