From 826614ed16e0fb23d30305990dbfa357b4366de2 Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 8 May 2006 03:20:49 +0000 Subject: r15508: Use clock_gettime for profiling timstamps if it is available. Use the fastest clock available on uniprocessors. (This used to be commit d44862928206b524f826bd7c2997ab5353c0b6a0) --- source3/lib/util.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index a9aebd0822..fd48cbfa83 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2969,3 +2969,21 @@ BOOL procid_is_local(const struct process_id *pid) { return True; } + +int this_is_smp(void) +{ +#if defined(HAVE_SYSCONF) + +#if defined(SYSCONF_SC_NPROC_ONLN) + return (sysconf(_SC_NPROC_ONLN) > 1) ? 1 : 0; +#elif defined(SYSCONF_SC_NPROCESSORS_ONLN) + return (sysconf(_SC_NPROCESSORS_ONLN) > 1) ? 1 : 0; +#else + return 0; +#endif + +#else + return 0; +#endif +} + -- cgit