Patch Detail
Show a patch.
GET /api/1.1/patches/2409/?format=api
{ "id": 2409, "url": "https://patchwork.libcamera.org/api/1.1/patches/2409/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2409/", "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": "<20191209045603.6245-1-paul.elder@ideasonboard.com>", "date": "2019-12-09T04:56:02", "name": "[libcamera-devel,v2,1/2] libcamera: v4l2_device, v4l2_videodevice: call open system call directly", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "64d5e1f6da0151199239b0af60d106e9867ba9ab", "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/2409/mbox/", "series": [ { "id": 585, "url": "https://patchwork.libcamera.org/api/1.1/series/585/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=585", "date": "2019-12-09T04:56:02", "name": "[libcamera-devel,v2,1/2] libcamera: v4l2_device, v4l2_videodevice: call open system call directly", "version": 2, "mbox": "https://patchwork.libcamera.org/series/585/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2409/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2409/checks/", "tags": {}, "headers": { "Return-Path": "<paul.elder@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65F7960BFE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 9 Dec 2019 05:56:14 +0100 (CET)", "from neptunite.amanokami.net (unknown [96.44.9.94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5223452B;\n\tMon, 9 Dec 2019 05:56:13 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1575867373;\n\tbh=qCIBG1+qD8/KRjYV7461m/C4W8HEh6NWfc3knAlrt2U=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=l2J3A76ZrmEpiBygvAlbPp1iM8cwAgxKA+C65WJL8U+WAWI9N4XCxJSLOCbueStLU\n\tlEzpMfzsXcGpV1Pi6uF5P34jsyoAFAs5csWLr4uM/Pnhy8vuxDvPnQle4Ilm9YVjyi\n\tip7127F3i9PU3l19p5p3A0jY4twiTxze7JcTprsg=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 8 Dec 2019 23:56:02 -0500", "Message-Id": "<20191209045603.6245-1-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.23.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/2] libcamera: v4l2_device,\n\tv4l2_videodevice: call open system call directly", "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>", "X-List-Received-Date": "Mon, 09 Dec 2019 04:56:14 -0000" }, "content": "We are preparing to integrate the V4L2 adaptation layer, which will\nintercept open() calls (among others) via LD_PRELOAD. To prevent\nlibcamera's own open() calls from being intercepted, replace them with a\ndirect syscall.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n---\nNo change in v2\n---\n src/libcamera/v4l2_device.cpp | 3 ++-\n src/libcamera/v4l2_videodevice.cpp | 3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 0452f801..f16931a3 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -11,6 +11,7 @@\n #include <iomanip>\n #include <string.h>\n #include <sys/ioctl.h>\n+#include <sys/syscall.h>\n #include <unistd.h>\n \n #include \"log.h\"\n@@ -75,7 +76,7 @@ int V4L2Device::open(unsigned int flags)\n \t\treturn -EBUSY;\n \t}\n \n-\tint ret = ::open(deviceNode_.c_str(), flags);\n+\tint ret = syscall(SYS_open, deviceNode_.c_str(), flags);\n \tif (ret < 0) {\n \t\tret = -errno;\n \t\tLOG(V4L2, Error) << \"Failed to open V4L2 device: \"\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 99213075..2dff3d3c 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -13,6 +13,7 @@\n #include <string.h>\n #include <sys/ioctl.h>\n #include <sys/mman.h>\n+#include <sys/syscall.h>\n #include <sys/time.h>\n #include <unistd.h>\n #include <vector>\n@@ -1427,7 +1428,7 @@ int V4L2M2MDevice::open()\n \t * as the V4L2VideoDevice::open() retains a handle by duplicating the\n \t * fd passed in.\n \t */\n-\tfd = ::open(deviceNode_.c_str(), O_RDWR | O_NONBLOCK);\n+\tfd = syscall(SYS_open, deviceNode_.c_str(), O_RDWR | O_NONBLOCK);\n \tif (fd < 0) {\n \t\tret = -errno;\n \t\tLOG(V4L2, Error)\n", "prefixes": [ "libcamera-devel", "v2", "1/2" ] }