xref: /dpdk/lib/eal/windows/include/unistd.h (revision e0bf217330a89c30505f218ce89005cfb662af7c)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2019 Intel Corporation
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef _UNISTD_H_
699a2dd95SBruce Richardson #define _UNISTD_H_
799a2dd95SBruce Richardson /**
899a2dd95SBruce Richardson  * This file is added to support common code in eal_common_lcore.c
999a2dd95SBruce Richardson  * as Microsoft libc does not contain unistd.h. This may be removed
1099a2dd95SBruce Richardson  * in future releases.
1199a2dd95SBruce Richardson  */
1299a2dd95SBruce Richardson 
1399a2dd95SBruce Richardson #include <io.h>
1499a2dd95SBruce Richardson 
15*e0bf2173SBruce Richardson /*
16*e0bf2173SBruce Richardson  * Windows appears to be missing STD*_FILENO macros, so define here.
17*e0bf2173SBruce Richardson  * For simplicity, assume that if STDIN_FILENO is missing, all are,
18*e0bf2173SBruce Richardson  * rather than checking each individually.
19*e0bf2173SBruce Richardson  */
20*e0bf2173SBruce Richardson #ifndef STDIN_FILENO
21*e0bf2173SBruce Richardson #define STDIN_FILENO _fileno(stdin)
22*e0bf2173SBruce Richardson #define STDOUT_FILENO _fileno(stdout)
23*e0bf2173SBruce Richardson #define STDERR_FILENO _fileno(stderr)
24*e0bf2173SBruce Richardson #endif
25*e0bf2173SBruce Richardson 
2699a2dd95SBruce Richardson #endif /* _UNISTD_H_ */
27