diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-11-17 21:56:08 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-11-17 21:56:08 +0000 |
commit | 913a0f6c362c8c9aac72f800485678845a60ed06 (patch) | |
tree | 227afb2373db8f9494b69c20069cce6a03ab0914 /libc/nscd/nscd_gethst_r.c | |
parent | 86abb02796d5bfc0c71d46ad9923ff8737e03280 (diff) |
Merge changes between r15584 and r15868 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15869 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nscd/nscd_gethst_r.c')
-rw-r--r-- | libc/nscd/nscd_gethst_r.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libc/nscd/nscd_gethst_r.c b/libc/nscd/nscd_gethst_r.c index 70631fa96..6ee142d71 100644 --- a/libc/nscd/nscd_gethst_r.c +++ b/libc/nscd/nscd_gethst_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2005, 2006, 2007, 2008, 2009 +/* Copyright (C) 1998-2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -98,6 +98,27 @@ libc_freeres_fn (hst_map_free) } +uint32_t +__nscd_get_nl_timestamp (void) +{ + if (__nss_not_use_nscd_hosts != 0) + return 0; + + struct mapped_database *map = __hst_map_handle.mapped; + + if (map == NULL + || (map != NO_MAPPING + && map->head->nscd_certainly_running == 0 + && map->head->timestamp + MAPPING_TIMEOUT < time (NULL))) + map = __nscd_get_mapping (GETFDHST, "hosts", &__hst_map_handle.mapped); + + if (map == NO_MAPPING) + return 0; + + return map->head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]; +} + + int __nss_have_localdomain attribute_hidden; static int |