pmemset API version 1.0

The PMDK repository on GitHub is the ultimate source of information on PMDK from release 2.0! For all questions and to submit eventual issues please follow to that repository. The PMDK documentation collected here should be valid up to the 1.13.1 release but is maintained only on a best-effort basis and may not reflect the latest state of the art.

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO

NAME

pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW()

  • creates an instance of persistent memory data source

SYNOPSIS

#include <libpmemset.h>

int pmemset_source_from_temporaryU(struct pmemset_source **src, const char const char *dir);
int pmemset_source_from_temporaryW(struct pmemset_source **src, const wchar_t const char *dir);

DESCRIPTION

pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() function instantiates a new struct pmemset_source* object describing the data source and creates a unnamed temporary file in the provided directory dir. The temporary file is always created with mode 0600, and the dir must specify an existing directory name. The created file has size 0 and is extended dynamically based on required map size during pmemset_map(3).

In case of source from temporary file the pmemset_source_delete(3) function frees *src and sets *src to NULL and closes the temporary file as a result the file is immediately deleted.

RETURN VALUE

The pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() function return 0 on success or negative error code on failure.

ERRORS

The pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() can fail with the following errors:

  • PMEMSET_E_INVALID_SOURCE_PATH - the provided directory path string is NULL or provided path does not exists.

  • PMEMSET_E_CANNOT_CREATE_TEMP_FILE - cannot create a unique temporary filename.

  • -ENOMEM - in case of insufficient memory to allocate an instance of struct pmemset_source.

SEE ALSO

pmemset_map(3), pmemset_source_delete(3), libpmemset(7) and http://pmem.io

The contents of this web site and the associated GitHub repositories are BSD-licensed open source.