diff options
author | James Peach <jpeach@samba.org> | 2006-05-08 03:20:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:55 -0500 |
commit | 826614ed16e0fb23d30305990dbfa357b4366de2 (patch) | |
tree | 924ca53959929f394ca662b9385280c10e7610c9 /source3/lib | |
parent | 256690098256dc5205ae246ff49de10324defdf6 (diff) | |
download | samba-826614ed16e0fb23d30305990dbfa357b4366de2.tar.gz samba-826614ed16e0fb23d30305990dbfa357b4366de2.tar.bz2 samba-826614ed16e0fb23d30305990dbfa357b4366de2.zip |
r15508: Use clock_gettime for profiling timstamps if it is available. Use
the fastest clock available on uniprocessors.
(This used to be commit d44862928206b524f826bd7c2997ab5353c0b6a0)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 +} + |