get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44567,
    "url": "http://patchwork.dpdk.org/api/patches/44567/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180911100419.19168-1-gaetan.rivet@6wind.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20180911100419.19168-1-gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180911100419.19168-1-gaetan.rivet@6wind.com",
    "date": "2018-09-11T10:04:19",
    "name": "[v1] eal: add strscpy function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0de1ddb8cfd4306c146f14a9c60e3498f3a648d7",
    "submitter": {
        "id": 269,
        "url": "http://patchwork.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180911100419.19168-1-gaetan.rivet@6wind.com/mbox/",
    "series": [
        {
            "id": 1265,
            "url": "http://patchwork.dpdk.org/api/series/1265/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1265",
            "date": "2018-09-11T10:04:19",
            "name": "[v1] eal: add strscpy function",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/1265/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/44567/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/44567/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 808694CA1;\n\tTue, 11 Sep 2018 12:04:45 +0200 (CEST)",
            "from mail-wr1-f68.google.com (mail-wr1-f68.google.com\n\t[209.85.221.68]) by dpdk.org (Postfix) with ESMTP id A422F4C92\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 12:04:43 +0200 (CEST)",
            "by mail-wr1-f68.google.com with SMTP id z96-v6so25248422wrb.8\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 03:04:43 -0700 (PDT)",
            "from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\to19-v6sm18382754wro.50.2018.09.11.03.04.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 11 Sep 2018 03:04:41 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=r6cSlciV+XLM+ZvFngG/pNrKGupin5mnrjix92JU+Jc=;\n\tb=iJeog5qCGqNL7EXoKnkvM3VYQmm1m81diJBYd/c2WSD+y4VgzMC7qSx6TIW0WCooaa\n\ttuhNgzZl8pKaquZmEnYcJCjrnDM8IB0of4JdceN+bbqQph91kZeZMURk9oRTv/aMVX3M\n\tWOWyXjk8vxYzQraT6N26rFbPOIq7VoNN6L+eQVdCNfDE3EeyTtSVOt/4R/uDjVNunMa2\n\t/z49E8Tw6xImohWRHh1yTNxONW+92KDfRzYDIGH1fbsxb28aYy3WGrNMjTpRJNueZD74\n\tB0Jukq8Cs9MYhXSxJGC9KnO71hDC6wMRPiCvCVQxQj6RogOSKUMidnQNQbZ9faPZFHpZ\n\txJ+Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=r6cSlciV+XLM+ZvFngG/pNrKGupin5mnrjix92JU+Jc=;\n\tb=a7QB+bilHr/dopdg9dfBrIiRbGuxOjR5ICh5XHpOetxgDtZU9w43fbVXec7ZHm6h/r\n\tV8DJ5ueJmnKJ/QCBemQn6OISNypwfLKlls4Eda+SnzEc1WBQGUBzosskwaRyX6W4u7xz\n\tlKabR2pQ76xz0Hn2uvXvQiaj3i1dJ06QRZGk9GhjEwkOj15Q+X26vcdgxMcrJ7qpPuE3\n\t36Ic0SqWT8kQdzyLpn9KGNGaVFMsiXUA6sZzqWNo1WcLCcTe7ySm8UkpBAFEr6uattPB\n\tGiUw3WRcD+EsF2LKC9C45d5J75y2w/pk9czL3z6s1D4GcSeDhGHGLOPP9LnV5OR1TxmU\n\ts+Jw==",
        "X-Gm-Message-State": "APzg51BdXK/7etMswjub1wtL3s1EoPCpUAZQPWACeJEv8CJlLhY01itL\n\t9b24f+YJqOJ1zOVK3glBnxGTH7IYG08=",
        "X-Google-Smtp-Source": "ANB0VdbcrcWiMurg1QkJDotqwM0EDkjtoWo74k2xq3p+567bH3s7GilDmoU3azZFlV+gC82PgGiDdA==",
        "X-Received": "by 2002:a5d:5685:: with SMTP id\n\tf5-v6mr19206548wrv.58.1536660282749; \n\tTue, 11 Sep 2018 03:04:42 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Tue, 11 Sep 2018 12:04:19 +0200",
        "Message-Id": "<20180911100419.19168-1-gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<VI1PR0402MB2925B3472641560C112F05CF9D040@VI1PR0402MB2925.eurprd04.prod.outlook.com>",
        "References": "<VI1PR0402MB2925B3472641560C112F05CF9D040@VI1PR0402MB2925.eurprd04.prod.outlook.com>",
        "Subject": "[dpdk-dev] [PATCH v1] eal: add strscpy function",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The strncpy function has long been deemed unsafe for use,\nin favor of strlcpy or snprintf.\n\nWhile snprintf is standard and strlcpy is still largely available,\nthey both have issues regarding error checking and performance.\n\nBoth will force reading the source buffer past the requested size\nif the input is not a proper c-string, and will return the expected\nnumber of bytes copied, meaning that error checking needs to verify\nthat the number of bytes copied is not superior to the destination\nsize.\n\nThis contributes to awkward code flow, unclear error checking and\npotential issues with malformed input.\n\nThe function strscpy has been discussed for some time already and\nhas been made available in the linux kernel[1].\n\nPropose this new function as a safe alternative.\n\n[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=30c44659f4a3e7e1f9f47e895591b4b40bf62671\n\nSigned-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n\nI agree with the original email, here is a proposed implementation.\nI have added the function as part of 18.11 API proper, because this API\nis definitely not meant to change.\n\nThis is not meant to be enforced on existing code, or even on new code.\nBut I think it is better to have it available.\n\n lib/librte_eal/common/eal_common_string_fns.c | 30 +++++++++++++++++++\n .../common/include/rte_string_fns.h           | 23 ++++++++++++++\n lib/librte_eal/rte_eal_version.map            |  7 +++++\n 3 files changed, 60 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_string_fns.c b/lib/librte_eal/common/eal_common_string_fns.c\nindex 6ac5f8289..8a34d2422 100644\n--- a/lib/librte_eal/common/eal_common_string_fns.c\n+++ b/lib/librte_eal/common/eal_common_string_fns.c\n@@ -38,3 +38,33 @@ rte_strsplit(char *string, int stringlen,\n \terrno = EINVAL;\n \treturn -1;\n }\n+\n+/* Copy src string into dst.\n+ *\n+ * Return negative value and NUL-terminate if dst is too short,\n+ * Otherwise return number of bytes copied.\n+ */\n+ssize_t\n+strscpy(char *dst, const char *src, size_t dsize)\n+{\n+\tconst char *osrc = src;\n+\tsize_t nleft = dsize;\n+\n+\t/* Copy as many bytes as will fit. */\n+\tif (nleft != 0) {\n+\t\twhile (--nleft != 0) {\n+\t\t\tif ((*dst++ = *src++) == '\\0')\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\t/* Not enough room in dst, add NUL and return error. */\n+\tif (nleft == 0) {\n+\t\tif (dsize != 0)\n+\t\t\t*dst = '\\0';\n+\t\treturn -E2BIG;\n+\t}\n+\n+\t/* count does not include NUL */\n+\treturn (src - osrc - 1);\n+}\ndiff --git a/lib/librte_eal/common/include/rte_string_fns.h b/lib/librte_eal/common/include/rte_string_fns.h\nindex 97597a148..46dd919b4 100644\n--- a/lib/librte_eal/common/include/rte_string_fns.h\n+++ b/lib/librte_eal/common/include/rte_string_fns.h\n@@ -76,6 +76,29 @@ rte_strlcpy(char *dst, const char *src, size_t size)\n #endif /* RTE_USE_LIBBSD */\n #endif /* BSDAPP */\n \n+/**\n+ * Copy string src to buffer dst of size dsize.\n+ * At most dsize-1 chars will be copied.\n+ * Always NUL-terminates, unless (dsize == 0).\n+ * Returns number of bytes copied (terminating NUL-byte excluded) on success.\n+ * Negative errno on error.\n+ *\n+ * @param dst\n+ *   The destination string.\n+ *\n+ * @param src\n+ *   The input string to be copied.\n+ *\n+ * @param dsize\n+ *   Length in bytes of the destination buffer.\n+ *\n+ * @return\n+ *   The number of bytes copied on success\n+ *   -E2BIG if the destination buffer is too small.\n+ */\n+ssize_t\n+strscpy(char *dst, const char *src, size_t dsize);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 344a43d32..fc7b50669 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -262,6 +262,13 @@ DPDK_18.08 {\n \n } DPDK_18.05;\n \n+DPDK_18.11 {\n+\tglobal:\n+\n+\tstrscpy;\n+\n+} DPDK_18.08;\n+\n EXPERIMENTAL {\n \tglobal:\n \n",
    "prefixes": [
        "v1"
    ]
}