vcl: add api to retrieve num bytes for tx
[vpp.git] / src / vppinfra / cpu.c
index 79e7dc0..385a4e2 100644 (file)
@@ -252,17 +252,25 @@ format_cpu_flags (u8 *s, va_list *args)
 __clib_export u32
 clib_get_current_cpu_id ()
 {
+#ifdef __linux__
   unsigned cpu, node;
   syscall (__NR_getcpu, &cpu, &node, 0);
   return cpu;
+#else
+  return 0;
+#endif /* __linux__ */
 }
 
 __clib_export u32
 clib_get_current_numa_node ()
 {
+#ifdef __linux__
   unsigned cpu, node;
   syscall (__NR_getcpu, &cpu, &node, 0);
   return node;
+#else
+  return 0;
+#endif /* __linux__ */
 }
 
 __clib_export u8 *