.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEM2_SOURCE_GET_FD" "3" "2022-08-25" "PMDK - pmem2 API version 1.0" "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[]() \- 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[] .fi .SH DESCRIPTION .PP The \f[B]pmem2_source_get_fd\f[]() function reads the file descriptor of *struct pmem2_source** object describing the data source and returns it by \f[I]fd\f[] parameter. .PP This function is Linux only, on Windows use \f[B]pmem2_source_get_handle\f[](3). .SH RETURN VALUE .PP The \f[B]pmem2_source_get_fd\f[]() function returns 0 on success or a negative error code on failure. .SH ERRORS .PP The \f[B]pmem2_source_get_fd\f[]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_FILE_DESCRIPTOR_NOT_SET\f[] \- in case of an instance of \f[I]struct pmem2_source\f[] 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[](3), \f[B]libpmem2\f[](7) and \f[B]\f[]