X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Funit%2Fget_max_cpuid_from_sysfs.c;fp=tests%2Funit%2Fget_max_cpuid_from_sysfs.c;h=a948a22e51367496743517ab3105ed8bd15558d2;hp=0000000000000000000000000000000000000000;hb=4de89c1129d52f0f13b63ec037802e095c506875;hpb=5cfe81b7ddff9543d451746de9965cac58c67182 diff --git a/tests/unit/get_max_cpuid_from_sysfs.c b/tests/unit/get_max_cpuid_from_sysfs.c new file mode 100644 index 0000000..a948a22 --- /dev/null +++ b/tests/unit/get_max_cpuid_from_sysfs.c @@ -0,0 +1,29 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include +#include + +#include "compat-smp.h" + +int main(int argc, char *argv[]) +{ + int ret; + + if( argc < 2 ) { + fprintf(stderr, "Missing argument.\n"); + return EXIT_FAILURE; + } + + ret = _get_max_cpuid_from_sysfs(argv[1]); + + printf("%d\n", ret); + + if (ret >= 0) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +}