diff --git a/examples/03-read-to-persistent/client.c b/examples/03-read-to-persistent/client.c index 2c71eb799a..5116f51867 100644 --- a/examples/03-read-to-persistent/client.c +++ b/examples/03-read-to-persistent/client.c @@ -128,6 +128,7 @@ main(int argc, char *argv[]) /* if no pmem support or it is not provided */ if (mr_ptr == NULL) { + (void) fprintf(stderr, NO_PMEM_MSG); mr_ptr = malloc_aligned(sizeof(struct hello_t)); if (mr_ptr == NULL) return -1; diff --git a/examples/common/common-conn.h b/examples/common/common-conn.h index 65b00d3815..ea449d9045 100644 --- a/examples/common/common-conn.h +++ b/examples/common/common-conn.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * common-conn.h -- a common connection functions declarations for examples @@ -12,11 +12,13 @@ #include #ifdef USE_LIBPMEM - /* signature marking the persistent contents as valid */ #define SIGNATURE_STR "RPMA_EXAMPLE_SIG" #define SIGNATURE_LEN (strlen(SIGNATURE_STR) + 1) +#define NO_PMEM_MSG "No provided. Using DRAM instead.\n" +#else +#define NO_PMEM_MSG "The example is unable to use libpmem. If unintended please check the build log. Using DRAM instead.\n" #endif /*