summaryrefslogtreecommitdiffstats
path: root/wrapper.c
blob: 73416315aa5cc462965c03e420e6920de4ba7f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: GPL-2.0-only
/*
 * This file is part of nvme-cli
 *
 * Copyright (c) 2022 Daniel Wagner, SUSE
 */

#include <dlfcn.h>

#include <libnvme.h>

const char * __attribute__((weak)) nvme_get_version(enum nvme_version type)
{
	const char *(*libnvme_get_version)(enum nvme_version type);

	libnvme_get_version = dlsym(RTLD_NEXT, "nvme_get_version");

	if (libnvme_get_version)
		return libnvme_get_version(type);

	return "n/a";
}