xref: /illumos-gate/usr/src/man/man3c/get_nprocs.3c (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2014 Joyent, Inc.
13.\"
14.Dd "Dec 21, 2014"
15.Dt GET_NPROCS 3C
16.Os
17.Sh NAME
18.Nm get_nprocs ,
19.Nm get_nprocs_conf
20.Nd get number of processors
21.Sh SYNOPSIS
22.In unistd.h
23.Ft int
24.Fo get_nprocs
25.Fa void
26.Fc
27.Ft int
28.Fo get_nprocs_conf
29.Fa void
30.Fc
31.Sh DESCRIPTION
32The
33.Fn get_nprocs
34and
35.Fn get_nprocs_conf
36functions are provided for compatibility with other systems and are
37equivalent to calling
38.Fn sysconf _SC_NPROCESSORS_ONLN
39and
40.Fn sysconf _SC_NPROCESSORS_CONF
41respectively.
42.Sh RETURN VALUES
43The
44.Fn get_nprocs
45function returns the number of processors that are currently online.
46The
47.Fn get_nprocs_conf
48function returns the number of processors that the operating system has
49configured.
50.Sh INTERFACE STABILITY
51.Sy Committed .
52.Sh MT-LEVEL
53.Sy MT-Safe ,
54.Sy Async-Signal-Safe
55.Sh SEE ALSO
56.Xr psrinfo 1M ,
57.Xr processor_info 2 ,
58.Xr sysconf 3C ,
59.Xr attributes 5 ,
60.Xr standards 5
61