fix: ifdef linux specific cpu count compat
[userspace-rcu.git] / tests / unit / get_max_cpuid_from_sysfs.c
CommitLineData
4de89c11
MJ
1/*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 *
4 * Copyright (C) 2022 Michael Jeanson <mjeanson@efficios.com>
5 */
6
7#include <stdio.h>
8#include <stdlib.h>
9
da44a943
MJ
10#ifdef __linux__
11
4de89c11
MJ
12#include "compat-smp.h"
13
14int main(int argc, char *argv[])
15{
16 int ret;
17
18 if( argc < 2 ) {
19 fprintf(stderr, "Missing argument.\n");
20 return EXIT_FAILURE;
21 }
22
23 ret = _get_max_cpuid_from_sysfs(argv[1]);
24
25 printf("%d\n", ret);
26
27 if (ret >= 0)
28 return EXIT_SUCCESS;
29 else
30 return EXIT_FAILURE;
31}
da44a943
MJ
32
33#else
34
35int main(void)
36{
37 return EXIT_SUCCESS;
38}
39#endif
This page took 0.023533 seconds and 4 git commands to generate.