eal/windows: define standard file numbers
PATCH 1/1 eal/windows: define standard file numbers
The macros for STD*_FILENO are missing on windows. Add defines for them to the DPDK-local unistd.h file.
--- lib/eal/windows/include/unistd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
lib/eal/windows/include/unistd.h +11 -0
@@ -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_ */
Signature · 1 line
2.43.0
2024-10-10 10:54 (UTC+0100), Bruce Richardson:
Quoted 18 lines
The macros for STD*_FILENO are missing on windows. Add defines for them to the DPDK-local
unistd.hfile.Signed-off-by Bruce Richardson <[email protected]>--- lib/eal/windows/include/unistd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)lib/eal/windows/include/unistd.h +2
-0@@ -12,4 +12,15 @@#include <io.h> +/* +* Windows appears to be missing STD*_FILENO macros, so define here.
lib/eal/windows/include/unistd.h line 26
Quoted 10 lines
lib/eal/windows/include/unistd.h +9
-0+* 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>
Quoted 28 lines · Dmitry Kozlyuk
2024-10-10 10:54 (UTC+0100), Bruce Richardson:
Quoted 27 lines
The macros for STD*_FILENO are missing on windows. Add defines for them to the DPDK-local
unistd.hfile.Signed-off-by Bruce Richardson <[email protected]>--- lib/eal/windows/include/unistd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)lib/eal/windows/include/unistd.h +11
-0@@ -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 +
Quoted 8 lines
lib/eal/windows/include/unistd.h line 26
Quoted 1 line
lib/eal/windows/include/unistd.h +0
-0#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>
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
This merged patch is now throwing errors about the missing defines on Windows.
/Bruce
Dmitry Kozlyuk
Acked-by2024-10-10 12:39 (UTC+0100), Bruce Richardson:
Quoted 38 lines · Dmitry Kozlyuk
Quoted 28 lines
2024-10-10 10:54 (UTC+0100), Bruce Richardson:
Quoted 27 lines
The macros for STD*_FILENO are missing on windows. Add defines for them to the DPDK-local
unistd.hfile.Signed-off-by Bruce Richardson <[email protected]>--- lib/eal/windows/include/unistd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)lib/eal/windows/include/unistd.h +11
-0@@ -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 +Quoted 8 lines
lib/eal/windows/include/unistd.h line 26
Quoted 1 line
lib/eal/windows/include/unistd.h +0
-0#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>
Quoted 4 lines
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
This merged patch is now throwing errors about the missing defines on Windows.
Thanks, I was searching some outdated source.
Currently, <rte_os_shim.h> contains at least read(), write(), and unlink() which POSIX places in <unistd.h>.
I wonder whether all that stuff should be moved into EAL's <unistd.h> or, on the opposite, <rte_os_shim.h> should consume all other shims. But that would be a broader refactoring, so for the fix:
Thomas Monjalon
Applied10/10/2024 14:33, Dmitry Kozlyuk:
Quoted 46 lines
2024-10-10 12:39 (UTC+0100), Bruce Richardson:
Quoted 38 lines · Dmitry Kozlyuk
Quoted 28 lines
2024-10-10 10:54 (UTC+0100), Bruce Richardson:
Quoted 27 lines
The macros for STD*_FILENO are missing on windows. Add defines for them to the DPDK-local
unistd.hfile.Signed-off-by Bruce Richardson <[email protected]>--- lib/eal/windows/include/unistd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)lib/eal/windows/include/unistd.h +11
-0@@ -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 +Quoted 8 lines
lib/eal/windows/include/unistd.h line 26
Quoted 1 line
lib/eal/windows/include/unistd.h +0
-0#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>Quoted 4 lines
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
This merged patch is now throwing errors about the missing defines on Windows.
Thanks, I was searching some outdated source.
Quoted 7 lines
Currently, <
rte_os_shim.h> contains at leastread(),write(), andunlink()which POSIX places in <unistd.h>.
I wonder whether all that stuff should be moved into EAL's <unistd.h> or, on the opposite, <rte_os_shim.h> should consume all other shims. But that would be a broader refactoring, so for the fix:Acked-by Dmitry Kozlyuk <[email protected]>
Applied, thanks.