diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-07-11 14:50:24 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-07-11 14:50:24 -0400 |
commit | 319b9ad4bccedb2a6b1a222cf446e873b2bc6de1 (patch) | |
tree | 7951727c0dbd4394af52715e226745986e8beeb4 /nscd/nscd.h | |
parent | 23bee3e8677c9357662ce789ed77fe25f3991c66 (diff) | |
download | glibc-319b9ad4bccedb2a6b1a222cf446e873b2bc6de1.zip glibc-319b9ad4bccedb2a6b1a222cf446e873b2bc6de1.tar.gz glibc-319b9ad4bccedb2a6b1a222cf446e873b2bc6de1.tar.bz2 |
Generalize framework to register monitoring of files in nscd
nscd can clear caches when certain files change. The list of files
was hardcoded so far and worked for nss_files and nss_dns and those
modules which need no monitoring. nss_db, for instance, has its
own set of files to monitor. Now the NSS modules themselves can
request that certain files are monitored.
Diffstat (limited to 'nscd/nscd.h')
-rw-r--r-- | nscd/nscd.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/nscd/nscd.h b/nscd/nscd.h index 5e3c865..c15e88b 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -62,6 +62,17 @@ typedef enum #define MAX_STACK_USE ((8 * NSCD_THREAD_STACKSIZE) / 10) +/* Registered filename used to fill database. */ +struct traced_file +{ + time_t mtime; + struct traced_file *next; + int call_res_init; + int inotify_descr; + char fname[]; +}; + + /* Structure describing dynamic part of one database. */ struct database_dyn { @@ -73,13 +84,11 @@ struct database_dyn int enabled; int check_file; - int inotify_descr; int clear_cache; int persistent; int shared; int propagate; - int reset_res; - const char filename[16]; + struct traced_file *traced_files; const char *db_filename; time_t file_mtime; size_t suggested_module; @@ -147,6 +156,9 @@ extern int nthreads; /* Maximum number of threads to use. */ extern int max_nthreads; +/* Inotify descriptor. */ +extern int inotify_fd; + /* User name to run server processes as. */ extern const char *server_user; @@ -191,6 +203,7 @@ extern int nscd_open_socket (void); /* connections.c */ extern void nscd_init (void); +extern void register_traced_file (size_t dbidx, struct traced_file *finfo); extern void close_sockets (void); extern void start_threads (void) __attribute__ ((__noreturn__)); |