summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2019-12-06 04:09:32 -0500
committerPaul Elder <paul.elder@ideasonboard.com>2020-01-03 19:53:10 -0500
commit58a19b9d56e5002367794ef0d2e9cf8dcd8d0be5 (patch)
tree3a85d5737a25ce77a1eeb90ef4abd86e998b8991 /src/libcamera/v4l2_videodevice.cpp
parent4910ff05c06b70f25e4799705913c4e282abfd86 (diff)
libcamera: v4l2_device, v4l2_videodevice: call open system call directly
We are preparing to integrate the V4L2 adaptation layer, which will intercept open() calls (among others) via LD_PRELOAD. To prevent libcamera's own open() calls from being intercepted, replace them with a direct syscall. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 13e02323..033f7cc0 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -13,6 +13,7 @@
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <sys/syscall.h>
#include <sys/time.h>
#include <unistd.h>
#include <vector>
@@ -1426,7 +1427,8 @@ int V4L2M2MDevice::open()
* as the V4L2VideoDevice::open() retains a handle by duplicating the
* fd passed in.
*/
- fd = ::open(deviceNode_.c_str(), O_RDWR | O_NONBLOCK);
+ fd = syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(),
+ O_RDWR | O_NONBLOCK);
if (fd < 0) {
ret = -errno;
LOG(V4L2, Error)