* Sysconf: Solaris uses _SC_NPROCESSORS_ONLN to return the number * of online processors.  I don't know if this call is portable or * not.
* Solaris and Linux use _SC_NPROCESSORS_ONLN to return the number of * online processors.  We don't want to repeatedly call sysconf because * it's quite expensive (requiring multiple filesystem accesses) under * Debian Linux. * * Spin 50 times per processor -- we have anecdotal evidence that this * is a reasonable value.
__os_spin(){	extern int __db_tsl_spins;	/* If the application specified the spins, use its value. */	if (__db_tsl_spins != 0)		return (__db_tsl_spins);	/*	 * XXX	 * Sysconf: Solaris uses _SC_NPROCESSORS_ONLN to return the number	 * of online processors.  I don't know if this call is portable or	 * not.	 */#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)	{		long sys_val;		sys_val = sysconf(_SC_NPROCESSORS_ONLN);		if (sys_val > 0)			return (sys_val * 50);	}#endif	/* Default to a single processor. */	return (1);}