.\" 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 2019, Intel Corporation .SH NAME .PP \f[B]pmem2_errormsg\f[R]() - returns last error message .SH SYNOPSIS .IP .nf \f[C] #include const char *pmem2_errormsg(void); \f[R] .fi .SH DESCRIPTION .PP If an error is detected during the call to a \f[B]libpmem2\f[R](7) function, the application may retrieve an error message describing the reason of the failure from \f[B]pmem2_errormsg\f[R](). The error message buffer is thread-local; errors encountered in one thread do not affect its value in other threads. The buffer is never cleared by any library function; its content is significant only when the return value of the immediately preceding call to a \f[B]libpmem2\f[R](7) function indicated an error. The application must not modify or free the error message string. Subsequent calls to other library functions may modify the previous message. .SH RETURN VALUE .PP The \f[B]pmem2_errormsg\f[R]() function returns a pointer to a static buffer containing the last error message logged for the current thread. If \f[I]errno\f[R] was set, the error message may include a description of the corresponding error code as returned by \f[B]strerror\f[R](3). .SH SEE ALSO .PP \f[B]strerror\f[R](3), \f[B]libpmem2\f[R](7) and \f[B]\f[R]