.\" 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_get_fd\f[R]() - reads file descriptor of the data source .SH SYNOPSIS .IP .nf \f[C] #include int pmem2_source_get_fd(const struct pmem2_source *src, int *fd); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_source_get_fd\f[R]() function reads the file descriptor of *struct pmem2_source** object describing the data source and returns it by \f[I]fd\f[R] parameter. .PP This function is Linux only, on Windows use \f[B]pmem2_source_get_handle\f[R](3). .SH RETURN VALUE .PP The \f[B]pmem2_source_get_fd\f[R]() function returns 0 on success or a negative error code on failure. .SH ERRORS .PP The \f[B]pmem2_source_get_fd\f[R]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_FILE_DESCRIPTOR_NOT_SET\f[R] - in case of an instance of \f[I]struct pmem2_source\f[R] that does not come from source type that support file descriptors, eg. anonymous data source. .SH SEE ALSO .PP \f[B]pmem2_source_get_handle\f[R](3), \f[B]libpmem2\f[R](7) and \f[B]\f[R]