libcamera: file_descriptor: Add a function to retrieve the inode
The inode is useful to check if two file descriptors refer to the same file. Add a function to retrieve it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#define __LIBCAMERA_FILE_DESCRIPTOR_H__
|
||||
|
||||
#include <memory>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
@@ -27,6 +28,8 @@ public:
|
||||
int fd() const { return fd_ ? fd_->fd() : -1; }
|
||||
FileDescriptor dup() const;
|
||||
|
||||
ino_t inode() const;
|
||||
|
||||
private:
|
||||
class Descriptor
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user