get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 89595,
    "url": "https://patches.dpdk.org/api/patches/89595/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210320130525.16452-4-dmitry.kozliuk@gmail.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210320130525.16452-4-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210320130525.16452-4-dmitry.kozliuk@gmail.com",
    "date": "2021-03-20T13:05:23",
    "name": "[v6,3/5] eal: make OS shims internal",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8b416ea356c09b7f5369a3a784cc7f2a52b4d216",
    "submitter": {
        "id": 1581,
        "url": "https://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210320130525.16452-4-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 15801,
            "url": "https://patches.dpdk.org/api/series/15801/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15801",
            "date": "2021-03-20T13:05:20",
            "name": "eal/windows: do not expose POSIX symbols",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/15801/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/89595/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/89595/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 40DC4A0524;\n\tSat, 20 Mar 2021 14:06:16 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 65C741410B2;\n\tSat, 20 Mar 2021 14:05:58 +0100 (CET)",
            "from mail-lf1-f52.google.com (mail-lf1-f52.google.com\n [209.85.167.52])\n by mails.dpdk.org (Postfix) with ESMTP id 2658B14109F\n for <dev@dpdk.org>; Sat, 20 Mar 2021 14:05:53 +0100 (CET)",
            "by mail-lf1-f52.google.com with SMTP id u10so14236289lff.1\n for <dev@dpdk.org>; Sat, 20 Mar 2021 06:05:53 -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 r66sm929610lff.93.2021.03.20.06.05.49\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 20 Mar 2021 06:05:50 -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=jV4Q84rpa1TkoRk0eFR3wJmzCTuxSpdPkYzC+NaCbYg=;\n b=qvsoVqywKhC1kRHmtH6ayUokOHBDAPYms7f+z7fwSDtHkDzpdzKGxLb/rv/Q6qCxTB\n IvLecRUMpduJtuJfbRQKzrWH5B+/PHK9RyHlW2Gl9L4hlgTSK5XLfnzH2/HiVsyPEWfP\n HNsjWBedTIayIzq00bG9hRAA27fz6oh2UQTax5KqFqp6HFRhjPgdf+72+1ioV/RBJbsM\n 3fjIS0trcNvYKMO8IQZBKXcAEPWPyMca7ctZJnwN88h7nYKAGv+wkjd/oyV9Otvb69T5\n M18BIiNM67l17tyUuVfxIfdT5qFGeD1nGFVTw8Vt3S6SXYioLEOgkPum514x3v9+snoq\n fvgA==",
        "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=jV4Q84rpa1TkoRk0eFR3wJmzCTuxSpdPkYzC+NaCbYg=;\n b=qOimjEG8IJ5PVp4Vb7X1LtLzV4mrFPCGXYaMNbNNsRPP9sXBIW/URwe6laiBOWw04h\n solvh9jryhe5YFHVcNOSoHpka4rDdkK5fOucjKtWYrgLtJcLPI11t4rz1SnPmtk/lp2K\n QzLLzjPIm5cuwkMbKnqoxEBFdTji0IvpSJsNFYLkCbeD+gR00A38wAqH6SaAhR6NLWPU\n Ykkjie9R8bK4TpKNxzijCp1Pu6pZmHT+Ukj/VXtVYkIp4I1Bu4vHyjPSh9sUfhOJn9Ys\n r4P1jnwiUVwJirgQP0/8QUP8LBkkRh3Qk6qW5VPvAxpK8geMvVipQ6ZaDsl0ldDsq3eD\n 3WZQ==",
        "X-Gm-Message-State": "AOAM533sLmQ9ERyGX5msDVTS20HTJRljUc/GL8v/JM5xXo0+LxfviUqa\n UYLUQQMAXj+MQcB6GzG2Us6Z+ia/1Zq3GXUZ",
        "X-Google-Smtp-Source": "\n ABdhPJyIM0W9uU0wOzFN1GdXwYdUqOMEWjtIz3FT1Vq5BpoySCk022ZZUK1emRFTqYAZ4Jb2lAYHhA==",
        "X-Received": "by 2002:a05:6512:3709:: with SMTP id\n z9mr3527189lfr.557.1616245550697;\n Sat, 20 Mar 2021 06:05:50 -0700 (PDT)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Jie Zhou <jizh@linux.microsoft.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, 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 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 Thomas Monjalon <thomas@monjalon.net>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Date": "Sat, 20 Mar 2021 16:05:23 +0300",
        "Message-Id": "<20210320130525.16452-4-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.29.3",
        "In-Reply-To": "<20210320130525.16452-1-dmitry.kozliuk@gmail.com>",
        "References": "<20210320112733.13160-1-dmitry.kozliuk@gmail.com>\n <20210320130525.16452-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 3/5] 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 all shims to <rte_os_internal.h>, a header to be used instead of\n<rte_os.h> by internal code. Include it in libraries and PMDs that\npreviously imported shims from <rte_os.h>.\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\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 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_options.c    |  2 +-\n lib/librte_eal/common/eal_internal_cfg.h      |  1 +\n .../freebsd/include/rte_os_internal.h         | 14 +++\n .../linux/include/rte_os_internal.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       | 92 +------------------\n .../windows/include/rte_os_internal.h         | 28 ++++++\n lib/librte_ethdev/ethdev_private.h            |  2 +\n lib/librte_kvargs/rte_kvargs.c                |  1 +\n 21 files changed, 77 insertions(+), 104 deletions(-)\n create mode 100644 lib/librte_eal/freebsd/include/rte_os_internal.h\n create mode 100644 lib/librte_eal/linux/include/rte_os_internal.h\n create mode 100644 lib/librte_eal/windows/include/rte_os_internal.h",
    "diff": "diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h\nindex f566943f5e..d95e6f71a2 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_internal.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..1a60c1b5d2 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_internal.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 3855582d0d..14b061690f 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_internal.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 d7cd049891..0719504e24 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_internal.h>\n \n #include \"i40e_logs.h\"\n #include \"base/i40e_prototype.h\"\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..ca45db9493 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_internal.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_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 622c7bc429..28da464fc9 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -1936,7 +1936,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_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h\nindex 51dbe86e2b..fc7cb3efaf 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_internal.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_internal.h b/lib/librte_eal/freebsd/include/rte_os_internal.h\nnew file mode 100644\nindex 0000000000..cabe9648fa\n--- /dev/null\n+++ b/lib/librte_eal/freebsd/include/rte_os_internal.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_INTERNAL_H_\n+#define _RTE_OS_INTERNAL_H_\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_INTERNAL_H_ */\ndiff --git a/lib/librte_eal/linux/include/rte_os_internal.h b/lib/librte_eal/linux/include/rte_os_internal.h\nnew file mode 100644\nindex 0000000000..cabe9648fa\n--- /dev/null\n+++ b/lib/librte_eal/linux/include/rte_os_internal.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_INTERNAL_H_\n+#define _RTE_OS_INTERNAL_H_\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_INTERNAL_H_ */\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 7ef38ff06c..8d845c57b7 100644\n--- a/lib/librte_eal/windows/include/rte_os.h\n+++ b/lib/librte_eal/windows/include/rte_os.h\n@@ -11,7 +11,6 @@\n  * Windows OS. It must not include Windows-specific headers.\n  */\n \n-#include <stdarg.h>\n #include <stdio.h>\n #include <stdlib.h>\n #include <string.h>\n@@ -20,101 +19,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-\n-static inline int\n-asprintf(char **buffer, const char *format, ...)\n-{\n-\tint size, ret;\n-\tva_list arg;\n-\n-\tva_start(arg, format);\n-\tsize = vsnprintf(NULL, 0, format, arg);\n-\tva_end(arg);\n-\tif (size < 0)\n-\t\treturn -1;\n-\tsize++;\n-\n-\t*buffer = (char *)malloc(size);\n-\tif (*buffer == NULL)\n-\t\treturn -1;\n-\n-\tva_start(arg, format);\n-\tret = vsnprintf(*buffer, size, format, arg);\n-\tva_end(arg);\n-\tif (ret != size - 1) {\n-\t\tfree(*buffer);\n-\t\treturn -1;\n-\t}\n-\treturn ret;\n-}\n-\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-\n-#endif /* RTE_TOOLCHAIN_GCC */\n-\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/windows/include/rte_os_internal.h b/lib/librte_eal/windows/include/rte_os_internal.h\nnew file mode 100644\nindex 0000000000..84e39eb2ae\n--- /dev/null\n+++ b/lib/librte_eal/windows/include/rte_os_internal.h\n@@ -0,0 +1,28 @@\n+/* SPDX-License-Identifier: BSD-3-Clause */\n+\n+#ifndef _RTE_OS_INTERNAL_H_\n+#define _RTE_OS_INTERNAL_H_\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_INTERNAL_H_ */\ndiff --git a/lib/librte_ethdev/ethdev_private.h b/lib/librte_ethdev/ethdev_private.h\nindex 905a45c337..bd601072fa 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_internal.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 285081c86c..f5221a2f71 100644\n--- a/lib/librte_kvargs/rte_kvargs.c\n+++ b/lib/librte_kvargs/rte_kvargs.c\n@@ -6,6 +6,7 @@\n #include <string.h>\n #include <stdlib.h>\n \n+#include <rte_os_internal.h>\n #include <rte_string_fns.h>\n \n #include \"rte_kvargs.h\"\n",
    "prefixes": [
        "v6",
        "3/5"
    ]
}