DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, david.marchand@redhat.com, ferruh.yigit@amd.com,
	thomas@monjalon.net,
	Tyler Retzlaff <roretzla@linux.microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>
Subject: Re: [PATCH] eal/windows: define standard file numbers
Date: Thu, 10 Oct 2024 13:43:41 +0300	[thread overview]
Message-ID: <20241010134341.142453cf@sovereign> (raw)
In-Reply-To: <20241010095434.358810-1-bruce.richardson@intel.com>

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@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>

  reply	other threads:[~2024-10-10 10:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  9:54 Bruce Richardson
2024-10-10 10:43 ` Dmitry Kozlyuk [this message]
2024-10-10 11:39   ` Bruce Richardson
2024-10-10 12:33     ` Dmitry Kozlyuk
2024-10-10 21:41       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241010134341.142453cf@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=pallavi.kadam@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).