---
name: "BUS_GET_CPUS"
section: "9freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/BUS_GET_CPUS/9freebsd"
---

# BUS\_GET\_CPUS(9freebsd)

request a set of device-specific CPUs

## NAME

**BUS\_GET\_CPUS**, **bus\_get\_cpus** – request a set of device-specific CPUs

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/bus.h\>**

**#include \<sys/cpuset.h\>**

*int*\

**BUS\_GET\_CPUS**(*device\_t dev*, *device\_t child*, *enum cpu\_sets op*, *size\_t setsize*, *cpuset\_t \*cpuset*);

*int*\

**bus\_get\_cpus**(*device\_t dev*, *enum cpu\_sets op*, *size\_t setsize*, *cpuset\_t \*cpuset*);

## DESCRIPTION

The **BUS\_GET\_CPUS**() method queries the parent bus device for a set of device-specific CPUs. The *op* argument specifies which set of CPUs to retrieve. If successful, the requested set of CPUs are returned in *cpuset*. The *setsize* argument specifies the size in bytes of the set passed in *cpuset*.

**BUS\_GET\_CPUS**() supports querying different types of CPU sets via the *op*, *argument.* Not all set types are supported for every device. If a set type is not supported, **BUS\_GET\_CPUS**() fails with EINVAL. These set types are supported:

- LOCAL\_CPUS

  The set of CPUs that are local to the device. If a device is closer to a specific memory domain in a non-uniform memory architecture system (NUMA), this will return the set of CPUs in that memory domain.

- INTR\_CPUS

  The preferred set of CPUs that this device should use for device interrupts. This set type must be supported by all bus drivers.

The **bus\_get\_cpus**() function is a simple wrapper around **BUS\_GET\_CPUS**().

## RETURN VALUES

Zero is returned on success, otherwise an appropriate error is returned.

## SEE ALSO

[cpuset(2)](/cpuset/2.md), [BUS\_BIND\_INTR(9)](/BUS_BIND_INTR/9.md), [device(9)](/device/9.md)

## HISTORY

The **BUS\_GET\_CPUS**() method and **bus\_get\_cpus**() function first appeared in FreeBSD 11.0.
