Index: lib/libsys/sched_getcpu.3 =================================================================== --- /dev/null +++ lib/libsys/sched_getcpu.3 @@ -0,0 +1,38 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 The FreeBSD Foundation +.\" +.\" This documentation was written by Ed Maste +.\" under sponsorship from the FreeBSD Foundation. +.\" +.Dd November 12, 2024 +.Dt SCHED_GETCPU 3 +.Os +.Sh NAME +.Nm sched_getcpu +.Nd get current CPU +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sched.h +.Ft int +.Fn sched_getcpu void +.Sh DESCRIPTION +The +.Fn sched_getcpu +function returns the current CPU on which the calling thread is running. +.Sh RETURN VALUES +.Fn sched_getcpu +returns the 0-based index of the current CPU. +It cannot fail. +.\" .Sh SEE ALSO +.Sh STANDARDS +The +.Nm +function originated in Linux. +This implementation aims to be source-compatible with the Linux implementation. +.Sh HISTORY +The +.Nm +function was introduced in +.Fx 13.1 .