get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88042,
    "url": "https://patches.dpdk.org/api/patches/88042/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210220232910.772-5-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": "<20210220232910.772-5-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210220232910.772-5-dmitry.kozliuk@gmail.com",
    "date": "2021-02-20T23:29:07",
    "name": "[4/7] eal: add asprintf() internal wrapper",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "04d232d42574f7815fc799db89ce07e1aad7c53a",
    "submitter": {
        "id": 1581,
        "url": "https://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210220232910.772-5-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 15317,
            "url": "https://patches.dpdk.org/api/series/15317/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15317",
            "date": "2021-02-20T23:29:03",
            "name": "eal/windows: do not expose POSIX symbols",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15317/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/88042/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/88042/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 DF618A0524;\n\tSun, 21 Feb 2021 00:29:49 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CF1D422A26C;\n\tSun, 21 Feb 2021 00:29:26 +0100 (CET)",
            "from mail-lj1-f174.google.com (mail-lj1-f174.google.com\n [209.85.208.174])\n by mails.dpdk.org (Postfix) with ESMTP id 13CDA22A25C\n for <dev@dpdk.org>; Sun, 21 Feb 2021 00:29:23 +0100 (CET)",
            "by mail-lj1-f174.google.com with SMTP id e17so44069613ljl.8\n for <dev@dpdk.org>; Sat, 20 Feb 2021 15:29:23 -0800 (PST)",
            "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 f5sm1462931ljc.8.2021.02.20.15.29.21\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 20 Feb 2021 15:29:22 -0800 (PST)"
        ],
        "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=q+E/j9rsoTh5jsrgzXTnX1xc/HqsqwkQuhT6CzsAzWE=;\n b=NvXCyvg2tLaLzxJLuliqwA9sRgfnw8dlXy26ZYwjGK/AUDNpOURlzt78l1fquyxEQE\n 4YEcLyfsKkpm6yxi8JBlDBM8gEJGDFtIUMWl8EkIbzeVhrkj5b5qG8Kw+4a5RRUw/bor\n NdQZ0sRTcA3ySChvXXcepjHqY8dtzrXOd4TfacmDjaOdhk/sFT0xce5F6EpT/U1EoxUH\n 7EBdcQSFihJ0wyJn33G4vZa1Ykrj66p/BtfQ2QGx0CqTrcn2YEk9qDH7tSJFFCEERyBK\n 6jwPTyMsOedY1Ej1N/T5i0Ga6Xhx4J0d+g2+NnyEEz3EOdDNQFtRA+k5O1Gy7ec/M7Bl\n NkhA==",
        "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=q+E/j9rsoTh5jsrgzXTnX1xc/HqsqwkQuhT6CzsAzWE=;\n b=TPrHC1LTxtePWVYXujaWEl1ZUfqSWHhc1EXG/DVprtwLWEmVwN9ywdRWKvky5z+Ql2\n gj3VdHNHmeCOeZj4TVq+qk4D4pAdcSF54BPpwV4UVWMHDXnYBA+y2IjY8qrEU6RXW9xg\n uucHCaoYy5yxHybzFCZqszU3oC8xcg69Wp9AyaDIoyve/3XlE/auXlLrLlzO16fIdlyR\n 7Y1wRDty+vjE6S2/zxgJPvdYgv5j75SQXHsvriBtZiNQs/IaLLJIGZGlJrEFbC0Sx4CS\n zn2K0SX77wy6GsT7vzwZ/c5ahNIGwZzeSJug8/A4+LHciitDJQOOow0AaDJ36EuDac84\n tRyw==",
        "X-Gm-Message-State": "AOAM530gLohaDE7uyxzzGzlJ8kSE0RrXVCPUVbDdlKHQ1OtzUD2wLvSb\n 9G++M8mnWscmeAY/W5EEawXmqt3lhdqhlw==",
        "X-Google-Smtp-Source": "\n ABdhPJzqkHiGt30I0rujDpX0H3Ckqevw8wUknlriS91nD2wnzHVPHyNtuK0esclkknakhIZOtfdDSA==",
        "X-Received": "by 2002:a05:651c:101:: with SMTP id\n a1mr6264345ljb.363.1613863762365;\n Sat, 20 Feb 2021 15:29:22 -0800 (PST)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Tyler Retzlaff <roretzla@microsoft.com>,\n Nick Connolly <nick.connolly@mayadata.io>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Jerin Jacob <jerinj@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>",
        "Date": "Sun, 21 Feb 2021 02:29:07 +0300",
        "Message-Id": "<20210220232910.772-5-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20210220232910.772-1-dmitry.kozliuk@gmail.com>",
        "References": "<20210220232910.772-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 4/7] eal: add asprintf() internal wrapper",
        "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": "POSIX asprintf() is unavailable on Windows.\nAdd eal_asprintf() wrapper for EAL internal use.\nOn Windows it's a function, on Unix it's a macro for asprintf().\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n---\n lib/librte_eal/common/eal_common_lcore.c      |  2 +-\n lib/librte_eal/common/eal_common_options.c    |  8 ++---\n lib/librte_eal/common/eal_common_trace.c      |  2 +-\n lib/librte_eal/common/eal_common_trace_ctf.c  |  2 +-\n .../common/eal_common_trace_utils.c           |  2 +-\n lib/librte_eal/common/eal_private.h           | 18 +++++++++++\n lib/librte_eal/windows/eal.c                  | 30 +++++++++++++++++++\n 7 files changed, 56 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 66d6bad1a..db16a34cc 100644\n--- a/lib/librte_eal/common/eal_common_lcore.c\n+++ b/lib/librte_eal/common/eal_common_lcore.c\n@@ -282,7 +282,7 @@ rte_lcore_callback_register(const char *name, rte_lcore_init_cb init,\n \tcallback = calloc(1, sizeof(*callback));\n \tif (callback == NULL)\n \t\treturn NULL;\n-\tif (asprintf(&callback->name, \"%s-%p\", name, arg) == -1) {\n+\tif (eal_asprintf(&callback->name, \"%s-%p\", name, arg) == -1) {\n \t\tfree(callback);\n \t\treturn NULL;\n \t}\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex bad389903..275f879d7 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -1435,7 +1435,7 @@ available_cores(void)\n \t\treturn NULL;\n \n \t/* first sequence */\n-\tif (asprintf(&str, \"%d\", idx) < 0)\n+\tif (eal_asprintf(&str, \"%d\", idx) < 0)\n \t\treturn NULL;\n \tprevious = idx;\n \tsequence = 0;\n@@ -1452,7 +1452,7 @@ available_cores(void)\n \n \t\t/* finish current sequence */\n \t\tif (sequence) {\n-\t\t\tif (asprintf(&tmp, \"%s-%d\", str, previous) < 0) {\n+\t\t\tif (eal_asprintf(&tmp, \"%s-%d\", str, previous) < 0) {\n \t\t\t\tfree(str);\n \t\t\t\treturn NULL;\n \t\t\t}\n@@ -1461,7 +1461,7 @@ available_cores(void)\n \t\t}\n \n \t\t/* new sequence */\n-\t\tif (asprintf(&tmp, \"%s,%d\", str, idx) < 0) {\n+\t\tif (eal_asprintf(&tmp, \"%s,%d\", str, idx) < 0) {\n \t\t\tfree(str);\n \t\t\treturn NULL;\n \t\t}\n@@ -1473,7 +1473,7 @@ available_cores(void)\n \n \t/* finish last sequence */\n \tif (sequence) {\n-\t\tif (asprintf(&tmp, \"%s-%d\", str, previous) < 0) {\n+\t\tif (eal_asprintf(&tmp, \"%s-%d\", str, previous) < 0) {\n \t\t\tfree(str);\n \t\t\treturn NULL;\n \t\t}\ndiff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c\nindex 24e27387b..d57bb8ecc 100644\n--- a/lib/librte_eal/common/eal_common_trace.c\n+++ b/lib/librte_eal/common/eal_common_trace.c\n@@ -435,7 +435,7 @@ __rte_trace_point_emit_field(size_t sz, const char *in, const char *datatype)\n \tfixup = trace_metadata_fixup_field(in);\n \tif (fixup != NULL)\n \t\tin = fixup;\n-\trc = asprintf(&field, \"%s        %s %s;\\n\",\n+\trc = eal_asprintf(&field, \"%s        %s %s;\\n\",\n \t\tRTE_PER_LCORE(ctf_field) != NULL ?\n \t\t\tRTE_PER_LCORE(ctf_field) : \"\",\n \t\tdatatype, in);\ndiff --git a/lib/librte_eal/common/eal_common_trace_ctf.c b/lib/librte_eal/common/eal_common_trace_ctf.c\nindex 4041d9af6..31df7262e 100644\n--- a/lib/librte_eal/common/eal_common_trace_ctf.c\n+++ b/lib/librte_eal/common/eal_common_trace_ctf.c\n@@ -389,7 +389,7 @@ char *trace_metadata_fixup_field(const char *field)\n \tfor (i = 0; i < RTE_DIM(ctf_reserved_words); i++) {\n \t\tif (strcmp(field, ctf_reserved_words[i]) != 0)\n \t\t\tcontinue;\n-\t\tif (asprintf(&out, \"_%s\", ctf_reserved_words[i]) == -1)\n+\t\tif (eal_asprintf(&out, \"_%s\", ctf_reserved_words[i]) == -1)\n \t\t\tout = NULL;\n \t\treturn out;\n \t}\ndiff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_eal/common/eal_common_trace_utils.c\nindex 6b81fdeec..1773140ac 100644\n--- a/lib/librte_eal/common/eal_common_trace_utils.c\n+++ b/lib/librte_eal/common/eal_common_trace_utils.c\n@@ -253,7 +253,7 @@ eal_trace_dir_args_save(char const *val)\n \t\treturn -ENAMETOOLONG;\n \t}\n \n-\tif (asprintf(&dir_path, \"%s/\", val) == -1) {\n+\tif (eal_asprintf(&dir_path, \"%s/\", val) == -1) {\n \t\ttrace_err(\"failed to copy directory: %s\", strerror(errno));\n \t\treturn -ENOMEM;\n \t}\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex 4684c4c7d..a5d9c5123 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -738,4 +738,22 @@ void __rte_thread_init(unsigned int lcore_id, rte_cpuset_t *cpuset);\n  */\n void __rte_thread_uninit(void);\n \n+/**\n+ * Allocate a buffer large enough to hold the formatted string\n+ * and perform formatting, equivalent to Unix asprintf(3).\n+ *\n+ * @param buffer\n+ *  Receives a pointer to allocated memory, call free(buffer) to deallocate.\n+ * @param format\n+ *  Format string.\n+ * @return\n+ *  Number of bytes allocated on success, (-1) on failure.\n+ */\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+__rte_format_printf(2, 3)\n+int eal_asprintf(char **buffer, const char *format, ...);\n+#else\n+#define eal_asprintf asprintf\n+#endif\n+\n #endif /* _EAL_PRIVATE_H_ */\ndiff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c\nindex 1e5f6576f..47495b36a 100644\n--- a/lib/librte_eal/windows/eal.c\n+++ b/lib/librte_eal/windows/eal.c\n@@ -2,6 +2,8 @@\n  * Copyright(c) 2019 Intel Corporation\n  */\n \n+#include <stdarg.h>\n+\n #include <fcntl.h>\n #include <io.h>\n #include <share.h>\n@@ -410,6 +412,34 @@ rte_eal_init(int argc, char **argv)\n \treturn fctret;\n }\n \n+/* Don't use MinGW asprintf() to have identical code with all toolchains. */\n+int\n+eal_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 = 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 int\n rte_vfio_container_dma_map(__rte_unused int container_fd,\n \t\t\t__rte_unused uint64_t vaddr,\n",
    "prefixes": [
        "4/7"
    ]
}