.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-26" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020, Intel Corporation .SH NAME .PP \f[B]pmem2_source_numa_node\f[R]() - returns data source numa node .SH SYNOPSIS .IP .nf \f[C] #include struct pmem2_source; int pmem2_source_numa_node(const struct pmem2_source *source, int *numa_node); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_source_numa_node\f[R]() function retrieves the numa node of the given data source. The numa node can be used to, e.g., pin threads to near-memory cores. The numa node is stored in \f[I]*numa_node\f[R]. It is the same value that is shown as \f[C]numa_node\f[R] in \f[C]ndctl list -v\f[R]. .SH RETURN VALUE .PP The \f[B]pmem2_source_numa_node\f[R]() function returns 0 on success. If the function fails, the \f[I]*numa_node\f[R] variable is left unmodified and a negative error code is returned. .SH ERRORS .PP The \f[B]pmem2_source_numa_node\f[R]() can fail with the following errors: .PP On all systems: .IP \[bu] 2 \f[B]PMEM2_E_NOSUPP\f[R] - source type or operating system not supported (see #caveats for details.) .PP on Linux: .IP \[bu] 2 \f[B]PMEM2_E_DAX_REGION_NOT_FOUND\f[R] - no \f[B]ndctl_region\f[R] could be determined for the source. .IP \[bu] 2 \f[B]PMEM2_E_INVALID_FILE_TYPE\f[R] - if the source points to a directory. .IP \[bu] 2 -\f[B]errno\f[R] set by failing \f[B]ndctl_new\f[R], while trying to create a new context. .SH CAVEATS .PP This call requires \f[B]libndctl\f[R] to retrieve the numa information. It only works for sources that are actually located on persistent memory, i.e., devdax or fsdax. As anonymous sources are not backed by files on persistent memory, this method is not supported for them. It also does not work under Windows or systems without \f[B]libndctl\f[R]. .SH SEE ALSO .PP \f[B]errno\f[R](3), \f[B]ndctl_new\f[R](3), \f[B]pmem2_source_from_handle\f[R](3), \f[B]pmem2_source_from_fd\f[R](3), \f[B]libpmem2\f[R](7), \f[B]libndctl\f[R](7) and \f[B]\f[R]