get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 954086,
    "url": "http://patchwork.ozlabs.org/api/patches/954086/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1533574847-19294-77-git-send-email-aleksandar.markovic@rt-rk.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1533574847-19294-77-git-send-email-aleksandar.markovic@rt-rk.com>",
    "list_archive_url": null,
    "date": "2018-08-06T17:00:43",
    "name": "[v7,76/80] linux-user: Add support for statx() syscall for all platforms",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c257df9a978f516ab3326073054837224cf2aab5",
    "submitter": {
        "id": 68635,
        "url": "http://patchwork.ozlabs.org/api/people/68635/?format=api",
        "name": "Aleksandar Markovic",
        "email": "aleksandar.markovic@rt-rk.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1533574847-19294-77-git-send-email-aleksandar.markovic@rt-rk.com/mbox/",
    "series": [
        {
            "id": 59520,
            "url": "http://patchwork.ozlabs.org/api/series/59520/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=59520",
            "date": "2018-08-06T16:59:27",
            "name": "Add nanoMIPS support to QEMU",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/59520/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/954086/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/954086/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=rt-rk.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41kljN1rzYz9rvt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  7 Aug 2018 03:57:28 +1000 (AEST)",
            "from localhost ([::1]:35479 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1fmjkz-000336-PN\n\tfor incoming@patchwork.ozlabs.org; Mon, 06 Aug 2018 13:57:25 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:42301)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <aleksandar.markovic@rt-rk.com>) id 1fmjHK-0008RS-Rn\n\tfor qemu-devel@nongnu.org; Mon, 06 Aug 2018 13:26:49 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <aleksandar.markovic@rt-rk.com>) id 1fmjHF-0002qx-Th\n\tfor qemu-devel@nongnu.org; Mon, 06 Aug 2018 13:26:46 -0400",
            "from mx2.rt-rk.com ([89.216.37.149]:47449 helo=mail.rt-rk.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <aleksandar.markovic@rt-rk.com>)\n\tid 1fmjHF-0002nl-AX\n\tfor qemu-devel@nongnu.org; Mon, 06 Aug 2018 13:26:41 -0400",
            "from localhost (localhost [127.0.0.1])\n\tby mail.rt-rk.com (Postfix) with ESMTP id CECBC1A21CC;\n\tMon,  6 Aug 2018 19:26:38 +0200 (CEST)",
            "from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local\n\t[10.10.13.43])\n\tby mail.rt-rk.com (Postfix) with ESMTPSA id A03051A216D;\n\tMon,  6 Aug 2018 19:26:38 +0200 (CEST)"
        ],
        "X-Virus-Scanned": "amavisd-new at rt-rk.com",
        "From": "Aleksandar Markovic <aleksandar.markovic@rt-rk.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon,  6 Aug 2018 19:00:43 +0200",
        "Message-Id": "<1533574847-19294-77-git-send-email-aleksandar.markovic@rt-rk.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1533574847-19294-1-git-send-email-aleksandar.markovic@rt-rk.com>",
        "References": "<1533574847-19294-1-git-send-email-aleksandar.markovic@rt-rk.com>",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x [fuzzy]",
        "X-Received-From": "89.216.37.149",
        "Subject": "[Qemu-devel] [PATCH v7 76/80] linux-user: Add support for statx()\n\tsyscall for all platforms",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "peter.maydell@linaro.org, thuth@redhat.com, pburton@wavecomp.com,\n\tsmarkovic@wavecomp.com, riku.voipio@iki.fi,\n\trichard.henderson@linaro.org, laurent@vivier.eu,\n\tarmbru@redhat.com, arikalo@wavecomp.com,\n\tphilippe.mathieu.daude@gmail.com, amarkovic@wavecomp.com,\n\tpjovanovic@wavecomp.com, aurelien@aurel32.net",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "From: Aleksandar Rikalo <arikalo@wavecomp.com>\n\nImplement support for syscall statx(). The implementation is based on\ninvoking other (more mature) syscalls (from the same 'stat' family)\non the host side. This way, problems of availability of statx() on the\nhost are avoided.\n\nSigned-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>\nSigned-off-by: Stefan Markovic <smarkovic@wavecomp.com>\n---\n linux-user/syscall.c      | 118 +++++++++++++++++++++++++++++++++++++++++++++-\n linux-user/syscall_defs.h |  38 +++++++++++++++\n 2 files changed, 155 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/linux-user/syscall.c b/linux-user/syscall.c\nindex bced9b8..4d94ec5 100644\n--- a/linux-user/syscall.c\n+++ b/linux-user/syscall.c\n@@ -8002,7 +8002,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,\n     abi_long ret;\n #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) \\\n     || defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) \\\n-    || defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64)\n+    || defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) \\\n+    || defined(TARGET_NR_statx)\n     struct stat st;\n #endif\n #if defined(TARGET_NR_statfs) || defined(TARGET_NR_statfs64) \\\n@@ -10025,6 +10026,121 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,\n         }\n         break;\n #endif\n+#if defined(TARGET_NR_statx)\n+    case TARGET_NR_statx:\n+        {\n+            struct target_statx *target_stx;\n+            int dirfd = tswap32(arg1);\n+            int flags = tswap32(arg3);\n+\n+            p = lock_user_string(arg2);\n+            if (p == NULL) {\n+                goto efault;\n+            }\n+#if defined(__NR_statx)\n+            {\n+                /* We assume that struct statx is arhitecture independed */\n+                struct target_statx host_stx;\n+                int mask = tswap32(arg4);\n+\n+                ret = get_errno(syscall(__NR_statx, dirfd, p, flags, mask,\n+                                        &host_stx));\n+                if (!is_error(ret)) {\n+                    unlock_user(p, arg2, 0);\n+                    if (!lock_user_struct(VERIFY_WRITE, target_stx, arg5, 0)) {\n+                        goto efault;\n+                    }\n+                    memset(target_stx, 0, sizeof(*target_stx));\n+\n+                    __put_user(host_stx.stx_mask, &target_stx->stx_mask);\n+                    __put_user(host_stx.stx_blksize, &target_stx->stx_blksize);\n+                    __put_user(host_stx.stx_attributes,\n+                               &target_stx->stx_attributes);\n+                    __put_user(host_stx.stx_nlink, &target_stx->stx_nlink);\n+                    __put_user(host_stx.stx_uid, &target_stx->stx_uid);\n+                    __put_user(host_stx.stx_gid, &target_stx->stx_gid);\n+                    __put_user(host_stx.stx_mode, &target_stx->stx_mode);\n+                    __put_user(host_stx.stx_ino, &target_stx->stx_ino);\n+                    __put_user(host_stx.stx_size, &target_stx->stx_size);\n+                    __put_user(host_stx.stx_blocks, &target_stx->stx_blocks);\n+                    __put_user(host_stx.stx_attributes_mask,\n+                               &target_stx->stx_attributes_mask);\n+                    __put_user(host_stx.stx_atime.tv_sec,\n+                               &target_stx->stx_atime.tv_sec);\n+                    __put_user(host_stx.stx_atime.tv_nsec,\n+                               &target_stx->stx_atime.tv_nsec);\n+                    __put_user(host_stx.stx_btime.tv_sec,\n+                               &target_stx->stx_atime.tv_sec);\n+                    __put_user(host_stx.stx_btime.tv_nsec,\n+                               &target_stx->stx_atime.tv_nsec);\n+                    __put_user(host_stx.stx_ctime.tv_sec,\n+                               &target_stx->stx_atime.tv_sec);\n+                    __put_user(host_stx.stx_ctime.tv_nsec,\n+                               &target_stx->stx_atime.tv_nsec);\n+                    __put_user(host_stx.stx_mtime.tv_sec,\n+                               &target_stx->stx_atime.tv_sec);\n+                    __put_user(host_stx.stx_mtime.tv_nsec,\n+                               &target_stx->stx_atime.tv_nsec);\n+                    __put_user(host_stx.stx_rdev_major,\n+                               &target_stx->stx_rdev_major);\n+                    __put_user(host_stx.stx_rdev_minor,\n+                               &target_stx->stx_rdev_minor);\n+                    __put_user(host_stx.stx_dev_major,\n+                               &target_stx->stx_dev_major);\n+                    __put_user(host_stx.stx_dev_minor,\n+                               &target_stx->stx_dev_minor);\n+                }\n+\n+                if (ret != TARGET_ENOSYS) {\n+                    break;\n+                }\n+            }\n+#endif\n+            if ((p == NULL) || (*((char *)p) == 0)) {\n+                /* By file descriptor */\n+                ret = get_errno(fstat(dirfd, &st));\n+                unlock_user(p, arg2, 0);\n+            } else if (*((char *)p) == '/') {\n+                /* An absolute pathname */\n+                ret = get_errno(stat(path(p), &st));\n+                unlock_user(p, arg2, 0);\n+            } else {\n+                if (dirfd == AT_FDCWD) {\n+                    /* A relative pathname */\n+                    ret = get_errno(stat(path(p), &st));\n+                    unlock_user(p, arg2, 0);\n+                } else {\n+                    /* A directory-relative pathname */\n+                    ret = get_errno(fstatat(dirfd, path(p), &st, flags));\n+                    unlock_user(p, arg2, 0);\n+                }\n+            }\n+\n+            if (!is_error(ret)) {\n+                if (!lock_user_struct(VERIFY_WRITE, target_stx, arg5, 0)) {\n+                    goto efault;\n+                }\n+                memset(target_stx, 0, sizeof(*target_stx));\n+                __put_user(major(st.st_dev), &target_stx->stx_dev_major);\n+                __put_user(minor(st.st_dev), &target_stx->stx_dev_minor);\n+                __put_user(st.st_ino, &target_stx->stx_ino);\n+                __put_user(st.st_mode, &target_stx->stx_mode);\n+                __put_user(st.st_uid, &target_stx->stx_uid);\n+                __put_user(st.st_gid, &target_stx->stx_gid);\n+                __put_user(st.st_nlink, &target_stx->stx_nlink);\n+                __put_user(major(st.st_rdev), &target_stx->stx_rdev_major);\n+                __put_user(minor(st.st_rdev), &target_stx->stx_rdev_minor);\n+                __put_user(st.st_size, &target_stx->stx_size);\n+                __put_user(st.st_blksize, &target_stx->stx_blksize);\n+                __put_user(st.st_blocks, &target_stx->stx_blocks);\n+                __put_user(st.st_atime, &target_stx->stx_atime.tv_sec);\n+                __put_user(st.st_mtime, &target_stx->stx_mtime.tv_sec);\n+                __put_user(st.st_ctime, &target_stx->stx_ctime.tv_sec);\n+                unlock_user_struct(target_stx, arg5, 1);\n+            }\n+        }\n+        break;\n+#endif\n #ifdef TARGET_NR_olduname\n     case TARGET_NR_olduname:\n         goto unimplemented;\ndiff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h\nindex abf94b8..34cc6e0 100644\n--- a/linux-user/syscall_defs.h\n+++ b/linux-user/syscall_defs.h\n@@ -2530,4 +2530,42 @@ struct target_user_cap_data {\n /* Return size of the log buffer */\n #define TARGET_SYSLOG_ACTION_SIZE_BUFFER   10\n \n+struct target_statx_timestamp {\n+   int64_t tv_sec;\n+   uint32_t tv_nsec;\n+   int32_t __reserved;\n+};\n+\n+struct target_statx {\n+   /* 0x00 */\n+   uint32_t stx_mask;       /* What results were written [uncond] */\n+   uint32_t stx_blksize;    /* Preferred general I/O size [uncond] */\n+   uint64_t stx_attributes; /* Flags conveying information about the file */\n+   /* 0x10 */\n+   uint32_t stx_nlink;      /* Number of hard links */\n+   uint32_t stx_uid;        /* User ID of owner */\n+   uint32_t stx_gid;        /* Group ID of owner */\n+   uint16_t stx_mode;       /* File mode */\n+   uint16_t __spare0[1];\n+   /* 0x20 */\n+   uint64_t stx_ino;        /* Inode number */\n+   uint64_t stx_size;       /* File size */\n+   uint64_t stx_blocks;     /* Number of 512-byte blocks allocated */\n+   uint64_t stx_attributes_mask; /* Mask to show what's supported in\n+                                    stx_attributes */\n+   /* 0x40 */\n+   struct target_statx_timestamp  stx_atime;  /* Last access time */\n+   struct target_statx_timestamp  stx_btime;  /* File creation time */\n+   struct target_statx_timestamp  stx_ctime;  /* Last attribute change time */\n+   struct target_statx_timestamp  stx_mtime;  /* Last data modification time */\n+   /* 0x80 */\n+   uint32_t stx_rdev_major;   /* Device ID of special file [if bdev/cdev] */\n+   uint32_t stx_rdev_minor;\n+   uint32_t stx_dev_major; /* ID of device containing file [uncond] */\n+   uint32_t stx_dev_minor;\n+   /* 0x90 */\n+   uint64_t __spare2[14];  /* Spare space for future expansion */\n+   /* 0x100 */\n+};\n+\n #endif\n",
    "prefixes": [
        "v7",
        "76/80"
    ]
}