Show a patch.

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

{
    "id": 25925,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/25925/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25925/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260122121015.3842322-1-paul.elder@ideasonboard.com>",
    "date": "2026-01-22T12:10:15",
    "name": "v4l2: v4l2_compat: Handle __ioctl_time64",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7939a8fb4091720b72d46d72c430334fff8498fe",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25925/mbox/",
    "series": [
        {
            "id": 5732,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5732/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5732",
            "date": "2026-01-22T12:10:15",
            "name": "v4l2: v4l2_compat: Handle __ioctl_time64",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5732/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25925/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25925/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 67A74C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 12:10:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 88F9561FC9;\n\tThu, 22 Jan 2026 13:10:26 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B87B61F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 13:10:24 +0100 (CET)",
            "from neptunite.hamster-moth.ts.net (unknown\n\t[IPv6:2404:7a81:160:2100:8816:a947:ebed:2ec7])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AAA9F324;\n\tThu, 22 Jan 2026 13:09:50 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YYe9kcyT\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769083791;\n\tbh=twHf0ajLXS701x23JyU/nlHm47GlBIxc21YfcJBIiag=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=YYe9kcyTuO+jkdt9XI4tNl6q41NZHZVSAptwRr7qEzyFm6goPrYUkEsRu3Zgv6bHo\n\tGQL901uuD48iENl+kReC8fM6xY5Eax5LsxIJrUUECbZ4l7QecwSMmiJkeHqPhWf8GF\n\tNmWG9qAxo3jNYGFg5F8ogdMRwR5WrlRivrBh4neg=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>",
        "Subject": "[PATCH] v4l2: v4l2_compat: Handle __ioctl_time64",
        "Date": "Thu, 22 Jan 2026 21:10:15 +0900",
        "Message-ID": "<20260122121015.3842322-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.47.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "On 32-bit systems, ioctl is redirected to __ioctl_time64, so the latter\nneeds to be intercepted and handled as well. Add support for this.\n\nBug: https://gitlab.freedesktop.org/camera/libcamera/-/issues/290\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/v4l2/v4l2_compat.cpp         | 21 +++++++++++++++++++++\n src/v4l2/v4l2_compat_manager.cpp | 10 ++++++++++\n src/v4l2/v4l2_compat_manager.h   |  2 ++\n 3 files changed, 33 insertions(+)",
    "diff": "diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp\nindex ff833f571bde..10421cef76f4 100644\n--- a/src/v4l2/v4l2_compat.cpp\n+++ b/src/v4l2/v4l2_compat.cpp\n@@ -165,4 +165,25 @@ LIBCAMERA_PUBLIC int ioctl(int fd, unsigned long request, ...)\n \treturn V4L2CompatManager::instance()->ioctl(fd, request, arg);\n }\n \n+/*\n+ * __USE_TIME64_REDIRECTS redirects ioctl to __ioctl_time64. Disable the\n+ * -Wmissing-declarations warnings, as the functions won't be declared if\n+ *  __USE_TIME64_REDIRECTS is not in use.\n+ */\n+#pragma GCC diagnostic push\n+#pragma GCC diagnostic ignored \"-Wmissing-declarations\"\n+\n+#if HAVE_POSIX_IOCTL\n+LIBCAMERA_PUBLIC int __ioctl_time64(int fd, int request, ...)\n+#else\n+LIBCAMERA_PUBLIC int __ioctl_time64(int fd, unsigned long request, ...)\n+#endif\n+{\n+\tvoid *arg;\n+\textract_va_arg(void *, arg, request);\n+\n+\treturn V4L2CompatManager::instance()->ioctl_time64(fd, request, arg);\n+}\n+\n+#pragma GCC diagnostic pop\n }\ndiff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp\nindex f53fb300dde8..4303883712d6 100644\n--- a/src/v4l2/v4l2_compat_manager.cpp\n+++ b/src/v4l2/v4l2_compat_manager.cpp\n@@ -46,6 +46,7 @@ V4L2CompatManager::V4L2CompatManager()\n \tget_symbol(fops_.dup, \"dup\");\n \tget_symbol(fops_.close, \"close\");\n \tget_symbol(fops_.ioctl, \"ioctl\");\n+\tget_symbol(fops_.ioctl_time64, \"__ioctl_time64\");\n \tget_symbol(fops_.mmap, \"mmap64\");\n \tget_symbol(fops_.munmap, \"munmap\");\n }\n@@ -249,3 +250,12 @@ int V4L2CompatManager::ioctl(int fd, unsigned long request, void *arg)\n \n \treturn file->proxy()->ioctl(file.get(), request, arg);\n }\n+\n+int V4L2CompatManager::ioctl_time64(int fd, unsigned long request, void *arg)\n+{\n+\tstd::shared_ptr<V4L2CameraFile> file = cameraFile(fd);\n+\tif (!file)\n+\t\treturn fops_.ioctl_time64(fd, request, arg);\n+\n+\treturn file->proxy()->ioctl(file.get(), request, arg);\n+}\ndiff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h\nindex f7c6f1228282..f713f2333500 100644\n--- a/src/v4l2/v4l2_compat_manager.h\n+++ b/src/v4l2/v4l2_compat_manager.h\n@@ -34,6 +34,7 @@ public:\n \t\tdup_func_t dup;\n \t\tclose_func_t close;\n \t\tioctl_func_t ioctl;\n+\t\tioctl_func_t ioctl_time64;\n \t\tmmap_func_t mmap;\n \t\tmunmap_func_t munmap;\n \t};\n@@ -50,6 +51,7 @@ public:\n \t\t   int fd, off64_t offset);\n \tint munmap(void *addr, size_t length);\n \tint ioctl(int fd, unsigned long request, void *arg);\n+\tint ioctl_time64(int fd, unsigned long request, void *arg);\n \n private:\n \tV4L2CompatManager();\n",
    "prefixes": []
}