summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/v4l2_device.cpp3
-rw-r--r--src/libcamera/v4l2_videodevice.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 0452f801..c13eddc8 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -11,6 +11,7 @@
#include <iomanip>
#include <string.h>
#include <sys/ioctl.h>
+#include <sys/syscall.h>
#include <unistd.h>
#include "log.h"
@@ -75,7 +76,7 @@ int V4L2Device::open(unsigned int flags)
return -EBUSY;
}
- int ret = ::open(deviceNode_.c_str(), flags);
+ int ret = syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), flags);
if (ret < 0) {
ret = -errno;
LOG(V4L2, Error) << "Failed to open V4L2 device: "
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)