hcreate_r

Name

hcreate_r -- allocate space for a hash search table, reentrantly

Synopsis

#include <search.h>

int hcreate_r(size_t nel, struct hsearch_data * htab);

Description

The hcreate_r() function is a reentrant version of the hcreate() function.

hcreate_r() shall initialize the object referenced by htab with a hash table containing at least nel elements. Unlike its non-reentrant equivalent, hcreate(), the hcreate_r() function may work with more than one hash table.

The memory for the htab object may be dynamically allocated. It must be initialized with 0 before hcreate_r() is called.

Return Value

On success, hcreate_r() shall return a non-zero value.

On failure, hcreate_r() shall return 0. This usually happens because not enough memory was available.