fdeae0c8fbb83656526e77ee12006f04e0bb385b
[dpdk.git] / lib / librte_eal / windows / eal / include / rte_os.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2019 Intel Corporation
3  */
4
5 #ifndef _RTE_OS_H_
6 #define _RTE_OS_H_
7
8 /**
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.
12  */
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 #include <Windows.h>
19 #include <BaseTsd.h>
20 #include <pthread.h>
21
22 #define strerror_r(a, b, c) strerror_s(b, c, a)
23
24 /* strdup is deprecated in Microsoft libc and _strdup is preferred */
25 #define strdup(str) _strdup(str)
26
27 typedef SSIZE_T ssize_t;
28
29 #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
30
31 /**
32  * Create a thread.
33  * This function is private to EAL.
34  *
35  * @param thread
36  *   The location to store the thread id if successful.
37  * @return
38  *   0 for success, -1 if the thread is not created.
39  */
40 int eal_thread_create(pthread_t *thread);
41
42 /**
43  * Create a map of processors and cores on the system.
44  * This function is private to EAL.
45  */
46 void eal_create_cpu_map(void);
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52 #endif /* _RTE_OS_H_ */