From 3078cba2f7272dab753c45b733af2e693e86d83c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 4 Oct 2004 16:35:54 +0000 Subject: Update. * nscd/connections.c (start_threads): Use sysconf in case _POSIX_CLOCK_SELECTION or _POSIX_MONOTONIC_CLOCK is not greater zero. * nscd/nscd.c: Remove getaddrinfo stub definition. --- nscd/connections.c | 12 ++++++++++-- nscd/nscd.c | 13 ------------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'nscd') diff --git a/nscd/connections.c b/nscd/connections.c index 45042beaab..aae798ed47 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1455,10 +1455,18 @@ start_threads (void) pthread_condattr_t condattr; pthread_condattr_init (&condattr); -#if _POSIX_CLOCK_SELECTION >= 0 && _POSIX_MONOTONIC_CLOCK >= 0 +#if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0 \ + && defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0 /* Determine whether the monotonous clock is available. */ struct timespec dummy; - if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0 + if ( +# if _POSIX_MONOTONIC_CLOCK == 0 + sysconf (_SC_MONOTONIC_CLOCK) > 0 && +# endif +# if _POSIX_CLOCK_SELECTION == 0 + sysconf (_SC_CLOCK_SELECTION) > 0 && +# endif + clock_getres (CLOCK_MONOTONIC, &dummy) == 0 && pthread_condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0) timeout_clock = CLOCK_MONOTONIC; #endif diff --git a/nscd/nscd.c b/nscd/nscd.c index 0ef54bcf08..0cc1818d9d 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -502,16 +502,3 @@ write_pid (const char *file) return 0; } - - -/* This is an ugly hack which prevents getaddrinfo from being dragged - into nscd. There currently is no special getaddrinfo version for - use in nscd. In case it should be necessary such a version must be - created and this dummy version should be removed. */ -extern void getaddrinfo (void) __attribute ((visibility ("hidden"))); - -void -getaddrinfo (void) -{ - abort (); -} -- cgit v1.2.3