Skip to content

Commit

Permalink
examples/performance-thread: fix build with pkg-config
Browse files Browse the repository at this point in the history
[ upstream commit e0216ac ]

main.c: In function ‘lthread_tx’:
main.c:2091:25: error: implicit declaration of function ‘sched_getcpu’;
 did you mean ‘sched_getparam’? [-Werror=implicit-function-declaration]
 2091 |  tx_conf->conf.cpu_id = sched_getcpu();
      |                         ^~~~~~~~~~~~
      |                         sched_getparam
cc1: all warnings being treated as errors

Explicitly pass _GNU_SOURCE and include missing header (rather than
rely on automagic inclusion from other system headers).

Fixes: d48415e ("examples/performance-thread: add l3fwd-thread app")

Signed-off-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
david-marchand authored and bluca committed Nov 16, 2020
1 parent 9ea2f2c commit 03dd4aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/performance-thread/l3fwd-thread/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* Copyright(c) 2010-2016 Intel Corporation
*/

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
Expand All @@ -12,6 +16,7 @@
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>
#include <sched.h>

#include <rte_common.h>
#include <rte_vect.h>
Expand Down

0 comments on commit 03dd4aa

Please sign in to comment.