Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SHTK_HW_CPUS(3)		    Library Functions Manual	       SHTK_HW_CPUS(3)

NAME
       shtk_hw_ncpus --	Queries	the number of CPUs (threads) in	the machine

LIBRARY
       shtk_import hw

SYNOPSIS
       shtk_hw_ncpus

DESCRIPTION
       The shtk_hw_ncpus function queries the number of	CPU threads in the ma-
       chine and prints	the total number to stdout.

       If  the	query  fails,  or if the function does not know	how to get the
       number from the current operating system, prints	1.

RETURN VALUES
       shtk_hw_ncpus returns 0.

EXAMPLES
	     make -j"$(shtk_hw_ncpus)" all

ENVIRONMENT
       SHTK_HW_NCPUS
	     If	set to a number	greater	than zero, overrides the return	 value
	     of	shtk_hw_ncpus.	Generally useful for testing purposes, but can
	     also be useful to inject greater numbers of parallelism in	appli-
	     cations that do not expose	a mechanism to tune such number.

SEE ALSO
       shtk(3),	shtk_hw(3)

HISTORY
       shtk_hw_ncpus first appeared in shtk 1.7.

FreeBSD	Ports 14.quarterly     February	6, 2017		       SHTK_HW_CPUS(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=shtk_hw_ncpus&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help