[PATCH] eal/windows: define standard file numbers
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Thu Oct 10 12:43:41 CEST 2024
2024-10-10 10:54 (UTC+0100), Bruce Richardson:
> The macros for STD*_FILENO are missing on windows. Add defines for them
> to the DPDK-local unistd.h file.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> lib/eal/windows/include/unistd.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/lib/eal/windows/include/unistd.h b/lib/eal/windows/include/unistd.h
> index 6b33005b24..78150c6480 100644
> --- a/lib/eal/windows/include/unistd.h
> +++ b/lib/eal/windows/include/unistd.h
> @@ -12,4 +12,15 @@
>
> #include <io.h>
>
> +/*
> + * Windows appears to be missing STD*_FILENO macros, so define here.
> + * For simplicity, assume that if STDIN_FILENO is missing, all are,
> + * rather than checking each individually.
> + */
> +#ifndef STDIN_FILENO
> +#define STDIN_FILENO _fileno(stdin)
> +#define STDOUT_FILENO _fileno(stdout)
> +#define STDERR_FILENO _fileno(stderr)
> +#endif
> +
> #endif /* _UNISTD_H_ */
Why is this needed?
There are 3 users of STD*_FILENO within DPDK:
* lib/eal/unix/eal_debug.c - not for Windows, obviously
* app/dumpcap - not for Windows, requires multi-process
* app/proc-info - not for Windows, requires multi-process
* examples/l2fwd-cat - not for Windows, requires <pqos.h>
More information about the dev
mailing list