Home | History | Annotate | Line # | Download | only in unit
      1 /*
      2  * SPDX-License-Identifier: GPL-2.0-or-later
      3  *
      4  * Copyright (C) 2022 Michael Jeanson <mjeanson (at) efficios.com>
      5  */
      6 
      7 #include <stdio.h>
      8 #include <stdlib.h>
      9 
     10 #ifdef __linux__
     11 
     12 #include "compat-smp.h"
     13 
     14 int main(int argc, char *argv[])
     15 {
     16 	int ret;
     17 	char buf[URCU_CPUMASK_SIZE];
     18 
     19 	if( argc < 2 ) {
     20 		fprintf(stderr, "Missing argument.\n");
     21 		return EXIT_FAILURE;
     22 	}
     23 
     24 	ret = get_cpu_mask_from_sysfs((char *) &buf, URCU_CPUMASK_SIZE, argv[1]);
     25 
     26 	printf("%s", buf);
     27 
     28 	if (ret >= 0)
     29 		return EXIT_SUCCESS;
     30 	else
     31 		return EXIT_FAILURE;
     32 }
     33 
     34 #else
     35 
     36 int main(void)
     37 {
     38 	return EXIT_SUCCESS;
     39 }
     40 #endif
     41