mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 14:13:33 +08:00
Created px4_access to handle check of virtual files
uORBManager_posix.cpp did a stat to see if a file exists but the file is actually a virtual file. Using stat was incorrect because it required a stat buffer that was never used. The POSIX access function is a better choice so I created a px4_access version to handle virtual files. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -67,6 +67,7 @@ typedef struct pollfd px4_pollfd_struct_t;
|
||||
#define px4_read _GLOBAL read
|
||||
#define px4_poll _GLOBAL poll
|
||||
#define px4_fsync _GLOBAL fsync
|
||||
#define px4_access _GLOBAL access
|
||||
|
||||
#elif defined(__PX4_POSIX)
|
||||
|
||||
@@ -96,6 +97,7 @@ __EXPORT ssize_t px4_write(int fd, const void *buffer, size_t buflen);
|
||||
__EXPORT int px4_ioctl(int fd, int cmd, unsigned long arg);
|
||||
__EXPORT int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout);
|
||||
__EXPORT int px4_fsync(int fd);
|
||||
__EXPORT int px4_access(const char *pathname, int mode);
|
||||
|
||||
__END_DECLS
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user