Example #1
0
File: find_uid.c Project: 3van/sssd
errno_t get_uid_table(TALLOC_CTX *mem_ctx, hash_table_t **table)
{
#ifdef __linux__
    int ret;

    ret = hash_create_ex(INITIAL_TABLE_SIZE, table, 0, 0, 0, 0,
                         hash_talloc, hash_talloc_free, mem_ctx,
                         NULL, NULL);
    if (ret != HASH_SUCCESS) {
        DEBUG(SSSDBG_CRIT_FAILURE,
              "hash_create_ex failed [%s]\n", hash_error_string(ret));
        return ENOMEM;
    }

    return get_active_uid_linux(*table, 0);
#else
    return ENOSYS;
#endif
}
Example #2
0
File: jlg_hash.c Project: ccbon/ocp
// create a hash table with key size optionally specified
// this function allocates memory so hash_delete has to be called to free memory
hash_t *hash_create() {
	return hash_create_ex(hash_config_create());
}