1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2019 Intel Corporation
9 * This is header should contain any function/macro definition
10 * which are not supported natively or named differently in the
11 * Windows OS. Functions will be added in future releases.
23 /* limits.h replacement */
26 #define PATH_MAX _MAX_PATH
29 #define strerror_r(a, b, c) strerror_s(b, c, a)
31 /* strdup is deprecated in Microsoft libc and _strdup is preferred */
32 #define strdup(str) _strdup(str)
34 typedef SSIZE_T ssize_t;
36 #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
38 #define index(a, b) strchr(a, b)
39 #define rindex(a, b) strrchr(a, b)
41 #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
45 * This function is private to EAL.
48 * The location to store the thread id if successful.
50 * 0 for success, -1 if the thread is not created.
52 int eal_thread_create(pthread_t *thread);
55 * Create a map of processors and cores on the system.
56 * This function is private to EAL.
58 void eal_create_cpu_map(void);
61 asprintf(char **buffer, const char *format, ...)
66 va_start(arg, format);
67 size = vsnprintf(NULL, 0, format, arg);
73 *buffer = malloc(size);
77 va_start(arg, format);
78 ret = vsnprintf(*buffer, size, format, arg);
80 if (ret != size - 1) {
87 /* cpu_set macros implementation */
88 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
89 #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
90 #define RTE_CPU_FILL(set) CPU_FILL(set)
91 #define RTE_CPU_NOT(dst, src) CPU_NOT(dst, src)
97 #endif /* _RTE_OS_H_ */