diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-08-26 18:35:05 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-08-26 18:35:05 +0000 |
commit | a95a08b4af38992cbcf3d1da97199ef19528fbde (patch) | |
tree | 669bba61a337bf8b9c9c15857877bc589792435c /nscd/nscd_conf.c | |
parent | 1114ffff54dfbd35cbff9c845376b8221c2c9ced (diff) | |
download | glibc-a95a08b4af38992cbcf3d1da97199ef19528fbde.zip glibc-a95a08b4af38992cbcf3d1da97199ef19528fbde.tar.gz glibc-a95a08b4af38992cbcf3d1da97199ef19528fbde.tar.bz2 |
Update.
2004-08-26 Ulrich Drepper <drepper@redhat.com>
* nscd/cache.c: Major rewrite. The data is now optionally kept in
a mmaped memory region which is automatically mirrored on disk.
This implements persistent data storage. The Memory handled
needed to be completely revamped, it now uses a garbage collection
mechanism instead of malloc.
* nscd/connections.c: Likewise.
* nscd/nscd.c: Likewise.
* nscd/nscd.h: Likewise.
* nscd/nscd_conf.c: Likewise.
* nscd/nscd_stat.c: Likewise.
* nscd/grpcache.c: Likewise.
* nscd/hstcache.c:: Likewise.
* nscd/pwdcache.c:: Likewise.
* nscd/Makefile: Add rules to build mem.c.
* nscd/mem.c: New file.
* nscd/nscd.conf: Describe new configuration options.
Diffstat (limited to 'nscd/nscd_conf.c')
-rw-r--r-- | nscd/nscd_conf.c | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c index 7b6e2e6..be7527e 100644 --- a/nscd/nscd_conf.c +++ b/nscd/nscd_conf.c @@ -44,7 +44,7 @@ const char *dbnames[lastdb] = }; int -nscd_parse_file (const char *fname, struct database dbs[lastdb]) +nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb]) { FILE *fp; char *line, *cp, *entry, *arg1, *arg2; @@ -117,7 +117,7 @@ nscd_parse_file (const char *fname, struct database dbs[lastdb]) break; } if (cnt == lastdb) - dbg_log ("server %s is not supported\n", arg1); + dbg_log ("database %s is not supported\n", arg1); } else if (strcmp (entry, "negative-time-to-live") == 0) { @@ -128,18 +128,18 @@ nscd_parse_file (const char *fname, struct database dbs[lastdb]) break; } if (cnt == lastdb) - dbg_log ("server %s is not supported\n", arg1); + dbg_log ("database %s is not supported\n", arg1); } else if (strcmp (entry, "suggested-size") == 0) { for (cnt = 0; cnt < lastdb; ++cnt) if (strcmp (arg1, dbnames[cnt]) == 0) { - dbs[cnt].module = atol (arg2); + dbs[cnt].suggested_module = atol (arg2); break; } if (cnt == lastdb) - dbg_log ("server %s is not supported\n", arg1); + dbg_log ("database %s is not supported\n", arg1); } else if (strcmp (entry, "enable-cache") == 0) { @@ -153,7 +153,7 @@ nscd_parse_file (const char *fname, struct database dbs[lastdb]) break; } if (cnt == lastdb) - dbg_log ("server %s is not supported\n", arg1); + dbg_log ("database %s is not supported\n", arg1); } else if (strcmp (entry, "check-files") == 0) { @@ -167,7 +167,7 @@ nscd_parse_file (const char *fname, struct database dbs[lastdb]) break; } if (cnt == lastdb) - dbg_log ("server %s is not supported\n", arg1); + dbg_log ("database %s is not supported\n", arg1); } else if (strcmp (entry, "logfile") == 0) set_logfile (arg1); @@ -202,6 +202,35 @@ nscd_parse_file (const char *fname, struct database dbs[lastdb]) stat_uid = pw->pw_uid; } } + else if (strcmp (entry, "persistent") == 0) + { + for (cnt = 0; cnt < lastdb; ++cnt) + if (strcmp (arg1, dbnames[cnt]) == 0) + { + if (strcmp (arg2, "no") == 0) + dbs[cnt].persistent = 0; + else if (strcmp (arg2, "yes") == 0) + dbs[cnt].persistent = 1; + break; + } + if (cnt == lastdb) + dbg_log ("database %s is not supported\n", arg1); + } + else if (strcmp (entry, "reload-count") == 0) + { + if (strcasecmp (arg1, "unlimited") == 0) + reload_count = UINT_MAX; + else + { + unsigned int count = strtoul (arg1, NULL, 0); + if (count > UINT8_MAX - 1) + reload_count = UINT_MAX; + else if (count >= 0) + reload_count = count; + else + dbg_log (_("invalid value for 'reload-count': %u"), count); + } + } else dbg_log (_("Unknown option: %s %s %s"), entry, arg1, arg2); } |