get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/91477/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 91477,
    "url": "http://patches.dpdk.org/api/patches/91477/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210414220651.28691-3-dmitry.kozliuk@gmail.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210414220651.28691-3-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210414220651.28691-3-dmitry.kozliuk@gmail.com",
    "date": "2021-04-14T22:06:49",
    "name": "[v10,2/4] eal: make OS shims internal",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c27e0d2c72a0aa21d1e873b1e3190fc0a6a149bb",
    "submitter": {
        "id": 1581,
        "url": "http://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210414220651.28691-3-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 16380,
            "url": "http://patches.dpdk.org/api/series/16380/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16380",
            "date": "2021-04-14T22:06:47",
            "name": "eal/windows: do not expose POSIX symbols",
            "version": 10,
            "mbox": "http://patches.dpdk.org/series/16380/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/91477/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/91477/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3AD93A0A02;\n\tThu, 15 Apr 2021 00:07:13 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4FE3D161D76;\n\tThu, 15 Apr 2021 00:07:07 +0200 (CEST)",
            "from mail-lf1-f42.google.com (mail-lf1-f42.google.com\n [209.85.167.42])\n by mails.dpdk.org (Postfix) with ESMTP id 3339F161D6C\n for <dev@dpdk.org>; Thu, 15 Apr 2021 00:07:03 +0200 (CEST)",
            "by mail-lf1-f42.google.com with SMTP id n138so35851075lfa.3\n for <dev@dpdk.org>; Wed, 14 Apr 2021 15:07:03 -0700 (PDT)",
            "from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.\n [37.110.65.23])\n by smtp.gmail.com with ESMTPSA id m28sm271489lfo.278.2021.04.14.15.07.01\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 14 Apr 2021 15:07:01 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=3EFhcgW43bh1WtSGNJaUd4mPjxS6YGcUqSOwf2GvXls=;\n b=k1OhLDMu6g3YiFJuVIk3CsNiMy3diQDEN+MvdkUafOz31fIxdDqc076lfiltSoU7Xj\n R+lO5kXNdM7lLVVmoLXpzeSLR7z5maBSJJsM9fo0A0bnm3EgOLVjhHmJkVyPKxQ2q106\n TViP8BCYghHBiZ6DNThpNpXvTlr/v6ott8qYwP5u4V5hILep7khg8hCVDss18zFZgrHF\n vTFNuTj5hSQqtUQZIknm4q/YmK0QposRNMJKI4QLp3MxIZ7TUTySLe1eiNFKBTSKrDln\n ZhPwFk3pFCUE/cr/cxiULxD5Ak/KAoPb3ox3p8OwQmEdIY02anR8oRjlLzkCh/7VpHKm\n +6TQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=3EFhcgW43bh1WtSGNJaUd4mPjxS6YGcUqSOwf2GvXls=;\n b=KLpuLRY9EAyZwulT+7ZHKrL2mIxhY4gAE5U9oyhhOwOkOgbEdvCPmQPji9b1WPhNhy\n gN6P/gcljHnmr56Gj3O6hMFRKja1xKapH8PsWr6Gj/ZXN9yCReg8qKO+DKNnjLgI0dxt\n T2m3BbUdVEWq3Jp/MUclPda4+4eYeTtPDnQhIGqMw/GAOdJI9v/TShCbJ5gVlHGN3OhG\n t62vEVbsFP+QT/Me9SZS3rJtc6d1L+V6gBHe4V2Q5R6MGAiytl/WpZkGk5kZTEoqZun4\n KKcgu8JKO1JDYw1ijZ1VxDdWHHUWqRDxwJU/rB9xSCn/0qTdKvfWiGTTlnOLrtZKkbvy\n hiPg==",
        "X-Gm-Message-State": "AOAM531VrnwuFoDlWEhbMCa6OutzmUnc8HnGtuUH2K+L6nwM4uliTRmW\n txWWoxATZnU+rYyIuU7o7awfTG24qjGlB/xb",
        "X-Google-Smtp-Source": "\n ABdhPJxbesU3OeyM3TI7YBN/rnVYbZFots9qdWUF6bNcmg/WrUqBb0OhnTMdi+A5IMmXy7ggQHHs4w==",
        "X-Received": "by 2002:a05:6512:2341:: with SMTP id\n p1mr205712lfu.507.1618438022334;\n Wed, 14 Apr 2021 15:07:02 -0700 (PDT)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Thomas Monjalon <thomas@monjalon.net>, Matan Azrad <matan@nvidia.com>,\n Shahaf Shuler <shahafs@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Beilei Xing <beilei.xing@intel.com>, Jeff Guo <jia.guo@intel.com>,\n Harry van Haaren <harry.van.haaren@intel.com>,\n Olivier Matz <olivier.matz@6wind.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Date": "Thu, 15 Apr 2021 01:06:49 +0300",
        "Message-Id": "<20210414220651.28691-3-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.29.3",
        "In-Reply-To": "<20210414220651.28691-1-dmitry.kozliuk@gmail.com>",
        "References": "<20210410224732.20234-1-dmitry.kozliuk@gmail.com>\n <20210414220651.28691-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v10 2/4] eal: make OS shims internal",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "DPDK code often relies on functions and macros that are not standard C,\nbut are found on all platforms, even if by slightly different names.\nWindows <rte_os.h> provided macros or inline definitions for such symbols.\nHowever, when placed in public header, these symbols were unnecessarily\nexposed, breaking consumer POSIX compatibility code.\n\nMove most of the shims to <rte_os_shim.h>, a header to be used instead\nof <rte_os.h> by internal code. Include it in libraries and PMDs that\npreviously imported shims from <rte_os.h>. Directly replace shims that\nwere only used inside EAL:\n* index -> strchr, rindex -> strrchr\n* sleep -> rte_delay_us_sleep\n* strerror_r -> strerror_s\n\nRemove sleep(3) shim in favour of rte_delay_us_sleep().\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\nAcked-by: Thomas Monjalon <thomas@monjalon.net>\n---\n drivers/bus/pci/private.h                    |  4 +-\n drivers/bus/vdev/vdev_private.h              |  2 +\n drivers/common/mlx5/mlx5_common.h            |  1 +\n drivers/net/i40e/i40e_ethdev.c               |  1 +\n examples/service_cores/main.c                |  4 +-\n lib/librte_cmdline/cmdline.c                 |  4 --\n lib/librte_cmdline/cmdline_os_windows.c      |  2 -\n lib/librte_cmdline/cmdline_private.h         |  1 +\n lib/librte_cmdline/cmdline_socket.c          |  4 --\n lib/librte_eal/common/eal_common_config.c    |  1 -\n lib/librte_eal/common/eal_common_errno.c     |  4 ++\n lib/librte_eal/common/eal_common_log.c       |  1 +\n lib/librte_eal/common/eal_common_options.c   |  2 +-\n lib/librte_eal/common/eal_common_timer.c     |  4 +-\n lib/librte_eal/common/eal_internal_cfg.h     |  1 +\n lib/librte_eal/freebsd/include/rte_os_shim.h | 14 +++++\n lib/librte_eal/linux/include/rte_os_shim.h   | 14 +++++\n lib/librte_eal/windows/eal_hugepages.c       |  1 -\n lib/librte_eal/windows/eal_lcore.c           |  1 -\n lib/librte_eal/windows/eal_memalloc.c        |  1 -\n lib/librte_eal/windows/include/rte_os.h      | 62 ++------------------\n lib/librte_eal/windows/include/rte_os_shim.h | 28 +++++++++\n lib/librte_ethdev/ethdev_private.h           |  2 +\n lib/librte_kvargs/rte_kvargs.c               |  1 +\n 24 files changed, 82 insertions(+), 78 deletions(-)\n create mode 100644 lib/librte_eal/freebsd/include/rte_os_shim.h\n create mode 100644 lib/librte_eal/linux/include/rte_os_shim.h\n create mode 100644 lib/librte_eal/windows/include/rte_os_shim.h",
    "diff": "diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h\nindex f566943f5e..4cd9d14ec7 100644\n--- a/drivers/bus/pci/private.h\n+++ b/drivers/bus/pci/private.h\n@@ -7,8 +7,10 @@\n \n #include <stdbool.h>\n #include <stdio.h>\n-#include <rte_pci.h>\n+\n #include <rte_bus_pci.h>\n+#include <rte_os_shim.h>\n+#include <rte_pci.h>\n \n extern struct rte_pci_bus rte_pci_bus;\n \ndiff --git a/drivers/bus/vdev/vdev_private.h b/drivers/bus/vdev/vdev_private.h\nindex ba6dc48ff3..e683f5f133 100644\n--- a/drivers/bus/vdev/vdev_private.h\n+++ b/drivers/bus/vdev/vdev_private.h\n@@ -5,6 +5,8 @@\n #ifndef _VDEV_PRIVATE_H_\n #define _VDEV_PRIVATE_H_\n \n+#include <rte_os_shim.h>\n+\n #ifdef __cplusplus\n extern \"C\" {\n #endif\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex 327374fdcf..f3c6beb23b 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -14,6 +14,7 @@\n #include <rte_kvargs.h>\n #include <rte_devargs.h>\n #include <rte_bitops.h>\n+#include <rte_os_shim.h>\n \n #include \"mlx5_prm.h\"\n #include \"mlx5_devx_cmds.h\"\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex c03e4a0a4b..ea5d384283 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -27,6 +27,7 @@\n #include <rte_tailq.h>\n #include <rte_hash_crc.h>\n #include <rte_bitmap.h>\n+#include <rte_os_shim.h>\n \n #include \"i40e_logs.h\"\n #include \"base/i40e_prototype.h\"\ndiff --git a/examples/service_cores/main.c b/examples/service_cores/main.c\nindex c7c792810d..0b3d8c8073 100644\n--- a/examples/service_cores/main.c\n+++ b/examples/service_cores/main.c\n@@ -209,10 +209,10 @@ main(int argc, char **argv)\n \t\tapply_profile(i);\n \t\tprintf(\"\\n==> Profile: %s\\n\\n\", profiles[i].name);\n \n-\t\tsleep(1);\n+\t\trte_delay_us_sleep(1 * US_PER_S);\n \t\trte_service_dump(stdout, UINT32_MAX);\n \n-\t\tsleep(5);\n+\t\trte_delay_us_sleep(5 * US_PER_S);\n \t\trte_service_dump(stdout, UINT32_MAX);\n \n \t\ti++;\ndiff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c\nindex 79ea5f98c8..49770869bb 100644\n--- a/lib/librte_cmdline/cmdline.c\n+++ b/lib/librte_cmdline/cmdline.c\n@@ -18,10 +18,6 @@\n \n #include \"cmdline_private.h\"\n \n-#ifdef RTE_EXEC_ENV_WINDOWS\n-#define write _write\n-#endif\n-\n static void\n cmdline_valid_buffer(struct rdline *rdl, const char *buf,\n \t\t     __rte_unused unsigned int size)\ndiff --git a/lib/librte_cmdline/cmdline_os_windows.c b/lib/librte_cmdline/cmdline_os_windows.c\nindex e9585c9eea..73ed9ba290 100644\n--- a/lib/librte_cmdline/cmdline_os_windows.c\n+++ b/lib/librte_cmdline/cmdline_os_windows.c\n@@ -4,8 +4,6 @@\n \n #include <io.h>\n \n-#include <rte_os.h>\n-\n #include \"cmdline_private.h\"\n \n /* Missing from some MinGW-w64 distributions. */\ndiff --git a/lib/librte_cmdline/cmdline_private.h b/lib/librte_cmdline/cmdline_private.h\nindex a8a6ee9e69..a87c45275c 100644\n--- a/lib/librte_cmdline/cmdline_private.h\n+++ b/lib/librte_cmdline/cmdline_private.h\n@@ -8,6 +8,7 @@\n #include <stdarg.h>\n \n #include <rte_common.h>\n+#include <rte_os_shim.h>\n #ifdef RTE_EXEC_ENV_WINDOWS\n #include <rte_windows.h>\n #endif\ndiff --git a/lib/librte_cmdline/cmdline_socket.c b/lib/librte_cmdline/cmdline_socket.c\nindex 0fe1497008..998e8ade25 100644\n--- a/lib/librte_cmdline/cmdline_socket.c\n+++ b/lib/librte_cmdline/cmdline_socket.c\n@@ -16,10 +16,6 @@\n #include \"cmdline_private.h\"\n #include \"cmdline_socket.h\"\n \n-#ifdef RTE_EXEC_ENV_WINDOWS\n-#define open _open\n-#endif\n-\n struct cmdline *\n cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path)\n {\ndiff --git a/lib/librte_eal/common/eal_common_config.c b/lib/librte_eal/common/eal_common_config.c\nindex 56d09dda7f..1c4c4dd585 100644\n--- a/lib/librte_eal/common/eal_common_config.c\n+++ b/lib/librte_eal/common/eal_common_config.c\n@@ -3,7 +3,6 @@\n  */\n #include <string.h>\n \n-#include <rte_os.h>\n #include <rte_string_fns.h>\n \n #include \"eal_private.h\"\ndiff --git a/lib/librte_eal/common/eal_common_errno.c b/lib/librte_eal/common/eal_common_errno.c\nindex 2a10fb823f..f86802705a 100644\n--- a/lib/librte_eal/common/eal_common_errno.c\n+++ b/lib/librte_eal/common/eal_common_errno.c\n@@ -15,6 +15,10 @@\n #include <rte_errno.h>\n #include <rte_string_fns.h>\n \n+#ifdef RTE_EXEC_ENV_WINDOWS\n+#define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)\n+#endif\n+\n RTE_DEFINE_PER_LCORE(int, _rte_errno);\n \n const char *\ndiff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c\nindex bed83a402a..cedf9f0894 100644\n--- a/lib/librte_eal/common/eal_common_log.c\n+++ b/lib/librte_eal/common/eal_common_log.c\n@@ -13,6 +13,7 @@\n \n #include <rte_eal.h>\n #include <rte_log.h>\n+#include <rte_os_shim.h>\n #include <rte_per_lcore.h>\n \n #include \"eal_log.h\"\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 2951b1aca2..66f9114715 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -1959,7 +1959,7 @@ eal_check_common_options(struct internal_config *internal_cfg)\n \t\tRTE_LOG(ERR, EAL, \"Invalid length of --\" OPT_MBUF_POOL_OPS_NAME\" option\\n\");\n \t\treturn -1;\n \t}\n-\tif (index(eal_get_hugefile_prefix(), '%') != NULL) {\n+\tif (strchr(eal_get_hugefile_prefix(), '%') != NULL) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid char, '%%', in --\"OPT_FILE_PREFIX\" \"\n \t\t\t\"option\\n\");\n \t\treturn -1;\ndiff --git a/lib/librte_eal/common/eal_common_timer.c b/lib/librte_eal/common/eal_common_timer.c\nindex 71e0bd035a..86f8429847 100644\n--- a/lib/librte_eal/common/eal_common_timer.c\n+++ b/lib/librte_eal/common/eal_common_timer.c\n@@ -47,9 +47,9 @@ estimate_tsc_freq(void)\n #define CYC_PER_10MHZ 1E7\n \tRTE_LOG(WARNING, EAL, \"WARNING: TSC frequency estimated roughly\"\n \t\t\" - clock timings may be less accurate.\\n\");\n-\t/* assume that the sleep(1) will sleep for 1 second */\n+\t/* assume that the rte_delay_us_sleep() will sleep for 1 second */\n \tuint64_t start = rte_rdtsc();\n-\tsleep(1);\n+\trte_delay_us_sleep(US_PER_S);\n \t/* Round up to 10Mhz. 1E7 ~ 10Mhz */\n \treturn RTE_ALIGN_MUL_NEAR(rte_rdtsc() - start, CYC_PER_10MHZ);\n }\ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h\nindex 51dbe86e2b..d6c0470eb8 100644\n--- a/lib/librte_eal/common/eal_internal_cfg.h\n+++ b/lib/librte_eal/common/eal_internal_cfg.h\n@@ -11,6 +11,7 @@\n #define EAL_INTERNAL_CFG_H\n \n #include <rte_eal.h>\n+#include <rte_os_shim.h>\n #include <rte_pci_dev_feature_defs.h>\n \n #include \"eal_thread.h\"\ndiff --git a/lib/librte_eal/freebsd/include/rte_os_shim.h b/lib/librte_eal/freebsd/include/rte_os_shim.h\nnew file mode 100644\nindex 0000000000..1e85229ca9\n--- /dev/null\n+++ b/lib/librte_eal/freebsd/include/rte_os_shim.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_SHIM_\n+#define _RTE_OS_SHIM_\n+\n+#include <rte_os.h>\n+\n+/**\n+ * @file\n+ * @internal\n+ * Provides semi-standard OS facilities by convenient names.\n+ */\n+\n+#endif /* _RTE_OS_SHIM_ */\ndiff --git a/lib/librte_eal/linux/include/rte_os_shim.h b/lib/librte_eal/linux/include/rte_os_shim.h\nnew file mode 100644\nindex 0000000000..1e85229ca9\n--- /dev/null\n+++ b/lib/librte_eal/linux/include/rte_os_shim.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_SHIM_\n+#define _RTE_OS_SHIM_\n+\n+#include <rte_os.h>\n+\n+/**\n+ * @file\n+ * @internal\n+ * Provides semi-standard OS facilities by convenient names.\n+ */\n+\n+#endif /* _RTE_OS_SHIM_ */\ndiff --git a/lib/librte_eal/windows/eal_hugepages.c b/lib/librte_eal/windows/eal_hugepages.c\nindex 83a3d0ffc6..b007dceb39 100644\n--- a/lib/librte_eal/windows/eal_hugepages.c\n+++ b/lib/librte_eal/windows/eal_hugepages.c\n@@ -6,7 +6,6 @@\n #include <rte_log.h>\n #include <rte_memory.h>\n #include <rte_memzone.h>\n-#include <rte_os.h>\n \n #include \"eal_private.h\"\n #include \"eal_filesystem.h\"\ndiff --git a/lib/librte_eal/windows/eal_lcore.c b/lib/librte_eal/windows/eal_lcore.c\nindex a85149be95..476c2d2bdf 100644\n--- a/lib/librte_eal/windows/eal_lcore.c\n+++ b/lib/librte_eal/windows/eal_lcore.c\n@@ -9,7 +9,6 @@\n #include <rte_common.h>\n #include <rte_debug.h>\n #include <rte_lcore.h>\n-#include <rte_os.h>\n \n #include \"eal_private.h\"\n #include \"eal_thread.h\"\ndiff --git a/lib/librte_eal/windows/eal_memalloc.c b/lib/librte_eal/windows/eal_memalloc.c\nindex 85a9712cea..4459d59b1a 100644\n--- a/lib/librte_eal/windows/eal_memalloc.c\n+++ b/lib/librte_eal/windows/eal_memalloc.c\n@@ -3,7 +3,6 @@\n  */\n \n #include <rte_errno.h>\n-#include <rte_os.h>\n \n #include \"eal_internal_cfg.h\"\n #include \"eal_memalloc.h\"\ndiff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h\nindex 1afe49f35e..66c711d458 100644\n--- a/lib/librte_eal/windows/include/rte_os.h\n+++ b/lib/librte_eal/windows/include/rte_os.h\n@@ -18,72 +18,18 @@\n extern \"C\" {\n #endif\n \n-/* limits.h replacement, value as in <windows.h> */\n-#ifndef PATH_MAX\n-#define PATH_MAX _MAX_PATH\n-#endif\n-\n-#ifndef sleep\n-#define sleep(x) Sleep(1000 * (x))\n-#endif\n-\n-#ifndef strerror_r\n-#define strerror_r(a, b, c) strerror_s(b, c, a)\n-#endif\n-\n-#ifndef strdup\n-/* strdup is deprecated in Microsoft libc and _strdup is preferred */\n-#define strdup(str) _strdup(str)\n-#endif\n-\n-#ifndef strtok_r\n-#define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)\n-#endif\n-\n-#ifndef index\n-#define index(a, b)     strchr(a, b)\n-#endif\n-\n-#ifndef rindex\n-#define rindex(a, b)    strrchr(a, b)\n-#endif\n-\n-#ifndef strncasecmp\n-#define strncasecmp(s1, s2, count)        _strnicmp(s1, s2, count)\n-#endif\n-\n-#ifndef close\n-#define close _close\n-#endif\n-\n-#ifndef unlink\n-#define unlink _unlink\n-#endif\n-\n /* cpu_set macros implementation */\n #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)\n #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)\n #define RTE_CPU_FILL(set) CPU_FILL(set)\n #define RTE_CPU_NOT(dst, src) CPU_NOT(dst, src)\n \n-/* as in <windows.h> */\n+/* This is an exception without \"rte_\" prefix, because Windows does have\n+ * ssize_t, but it's defined in <windows.h> which we avoid to expose.\n+ * If ssize_t is defined in user code, it necessarily has the same type.\n+ */\n typedef long long ssize_t;\n \n-#ifndef RTE_TOOLCHAIN_GCC\n-static inline const char *\n-eal_strerror(int code)\n-{\n-\tstatic char buffer[128];\n-\n-\tstrerror_s(buffer, sizeof(buffer), code);\n-\treturn buffer;\n-}\n-\n-#ifndef strerror\n-#define strerror eal_strerror\n-#endif\n-#endif /* RTE_TOOLCHAIN_GCC */\n-\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/windows/include/rte_os_shim.h b/lib/librte_eal/windows/include/rte_os_shim.h\nnew file mode 100644\nindex 0000000000..edd9a1082c\n--- /dev/null\n+++ b/lib/librte_eal/windows/include/rte_os_shim.h\n@@ -0,0 +1,28 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_SHIM_\n+#define _RTE_OS_SHIM_\n+\n+#include <rte_os.h>\n+\n+/**\n+ * @file\n+ * @internal\n+ * Provides semi-standard OS facilities by convenient names.\n+ */\n+\n+#ifndef PATH_MAX\n+#define PATH_MAX _MAX_PATH\n+#endif\n+\n+#define strdup(str) _strdup(str)\n+#define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)\n+#define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)\n+\n+#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)\n+#define read(fd, buf, n) _read(fd, buf, n)\n+#define write(fd, buf, n) _write(fd, buf, n)\n+#define close(fd) _close(fd)\n+#define unlink(path) _unlink(path)\n+\n+#endif /* _RTE_OS_SHIM_ */\ndiff --git a/lib/librte_ethdev/ethdev_private.h b/lib/librte_ethdev/ethdev_private.h\nindex 220ddd4408..9bb0879538 100644\n--- a/lib/librte_ethdev/ethdev_private.h\n+++ b/lib/librte_ethdev/ethdev_private.h\n@@ -5,6 +5,8 @@\n #ifndef _ETH_PRIVATE_H_\n #define _ETH_PRIVATE_H_\n \n+#include <rte_os_shim.h>\n+\n #include \"rte_ethdev.h\"\n \n #ifdef __cplusplus\ndiff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c\nindex 4cce8e953b..38e9d5c1ca 100644\n--- a/lib/librte_kvargs/rte_kvargs.c\n+++ b/lib/librte_kvargs/rte_kvargs.c\n@@ -7,6 +7,7 @@\n #include <stdlib.h>\n #include <stdbool.h>\n \n+#include <rte_os_shim.h>\n #include <rte_string_fns.h>\n \n #include \"rte_kvargs.h\"\n",
    "prefixes": [
        "v10",
        "2/4"
    ]
}