get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817380,
    "url": "http://patchwork.ozlabs.org/api/patches/817380/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170922081728.32508-2-mac@mcrowe.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api",
        "name": "GNU Compiler Collection",
        "link_name": "gcc",
        "list_id": "gcc-patches.gcc.gnu.org",
        "list_email": "gcc-patches@gcc.gnu.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170922081728.32508-2-mac@mcrowe.com>",
    "list_archive_url": null,
    "date": "2017-09-22T08:17:25",
    "name": "[RFC,1/4] libstdc++ futex: Use FUTEX_CLOCK_REALTIME for wait",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e676c8bab4aa31a781d9aa8244ebf983656175d4",
    "submitter": {
        "id": 66786,
        "url": "http://patchwork.ozlabs.org/api/people/66786/?format=api",
        "name": "Mike Crowe",
        "email": "mac@mcrowe.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20170922081728.32508-2-mac@mcrowe.com/mbox/",
    "series": [
        {
            "id": 4567,
            "url": "http://patchwork.ozlabs.org/api/series/4567/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=4567",
            "date": "2017-09-22T08:17:24",
            "name": "Make std::future::wait_* use std::chrono::steady_clock when required",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4567/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817380/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817380/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-462756-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "mailing list gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462756-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"RozmB0OE\"; dkim-atps=neutral",
            "sourceware.org; auth=none"
        ],
        "Received": [
            "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz5wl3yxwz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 18:19:03 +1000 (AEST)",
            "(qmail 26160 invoked by alias); 22 Sep 2017 08:18:22 -0000",
            "(qmail 25991 invoked by uid 89); 22 Sep 2017 08:18:22 -0000",
            "from relay101a.appriver.com (HELO relay.appriver.com)\n\t(207.97.230.14) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 22 Sep 2017 08:18:20 +0000",
            "from [213.210.30.29] (HELO elite.brightsign) by relay.appriver.com\n\t(CommuniGate Pro SMTP 6.1.7) with ESMTPS id 201294878;\n\tFri, 22 Sep 2017 04:18:20 -0400",
            "from chuckie.brightsign ([fd44:d8b8:cab5:cb01::19]\n\thelo=chuckie)\tby elite.brightsign with esmtp (Exim\n\t4.89)\t(envelope-from <mcrowe@brightsign.biz>)\tid\n\t1dvJAB-000B0G-BN; Fri, 22 Sep 2017 09:18:19 +0100",
            "from mac by chuckie with local (Exim 4.89)\t(envelope-from\n\t<mcrowe@brightsign.biz>)\tid 1dvJAB-0008Tp-Ao;\n\tFri, 22 Sep 2017 09:18:19 +0100"
        ],
        "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:in-reply-to:references; q=dns; s=\n\tdefault; b=ZzIt9Ym5U4rFpguvZdc8Ygw6cV8NYIdFdhixriQF3dzzpoG6yPlQq\n\t0KrtxWyTAcqTFwYw0GepDf8RiMLOt7gN85UdXCas1awJ3XhEZiMOXBBZLshPVP6q\n\t1vOXjUqw5cXqZAZm4d/+YchhIzwn9HN4GEK20kDJ5Cj9dE7biPPlHI=",
        "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:in-reply-to:references; s=\n\tdefault; bh=J+d6cyc30M4SkCZA31x+0Wy78rk=; b=RozmB0OE05bRLhBLNkhg\n\tnZr/K8RaEpp+UL3JcrS2c8U25eCC310/9sKmwExIjiWgGxz490P9CIQunjyTsqk5\n\tMCtInja7FhoG/9JkJKz6bvaYAa6c+7cFNX/xzj9saGI8hNXcTgZbgOrMz23gVYQG\n\t9mM0U6XKQOL3Y49/4f5tCjo=",
        "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm",
        "Precedence": "bulk",
        "List-Id": "<gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>",
        "Sender": "gcc-patches-owner@gcc.gnu.org",
        "X-Virus-Found": "No",
        "X-Spam-SWARE-Status": "No, score=-26.6 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tKAM_LAZY_DOMAIN_SECURITY,\n\tRCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=expire",
        "X-Spam-User": "qpsmtpd, 2 recipients",
        "X-HELO": "relay.appriver.com",
        "X-Note": [
            "This Email was scanned by AppRiver SecureTide",
            "SecureTide Build: 7/20/2017 1:24:22 PM UTC (2.6.20.0)",
            "Filtered by 10.238.11.161",
            "ICH-CT/SI:0-1052/SG:1 9/22/2017 4:17:36 AM",
            "TCH-CT/SI:0-23/SG:1 9/22/2017 4:17:36 AM",
            "Spam Tests Failed:",
            "User Rule Hits:",
            "Global Rule Hits: G281 G282 G283 G284 G288 G289 G418",
            "Encrypt Rule Hits:",
            "Mail Class: VALID",
            "Headers Injected"
        ],
        "X-Note-AR-ScanTimeLocal": "09/22/2017 4:18:20 AM",
        "X-Policy": [
            "brightsign.biz  - brightsign.biz",
            "brightsign.biz  - brightsign.biz",
            "brightsign.biz  - brightsign.biz"
        ],
        "X-Primary": "mcrowe@brightsign.biz",
        "X-Virus-Scan": "V-",
        "X-Note-SnifferID": "0",
        "X-GBUdb-Analysis": "0, 213.210.30.29, Ugly c=0.52985 p=-0.883041 Source Normal",
        "X-Signature-Violations": "0-0-0-4767-c",
        "X-Country-Path": "->->United Kingdom->United States",
        "X-Note-Sending-IP": "213.210.30.29",
        "X-Note-Reverse-DNS": "elite.brightsigndigital.co.uk",
        "X-Note-Return-Path": "mcrowe@brightsign.biz",
        "From": "Mike Crowe <mac@mcrowe.com>",
        "To": "libstdc++@gcc.gnu.org,\tgcc-patches@gcc.gnu.org",
        "Cc": "Mike Crowe <mac@mcrowe.com>",
        "Subject": "[RFC PATCH 1/4] libstdc++ futex: Use FUTEX_CLOCK_REALTIME for wait",
        "Date": "Fri, 22 Sep 2017 09:17:25 +0100",
        "Message-Id": "<20170922081728.32508-2-mac@mcrowe.com>",
        "In-Reply-To": "<20170922081728.32508-1-mac@mcrowe.com>",
        "References": "<20170922081728.32508-1-mac@mcrowe.com>"
    },
    "content": "The futex system call supports waiting for an absolute time if\nFUTEX_WAIT_BITSET is used rather than FUTEX_WAIT. Doing so provides two\nbenefits:\n\n1. The call to gettimeofday is not required in order to calculate a\n   relative timeout.\n\n2. If someone changes the system clock during the wait then the futex\n   timeout will correctly expire earlier or later. Currently that only\n   happens if the clock is changed prior to the call to gettimeofday.\n\nAccording to futex(2), support for FUTEX_CLOCK_REALTIME was added in the\nv2.6.28 Linux kernel and FUTEX_WAIT_BITSET was added in v2.6.25. There is\nno attempt to detect the kernel version and fall back to the previous\nmethod.\n---\n libstdc++-v3/src/c++11/futex.cc | 21 ++++++---------------\n 1 file changed, 6 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc\nindex 64aada06969..217aeefe005 100644\n--- a/libstdc++-v3/src/c++11/futex.cc\n+++ b/libstdc++-v3/src/c++11/futex.cc\n@@ -35,6 +35,9 @@\n \n // Constants for the wait/wake futex syscall operations\n const unsigned futex_wait_op = 0;\n+const unsigned futex_wait_bitset_op = 9;\n+const unsigned futex_clock_realtime_flag = 256;\n+const unsigned futex_bitset_match_any = ~0;\n const unsigned futex_wake_op = 1;\n \n namespace std _GLIBCXX_VISIBILITY(default)\n@@ -58,22 +61,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       }\n     else\n       {\n-\tstruct timeval tv;\n-\tgettimeofday (&tv, NULL);\n-\t// Convert the absolute timeout value to a relative timeout\n \tstruct timespec rt;\n-\trt.tv_sec = __s.count() - tv.tv_sec;\n-\trt.tv_nsec = __ns.count() - tv.tv_usec * 1000;\n-\tif (rt.tv_nsec < 0)\n-\t  {\n-\t    rt.tv_nsec += 1000000000;\n-\t    --rt.tv_sec;\n-\t  }\n-\t// Did we already time out?\n-\tif (rt.tv_sec < 0)\n-\t  return false;\n-\n-\tif (syscall (SYS_futex, __addr, futex_wait_op, __val, &rt) == -1)\n+\trt.tv_sec = __s.count();\n+\trt.tv_nsec = __ns.count();\n+\tif (syscall (SYS_futex, __addr, futex_wait_bitset_op | futex_clock_realtime_flag, __val, &rt, nullptr, futex_bitset_match_any) == -1)\n \t  {\n \t    _GLIBCXX_DEBUG_ASSERT(errno == EINTR || errno == EAGAIN\n \t\t\t\t  || errno == ETIMEDOUT);\n",
    "prefixes": [
        "RFC",
        "1/4"
    ]
}