GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SCHED_GETCPU(3) FreeBSD Library Functions Manual SCHED_GETCPU(3)

sched_getcpuget current CPU

Standard C Library (libc, -lc)

#include <sched.h>

int
sched_getcpu(void);

The () function returns the current CPU on which the calling thread is running.

sched_getcpu() returns the 0-based index of the current CPU at the time of the call. The value may become invalid immediately after return, unless the thread is pinned to a specific CPU. CPU numbering is the same as used by cpuset(2) and CPU affinity calls.

There are no error values as sched_getcpu() does not fail.

cpuset(2), cpuset_getaffinity(2), cpuset_setaffinity(2), pthread_getaffinity_np(3), pthread_setaffinity_np

The sched_getcpu function originated in Linux. This implementation aims to be source-compatible with the Linux implementation.

The sched_getcpu function was introduced in FreeBSD 13.1.

November 13, 2024 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.