Replace obsolete linux macro
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "ndpi_config.h"
|
#include "ndpi_config.h"
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
@@ -105,7 +105,7 @@ static u_int16_t num_loops = 1;
|
|||||||
static u_int8_t shutdown_app = 0, quiet_mode = 0;
|
static u_int8_t shutdown_app = 0, quiet_mode = 0;
|
||||||
static u_int8_t num_threads = 1;
|
static u_int8_t num_threads = 1;
|
||||||
static struct timeval startup_time, begin, end;
|
static struct timeval startup_time, begin, end;
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
static int core_affinity[MAX_NUM_READER_THREADS];
|
static int core_affinity[MAX_NUM_READER_THREADS];
|
||||||
#endif
|
#endif
|
||||||
static struct timeval pcap_start = { 0, 0}, pcap_end = { 0, 0 };
|
static struct timeval pcap_start = { 0, 0}, pcap_end = { 0, 0 };
|
||||||
@@ -457,7 +457,7 @@ static void help(u_int long_help) {
|
|||||||
" -k <file> | Specify a file to write serialized detection results\n"
|
" -k <file> | Specify a file to write serialized detection results\n"
|
||||||
" -K <format> | Specify the serialization format for `-k'\n"
|
" -K <format> | Specify the serialization format for `-k'\n"
|
||||||
" | Valid formats are tlv, csv or json (default)\n"
|
" | Valid formats are tlv, csv or json (default)\n"
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
" -g <id:id...> | Thread affinity mask (one core id per thread)\n"
|
" -g <id:id...> | Thread affinity mask (one core id per thread)\n"
|
||||||
#endif
|
#endif
|
||||||
" -a <mode> | Generates option values for GUIs\n"
|
" -a <mode> | Generates option values for GUIs\n"
|
||||||
@@ -788,7 +788,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
#ifndef USE_DPDK
|
#ifndef USE_DPDK
|
||||||
char *__pcap_file = NULL;
|
char *__pcap_file = NULL;
|
||||||
int thread_id, do_capture = 0;
|
int thread_id, do_capture = 0;
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
char *bind_mask = NULL;
|
char *bind_mask = NULL;
|
||||||
u_int num_cores = sysconf(_SC_NPROCESSORS_ONLN);
|
u_int num_cores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
#endif
|
#endif
|
||||||
@@ -864,7 +864,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef USE_DPDK
|
#ifndef USE_DPDK
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
case 'g':
|
case 'g':
|
||||||
bind_mask = optarg;
|
bind_mask = optarg;
|
||||||
break;
|
break;
|
||||||
@@ -1105,7 +1105,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
#ifndef USE_DPDK
|
#ifndef USE_DPDK
|
||||||
for(thread_id = 0; thread_id < num_threads; thread_id++)
|
for(thread_id = 0; thread_id < num_threads; thread_id++)
|
||||||
core_affinity[thread_id] = -1;
|
core_affinity[thread_id] = -1;
|
||||||
@@ -4041,7 +4041,7 @@ void * processing_thread(void *_thread_id) {
|
|||||||
char pcap_error_buffer[PCAP_ERRBUF_SIZE];
|
char pcap_error_buffer[PCAP_ERRBUF_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(linux) && defined(HAVE_PTHREAD_SETAFFINITY_NP)
|
#if defined(__linux__) && defined(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
if(core_affinity[thread_id] >= 0) {
|
if(core_affinity[thread_id] >= 0) {
|
||||||
cpu_set_t cpuset;
|
cpu_set_t cpuset;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef __linux__
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user