Add more unit tests for possible_cpus_array_len
[lttng-ust.git] / tests / unit / libcommon / get_cpu_mask_from_sysfs.c
CommitLineData
fb0f6ca9
MJ
1/*
2 * SPDX-License-Identifier: LGPL-2.1-only
3 *
4 * Copyright (C) 2022 Michael Jeanson <mjeanson@efficios.com>
5 */
6
7#include <stdio.h>
8#include <stdlib.h>
9
10#include "common/smp.h"
11
12int main(int argc, char *argv[])
13{
14 int ret;
15 char buf[LTTNG_UST_CPUMASK_SIZE];
16
17 if( argc < 2 ) {
18 fprintf(stderr, "Missing argument.\n");
19 return EXIT_FAILURE;
20 }
21
22 ret = get_cpu_mask_from_sysfs((char *) &buf, LTTNG_UST_CPUMASK_SIZE, argv[1]);
23
24 printf("%s", buf);
25
26 if (ret >= 0)
27 return EXIT_SUCCESS;
28 else
29 return EXIT_FAILURE;
30}
This page took 0.024544 seconds and 4 git commands to generate.